Skip to content

Commit

Permalink
Fixed Placing a bed against a vertical slab makes it disappear #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Oct 9, 2022
1 parent c115ff4 commit cc4a871
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -472,7 +472,8 @@ public boolean canPlaceLiquid(BlockGetter getter, BlockPos pos, BlockState state

@Override
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
if (!state.getValue(DOUBLE) && state.getValue(SHAPE) == StairsShape.STRAIGHT && VerticalSlabUtils.getReferredSlabState(context.getItemInHand()) == VerticalSlabUtils.getReferredSlabState(context.getLevel(), context.getClickedPos())) {
BlockState blockState = VerticalSlabUtils.getReferredSlabState(context.getItemInHand());
if (!state.getValue(DOUBLE) && state.getValue(SHAPE) == StairsShape.STRAIGHT && blockState != null && blockState == VerticalSlabUtils.getReferredSlabState(context.getLevel(), context.getClickedPos())) {
if (context.replacingClickedOnBlock()) {
return context.getClickedFace() == state.getValue(FACING).getOpposite();
}

0 comments on commit cc4a871

Please sign in to comment.