summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-15 12:33:17 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-15 12:33:17 +0000
commitc51612d9984cdc54b8e43bbf3e27cb5ea5d85100 (patch)
tree7ced79775b99a2a2f59497bba315e0d3d3c98991 /EssentialsProtect
parentcf46d880c53e9bd12345a8ccfe2c4814e01e7476 (diff)
downloadEssentials-c51612d9984cdc54b8e43bbf3e27cb5ea5d85100.tar
Essentials-c51612d9984cdc54b8e43bbf3e27cb5ea5d85100.tar.gz
Essentials-c51612d9984cdc54b8e43bbf3e27cb5ea5d85100.tar.lz
Essentials-c51612d9984cdc54b8e43bbf3e27cb5ea5d85100.tar.xz
Essentials-c51612d9984cdc54b8e43bbf3e27cb5ea5d85100.zip
Added permissions to bypass EssentialsProtect damage protection.
Change for admin! Since we don't want to murder all admins, I added another permission: essentials.protect.damage.disable Since all admins get this by using '*', all those damage permissions are disabled Don't use - -essentials.protect.damage.* as I stated in the last commit. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1479 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsProtect')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index fa61b5b83..114dd0cb4 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -53,21 +53,24 @@ public class EssentialsProtectEntityListener extends EntityListener
if (EssentialsProtect.playerSettings.get("protect.disable.contactdmg") && cause == DamageCause.CONTACT
&& !(event.getEntity() instanceof Player
- && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.contact")))
+ && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.contact")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.playerSettings.get("protect.disable.lavadmg") && cause == DamageCause.LAVA
&& !(event.getEntity() instanceof Player
- && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.lava")))
+ && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.lava")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.guardSettings.get("protect.prevent.tnt-explosion") && cause == DamageCause.BLOCK_EXPLOSION
&& !(event.getEntity() instanceof Player
- && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.tnt")))
+ && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.tnt")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
@@ -100,7 +103,8 @@ public class EssentialsProtectEntityListener extends EntityListener
{
if (eAttack instanceof Creeper && EssentialsProtect.guardSettings.get("protect.prevent.creeper-explosion")
&& !(event.getEntity() instanceof Player
- && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.creeper")))
+ && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.creeper")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
@@ -108,7 +112,8 @@ public class EssentialsProtectEntityListener extends EntityListener
if (eAttack instanceof Creeper && EssentialsProtect.guardSettings.get("protect.prevent.creeper-playerdamage")
&& !(event.getEntity() instanceof Player
- && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.creeper")))
+ && Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.creeper")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
@@ -120,7 +125,8 @@ public class EssentialsProtectEntityListener extends EntityListener
{
if (event.getEntity() instanceof Player
&& EssentialsProtect.playerSettings.get("protect.disable.projectiles")
- && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.projectiles"))
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.projectiles")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable"))
{
event.setCancelled(true);
return;
@@ -132,33 +138,38 @@ public class EssentialsProtectEntityListener extends EntityListener
if (casualty instanceof Player)
{
if (EssentialsProtect.playerSettings.get("protect.disable.fall") && cause == DamageCause.FALL
- && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.fall")))
+ && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.fall")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.playerSettings.get("protect.disable.suffocate") && cause == DamageCause.SUFFOCATION
- && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.suffocation")))
+ && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.suffocation")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.playerSettings.get("protect.disable.firedmg") && (cause == DamageCause.FIRE
|| cause == DamageCause.FIRE_TICK)
- && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.fire")))
+ && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.fire")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.playerSettings.get("protect.disable.drown") && cause == DamageCause.DROWNING
- && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.drowning")))
+ && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.drowning")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;
}
if (EssentialsProtect.playerSettings.get("protect.disable.lightning") && cause == DamageCause.LIGHTNING
- && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.lightning")))
+ && !(Essentials.getStatic().getUser(casualty).isAuthorized("essentials.protect.damage.lightning")
+ && !Essentials.getStatic().getUser(event.getEntity()).isAuthorized("essentials.protect.damage.disable")))
{
event.setCancelled(true);
return;