From 0d9d466efd4ec4c862f18e1a820996082c78c8c7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 9 Nov 2018 00:38:42 +0100 Subject: [PATCH] fixed the placer ignoring placement checks for redstone and gold powder --- .../naturesaura/blocks/tiles/TileEntityPlacer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPlacer.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPlacer.java index 679e41e0..00dfde46 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPlacer.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPlacer.java @@ -112,9 +112,15 @@ public class TileEntityPlacer extends TileEntityImpl implements ITickable { private boolean handleSpecialCases(ItemStack stack, BlockPos pos) { if (stack.getItem() == Items.REDSTONE) - this.world.setBlockState(pos, Blocks.REDSTONE_WIRE.getDefaultState()); + if (Blocks.REDSTONE_WIRE.canPlaceBlockAt(this.world, pos)) + this.world.setBlockState(pos, Blocks.REDSTONE_WIRE.getDefaultState()); + else + return false; else if (stack.getItem() == Item.getItemFromBlock(ModBlocks.GOLD_POWDER)) - this.world.setBlockState(pos, ModBlocks.GOLD_POWDER.getDefaultState()); + if (ModBlocks.GOLD_POWDER.canPlaceBlockAt(this.world, pos)) + this.world.setBlockState(pos, ModBlocks.GOLD_POWDER.getDefaultState()); + else + return false; else if (stack.getItem() instanceof IPlantable) { IPlantable plantable = (IPlantable) stack.getItem(); IBlockState plant = plantable.getPlant(this.world, pos);