3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Use normal biome data for non-extended world height

Dieser Commit ist enthalten in:
Camotoy 2021-07-14 21:59:10 -04:00
Ursprung d19ff657de
Commit e5cb122db3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -85,27 +85,32 @@ public class ChunkUtils {
public static final byte[] EMPTY_BIOME_DATA;
static {
ByteBuf byteBuf = Unpooled.buffer();
try {
BlockStorage blockStorage = new BlockStorage(0);
blockStorage.writeToNetwork(byteBuf);
if (GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) {
ByteBuf byteBuf = Unpooled.buffer();
try {
BlockStorage blockStorage = new BlockStorage(0);
blockStorage.writeToNetwork(byteBuf);
EMPTY_BIOME_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_BIOME_DATA);
} finally {
byteBuf.release();
}
byteBuf = Unpooled.buffer();
try {
for (int i = 0; i < 32; i++) {
byteBuf.writeBytes(EMPTY_BIOME_DATA);
EMPTY_BIOME_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_BIOME_DATA);
} finally {
byteBuf.release();
}
EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_CHUNK_DATA);
} finally {
byteBuf.release();
byteBuf = Unpooled.buffer();
try {
for (int i = 0; i < 32; i++) {
byteBuf.writeBytes(EMPTY_BIOME_DATA);
}
EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_CHUNK_DATA);
} finally {
byteBuf.release();
}
} else {
EMPTY_BIOME_DATA = null; // Unused
EMPTY_CHUNK_DATA = new byte[257]; // 256 bytes for biomes, one for borders
}
}