Fix a few truncation and off by 1 errors

This commit is contained in:
James Seibel
2021-07-25 18:48:25 -05:00
parent 19fd1aff98
commit 99209f920d
2 changed files with 4 additions and 3 deletions
@@ -159,9 +159,10 @@ public class LodBufferBuilder
// set where this square will be drawn in the world
double xOffset = (LodChunk.WIDTH * i) + // offset by the number of LOD blocks
startX; // offset so the center LOD block is centered underneath the player
startX + // offset so the center LOD block is centered underneath the player
2; // truncation(?) correction
double yOffset = 0;
double zOffset = (LodChunk.WIDTH * j) + startZ;
double zOffset = (LodChunk.WIDTH * j) + startZ + 2;
LodChunk lod = lodDim.getLodFromCoordinates(chunkX, chunkZ);
@@ -289,7 +289,7 @@ public class LodChunkBuilder
// enough blocks in this
// layer to count as an
// LOD point
return (short) (y + (section * CHUNK_SECTION_HEIGHT));
return (short) (y + 1 + (section * CHUNK_SECTION_HEIGHT));
}
}
}