[Bug]: Ecologics generates Azalea trees in every biome (+ bonus 2nd bug in all placed features).
Vaelzan opened this issue ยท 3 comments
Mod Version
1.5.3
Mod Loader
Forge
Mod Loader Version
40.0.40
What happened?
When Ecologics replaces vanilla rooted Azalea, it doesn't limit the addition of the feature to just the lush caves biome (which is the only biome in Vanilla Minecraft that naturally has the feature), and instead adds it to all biomes:
- it lacks the biome check that your other placed features have.It would be a fairly easy fix to move the entire if block (of what is currently line 71-74) to inside the lush caves block just above:
I believe there is also a separate bug in the same file - by using Holder.direct
you're copying the contents of your configured features into the placed feature instead of making a reference to it. You can see the result more clearly if you run the /worldGenExport
command while you have Oh The Biomes You Go Installed (I found that the easiest way to export worldgen as json) and take a look at the exported placed feature JSON files for Ecologics - unlike other mods, you're skipping the configured feature by including it in the placed feature instead of a reference to it. You could call the register method in net.minecraft.data.worldgen.placement.PlacementUtils instead and store the result as Holder instead of PlacedFeature (see example from another mod: https://github.com/stal111/Forbidden-Arcanus/blob/1.18/src/main/java/com/stal111/forbidden_arcanus/data/worldgen/placement/ModOrePlacements.java).
latest.log
N/A - I'm looking at the source code.
More info for the second of the two bugs, so you don't need to go run the command I mentioned yourself:
Example of how your placed feature JSON ends up: https://pastebin.com/aAXZHLk0
Same thing in vanilla Minecraft: https://github.com/misode/vanilla-worldgen/blob/master/worldgen/placed_feature/rooted_azalea_tree.json
A JSON export of your placement should ideally end up pretty much identical to the one in vanilla, but with "feature": "ecologics:rooted_azalea_tree",
in the top line. The other features are all impacted too, I just used the azalea as an example since it was easy to refer to the vanilla version. I haven't verified that it's the use of Holder.direct, but glancing at the code makes that seem like the likely culprit (vanilla uses Holder.hackyErase in the register method inside PlacementUtils instead, despite the scary looking name).
Edit: This is happening in the configured features too, here:
- it's copying the azalea_tree configured feature into the rooted_azalea_tree configured feature, instead of a reference to it.