mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
Fixed NPE with null ItemStack for pumpkin scuba in EntityDamageEvent.
This commit is contained in:
parent
10296cb736
commit
ddefbfe2cf
@ -415,9 +415,12 @@ public void onEntityDamage(EntityDamageEvent event) {
|
||||
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