diff options
author | snowleo <schneeleo@gmail.com> | 2011-09-21 02:30:58 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-09-21 02:30:58 +0200 |
commit | a2950c74cb5731e32e7e7bbec97cf8292645f586 (patch) | |
tree | 92a0eeb70e537256cc0830781b31a823dd9ae69c | |
parent | 86aabb7a95fae8a0a8a77ba35d6df2ef0b3d8ec0 (diff) | |
download | Essentials-a2950c74cb5731e32e7e7bbec97cf8292645f586.tar Essentials-a2950c74cb5731e32e7e7bbec97cf8292645f586.tar.gz Essentials-a2950c74cb5731e32e7e7bbec97cf8292645f586.tar.lz Essentials-a2950c74cb5731e32e7e7bbec97cf8292645f586.tar.xz Essentials-a2950c74cb5731e32e7e7bbec97cf8292645f586.zip |
New config setting: protect.prevent.enderman-pickup
Defaults to false
4 files changed, 16 insertions, 0 deletions
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index d2c12be0e..6edf0244d 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -401,6 +401,7 @@ protect: creeper-explosion: false creeper-playerdamage: false creeper-blockdamage: false + enderman-pickup: false # Monsters won't follow players # permission essentials.protect.entitytarget.bypass disables this entitytarget: false diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index fa1fadad6..98daf26cb 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -70,6 +70,7 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect pm.registerEvent(Type.CREATURE_SPAWN, entityListener, Priority.Highest, this); pm.registerEvent(Type.ENTITY_TARGET, entityListener, Priority.Highest, this); pm.registerEvent(Type.EXPLOSION_PRIME, entityListener, Priority.Highest, this); + pm.registerEvent(Type.ENDERMAN_PICKUP, entityListener, Priority.Highest, this); final EssentialsProtectWeatherListener weatherListener = new EssentialsProtectWeatherListener(this); pm.registerEvent(Type.LIGHTNING_STRIKE, weatherListener, Priority.Highest, this); diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index f28fd1185..c0e568578 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -22,6 +22,7 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.EndermanPickupEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -352,4 +353,16 @@ public class EssentialsProtectEntityListener extends EntityListener event.setFire(false); } } + + @Override + public void onEndermanPickup(EndermanPickupEvent event) + { + if (event.isCancelled()) { + return; + } + if (prot.getSettingBool(ProtectConfig.prevent_enderman_pickup)) { + 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 9959db8c6..5d93fe0ea 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java @@ -39,6 +39,7 @@ public enum ProtectConfig prevent_creeper_explosion("protect.prevent.creeper-explosion", true), 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_entitytarget("protect.prevent.entitytarget", false), protect_rails("protect.protect.rails", true), protect_below_rails("protect.protect.block-below", true), |