From ec3451041705851ee5b852adbde07caab4b9fcd7 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Thu, 25 Nov 2021 11:59:25 -0500 Subject: [PATCH] Don't tie biome translation to Bedrock chunk section size This allows biomes to be translated even if the block count is empty. Fixes some biome glitching. --- .../java/level/JavaLevelChunkWithLightTranslator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java index 127cae9ab..96dcfed2c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java @@ -315,7 +315,7 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator> 4; - for (int i = 0; i < sectionCount; i++) { + for (int i = 0; i < chunkSize; i++) { int biomeYOffset = dimensionOffset + i; if (biomeYOffset < yOffset) { // Ignore this biome section since it goes above or below the height of the Java world @@ -328,14 +328,14 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator= Bedrock_v475.V475_CODEC.getProtocolVersion()) { - int remainingEmptyBiomes = 25 - sectionCount; + int remainingEmptyBiomes = 25 - chunkSize; for (int i = 0; i < remainingEmptyBiomes; i++) { // A header that says to carry on the biome data from the previous chunk // This notably fixes biomes in the End byteBuf.writeByte((127 << 1) | 1); } } else { - int remainingEmptyBiomes = 32 - sectionCount; + int remainingEmptyBiomes = 32 - chunkSize; for (int i = 0; i < remainingEmptyBiomes; i++) { byteBuf.writeBytes(ChunkUtils.EMPTY_BIOME_DATA); }