be more discerning with what can go in a template block

This commit is contained in:
Meredith Espinosa 2019-07-11 00:38:22 -07:00
parent 715095434c
commit 3fef940041

View File

@ -42,7 +42,7 @@ public abstract class TemplateBlock extends Block implements BlockEntityProvider
} }
ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit)); ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit));
BlockState placementState = block.getPlacementState(ctx); BlockState placementState = block.getPlacementState(ctx);
if (Block.isShapeFullCube(placementState.getCollisionShape(world, pos)) && !(block instanceof BlockEntityProvider)) { if (state.isSimpleFullBlock(world, pos) && !(block instanceof BlockEntityProvider)) {
if (be.getRenderedState().getBlock() == Blocks.AIR) { if (be.getRenderedState().getBlock() == Blocks.AIR) {
be.setRenderedState(placementState); be.setRenderedState(placementState);
if (!player.abilities.creativeMode) stack.decrement(1); if (!player.abilities.creativeMode) stack.decrement(1);