Currently, the Vanilla AdvancementManager constructor unconditionally causes all advancements to be reloaded from disk. Since WorldServer#init() creates a new AdvancementManager, every world load causes a full reload of all advancements from disk.
The only possible way for this reload to do anything would be if either the minecraft jar or a mod jar was modified at runtime, since recipe JSON files are loaded from within jars. Assuming that Forge doesn't want to support such a bizarre use case, we could cut down on both world loading time and log spam (in the case of missing advancement recipes) by performing advancement loading exactly once.
Note that runtime jar modification isn't even possible on Windows, since a file cann't be modified while it's being held open by a program (e.g. Java). Any mod that tried to change its own jar file at runtime would only work on Linux and (possibly) OS X.
If there's interest in this idea, I can make a PR implementing it.
how would we do this, by passing in the existing AdvancementManager of the overworld, or?
We could just add a static boolean to AdvancementManager, and check it in reload. If we want to retain compatibility with mods that create their own (unlreated) AdvancementManager instance, we could add a new constructor to AdvancementManager, which performs a check before calling reload
and how do you load advancements or recipes from datapacks ?
and worlds that disable vanilla datapacks ?
@Tralomine: I was only considering this for 1.12 - I haven't look at how things work in 1.13.
Even in 1.12, custom advancements in the world folder are a thing. How would you be proposing to deal with them, given they effectively override builtin advancements?
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!
This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.
Most helpful comment
Even in 1.12, custom advancements in the world folder are a thing. How would you be proposing to deal with them, given they effectively override builtin advancements?