mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Make the ByteBuf in ChunkDataTranslator allocate a more decent size
This commit is contained in:
parent
99a7f9a012
commit
3b55826d70
1 changed files with 5 additions and 1 deletions
|
@ -81,7 +81,11 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
|
||||||
ChunkSection section = sections[i];
|
ChunkSection section = sections[i];
|
||||||
size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize();
|
size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize();
|
||||||
}
|
}
|
||||||
size += 256; // Biomes pre-1.18
|
if (NEW_BIOME_WRITE) {
|
||||||
|
size += session.getBlockMappings().getEmptyChunkSection().estimateNetworkSize() * 32;
|
||||||
|
} else {
|
||||||
|
size += 256; // Biomes pre-1.18
|
||||||
|
}
|
||||||
size += 1; // Border blocks
|
size += 1; // Border blocks
|
||||||
size += 1; // Extra data length (always 0)
|
size += 1; // Extra data length (always 0)
|
||||||
size += chunkData.getBlockEntities().length * 64; // Conservative estimate of 64 bytes per tile entity
|
size += chunkData.getBlockEntities().length * 64; // Conservative estimate of 64 bytes per tile entity
|
||||||
|
|
Loading…
Reference in a new issue