Allow overriding of tool level requirements when harvesting a block, via the HarvestCheck event. (#6632)

This commit is contained in:
Brennan Ward 2020-05-03 16:40:34 -04:00 committed by GitHub
parent 035c01e222
commit 9e763a8334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,7 +193,7 @@ public class ForgeHooks
return player.canHarvestBlock(state); return player.canHarvestBlock(state);
} }
return toolLevel >= state.getHarvestLevel(); return ForgeEventFactory.doPlayerHarvestCheck(player, state, toolLevel >= state.getHarvestLevel());
} }
public static boolean canToolHarvestBlock(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack) public static boolean canToolHarvestBlock(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)