@@ -207,7 +207,7 @@ private static long packPartialQuadData(int modelId, long state, long metadata)
207207 return quadData ;
208208 }
209209
210- private int prepareSectionData () {
210+ private int prepareSectionData (final long [] rawSectionData ) {
211211 final var sectionData = this .sectionData ;
212212 final var rawModelIds = this .modelMan ._unsafeRawAccess ();
213213 int opaque = 0 ;
@@ -217,7 +217,7 @@ private int prepareSectionData() {
217217
218218 int neighborAcquireMsk = 0 ;//-+x, -+y, -+Z
219219 for (int i = 0 ; i < 32 *32 *32 ;) {
220- long block = sectionData [ i + 32 * 32 * 32 ];//Get the block mapping
220+ long block = rawSectionData [ i ];//Get the block mapping
221221 if (Mapper .isAir (block )) {//If it is air, just emit lighting
222222 sectionData [i * 2 ] = (block &(0xFFL <<56 ))>>1 ;
223223 sectionData [i * 2 + 1 ] = 0 ;
@@ -1542,7 +1542,7 @@ public BuiltSection generateMesh(WorldSection section) {
15421542 //THE EXCEPTION THAT THIS THROWS CAUSES MAJOR ISSUES
15431543
15441544 //Copy section data to end of array so that can mutate array while reading safely
1545- section .copyDataTo (this .sectionData , 32 *32 *32 );
1545+ // section.copyDataTo(this.sectionData, 32*32*32);
15461546
15471547 //We must reset _everything_ that could have changed as we dont exactly know the state due to how the model id exception
15481548 // throwing system works
@@ -1578,7 +1578,7 @@ public BuiltSection generateMesh(WorldSection section) {
15781578 Arrays .fill (this .fluidMasks , 0 );
15791579
15801580 //Prepare everything
1581- int neighborMsk = this .prepareSectionData ();
1581+ int neighborMsk = this .prepareSectionData (section . _unsafeGetRawDataArray () );
15821582 if (neighborMsk >>31 !=0 ) {//We failed to get everything so throw exception
15831583 throw new IdNotYetComputedException (neighborMsk &(~(1 <<31 )), true );
15841584 }
0 commit comments