From 82638a9d5399ef2572c8cc1fa4a8dbf1721d261c Mon Sep 17 00:00:00 2001 From: Wendall Cada Date: Thu, 14 Jun 2018 13:05:09 -0700 Subject: [PATCH] Fix potential crash with whitelisted items that aren't tools, but attempt to harvest. --- src/main/java/tinkersurvival/event/HarvestEventHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/tinkersurvival/event/HarvestEventHandler.java b/src/main/java/tinkersurvival/event/HarvestEventHandler.java index 1f9931f..216b780 100644 --- a/src/main/java/tinkersurvival/event/HarvestEventHandler.java +++ b/src/main/java/tinkersurvival/event/HarvestEventHandler.java @@ -150,9 +150,9 @@ public void breakBlock(BlockEvent.BreakEvent event) { String neededToolClass = block.getHarvestTool(event.getState()); if (neededToolClass != null) { - if (ItemUse.isWhitelistItem(heldItemStack)) { - String toolClass = ItemUse.getToolClass(heldItemStack); + String toolClass = ItemUse.getToolClass(heldItemStack); + if (ItemUse.isWhitelistItem(heldItemStack) && toolClass != null) { if (neededToolClass.equals(toolClass)) { if (heldItemStack.getItem().getHarvestLevel(heldItemStack, toolClass, null, null) >= neededHarvestLevel) { return;