mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 03:25:24 +01:00
Fixed NPE with null ItemStack for pumpkin scuba in EntityDamageEvent.
This commit is contained in:
parent
10296cb736
commit
ddefbfe2cf
@ -414,10 +414,13 @@ public void onEntityDamage(EntityDamageEvent event) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack helmet = player.getInventory().getHelmet();
|
||||
|
||||
if (type == DamageCause.DROWNING && wcfg.pumpkinScuba
|
||||
&& (player.getInventory().getHelmet().getTypeId() == BlockID.PUMPKIN
|
||||
|| player.getInventory().getHelmet().getTypeId() == BlockID.JACKOLANTERN)) {
|
||||
&& helmet != null
|
||||
&& (helmet.getTypeId() == BlockID.PUMPKIN
|
||||
|| helmet.getTypeId() == BlockID.JACKOLANTERN)) {
|
||||
player.setRemainingAir(player.getMaximumAir());
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user