diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-04-13 01:03:08 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-04-13 01:03:08 -0500 |
commit | c3cf8a435b73d7e8ab68dd23524fa7def90330d6 (patch) | |
tree | f6f1b50be70f6a25c44f96edac7c161e3a595c1e /src/main | |
parent | 8590492680b58ca5aa3e5743052d4c3e0b4fab24 (diff) | |
download | craftbukkit-c3cf8a435b73d7e8ab68dd23524fa7def90330d6.tar craftbukkit-c3cf8a435b73d7e8ab68dd23524fa7def90330d6.tar.gz craftbukkit-c3cf8a435b73d7e8ab68dd23524fa7def90330d6.tar.lz craftbukkit-c3cf8a435b73d7e8ab68dd23524fa7def90330d6.tar.xz craftbukkit-c3cf8a435b73d7e8ab68dd23524fa7def90330d6.zip |
Don't apply fall damage when cancelled. Fixes BUKKIT-4065
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityLiving.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index fd1327a4..f8dd4177 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -957,11 +957,13 @@ public abstract class EntityLiving extends Entity { // CraftBukkit start if (i > 0) { EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i); - if (!event.isCancelled()) { - i = event.getDamage(); - if (i > 0) { - this.getBukkitEntity().setLastDamageCause(event); - } + if (event.isCancelled()) { + return; + } + + i = event.getDamage(); + if (i > 0) { + this.getBukkitEntity().setLastDamageCause(event); } } // CraftBukkit end |