Fix ShapeUtils::hasSolidSide
This commit is contained in:
parent
b6813ad14d
commit
26cfe04646
|
@ -20,8 +20,7 @@ public class ShapeUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasSolidSide(VoxelShape shape, Direction side) {
|
public static boolean hasSolidSide(VoxelShape shape, Direction side) {
|
||||||
BiFunction<VoxelShape, Direction.Axis, Double> getter = side.getDirection() == Direction.AxisDirection.NEGATIVE ? VoxelShape::getMinimum : VoxelShape::getMaximum;
|
if ((side.getDirection() == Direction.AxisDirection.POSITIVE && shape.getMaximum(side.getAxis()) < 1) || (side.getDirection() == Direction.AxisDirection.NEGATIVE && shape.getMinimum(side.getAxis()) > 0)) {
|
||||||
if (getter.apply(shape, side.getAxis()) < 1) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (Direction.Axis axis : Direction.Axis.values()) {
|
for (Direction.Axis axis : Direction.Axis.values()) {
|
||||||
|
|
Loading…
Reference in New Issue