mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Edits enable use of EntityPlayer.canHarvestBlock (for PlayerAPI) when the ToolClass has no rules for the block.
This commit is contained in:
1 parent
36c7a35db9
commit
8ffd66f27f
1 file changed
+3
-3
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user