mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Fix chunk packet read
This commit is contained in:
parent
97d17f9b8b
commit
72bf894162
@ -39,8 +39,8 @@ public class ChunkDataPacket implements ServerPacket, CacheablePacket {
|
|||||||
public Biome[] biomes;
|
public Biome[] biomes;
|
||||||
public int chunkX, chunkZ;
|
public int chunkX, chunkZ;
|
||||||
|
|
||||||
public PaletteStorage paletteStorage;
|
public PaletteStorage paletteStorage = new PaletteStorage(8, 2);
|
||||||
public PaletteStorage customBlockPaletteStorage;
|
public PaletteStorage customBlockPaletteStorage = new PaletteStorage(8, 2);
|
||||||
|
|
||||||
public IntSet blockEntities;
|
public IntSet blockEntities;
|
||||||
public Int2ObjectMap<Data> blocksData;
|
public Int2ObjectMap<Data> blocksData;
|
||||||
@ -189,6 +189,7 @@ public class ChunkDataPacket implements ServerPacket, CacheablePacket {
|
|||||||
// Data
|
// Data
|
||||||
this.paletteStorage = new PaletteStorage(8, 1);
|
this.paletteStorage = new PaletteStorage(8, 1);
|
||||||
int blockArrayLength = reader.readVarInt();
|
int blockArrayLength = reader.readVarInt();
|
||||||
|
if (maskCount > 0) {
|
||||||
final long mask = masks[0]; // TODO support for variable size
|
final long mask = masks[0]; // TODO support for variable size
|
||||||
for (int section = 0; section < CHUNK_SECTION_COUNT; section++) {
|
for (int section = 0; section < CHUNK_SECTION_COUNT; section++) {
|
||||||
boolean hasSection = (mask & 1 << section) != 0;
|
boolean hasSection = (mask & 1 << section) != 0;
|
||||||
@ -219,6 +220,7 @@ public class ChunkDataPacket implements ServerPacket, CacheablePacket {
|
|||||||
data[i] = reader.readLong();
|
data[i] = reader.readLong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Block entities
|
// Block entities
|
||||||
int blockEntityCount = reader.readVarInt();
|
int blockEntityCount = reader.readVarInt();
|
||||||
|
Loading…
Reference in New Issue
Block a user