Fix empty voxel shape usage (Fixes #7043)

This commit is contained in:
DefineOutside 2021-12-15 18:15:04 +00:00
parent fd9b86bcb9
commit 62a868c3e4

View file

@ -1467,10 +1467,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static VoxelShape box(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { public static VoxelShape box(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
@@ -0,0 +0,0 @@ public final class Shapes { @@ -0,0 +0,0 @@ public final class Shapes {
}
public static VoxelShape create(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { public static VoxelShape create(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
- if (!(maxX - minX < 1.0E-7D) && !(maxY - minY < 1.0E-7D) && !(maxZ - minZ < 1.0E-7D)) { if (!(maxX - minX < 1.0E-7D) && !(maxY - minY < 1.0E-7D) && !(maxZ - minZ < 1.0E-7D)) {
- int i = findBits(minX, maxX); - int i = findBits(minX, maxX);
- int j = findBits(minY, maxY); - int j = findBits(minY, maxY);
- int k = findBits(minZ, maxZ); - int k = findBits(minZ, maxZ);
@ -1487,10 +1486,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- } else { - } else {
- return new ArrayVoxelShape(BLOCK.shape, (DoubleList)DoubleArrayList.wrap(new double[]{minX, maxX}), (DoubleList)DoubleArrayList.wrap(new double[]{minY, maxY}), (DoubleList)DoubleArrayList.wrap(new double[]{minZ, maxZ})); - return new ArrayVoxelShape(BLOCK.shape, (DoubleList)DoubleArrayList.wrap(new double[]{minX, maxX}), (DoubleList)DoubleArrayList.wrap(new double[]{minY, maxY}), (DoubleList)DoubleArrayList.wrap(new double[]{minZ, maxZ}));
- } - }
- } else { + return new io.papermc.paper.voxel.AABBVoxelShape(new AABB(minX, minY, minZ, maxX, maxY, maxZ)); // Paper
- return empty(); } else {
- } return empty();
+ return new io.papermc.paper.voxel.AABBVoxelShape(new AABB(minX, minY, minZ, maxX, maxY, maxZ)); // Paper }
} }
public static VoxelShape create(AABB box) { public static VoxelShape create(AABB box) {