Don't apply fall damage when cancelled. Fixes BUKKIT-4065

This commit is contained in:
Travis Watkins 2013-04-13 01:03:08 -05:00
parent 8590492680
commit c3cf8a435b

View File

@ -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