Skip to content

Commit

Permalink
Fix potential crash with whitelisted items that aren't tools, but att…
Browse files Browse the repository at this point in the history
…empt to harvest.
  • Loading branch information
wendall911 committed Jun 14, 2018
1 parent c62350f commit 82638a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/tinkersurvival/event/HarvestEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 82638a9

Please sign in to comment.