Fixed NPE with null ItemStack for pumpkin scuba in EntityDamageEvent.

This commit is contained in:
sk89q 2012-03-02 10:33:14 -08:00
parent 10296cb736
commit ddefbfe2cf

View File

@ -415,9 +415,12 @@ public void onEntityDamage(EntityDamageEvent event) {
return; return;
} }
ItemStack helmet = player.getInventory().getHelmet();
if (type == DamageCause.DROWNING && wcfg.pumpkinScuba if (type == DamageCause.DROWNING && wcfg.pumpkinScuba
&& (player.getInventory().getHelmet().getTypeId() == BlockID.PUMPKIN && helmet != null
|| player.getInventory().getHelmet().getTypeId() == BlockID.JACKOLANTERN)) { && (helmet.getTypeId() == BlockID.PUMPKIN
|| helmet.getTypeId() == BlockID.JACKOLANTERN)) {
player.setRemainingAir(player.getMaximumAir()); player.setRemainingAir(player.getMaximumAir());
event.setCancelled(true); event.setCancelled(true);
return; return;