Fabric API

Fabric API

108M Downloads

[Bug] Fabric MC Will not discard structures from deleted mods

itsdinkd opened this issue ยท 6 comments

commented

As title states, 1.17.1 is not discarding structures after the mod is deleted.

i've been getting spammed this every day, for the last 5 days. while 10 players play, every day. Repeats the chunk coords, over and over, and sometimes it will be a different one, but it repeats that one over and over. i've seen the same chunk coord now for 5 days. I have hundreds of thousands of lines I can provide of the same message on the same 5 different chunks coords.

Tried deleting data from fabricDynamicRegistry.dat didn't help.

[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [180, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [180, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [181, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [181, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [183, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [182, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [183, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [182, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [184, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [184, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [185, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [185, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [186, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [186, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [187, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [187, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [188, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [188, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:well' in chunk [189, 110], discarding
[WARN] (class_2852) Found reference to unknown structure 'the_aether:skyroot_tower' in chunk [189, 110], discarding``` 
commented

This isn't a fabric issue. The class_2852 is vanilla code (the ChunkSerializer).

Your chunk data holds references to structures that no longer exist because you deleted the mod.
Minecraft will spam that message every time it loads the chunk(s).

The references are maintained by minecraft because it wants to know which chunks are associated with which structure.
e.g. where wither skeletons should spawn for a nether fortress or what is the extent of a village

Minecraft doesn't have any logic to remove these references if you remove the structure definition.
It just logs that message when it encounters the problem.

The simplest way to fix this is probably to add a custom log4j configuration that changes to the log level to ERROR (either for all of minecraft or just the class_2852). This would mean WARNs are no longer sent to the log.
https://logging.apache.org/log4j/2.x/manual/configuration.html
You can find the default logging configuration in the root of the minecraft jar

Another way would be to use an nbt editor to modify the chunk data to remove the now invalid references from the chunk(s)

Finally, you could ask Mojang to fix the problem, or you could write your own mod to fix it for them. :-)

commented

Another way to "fix" to the problem would be to get a mod that lets you set the "broken" chunks to always loaded.
Then you would only get the WARNings when it first loads the world.
Since they will remain loaded you won't be spammed with the message when they are unloaded/reloaded

This obviously won't be a solution if there are lots of broken chunks.

commented

There is this (more of a utility than a mod):
https://github.com/Nyveon/MCStructureCleaner
I can't vouch for it - I have never used it.

It references a Mojang bug report which sounds similar to your problem:
https://bugs.mojang.com/browse/MC-194811

Like it says on the readme, backup your world before running the python script.

commented

You know a mod that does that @warjort?

commented

Yeah I saw that one as well, seems very risky. I ended up creating a new world, but I feel bad for all the server owners who downloaded my modpacks latest update =/

commented

What was actually the previous behaviour when an unknown structure appeared?