[Bleeding] Account for null in EntityDamageEvent handling. Fixes BUKKIT-5317

Damage caused by explosions will return null for the event as of
6588d6f72bbca74bf150de65593ac575b846111b. As such, a null check is
now necessary when handling non-living entity damage events.
This commit is contained in:
t00thpick1 2014-01-07 00:25:11 -05:00 committed by feildmaster
parent fef9f9692f
commit 771c41c691

View File

@ -455,8 +455,10 @@ public class CraftEventFactory {
if (!(source instanceof EntityDamageSource)) {
return false;
}
// We don't need to check for null, since EntityDamageSource will always return an event
EntityDamageEvent event = handleEntityDamageEvent(entity, source, damage);
if (event == null) {
return false;
}
return event.isCancelled() || event.getDamage() == 0;
}