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 | a0031d1d4511870fbeb16edc232f683492d0ad03 (patch) | |
tree | 9099959edf354fb3252ce2f51f17a34af76161b3 /EssentialsProtect | |
parent | d60dd01f0f33841ceb84e57478176be3eab47629 (diff) | |
download | Essentials-a0031d1d4511870fbeb16edc232f683492d0ad03.tar Essentials-a0031d1d4511870fbeb16edc232f683492d0ad03.tar.gz Essentials-a0031d1d4511870fbeb16edc232f683492d0ad03.tar.lz Essentials-a0031d1d4511870fbeb16edc232f683492d0ad03.tar.xz Essentials-a0031d1d4511870fbeb16edc232f683492d0ad03.zip |
New config setting: protect.prevent.enderman-pickup
Defaults to false
Diffstat (limited to 'EssentialsProtect')
3 files changed, 15 insertions, 0 deletions
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), |