parent
7e2251b8e5
commit
c6a315a51c
|
@ -241,14 +241,15 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable {
|
|||
float strengthVsBlock = getDestroySpeed(stack, blockState);
|
||||
|
||||
if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) {
|
||||
if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player))
|
||||
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock())));
|
||||
else {
|
||||
NonNullList<ItemStack> itemDrops = new NonNullList<>();
|
||||
blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl);
|
||||
for (ItemStack stacks : itemDrops)
|
||||
ItemHandlerHelper.giveItemToPlayer(player, stacks);
|
||||
}
|
||||
if (!player.isCreative())
|
||||
if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player))
|
||||
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock())));
|
||||
else {
|
||||
NonNullList<ItemStack> itemDrops = NonNullList.create();
|
||||
blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl);
|
||||
for (ItemStack stacks : itemDrops)
|
||||
ItemHandlerHelper.giveItemToPlayer(player, stacks);
|
||||
}
|
||||
blockState.getBlock().removedByPlayer(world.getBlockState(blockPos), world, blockPos, player, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue