Closes #1084 (AfterDhInitEvent firing before DH config setup)
This commit is contained in:
@@ -77,13 +77,12 @@ public abstract class AbstractModInitializer
|
||||
|
||||
this.initializeModCompat();
|
||||
|
||||
LOGGER.info(ModInfo.READABLE_NAME + " client Initialized.");
|
||||
ApiEventInjector.INSTANCE.fireAllEvents(DhApiAfterDhInitEvent.class, null);
|
||||
|
||||
// Client uses config for auto-updater, so it's initialized here instead of post-init stage
|
||||
this.initConfig();
|
||||
logModIncompatibilityWarnings(); // needs to be called after config loading
|
||||
|
||||
LOGGER.info(ModInfo.READABLE_NAME + " client Initialized.");
|
||||
|
||||
this.subscribeClientStartedEvent(this::postInit);
|
||||
}
|
||||
|
||||
@@ -106,8 +105,7 @@ public abstract class AbstractModInitializer
|
||||
|
||||
this.initializeModCompat();
|
||||
|
||||
LOGGER.info(ModInfo.READABLE_NAME + " server Initialized.");
|
||||
ApiEventInjector.INSTANCE.fireAllEvents(DhApiAfterDhInitEvent.class, null);
|
||||
LOGGER.info(ModInfo.READABLE_NAME + " server Initialized, adding event subscribers...");
|
||||
|
||||
this.subscribeRegisterCommandsEvent(dispatcher -> { this.commandInitializer = new CommandInitializer(dispatcher); });
|
||||
|
||||
@@ -121,7 +119,7 @@ public abstract class AbstractModInitializer
|
||||
|
||||
this.checkForUpdates();
|
||||
|
||||
LOGGER.info("Dedicated server initialized at " + server.getServerDirectory());
|
||||
LOGGER.info(ModInfo.READABLE_NAME + " server Initialized at " + server.getServerDirectory());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -186,6 +184,9 @@ public abstract class AbstractModInitializer
|
||||
LOGGER.info("Post-Initializing Mod");
|
||||
this.runDelayedSetup();
|
||||
LOGGER.info("Mod Post-Initialized");
|
||||
|
||||
// should be fired after all delayed setup so singletons and config can be accessed
|
||||
ApiEventInjector.INSTANCE.fireAllEvents(DhApiAfterDhInitEvent.class, null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user