Add a null check in case there is no current equipped item

This commit is contained in:
Jason Mitchell committed 2018-01-29 22:31:02 -08:00
1 parent 9387e21f50
commit 14543da225
1 file changed
+4 -1
@@ -289,7 +289,10 @@ public abstract class HarvestTool extends ToolCore
}
// callback to the tool the player uses. Called on both sides. This damages the tool n stuff.
player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player);
ItemStack currentItem = player.getCurrentEquippedItem();
if(currentItem != null) {
currentItem.func_150999_a(world, block, x, y, z, player);
}
// server sided handling
if (!world.isRemote) {