1.19.2 Silent Gear Flax Overwriting `Random Bonemeal Flowers` mod effect.
P3rf3ctXZer0 opened this issue ยท 8 comments
Versions
- Silent Gear: silent-gear-1.19.2-3.0.4
- Silent Lib: silent-lib-1.19.2-7.0.3
- Forge: 43.1.24
- Modpack: N/A
Expected Behavior
Using Bonemeal on the ground should spawn all kinds of flowers flora.
Actual Behavior
It is only spawning grass and flax.
Links/Images
Steps to Reproduce the Problem
- Setup mods.
- Load mods.
- Use bonemeal on ground.
Confirmed to happen in a development environment. How strange. I'll start investigating the cause.
Does anyone have any clues for this issue? I tried to debug it a while back and came up empty. I couldn't locate the code that determines what plants grow when bonemealing grass.
Let me ask devs who mess with world gen i bet @Adubbz might know then another skilled dev with plants is @MatrexsVigil on more comes to mind @ShetiPhian pretty much beyond these 3 not sure who else has plant mod experience. Matrexsvigil has been afk and also does not have any 1.19.2 experience but they I believe had something similar happen back in 1.12.2 days Dear tagged devs please consider lending us your wisdom.
I did some digging and made some progress figuring out what's going on.
The short of it is you added flax and fluffy plants as individual worldgen features.
However, vanilla has a single feature for all flowers in a given biome.
During worldgen, the entire list is used, as demonstrated by flowers all still working.
However, bone meal queries the biome for the list of flower features, then picks only the first one.
That ends up your wild flax feature. In fact, there are three when I run in a debugger. Your flax plant, followed by your fluffy plant, followed by a single feature with all the biome flowers in it.
From GrassBlock:performBoneMeal(ServerLevel, RandomSource, BlockPos, BlockState)
:
holder = ((RandomPatchConfiguration)list.get(0).config()).feature();
Well now I know my flowers are no longer placed via bonemeal.
Looking all the way back to 1.14, list.get(0) is used so it hasn't worked since 1.12
For comparison I looked into how Botania does it.
Botania adds the feature using a standard forge registry pattern on net.minecraft.core.Registry.FEATURE_REGISTRY
:
https://github.com/VazkiiMods/Botania/blob/1.19.x/Forge/src/main/java/vazkii/botania/forge/ForgeCommonInitializer.java#L203
https://github.com/VazkiiMods/Botania/blob/1.19.x/Xplat/src/main/java/vazkii/botania/common/world/BotaniaFeatures.java#L26
https://github.com/VazkiiMods/Botania/blob/1.19.x/Xplat/src/main/java/vazkii/botania/common/world/MysticalFlowerFeature.java
By contrast, you're adding it directly to the biomes:
https://github.com/SilentChaos512/Silent-Gear/blob/1.18.x/src/main/java/net/silentchaos512/gear/world/ModWorldFeatures.java#L197
Botania's approach will avoid the mystical flowers ever showing up at all for bone meal, which is fine for them.
My gut check says to find a way to add the flax/fluffy to the flower feature itself. No idea how to go about that with a registry pattern setup though.
Thank you all for any info you have honestly as I appreciate the shared collective. Minecraft changes too much too often and small functions slip through the cracks. I am obviously not the dev but I know regardless at this point any info is valid.