mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-23 23:38:41 +01:00
Better estimate for new biome data size
This commit is contained in:
parent
3b55826d70
commit
db1563aa79
2 changed files with 3 additions and 2 deletions
|
@ -82,7 +82,7 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
|
|||
size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize();
|
||||
}
|
||||
if (NEW_BIOME_WRITE) {
|
||||
size += session.getBlockMappings().getEmptyChunkSection().estimateNetworkSize() * 32;
|
||||
size += ChunkUtils.EMPTY_CHUNK_DATA.length; // Consists only of biome data
|
||||
} else {
|
||||
size += 256; // Biomes pre-1.18
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ChunkUtils {
|
|||
private static final int MAXIMUM_ACCEPTED_HEIGHT = 256;
|
||||
private static final int MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? 384 : MAXIMUM_ACCEPTED_HEIGHT;
|
||||
|
||||
private static final byte[] EMPTY_CHUNK_DATA;
|
||||
public static final byte[] EMPTY_CHUNK_DATA;
|
||||
public static final byte[] EMPTY_BIOME_DATA;
|
||||
|
||||
static {
|
||||
|
@ -105,6 +105,7 @@ public class ChunkUtils {
|
|||
|
||||
EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()];
|
||||
byteBuf.readBytes(EMPTY_CHUNK_DATA);
|
||||
System.out.println(EMPTY_CHUNK_DATA.length);
|
||||
} finally {
|
||||
byteBuf.release();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue