use of io.discloader.discloader.common.event.DLPreInitEvent in project DiscLoader by R3alCl0ud.
the class ModRegistry method loadMod.
public static void loadMod(String modid) {
ModContainer mod = preInitMods.get(modid);
ProgressLogger.progress(1, 3, "Checking if another mod is currently active");
logger.info("Checking if another mod is currently active");
if (activeMod != null) {
loadMod.put(mod.modInfo.modid(), activeMod.modInfo.modid());
}
ProgressLogger.progress(2, 3, "Setting active mod");
logger.info("Setting active mod");
activeMod = mod;
ProgressLogger.progress(3, 3, "Executing PreInit handler in: " + mod.modInfo.modid());
logger.info("Executing PreInit handler in: " + mod.modInfo.modid());
mods.put(mod.modInfo.modid(), mod);
DLPreInitEvent event = new DLPreInitEvent(loader);
mod.emit("preInit", event);
if (loadMod.containsKey(mod.modInfo.modid())) {
activeMod = preInitMods.get(loadMod.get(mod.modInfo.modid()));
} else {
activeMod = null;
}
mod.loaded = true;
}
Aggregations