File tree Expand file tree Collapse file tree
src/main/java/me/cortex/voxy/client/core/rendering/building Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ()) {
You can’t perform that action at this time.
0 commit comments