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) {
BiFunction<VoxelShape, Direction.Axis, Double> getter = side.getDirection() == Direction.AxisDirection.NEGATIVE ? VoxelShape::getMinimum : VoxelShape::getMaximum;
if (getter.apply(shape, side.getAxis()) < 1) {
if ((side.getDirection() == Direction.AxisDirection.POSITIVE && shape.getMaximum(side.getAxis()) < 1) || (side.getDirection() == Direction.AxisDirection.NEGATIVE && shape.getMinimum(side.getAxis()) > 0)) {
return false;
}
for (Direction.Axis axis : Direction.Axis.values()) {