Skip to content

Commit

Permalink
refactor: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 1, 2025
1 parent 33bbbc0 commit 8cc9d4d
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ private static VoxelShape calculateShape(BlockState state) {
if (state.getValue(BASE)) {
voxelshape = DOWN_AABB;
}
voxelshape = switch ((WallSide)state.getValue(NORTH)) {
voxelshape = switch (state.getValue(NORTH)) {
case NONE -> voxelshape;
case LOW -> Shapes.or(voxelshape, NORTH_SHORT_AABB);
case TALL -> Shapes.or(voxelshape, NORTH_AABB);
};

voxelshape = switch ((WallSide)state.getValue(SOUTH)) {
voxelshape = switch (state.getValue(SOUTH)) {
case NONE -> voxelshape;
case LOW -> Shapes.or(voxelshape, SOUTH_SHORT_AABB);
case TALL -> Shapes.or(voxelshape, SOUTH_AABB);
};

voxelshape = switch ((WallSide)state.getValue(EAST)) {
voxelshape = switch (state.getValue(EAST)) {
case NONE -> voxelshape;
case LOW -> Shapes.or(voxelshape, EAST_SHORT_AABB);
case TALL -> Shapes.or(voxelshape, EAST_AABB);
};

voxelshape = switch ((WallSide)state.getValue(WEST)) {
voxelshape = switch (state.getValue(WEST)) {
case NONE -> voxelshape;
case LOW -> Shapes.or(voxelshape, WEST_SHORT_AABB);
case TALL -> Shapes.or(voxelshape, WEST_AABB);
Expand Down Expand Up @@ -268,15 +268,15 @@ protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockSt
@Override
protected BlockState rotate(BlockState p_379325_, Rotation p_380164_) {
return switch (p_380164_) {
case CLOCKWISE_180 -> (BlockState)p_379325_.setValue(NORTH, p_379325_.getValue(SOUTH))
case CLOCKWISE_180 -> p_379325_.setValue(NORTH, p_379325_.getValue(SOUTH))
.setValue(EAST, p_379325_.getValue(WEST))
.setValue(SOUTH, p_379325_.getValue(NORTH))
.setValue(WEST, p_379325_.getValue(EAST));
case COUNTERCLOCKWISE_90 -> (BlockState)p_379325_.setValue(NORTH, p_379325_.getValue(EAST))
case COUNTERCLOCKWISE_90 -> p_379325_.setValue(NORTH, p_379325_.getValue(EAST))
.setValue(EAST, p_379325_.getValue(SOUTH))
.setValue(SOUTH, p_379325_.getValue(WEST))
.setValue(WEST, p_379325_.getValue(NORTH));
case CLOCKWISE_90 -> (BlockState)p_379325_.setValue(NORTH, p_379325_.getValue(WEST))
case CLOCKWISE_90 -> p_379325_.setValue(NORTH, p_379325_.getValue(WEST))
.setValue(EAST, p_379325_.getValue(NORTH))
.setValue(SOUTH, p_379325_.getValue(EAST))
.setValue(WEST, p_379325_.getValue(SOUTH));
Expand All @@ -287,8 +287,8 @@ protected BlockState rotate(BlockState p_379325_, Rotation p_380164_) {
@Override
protected BlockState mirror(BlockState p_379462_, Mirror p_380184_) {
return switch (p_380184_) {
case LEFT_RIGHT -> (BlockState)p_379462_.setValue(NORTH, p_379462_.getValue(SOUTH)).setValue(SOUTH, p_379462_.getValue(NORTH));
case FRONT_BACK -> (BlockState)p_379462_.setValue(EAST, p_379462_.getValue(WEST)).setValue(WEST, p_379462_.getValue(EAST));
case LEFT_RIGHT -> p_379462_.setValue(NORTH, p_379462_.getValue(SOUTH)).setValue(SOUTH, p_379462_.getValue(NORTH));
case FRONT_BACK -> p_379462_.setValue(EAST, p_379462_.getValue(WEST)).setValue(WEST, p_379462_.getValue(EAST));
default -> super.mirror(p_379462_, p_380184_);
};
}
Expand Down

0 comments on commit 8cc9d4d

Please sign in to comment.