Fabric API

Fabric API

106M Downloads

Modded biomes do not persist after 1.18 world upgrade

Prospector opened this issue · 2 comments

commented

The datafixer ChunkHeightAndBiomeFix appears to overwrite all modded biomes to minecraft:plains because they are not in the hardcoded RAW_BIOME_IDS map.

Solving this problem seems difficult because the datafixer, to my knowledge, does not have any context beyond a Chunk's save data. Since fabric's dynamic registry data is per-world, I'm not sure if that can be taken into account in this datafixer. Any ideas how we could go about fixing this?

I know 1.18 has been out for a while, but I still think this is very much still a bug worth fixing.

commented

After capturing the biome registry for biome modification we can reconstruct the map, somehow?

commented

I have a working proof of concept.

image

This was achieved by saving the active registry map to a static variable when it is read in MixinLevelStorageSession, which is then accessed in a new mixin to ChunkHeightAndBiomeFix by redirecting the getOrDefault call to check Fabric's map instead of the hardcoded vanilla one.

I don't have time to see this through to a PR, but I can confirm this method works, even when using the "Optimize World" button. It of course, will require more testing to see what, if anything, breaks this.