Fix cave biomes leaking into non-overworld dimensions' biome sources - #260
Open
UwUOcha wants to merge 1 commit into
Open
Fix cave biomes leaking into non-overworld dimensions' biome sources#260UwUOcha wants to merge 1 commit into
UwUOcha wants to merge 1 commit into
Conversation
MultiNoiseBiomeSourceMixin#possibleBiomes added the cave biomes to every MultiNoiseBiomeSource regardless of dimension. Mods that merge the vanilla nether biome source into their own picker (e.g. BetterNether/WorldWeaver, whose MergeableBiomeSource force-tags every merged biome as #minecraft:is_nether) then actually generate nomansland:caves and nomansland:cave_depths as full nether biomes, dragging overworld structures (mineshafts, trial chambers, #c:is_cave structure sets) into the nether. Gate the injection on the biome source belonging to an overworld dimension, using the same dimension type Biolith itself tracks per biome source. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix cave biomes leaking into non-overworld dimensions' biome sources
The bug
MultiNoiseBiomeSourceMixin#possibleBiomesunconditionally addsnomansland:cavesandnomansland:cave_depthsto the possible-biome set of everyMultiNoiseBiomeSource, regardless of which dimension the source belongs to — including the vanilla nether source inside theminecraft:the_netherlevel stem and modded dimensions likedeeperdarker:otherside.In a vanilla nether this is invisible (the biomes are never actually picked), but it breaks badly together with BetterNether / WorldWeaver (wover): wover replaces the nether biome source with its own
WoverNetherBiomeSourceand merges the biomes of the source it replaces. ItsMergeableBiomeSourcelogic force-adds every merged biome that isn't already in#minecraft:is_netherinto that tag and into its nether biome picker. As a result the two overworld cave biomes actually generate in the nether as full-fledged nether biomes.Since those biomes are in
#minecraft:has_structure/mineshaft,#minecraft:has_structure/trial_chambers,#minecraft:has_structure/ruined_portal_standardand#c:is_cave, this drags mineshafts, trial chambers, ruined portals and any third-party structure sets targeting cave/underground tags into the nether. It also feeds overworld mob-spawn lists into nether chunk generation, which for some players escalates into worldgen-thread stalls/freezes (observed with Alex's Caves'NaturalSpawnerchunk-generation spawning, e.g. striders with jockeys mounting during worldgen).Log evidence from a pack with BetterNether (wover's world-dimensions report at world load), before the fix:
The same two biomes also leak into
deeperdarker:otherside:This cannot be worked around by users: the mixin has no config gate, so disabling the cave biomes in the config does not stop the leak.
The fix
Gate the injection on the biome source actually belonging to an overworld dimension, using the dimension type Biolith already tracks per biome source (
InterfaceBiomeSource#biolith$getDimensionType) — the same check Biolith itself uses when deciding which placement's entries to inject. The cave biomes are only ever placed in the overworld (DimensionBiomePlacementMixinguards onOverworldBiomePlacement), so reporting them as possible biomes of other dimensions' sources is never correct.Testing
Tested on 1.21.1 / NeoForge with a ~230-mod pack including BetterNether 21.0.20, Deeper and Darker, TerraBlender and Biolith 3.0.12. After the fix:
biomes = 27, namespaces = betternether(22), minecraft(5); theMerged 2 biomesline is gone.deeperdarker:othersideis clean:namespaces = deeperdarker(4).namespaces = minecraft(53), spawn(10), nomansland(22), yungscavebiomes(2)— same as before the fix, cave biomes still generate and decorate normally.🤖 Generated with Claude Code