Skip to content

Commit 5d40739

Browse files
committed
.... how... how has this been missed for well over a year ;-; fuuuuuuuuuuuu
1 parent 91d4f7c commit 5d40739

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/java/me/cortex/voxy/client/core/rendering/building/RenderDataFactory.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,13 +1777,20 @@ public BuiltSection generateMesh(WorldSection section) {
17771777
coff += size;
17781778
}
17791779

1780+
1781+
17801782
int aabb = 0;
17811783
aabb |= this.minX;
17821784
aabb |= this.minY<<5;
17831785
aabb |= this.minZ<<10;
1784-
aabb |= (this.maxX-this.minX-1)<<15;
1785-
aabb |= (this.maxY-this.minY-1)<<20;
1786-
aabb |= (this.maxZ-this.minZ-1)<<25;
1786+
//Feel like a clown for missing the Math.max
1787+
aabb |= Math.max(0,this.maxX-this.minX-1)<<15;
1788+
aabb |= Math.max(0,this.maxY-this.minY-1)<<20;
1789+
aabb |= Math.max(0,this.maxZ-this.minZ-1)<<25;
1790+
1791+
//if (this.maxX<=this.minX||this.maxY<=this.minY||this.maxZ<=this.minZ) {
1792+
// throw new IllegalStateException("AABB bounds are not valid");
1793+
//}
17871794

17881795
MemoryBuffer occupancy = null;
17891796
if (this.occupancy != null && !this.occupancy.isEmpty()) {

0 commit comments

Comments
 (0)