From 9afff6f780bdde6f6259b30a4844fdd6d271db57 Mon Sep 17 00:00:00 2001 From: Genny Date: Tue, 3 Mar 2020 21:11:51 -0600 Subject: Add check helmet is not null in damager --- src/main/java/dev/genbyte/sunfright/Damager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/dev/genbyte/sunfright/Damager.java b/src/main/java/dev/genbyte/sunfright/Damager.java index bfb977f..cdee7c1 100644 --- a/src/main/java/dev/genbyte/sunfright/Damager.java +++ b/src/main/java/dev/genbyte/sunfright/Damager.java @@ -27,7 +27,8 @@ public class Damager extends BukkitRunnable { if (skylight > 3) { new DoDamage(player, (byte) 1).runTask(sf); - } else if (player.getInventory().getHelmet().getEnchantmentLevel(Enchantment.VANISHING_CURSE) == 2) { + } else if (player.getInventory().getHelmet() != null + && player.getInventory().getHelmet().getEnchantmentLevel(Enchantment.VANISHING_CURSE) == 2) { player.getInventory().setHelmet(new ItemStack(Material.AIR)); } }); -- cgit 1.4.1-3-g733a5