3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Better estimate for new biome data size

Dieser Commit ist enthalten in:
Camotoy 2021-07-15 20:51:13 -04:00
Ursprung 3b55826d70
Commit db1563aa79
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -82,7 +82,7 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize(); size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize();
} }
if (NEW_BIOME_WRITE) { if (NEW_BIOME_WRITE) {
size += session.getBlockMappings().getEmptyChunkSection().estimateNetworkSize() * 32; size += ChunkUtils.EMPTY_CHUNK_DATA.length; // Consists only of biome data
} else { } else {
size += 256; // Biomes pre-1.18 size += 256; // Biomes pre-1.18
} }

Datei anzeigen

@ -81,7 +81,7 @@ public class ChunkUtils {
private static final int MAXIMUM_ACCEPTED_HEIGHT = 256; 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 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; public static final byte[] EMPTY_BIOME_DATA;
static { static {
@ -105,6 +105,7 @@ public class ChunkUtils {
EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()]; EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_CHUNK_DATA); byteBuf.readBytes(EMPTY_CHUNK_DATA);
System.out.println(EMPTY_CHUNK_DATA.length);
} finally { } finally {
byteBuf.release(); byteBuf.release();
} }