Remove dead ForgeHooks.canToolHarvestBlock function. (#7262)
This commit is contained in:
parent
05480843cd
commit
47ba5b7a89
2 changed files with 4 additions and 14 deletions
|
@ -173,22 +173,13 @@ public class ForgeHooks
|
||||||
if (stack.isEmpty() || tool == null)
|
if (stack.isEmpty() || tool == null)
|
||||||
return player.func_234569_d_(state);
|
return player.func_234569_d_(state);
|
||||||
|
|
||||||
int toolLevel = stack.getItem().getHarvestLevel(stack, tool, player, state);
|
int toolLevel = stack.getHarvestLevel(tool, player, state);
|
||||||
if (toolLevel < 0)
|
if (toolLevel < 0)
|
||||||
return player.func_234569_d_(state);
|
return player.func_234569_d_(state);
|
||||||
|
|
||||||
return ForgeEventFactory.doPlayerHarvestCheck(player, state, toolLevel >= state.getHarvestLevel());
|
return ForgeEventFactory.doPlayerHarvestCheck(player, state, toolLevel >= state.getHarvestLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canToolHarvestBlock(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)
|
|
||||||
{
|
|
||||||
BlockState state = world.getBlockState(pos);
|
|
||||||
//state = state.getActualState(world, pos);
|
|
||||||
ToolType tool = state.getHarvestTool();
|
|
||||||
if (stack.isEmpty() || tool == null) return false;
|
|
||||||
return stack.getHarvestLevel(tool, null, null) >= state.getHarvestLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isToolEffective(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)
|
public static boolean isToolEffective(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)
|
||||||
{
|
{
|
||||||
BlockState state = world.getBlockState(pos);
|
BlockState state = world.getBlockState(pos);
|
||||||
|
|
|
@ -94,8 +94,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundNBT>
|
||||||
* Queries the harvest level of this item stack for the specified tool class,
|
* Queries the harvest level of this item stack for the specified tool class,
|
||||||
* Returns -1 if this tool is not of the specified type
|
* Returns -1 if this tool is not of the specified type
|
||||||
*
|
*
|
||||||
* @param stack This item stack instance
|
* @param tool the tool type of the item
|
||||||
* @param toolClass Tool Class
|
|
||||||
* @param player The player trying to harvest the given blockstate
|
* @param player The player trying to harvest the given blockstate
|
||||||
* @param state The block to harvest
|
* @param state The block to harvest
|
||||||
* @return Harvest level, or -1 if not the specified tool type.
|
* @return Harvest level, or -1 if not the specified tool type.
|
||||||
|
|
Loading…
Reference in a new issue