Skip to content

Commit

Permalink
Fixed RailwaySignWall wrong broke
Browse files Browse the repository at this point in the history
Fixed #5
  • Loading branch information
ZiYueCommentary committed Sep 21, 2024
1 parent b17c2b1 commit 036f9ff
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ public BlockState getPlacementState2(ItemPlacementContext ctx) {
@Nonnull
@Override
public BlockState getStateForNeighborUpdate2(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
return IRailwaySign.getStateForNeighborUpdate(state, direction, neighborState, BlockList.RAILWAY_SIGN_WALL_MIDDLE.get());
final Direction facing = IBlock.getStatePropertySafe(state, FACING);
final boolean isNext = ((!IBlock.getStatePropertySafe(state, EOS) && (direction == facing.rotateYClockwise())) || IBlockExtension.isBlock(state, BlockList.RAILWAY_SIGN_WALL_MIDDLE.get()) && (direction == facing.rotateYCounterclockwise()));
if (isNext && !(state.getBlock().data instanceof BlockRailwaySignWall)) {
return Blocks.getAirMapped().getDefaultState();
} else {
return state;
}
}

@Nonnull
Expand Down

0 comments on commit 036f9ff

Please sign in to comment.