diff --git a/src/main/java/WayofTime/bloodmagic/item/block/ItemBlockMimic.java b/src/main/java/WayofTime/bloodmagic/item/block/ItemBlockMimic.java index dc3c04a4..fff89c1c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/block/ItemBlockMimic.java +++ b/src/main/java/WayofTime/bloodmagic/item/block/ItemBlockMimic.java @@ -48,6 +48,12 @@ public class ItemBlockMimic extends ItemBlock int i = this.getMetadata(stack.getMetadata()); IBlockState iblockstate1 = this.block.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, i, player); + IBlockState blockReplaced = world.getBlockState(pos); + if (!canReplaceBlock(world, pos, blockReplaced)) + { + return super.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ); + } + TileEntity tileReplaced = world.getTileEntity(pos); if (!canReplaceTile(i, tileReplaced)) { @@ -109,6 +115,10 @@ public class ItemBlockMimic extends ItemBlock return tile == null; } + public boolean canReplaceBlock(World world, BlockPos pos, IBlockState state) { + return state.getBlockHardness(world, pos) != -1.0F; + } + public NBTTagCompound getTagFromTileEntity(TileEntity tile) { NBTTagCompound tag = new NBTTagCompound();