fixed the placer ignoring placement checks for redstone and gold powder

This commit is contained in:
Ellpeck 2018-11-09 00:38:42 +01:00
parent 6248495b0b
commit 0d9d466efd

View file

@ -112,9 +112,15 @@ public class TileEntityPlacer extends TileEntityImpl implements ITickable {
private boolean handleSpecialCases(ItemStack stack, BlockPos pos) { private boolean handleSpecialCases(ItemStack stack, BlockPos pos) {
if (stack.getItem() == Items.REDSTONE) if (stack.getItem() == Items.REDSTONE)
if (Blocks.REDSTONE_WIRE.canPlaceBlockAt(this.world, pos))
this.world.setBlockState(pos, Blocks.REDSTONE_WIRE.getDefaultState()); this.world.setBlockState(pos, Blocks.REDSTONE_WIRE.getDefaultState());
else
return false;
else if (stack.getItem() == Item.getItemFromBlock(ModBlocks.GOLD_POWDER)) else if (stack.getItem() == Item.getItemFromBlock(ModBlocks.GOLD_POWDER))
if (ModBlocks.GOLD_POWDER.canPlaceBlockAt(this.world, pos))
this.world.setBlockState(pos, ModBlocks.GOLD_POWDER.getDefaultState()); this.world.setBlockState(pos, ModBlocks.GOLD_POWDER.getDefaultState());
else
return false;
else if (stack.getItem() instanceof IPlantable) { else if (stack.getItem() instanceof IPlantable) {
IPlantable plantable = (IPlantable) stack.getItem(); IPlantable plantable = (IPlantable) stack.getItem();
IBlockState plant = plantable.getPlant(this.world, pos); IBlockState plant = plantable.getPlant(this.world, pos);