Fix potential NPE with harvest levels
@@ -4,11 +4,9 @@ package slimeknights.tconstruct.library.tools;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.event.entity.player.PlayerEvent;
-import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import slimeknights.tconstruct.library.utils.ToolHelper;
@@ -27,6 +25,7 @@ public final class DualToolHarvestUtils {
return tool != null
&& offhand != null
+ && blockState != null
&& tool.getItem() instanceof TinkerToolCore
&& !ToolHelper.isToolEffective2(tool, blockState)
&& ToolHelper.isToolEffective2(offhand, blockState);
