-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fetching biomes during world generation #11086
Conversation
Currently running my server with this exact patch, works perfectly and server no longer crashes on LakeFeature. Would love to see this merged! |
LakeFeature is deprecated and vanilla has moved away from using it for anything except for lava lakes. |
This patch works, and stops my datapack heavy server (Terralith, Nullscape, etc...) from crashing. But, at the same time it makes new chunk generation performance x3-x4 worse! Why does it, and how can I make sure performance isn't so bad and it doesn't crash? |
Can confirm that this changed code is called very often during world gen and could therefore potentially have a negative performance impact, I will make just the two features which call getBiome() during worldgen (LakeFeature and SnowAndFreezeFeature) use the uncached biome instead of overriding getBiome() entirely on WorldGenRegion. |
@fucksophie I changed the patch to fix the lake feature in a different way which shouldn't slow down world generation. Test it out and lmk |
Hi @NewwindServer, can you please create a new issue with proper reproduction steps for 1.21? The issue you're linking that this PR fixes (#11084) was closed due to being incomplete and a deleted user. |
Fixes #11084
getBiome() on LevelReader calls getNoiseBiome(), which itself calls getChunk() in order to get the biome cached inside the chunk.
However, calling getChunk() on WorldGenRegion will cause a crash if the chunk isn't found: "Requested chunk unavailable during world generation"
This means that features which attempt to fetch biomes during generation (LakeFeature/SnowAndFreezeFeature)
can cause the server to crash.
This patch ensures that these features are fetching biomes in a way that doesn't call getChunk()