fix: do not add a 1,1,1->0,0,0 collision shape if no boundingbox is present

This commit is contained in:
mworzala 2024-03-25 19:02:12 -04:00
parent fa0cd40ac1
commit 4d2e78e7cf
No known key found for this signature in database
GPG Key ID: B148F922E64797C7
1 changed files with 4 additions and 1 deletions

View File

@ -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;