Resolve custom world generation crashes linked to the minecraft:lake feature with the help of the WorldGenFeatureFix mod (MC-273228 and MC-272370).
Overview of the Mod
The WorldGenFeatureFix mod addresses a significant issue that arises when a custom world generation datapack utilizes the minecraft:lake or minecraft:snow_and_freeze features, leading to crashes within the chunk generator. For further information, refer to issue reports MC-273228 and MC-272370. This mod, influenced by a project on GitHub, implements mixins to restore the intended functionality.
Technical Insights
With the release of version 1.21, the chunk generation process received significant optimizations. Unfortunately, this optimization inadvertently disrupted the freeze detection mechanism associated with the lake feature, as it began attempting to access chunks that were unavailable. This issue is not present in the standard version of Minecraft, as Mojang has limited the lake feature’s application primarily to lava lakes. However, it remains problematic for custom world generation scenarios. The WorldGenFeatureFix mod remedies this by applying mixins that revert to utilizing getUncachedNoiseChunk, restoring proper functionality to the lake feature.
Important Considerations
It’s worth noting that the pull request referenced indicates that the LakeFeature is now deprecated, with vanilla Minecraft shifting away from employing it outside of lava lakes. This mod includes a safeguard that removes errors related to unsafe chunks to prevent the execution of poor code, such as that present within the no-longer-used LakeFeature for generating water lakes. Although this adjustment might seem like a fix, it is not a definitive solution and could allow other more critical issues to go unnoticed. Proceed with caution when using this mod.