fix: there's some unknown issue with y index being out of bounds for some reason on kaboom ONLY

This commit is contained in:
ChomeNS
2025-03-05 16:59:12 +07:00
parent 02b9fd4f0b
commit fbe6f1711b
2 changed files with 4 additions and 4 deletions

View File

@@ -35,16 +35,16 @@ public class ChunkColumn {
int yIndex = (y - minY) >> 4;
if (chunks[yIndex] == null) return 0;
if (yIndex >= chunks.length) return 0;
return chunks[yIndex].getBlock(x, y & 15, z);
}
public void setBlock (int x, int y, int z, int id) {
if (chunks == null) return;
int yIndex = (y - minY) >> 4;
if (yIndex >= chunks.length) return;
if (chunks[yIndex] == null) {
chunks[yIndex] = new ChunkSection();
chunks[yIndex].setBlock(0, 0, 0, 0);