mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 02:26:00 +01:00
Tentative fix for #560
This commit is contained in:
parent
5ddf614026
commit
6032043126
@ -92,11 +92,11 @@ public Chunk loadChunk(int chunkX, int chunkZ) throws IOException {
|
||||
channel.position(xzChunk * 4);
|
||||
readFully(channel, header, 0, 4);
|
||||
|
||||
int offset = header[0] << 16;
|
||||
int offset = (header[0] & 0xFF) << 16;
|
||||
offset |= (header[1] & 0xFF) << 8;
|
||||
offset |= header[2] & 0xFF;
|
||||
offset *= 4096;
|
||||
int size = header[3] * 4096;
|
||||
int size = (header[3] & 0xFF) * 4096;
|
||||
|
||||
if (size == 0) return Chunk.EMPTY_CHUNK;
|
||||
|
||||
@ -131,7 +131,7 @@ public void iterateAllChunks(ChunkConsumer consumer) throws IOException {
|
||||
for (int z = 0; z < 32; z++) {
|
||||
int xzChunk = (z & 0b11111) << 5 | (x & 0b11111);
|
||||
|
||||
int size = header[xzChunk * 4 + 3] * 4096;
|
||||
int size = (header[xzChunk * 4 + 3] & 0xFF) * 4096;
|
||||
if (size == 0) continue;
|
||||
|
||||
int chunkX = chunkStartX + x;
|
||||
@ -146,7 +146,7 @@ public void iterateAllChunks(ChunkConsumer consumer) throws IOException {
|
||||
// load chunk only if consumers filter returns true
|
||||
if (consumer.filter(chunkX, chunkZ, timestamp)) {
|
||||
i = xzChunk * 4;
|
||||
int offset = header[i++] << 16;
|
||||
int offset = (header[i++] & 0xFF) << 16;
|
||||
offset |= (header[i++] & 0xFF) << 8;
|
||||
offset |= header[i] & 0xFF;
|
||||
offset *= 4096;
|
||||
|
Loading…
Reference in New Issue
Block a user