Skip to content
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

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

Closed
TelepathicGrunt opened this issue Nov 19, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@TelepathicGrunt
Copy link

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: YUNG-GANG/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 Motschen added the bug Something isn't working label Nov 19, 2020
@Motschen Motschen pinned this issue Nov 19, 2020
@Motschen
Copy link
Member

Motschen commented Nov 19, 2020

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
Copy link
Member

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

@Motschen
Copy link
Member

Motschen commented Nov 19, 2020

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.

@Motschen Motschen unpinned this issue Nov 19, 2020
@TelepathicGrunt
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants