From 62a868c3e48678876bf6b298888b74139aff9cf9 Mon Sep 17 00:00:00 2001 From: DefineOutside <49797025+MWHunter@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:15:04 +0000 Subject: [PATCH] Fix empty voxel shape usage (Fixes #7043) --- ...ptimise-single-and-multi-AABB-VoxelShapes-an.patch | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index bbfc4c63b0..5f19007d90 100644 --- a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch @@ -1467,10 +1467,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static VoxelShape box(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { @@ -0,0 +0,0 @@ public final class Shapes { - } 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 j = findBits(minY, maxY); - int k = findBits(minZ, maxZ); @@ -1487,10 +1486,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } 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})); - } -- } else { -- return empty(); -- } -+ return new io.papermc.paper.voxel.AABBVoxelShape(new AABB(minX, minY, minZ, maxX, maxY, maxZ)); // Paper ++ return new io.papermc.paper.voxel.AABBVoxelShape(new AABB(minX, minY, minZ, maxX, maxY, maxZ)); // Paper + } else { + return empty(); + } } public static VoxelShape create(AABB box) {