From c3cf8a435b73d7e8ab68dd23524fa7def90330d6 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Sat, 13 Apr 2013 01:03:08 -0500 Subject: [PATCH] Don't apply fall damage when cancelled. Fixes BUKKIT-4065 --- src/main/java/net/minecraft/server/EntityLiving.java | 12 +++++++----- 1 file 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 fd1327a421..f8dd4177c8 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