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 | 31161d7536aa3a20795f4bda60ee29230c95a7d1 (patch) | |
tree | 590861cabc9740373bb42875c52c56b866e14777 | |
parent | 77621e1cbf4f2525873aaa856adbd8e47ba46d62 (diff) | |
download | Essentials-31161d7536aa3a20795f4bda60ee29230c95a7d1.tar Essentials-31161d7536aa3a20795f4bda60ee29230c95a7d1.tar.gz Essentials-31161d7536aa3a20795f4bda60ee29230c95a7d1.tar.lz Essentials-31161d7536aa3a20795f4bda60ee29230c95a7d1.tar.xz Essentials-31161d7536aa3a20795f4bda60ee29230c95a7d1.zip |
Protect updates :: ability to prevent wither damage :: block spawning of new mobs
3 files changed, 17 insertions, 2 deletions
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index a9db65ba9..83a1a5a74 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -496,7 +496,10 @@ protect: ocelot: false iron_golem: false villager: false - + wither: false + bat: false + witch: false + # Maximum height the creeper should explode. -1 allows them to explode everywhere. # Set prevent.creeper-explosion to true, if you want to disable creeper explosions. creeper: @@ -549,6 +552,9 @@ protect: # Should the damage after hit by a lightning be disabled? lightning: false + + # Should Wither damage be disabled? + wither: false # Disable weather options weather: 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), |