Skip to content

Commit

Permalink
Fix crash when clicking the chopping block with an empty hand.
Browse files Browse the repository at this point in the history
  • Loading branch information
gigaherz committed Jul 25, 2016
1 parent e951ddb commit 4e50951
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repositories {

apply plugin: 'net.minecraftforge.gradle.forge'

version = "1.5.0"
version = "1.5.1"
group= "gigaherz.survivalist" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Survivalist-1.10.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn)
{
TileChopping chopper = (TileChopping) tileentity;
ItemStack heldItem = playerIn.getHeldItem(EnumHand.MAIN_HAND);
assert heldItem != null;

int harvestLevel = heldItem.getItem().getHarvestLevel(heldItem, "axe");
int harvestLevel = heldItem != null ? heldItem.getItem().getHarvestLevel(heldItem, "axe") : -1;
if (harvestLevel >= 0)
{
if (chopper.chop(playerIn, harvestLevel, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, heldItem)))
Expand Down

0 comments on commit 4e50951

Please sign in to comment.