Skip to content

Commit b210b54

Browse files
committed
Ignore chunks with negative size
1 parent 05ae60f commit b210b54

File tree

1 file changed

+2
-2
lines changed
  • core/src/main/java/de/bluecolored/bluemap/core/world/mca/region

1 file changed

+2
-2
lines changed

core/src/main/java/de/bluecolored/bluemap/core/world/mca/region/MCARegion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public T loadChunk(int chunkX, int chunkZ) throws IOException {
9393
offset *= 4096;
9494
int size = (header[3] & 0xFF) * 4096;
9595

96-
if (size == 0) return chunkLoader.emptyChunk();
96+
if (size <= 0) return chunkLoader.emptyChunk();
9797

9898
byte[] chunkDataBuffer = new byte[size];
9999

@@ -127,7 +127,7 @@ public void iterateAllChunks(ChunkConsumer<T> consumer) throws IOException {
127127
int xzChunk = (z & 0b11111) << 5 | (x & 0b11111);
128128

129129
int size = (header[xzChunk * 4 + 3] & 0xFF) * 4096;
130-
if (size == 0) continue;
130+
if (size <= 0) continue;
131131

132132
int chunkX = chunkStartX + x;
133133
int chunkZ = chunkStartZ + z;

0 commit comments

Comments
 (0)