mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Handle the server sending invalid biome IDs in chunks
Should hopefully address #2400 - the Java client handles invalid biome IDs and simply complains in its logs.
This commit is contained in:
parent
a197f60446
commit
3d50155ee3
1 changed files with 8 additions and 5 deletions
|
@ -92,9 +92,12 @@ public class BiomeTranslator {
|
|||
bedrockId = Registries.BIOME_IDENTIFIERS.get().getInt(replacementBiome);
|
||||
}
|
||||
|
||||
if (javaId != bedrockId) {
|
||||
// When we see the Java ID, we should instead apply the Bedrock ID
|
||||
biomeTranslations.put(javaId, bedrockId);
|
||||
|
||||
if (javaId == 0) {
|
||||
// Matches Java behavior when it sees an invalid biome - it just replaces it with ID 0
|
||||
biomeTranslations.defaultReturnValue(bedrockId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -132,8 +135,8 @@ public class BiomeTranslator {
|
|||
int x = i & 3;
|
||||
int y = (i >> 4) & 3;
|
||||
int z = (i >> 2) & 3;
|
||||
// Get the Bedrock biome ID override, or this ID if it's the same
|
||||
int biomeId = biomeTranslations.getOrDefault(javaId, javaId);
|
||||
// Get the Bedrock biome ID override
|
||||
int biomeId = biomeTranslations.get(javaId);
|
||||
int idx = storage.idFor(biomeId);
|
||||
// Convert biome coordinates into block coordinates
|
||||
// Bedrock expects a full 4096 blocks
|
||||
|
|
Loading…
Reference in a new issue