From c6a315a51c21c1a101264f612dfeebbbce2f3cf6 Mon Sep 17 00:00:00 2001 From: Tobias Gremeyer Date: Mon, 21 Jan 2019 00:16:22 +0100 Subject: [PATCH] Fixed compile-time fatal error (#1510) Added Creative handling --- .../bloodmagic/item/ItemBoundTool.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java index eb89458c..128751c6 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java @@ -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 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 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); } }