diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-12-09 13:40:52 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-12-09 13:40:52 -0600 |
commit | 305e5f4f08a39976857ad9af61bfcf77fc9bfa78 (patch) | |
tree | 627ea4830a3eec104ceca2fcb8a2bf82e4b30bbc /src/main | |
parent | 80935e5c2bef9793388bf0e877d66ffc98c60d05 (diff) | |
download | craftbukkit-305e5f4f08a39976857ad9af61bfcf77fc9bfa78.tar craftbukkit-305e5f4f08a39976857ad9af61bfcf77fc9bfa78.tar.gz craftbukkit-305e5f4f08a39976857ad9af61bfcf77fc9bfa78.tar.lz craftbukkit-305e5f4f08a39976857ad9af61bfcf77fc9bfa78.tar.xz craftbukkit-305e5f4f08a39976857ad9af61bfcf77fc9bfa78.zip |
Handle null damage events for item frames. Fixes BUKKIT-5114
Some types of damage are handled specially so do not end up returning an
event in handleEntityDamageEvent. To ensure we don't have problems with
these we need to check for them and simply ignore them, as they've been
handled already.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityItemFrame.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java index 059a1e8a..12d05064 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java @@ -24,10 +24,12 @@ public class EntityItemFrame extends EntityHanging { } 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; + org.bukkit.event.entity.EntityDamageEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handleEntityDamageEvent(this, damagesource, f); + if ((event != null && event.isCancelled()) || this.dead) { + return true; } // CraftBukkit end + this.b(damagesource.getEntity(), false); this.setItem((ItemStack) null); } |