When a datapack with custom biomes is loaded, the biomes it defines are assigned IDs according to their lexicographic order. When a new biome is added to an existing world but its name gets sorted anywhere else than at the end, it causes the biomes that follow it to shift. Chunks only store the resulting IDs in their biome maps and not the names, so they become corrupted, showing the biome that precedes the correct one.
This can be quite easily fixed if chunks stored not only the biome IDs, but also a mapping that allowed retrieving the actual name, kinda like the block palette already works for a chunk section. Since there is usually only one biome per chunk, it's just a matter of storing one additional pair in the chunk data. This would also make it possible to define more than 256 biomes for a world.
Linked issues
is duplicated by 2
Attachments
Comments 11
I've added two versions of a datapack which can be used for testing purposes. Install v3.0.3 first, load some chunks in the Nether, and then delete it and install v3.1.
Requesting the title to be changed to be a bit more accurate:
1. only custom biome IDs get shifted
2. vanilla adding biomes also shifts them
3. mention the core issue
Suggested title: Addition of new biomes shifts IDs of custom biomes from data packs due to missing ID mapping
Seems fixed in the newest snapshot with the chunk format changes:
Chunk’s Level.Biomes are now paletted and live in a similar container structure in Level.Sections[].biomes
Uhm, this was supposed to be created for Minecraft: Java Edition. Can it be moved?