Skip to content

Commit

Permalink
fix: standing on LED panels
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushmead committed Aug 16, 2024
1 parent 28183da commit 89848d7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ public class PipeBlock extends DirectionalBlock implements Support {
public static final DirectionProperty FACING = DirectionalBlock.FACING;
private final VoxelShape Z_BOX = Shapes.create(new AABB(0.35, 0.4, 0, 0.65, 0.6, 1));
private final VoxelShape Z_BOX_DOWN = Shapes.create(new AABB(0, 0, 0, 1, 0.6, 1));
private final VoxelShape Z_BOX_UP = Shapes.create(new AABB(0, 0.4, 0, 1, 1, 1));
private final VoxelShape X_BOX = Shapes.create(new AABB(0, 0.4, 0.4, 1, 0.6, 0.6));
private final VoxelShape X_BOX_DOWN = Shapes.create(new AABB(0, 0, 0, 1, 0.6, 1));
private final VoxelShape X_BOX_UP = Shapes.create(new AABB(0, 0.4, 0, 1, 1, 1));
private final VoxelShape Y_BOX = Shapes.create(new AABB(0.4, 0, 0.4, 0.6, 1, 0.6));
private final VoxelShape Y_BOX_SOUTH = Shapes.create(new AABB(0, 0, 0.4, 1, 1, 1));
private final VoxelShape Y_BOX_NORTH = Shapes.create(new AABB(0, 0, 0, 1, 1, 0.6));
Expand Down Expand Up @@ -104,6 +106,10 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co
VoxelShape ogShape = state.getValue(FACING).getAxis() == Direction.Axis.Z ? Z_BOX : X_BOX;
VoxelShape extensionShape = state.getValue(FACING).getAxis() == Direction.Axis.Z ? Z_BOX_DOWN : X_BOX_DOWN;
return Shapes.or(ogShape, extensionShape);
} else if(level.getBlockState(pos.relative(Direction.UP)).getBlock() instanceof HangableBlock){
VoxelShape ogShape = state.getValue(FACING).getAxis() == Direction.Axis.Z ? Z_BOX : X_BOX;
VoxelShape extensionShape = state.getValue(FACING).getAxis() == Direction.Axis.Z ? Z_BOX_UP : X_BOX_UP;
return Shapes.or(ogShape, extensionShape);
}
}
return state.getValue(FACING).getAxis() == Direction.Axis.Z ? Z_BOX
Expand Down

0 comments on commit 89848d7

Please sign in to comment.