mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fix ItemToolAbility bedrock breaking
This commit is contained in:
parent
3da96091da
commit
4983002013
@ -292,14 +292,23 @@ public class ItemToolAbility extends ItemTool implements IDepthRockTool, IGUIPro
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!(canHarvestBlock(block, stack) || canShearBlock(block, stack, world, x, y, z)) || block == Blocks.bedrock || block == ModBlocks.stone_keyhole)
|
||||
if(!(
|
||||
canHarvestBlock(block, stack) ||
|
||||
canShearBlock(block, stack, world, x, y, z)) ||
|
||||
block.getPlayerRelativeBlockHardness(player, world, x, y, z) < 0 ||
|
||||
block == ModBlocks.stone_keyhole
|
||||
)
|
||||
return;
|
||||
|
||||
Block refBlock = world.getBlock(refX, refY, refZ);
|
||||
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
|
||||
float strength = ForgeHooks.blockStrength(block, player, world, x, y, z);
|
||||
|
||||
if(!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f || refBlock.getPlayerRelativeBlockHardness(player, world, refX, refY, refZ) < 0)
|
||||
if(
|
||||
!ForgeHooks.canHarvestBlock(block, player, meta) ||
|
||||
refStrength / strength > 10f ||
|
||||
refBlock.getPlayerRelativeBlockHardness(player, world, refX, refY, refZ) < 0
|
||||
)
|
||||
return;
|
||||
|
||||
BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user