From 8ffd66f27ff1a795cc379a7480773e9495bc9f76 Mon Sep 17 00:00:00 2001 From: ShetiPhian Date: Mon, 16 Apr 2012 23:01:40 -0300 Subject: [PATCH] Edits enable use of EntityPlayer.canHarvestBlock (for PlayerAPI) when the ToolClass has no rules for the block. --- forge/forge_common/net/minecraft/src/forge/ForgeHooks.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java index 875283580..c0790346d 100644 --- a/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java +++ b/forge/forge_common/net/minecraft/src/forge/ForgeHooks.java @@ -431,13 +431,13 @@ public class ForgeHooks ItemStack stack = player.inventory.getCurrentItem(); if (stack == null) { - return false; + return player.canHarvestBlock(block); } List info = (List)toolClasses.get(stack.itemID); if (info == null) { - return stack.canHarvestBlock(block); + return player.canHarvestBlock(block); } Object[] tmp = info.toArray(); String toolClass = (String)tmp[0]; @@ -446,7 +446,7 @@ public class ForgeHooks Integer blockHarvestLevel = (Integer)toolHarvestLevels.get(Arrays.asList(block.blockID, metadata, toolClass)); if (blockHarvestLevel == null) { - return stack.canHarvestBlock(block); + return player.canHarvestBlock(block); } if (blockHarvestLevel > harvestLevel) {