From a93f3119f620cba35b22b394c8121286c39485d8 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 23 Jul 2021 21:42:08 -0400 Subject: [PATCH] Map bamboo jungle [hills] to their Bedrock ID --- .../java/org/geysermc/connector/utils/BiomeUtils.java | 10 ++++++---- .../java/org/geysermc/connector/utils/ChunkUtils.java | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/utils/BiomeUtils.java b/connector/src/main/java/org/geysermc/connector/utils/BiomeUtils.java index db9edacb4..da557ea57 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/BiomeUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/BiomeUtils.java @@ -71,12 +71,14 @@ public class BiomeUtils { private static int biomeID(int[] biomeData, int x, int y, int z) { int biomeId = biomeData[((y >> 2) & 63) << 4 | ((z >> 2) & 3) << 2 | ((x >> 2) & 3)]; - if (biomeId == 0) { - biomeId = 42; // Ocean - } else if (biomeId >= 40 && biomeId <= 43) { // Java has multiple End dimensions that Bedrock doesn't recognize + if (biomeId >= 40 && biomeId <= 43) { // Java has multiple End dimensions that Bedrock doesn't recognize biomeId = 9; - } else if (biomeId >= 170) { // Nether biomes. Dunno why it's like this :microjang: + } else if (biomeId >= 170 && biomeId <= 173) { // 1.16 nether biomes. Dunno why it's like this :microjang: biomeId += 8; + } else if (biomeId == 168) { // Bamboo jungle + biomeId = 48; + } else if (biomeId == 169) { // Bamboo jungle hills + biomeId = 49; } return biomeId; } diff --git a/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java b/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java index 4708ed2d2..528fdbdf6 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java @@ -107,6 +107,8 @@ public class ChunkUtils { byteBuf.writeBytes(EMPTY_BIOME_DATA); } + byteBuf.writeByte(0); // Border + EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()]; byteBuf.readBytes(EMPTY_CHUNK_DATA); } finally {