diff options
author | Iaccidentally <coryhuckaby@gmail.com> | 2012-10-28 09:39:54 -0400 |
---|---|---|
committer | Iaccidentally <coryhuckaby@gmail.com> | 2012-10-28 09:39:54 -0400 |
commit | 9864a75c32a8e4712fa8878c5b107d65ad9fc15b (patch) | |
tree | bba3b5f18dc7cf2c0dd827f67e69bcc165949661 /EssentialsProtect/src/com/earth2me/essentials | |
parent | 520427239f2c7fe0df1849b32e5416293cbe84fc (diff) | |
download | Essentials-9864a75c32a8e4712fa8878c5b107d65ad9fc15b.tar Essentials-9864a75c32a8e4712fa8878c5b107d65ad9fc15b.tar.gz Essentials-9864a75c32a8e4712fa8878c5b107d65ad9fc15b.tar.lz Essentials-9864a75c32a8e4712fa8878c5b107d65ad9fc15b.tar.xz Essentials-9864a75c32a8e4712fa8878c5b107d65ad9fc15b.zip |
Protect updates :: ability to prevent wither damage :: block spawning of new mobs
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials')
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java | 10 | ||||
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index ef556c9bd..5ce7623b6 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -10,9 +10,9 @@ import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; +import org.bukkit.event.entity.*; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityTargetEvent.TargetReason; -import org.bukkit.event.entity.*; public class EssentialsProtectEntityListener implements Listener @@ -184,6 +184,14 @@ public class EssentialsProtectEntityListener implements Listener event.setCancelled(true); return; } + if (cause == DamageCause.WITHER + && prot.getSettingBool(ProtectConfig.disable_wither) + && !(user.isAuthorized("essentials.protect.damage.wither")) + && !user.isAuthorized("essentials.protect.damage.disable")) + { + event.setCancelled(true); + return; + } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java index 31141d7e7..dda0060bf 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java @@ -17,6 +17,7 @@ public enum ProtectConfig disable_firedmg("protect.disable.firedmg", false), disable_lightning("protect.disable.lightning", false), disable_drown("protect.disable.drown", false), + disable_wither("protect.disable.wither", false), disable_weather_storm("protect.disable.weather.storm", false), disable_weather_lightning("protect.disable.weather.lightning", false), disable_weather_thunder("protect.disable.weather.thunder", false), |