From 4d2e78e7cf0b2724cee74d89287162a15aefcb07 Mon Sep 17 00:00:00 2001 From: mworzala Date: Mon, 25 Mar 2024 19:02:12 -0400 Subject: [PATCH] fix: do not add a 1,1,1->0,0,0 collision shape if no boundingbox is present --- src/main/java/net/minestom/server/collision/ShapeImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/collision/ShapeImpl.java b/src/main/java/net/minestom/server/collision/ShapeImpl.java index 36b4f8477..ac0e83b02 100644 --- a/src/main/java/net/minestom/server/collision/ShapeImpl.java +++ b/src/main/java/net/minestom/server/collision/ShapeImpl.java @@ -33,7 +33,7 @@ public final class ShapeImpl implements Shape { this.blockEntry = blockEntry; // Find bounds of collision - { + if (collisionBoundingBoxes.length > 0) { double minX = 1, minY = 1, minZ = 1; double maxX = 0, maxY = 0, maxZ = 0; for (BoundingBox blockSection : collisionBoundingBoxes) { @@ -48,6 +48,9 @@ public final class ShapeImpl implements Shape { } this.relativeStart = new Vec(minX, minY, minZ); this.relativeEnd = new Vec(maxX, maxY, maxZ); + } else { + this.relativeStart = Vec.ZERO; + this.relativeEnd = Vec.ZERO; } byte fullCollisionFaces = 0;