Map bamboo jungle [hills] to their Bedrock ID

This commit is contained in:
Camotoy 2021-07-23 21:42:08 -04:00
parent da66a01a9a
commit a93f3119f6
No known key found for this signature in database
GPG Key ID: 7EEFB66FE798081F
2 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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 {