Fix ShapeUtils::hasSolidSide

This commit is contained in:
Shadowfacts 2019-01-05 18:20:21 -05:00
parent b6813ad14d
commit 26cfe04646
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 2 deletions

View File

@ -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()) {