mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Expand getHarvestLevel to include player and blockstate (#3192)
This commit is contained in:
1 parent
7f40d90b75
commit
8dbfe1baad
4 files changed
+42
-12
No files matched your search
@@ -169,7 +169,7 @@ public class ForgeHooks
|
||||
return player.canHarvestBlock(state);
|
||||
}
|
||||
|
||||
int toolLevel = stack.getItem().getHarvestLevel(stack, tool);
|
||||
int toolLevel = stack.getItem().getHarvestLevel(stack, tool, player, state);
|
||||
if (toolLevel < 0)
|
||||
{
|
||||
return player.canHarvestBlock(state);
|
||||
@@ -184,7 +184,7 @@ public class ForgeHooks
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
String tool = state.getBlock().getHarvestTool(state);
|
||||
if (stack == null || tool == null) return false;
|
||||
return stack.getItem().getHarvestLevel(stack, tool) >= state.getBlock().getHarvestLevel(state);
|
||||
return stack.getItem().getHarvestLevel(stack, tool, null, null) >= state.getBlock().getHarvestLevel(state);
|
||||
}
|
||||
|
||||
public static float blockStrength(IBlockState state, EntityPlayer player, World world, BlockPos pos)
|
||||
|
||||
Reference in new issue
Block a user