Update SlopeTestBlock.java
This commit is contained in:
parent
07abe31ea4
commit
78e355d7a1
@ -62,11 +62,12 @@ public class SlopeTestBlock extends Block implements BlockEntityProvider {
|
|||||||
ItemStack stack = player.getStackInHand(hand);
|
ItemStack stack = player.getStackInHand(hand);
|
||||||
if (stack.getItem() instanceof BlockItem) {
|
if (stack.getItem() instanceof BlockItem) {
|
||||||
Block block = ((BlockItem)stack.getItem()).getBlock();
|
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);
|
SlopeTestEntity be = (SlopeTestEntity) world.getBlockEntity(pos);
|
||||||
if (be.getRenderedState().getBlock() == Blocks.AIR) {
|
if (be.getRenderedState().getBlock() == Blocks.AIR) {
|
||||||
ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit));
|
be.setRenderedState(placementState);
|
||||||
be.setRenderedState(block.getPlacementState(ctx));
|
|
||||||
if (!player.abilities.creativeMode) stack.decrement(1);
|
if (!player.abilities.creativeMode) stack.decrement(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user