diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-11-28 12:56:20 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-11-28 12:56:20 +0000 |
commit | 4614d6d0ddc6d53a9929d568325bd0dac7477c82 (patch) | |
tree | 782d09431cfb7ea392e9d42229d87dd830c4f58f | |
parent | 4a83d17fecb9f0fcbbf56af2b1b677d5121bb5e3 (diff) | |
parent | e8d64aca5ebf6334844dbca80e83dd694557f862 (diff) | |
download | Essentials-4614d6d0ddc6d53a9929d568325bd0dac7477c82.tar Essentials-4614d6d0ddc6d53a9929d568325bd0dac7477c82.tar.gz Essentials-4614d6d0ddc6d53a9929d568325bd0dac7477c82.tar.lz Essentials-4614d6d0ddc6d53a9929d568325bd0dac7477c82.tar.xz Essentials-4614d6d0ddc6d53a9929d568325bd0dac7477c82.zip |
Merge branch 'master' of github.com:essentials/Essentials
4 files changed, 10 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 62f7ad04e..ca4c6ad6a 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -57,7 +57,7 @@ import org.bukkit.scheduler.BukkitScheduler; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1518; + public static final int BUKKIT_VERSION = 1522; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index eef1d883d..77b3fc3a4 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -388,6 +388,7 @@ protect: creeper-playerdamage: false creeper-blockdamage: false enderman-pickup: false + villager-death: false # Monsters won't follow players # permission essentials.protect.entitytarget.bypass disables this entitytarget: false diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 2c4d1dbab..cd054d732 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -32,6 +32,13 @@ public class EssentialsProtectEntityListener extends EntityListener return; } final Entity target = event.getEntity(); + + if (target instanceof Villager && prot.getSettingBool(ProtectConfig.prevent_villager_death)) + { + event.setCancelled(true); + return; + } + final User user = ess.getUser(target); if (event instanceof EntityDamageByBlockEvent) { diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java index 369e988ae..817ad66af 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java @@ -40,6 +40,7 @@ public enum ProtectConfig prevent_creeper_playerdmg("protect.prevent.creeper-playerdamage", false), prevent_creeper_blockdmg("protect.prevent.creeper-blockdamage", false), prevent_enderman_pickup("protect.prevent.enderman-pickup", false), + prevent_villager_death("protect.prevent.villager-death", false), prevent_entitytarget("protect.prevent.entitytarget", false), protect_rails("protect.protect.rails", true), protect_below_rails("protect.protect.block-below", true), |