mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fix errors in preInit being lost when followed by a crash in fireRegistryEvents or objectHolder
This commit is contained in:
1 parent
ca7a5eadc0
commit
603903db50
3 files changed
+21
-2
No files matched your search
@@ -174,11 +174,18 @@ public class LoadController
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated // TODO remove in 1.13
|
||||
public void checkErrorsAfterAvailable()
|
||||
{
|
||||
checkErrors();
|
||||
}
|
||||
|
||||
public void checkErrors()
|
||||
{
|
||||
if (errors.size() > 0)
|
||||
{
|
||||
FMLLog.log.fatal("Fatal errors were detected during {}. Loading cannot continue", LoaderState.AVAILABLE);
|
||||
FMLLog.log.fatal("Fatal errors were detected during {}. Loading cannot continue.", state);
|
||||
state = state.transition(true);
|
||||
throw throwStoredErrors();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,6 +600,7 @@ public class Loader
|
||||
ItemStackHolderInjector.INSTANCE.findHolders(discoverer.getASMTable());
|
||||
CapabilityManager.INSTANCE.injectCapabilities(discoverer.getASMTable());
|
||||
modController.distributeStateMessage(LoaderState.PREINITIALIZATION, discoverer.getASMTable(), canonicalConfigDir);
|
||||
modController.checkErrors();
|
||||
GameData.fireRegistryEvents(rl -> !rl.equals(GameData.RECIPES));
|
||||
FMLCommonHandler.instance().fireSidedRegistryEvents();
|
||||
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
|
||||
@@ -725,7 +726,7 @@ public class Loader
|
||||
progressBar.step("Finishing up");
|
||||
modController.transition(LoaderState.AVAILABLE, false);
|
||||
modController.distributeStateMessage(LoaderState.AVAILABLE);
|
||||
modController.checkErrorsAfterAvailable();
|
||||
modController.checkErrors();
|
||||
GameData.freezeData();
|
||||
FMLLog.log.info("Forge Mod Loader has successfully loaded {} mod{}", mods.size(), mods.size() == 1 ? "" : "s");
|
||||
progressBar.step("Completing Minecraft initialization");
|
||||
|
||||
Reference in new issue
Block a user