diff options
author | feildmaster <admin@feildmaster.com> | 2014-08-02 16:03:50 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2014-08-02 16:12:03 -0500 |
commit | 971329c42b2a4242da1f5789ce6759c810779a6f (patch) | |
tree | e48473fc8ea08e0ecb30d95272622502c1cbc5bf /src/main/java/org/bukkit | |
parent | 594d7cb8c91943eeb0f2508a4e7b2c128d310f09 (diff) | |
download | craftbukkit-971329c42b2a4242da1f5789ce6759c810779a6f.tar craftbukkit-971329c42b2a4242da1f5789ce6759c810779a6f.tar.gz craftbukkit-971329c42b2a4242da1f5789ce6759c810779a6f.tar.lz craftbukkit-971329c42b2a4242da1f5789ce6759c810779a6f.tar.xz craftbukkit-971329c42b2a4242da1f5789ce6759c810779a6f.zip |
Fix removal of items from Item Frames. Fixes BUKKIT-5736
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 2c0065df..c6c7f23b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -564,8 +564,12 @@ public class CraftEventFactory { return handleEntityDamageEvent(damagee, source, modifiers, modifierFunctions); } - // Non-Living Entities such as EntityEnderCrystal, EntityItemFrame, and EntityFireball need to call this + // Non-Living Entities such as EntityEnderCrystal and EntityFireball need to call this public static boolean handleNonLivingEntityDamageEvent(Entity entity, DamageSource source, double damage) { + return handleNonLivingEntityDamageEvent(entity, source, damage, true); + } + + public static boolean handleNonLivingEntityDamageEvent(Entity entity, DamageSource source, double damage, boolean cancelOnZeroDamage) { if (entity instanceof EntityEnderCrystal && !(source instanceof EntityDamageSource)) { return false; } @@ -580,7 +584,7 @@ public class CraftEventFactory { if (event == null) { return false; } - return event.isCancelled() || event.getDamage() == 0; + return event.isCancelled() || (cancelOnZeroDamage && event.getDamage() == 0); } public static PlayerLevelChangeEvent callPlayerLevelChangeEvent(Player player, int oldLevel, int newLevel) { |