TeamMidnightDust / ThisRocks

Adds little rocks, sticks, pinecones and seashells to your minecraft world!
MIT License
4 stars 5 forks source link

This Rocks's ConfiguredFeatures are not registered and is killing Cinderscape's Ashy Shoals biome as a result #4

Closed TelepathicGrunt closed 3 years ago

TelepathicGrunt commented 3 years ago

Hello! I was helping someone out with their collection of mods and tried it with DebugWorldgenIssues mod. What it found was that This Rocks does not register their ConfiguredFeatures. This can be an issue for mod compatibility as under certain conditions, unregistered ConfiguredFeatures can basically prevent other mod's registered ConfiguredFeatures from spawning if in the same generation stage. And in fact, this seems to be the case as Minecraft logs out that Cinderscape's ash feature for their biome dies when this Rocks is on. [21:57:53] [main/ERROR]: Feature: Not a JSON object: "cinderscapes:ash_top_layer"

What this issue means is if mod A adds an unregistered CF to the ore generation stage and the biome's codec reaches it first, it will choke and basically nuke mob B's registered CFs afterwards. Here's another case where BetterCaves forgot to register their CF and caused several CFs from Oh The Biomes You'll Go to stop spawning in the world: yungnickyoung/YUNGs-Better-Caves#75

Here's a more detailed explanation of why this happens in the biome's codec: image

Specifically, when you call .configure on a Feature, you create a ConfiguredFeature. This is what should be registered to the WorldGenRegisties at mod init.

Anyway here's an example from my mod RepurposedStructures of me registering all my ConfiguredFeatures that you can check out. https://github.com/TelepathicGrunt/RepurposedStructures-Fabric/blob/c429a75c7d85670043e30752ee356988cd6af69a/src/main/java/com/telepathicgrunt/repurposedstructures/modinit/RSConfiguredFeatures.java#L197-L199

I hope this helps!

Picture of Cinderscape's Ashy Shoals with This Rocks on. image

Picture of same biome but with This Rocks off image

Motschen commented 3 years ago

Could you try if it also happens with This Rocks 1.1.0? I may have found the issue, it's just a little oversight in the last update, I forgot to initialize the NetherFeatures class before injecting the features into the biomes.

In RocksMain.java: new FeatureRegistry(); RockFeatures.init(); StickFeatures.init(); MiscFeatures.init(); FeatureInjector.init();

How it should be: new FeatureRegistry(); RockFeatures.init(); StickFeatures.init(); MiscFeatures.init(); NetherFeatures.init(); FeatureInjector.init();

Motschen commented 3 years ago

I think it's working now 2020-11-19_08 21 21

Motschen commented 3 years ago

Such a dumb mistake... I apologize for any problems caused by my stupidness, it was literally caused by this one damn line of code I forgot to add... Btw thanks for your VERY detailed report, it really helped me understand the cursedness that is minecraft configured feature deserialization. I'm gonna upload a fixed version in a few minutes.

TelepathicGrunt commented 3 years ago

Just tested latest release and yet, it's all working now! Thank you! And don't feel bad about forgetting to register the stuff as it seems to be a very common problem. At least we are trying to reach out to everyone and resolve this hard-to-diagnose issue!