diff options
author | Starbuck Johnson <starbuck@modwiz.com> | 2013-12-05 10:33:22 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-12-08 20:58:27 -0600 |
commit | 36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2 (patch) | |
tree | e93e54830d25657751d35f501b55dd9d809c0442 /src/main | |
parent | 3cf569a33fddfe1b1440e8f8d2a6dbfe003a131c (diff) | |
download | craftbukkit-36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2.tar craftbukkit-36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2.tar.gz craftbukkit-36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2.tar.lz craftbukkit-36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2.tar.xz craftbukkit-36ef37b9823b7d2c8f90a14c3cb938ccd93c30a2.zip |
Call EntityDamageEvent on ItemFrame item removal. Fixes BUKKIT-5020
Calling this event allows plugins to react to the situation by simply
handling a normal damage event, possibly using existing code to
handle other entity damage.
Pulled from PR #1279
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItemFrame.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java index 261d0c1e..059a1e8a 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java @@ -23,6 +23,11 @@ public class EntityItemFrame extends EntityHanging { return false; } else if (this.getItem() != null) { if (!this.world.isStatic) { + // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f).isCancelled() || this.dead) { + return false; + } + // CraftBukkit end this.b(damagesource.getEntity(), false); this.setItem((ItemStack) null); } |