Merge pull request #11 from GTNewHorizons/null_check

Add a null check in case there is no current equipped item
This commit is contained in:
Martin Robertz authored and GitHub committed 2018-01-30 09:01:35 +01:00
commit a930dd84f5
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) {