From 4f763cac6ef59e6a8a67ff58b617b3755c1db323 Mon Sep 17 00:00:00 2001 From: Jeremy Diamond Date: Wed, 16 Sep 2015 18:34:31 -0700 Subject: [PATCH] Thanks for all the null, Mojang Fixes #37 --- src/main/java/fox/spiteful/avaritia/LudicrousEvents.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java b/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java index 80f64ba..f4dd486 100644 --- a/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java +++ b/src/main/java/fox/spiteful/avaritia/LudicrousEvents.java @@ -257,8 +257,10 @@ public class LudicrousEvents { event.newSpeed *= 5; if(!event.entityPlayer.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(event.entityPlayer)) event.newSpeed *= 5; - if(held.getTagCompound().getBoolean("hammer") || held.getTagCompound().getBoolean("destroyer")) { - event.newSpeed *= 0.5; + if(held.getTagCompound() != null) { + if (held.getTagCompound().getBoolean("hammer") || held.getTagCompound().getBoolean("destroyer")) { + event.newSpeed *= 0.5; + } } } } @@ -269,7 +271,7 @@ public class LudicrousEvents { if(event.entityPlayer.getHeldItem() != null){ ItemStack held = event.entityPlayer.getHeldItem(); if(held.getItem() == LudicrousItems.infinity_shovel && event.block.getMaterial() == Material.rock){ - if(held.getTagCompound().getBoolean("destroyer") && isGarbageBlock(event.block)) + if(held.getTagCompound() != null && held.getTagCompound().getBoolean("destroyer") && isGarbageBlock(event.block)) event.success = true; } }