mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +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;
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user