From 78e355d7a1d629b57bea2f29d9c7082b913fc58e Mon Sep 17 00:00:00 2001 From: Meredith Espinosa Date: Wed, 19 Jun 2019 11:47:42 -0700 Subject: [PATCH] Update SlopeTestBlock.java --- .../io/github/cottonmc/slopetest/block/SlopeTestBlock.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/cottonmc/slopetest/block/SlopeTestBlock.java b/src/main/java/io/github/cottonmc/slopetest/block/SlopeTestBlock.java index b5918b4..f42f607 100644 --- a/src/main/java/io/github/cottonmc/slopetest/block/SlopeTestBlock.java +++ b/src/main/java/io/github/cottonmc/slopetest/block/SlopeTestBlock.java @@ -62,11 +62,12 @@ public class SlopeTestBlock extends Block implements BlockEntityProvider { ItemStack stack = player.getStackInHand(hand); if (stack.getItem() instanceof BlockItem) { Block block = ((BlockItem)stack.getItem()).getBlock(); - if (block.getDefaultState().getOutlineShape(world, pos) == VoxelShapes.fullCube() && !(block instanceof BlockEntityProvider)) { + ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit)); + BlockState placementState = block.getPlacementState(ctx); + if (placementState.getOutlineShape(world, pos) == VoxelShapes.fullCube() && !(block instanceof BlockEntityProvider)) { SlopeTestEntity be = (SlopeTestEntity) world.getBlockEntity(pos); if (be.getRenderedState().getBlock() == Blocks.AIR) { - ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit)); - be.setRenderedState(block.getPlacementState(ctx)); + be.setRenderedState(placementState); if (!player.abilities.creativeMode) stack.decrement(1); } }