fix: load mods later

This commit is contained in:
əlemi 2023-03-08 01:29:59 +01:00
parent 589ccc715f
commit e42f5245db
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -21,7 +21,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig.Type; import net.minecraftforge.fml.config.ModConfig.Type;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -43,7 +43,7 @@ public class Boscovicino implements ICommons {
public static Friends friends() { return Boscovicino.friends; } public static Friends friends() { return Boscovicino.friends; }
public Boscovicino() { public Boscovicino() {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onSetupComplete);
ForgeConfigSpec.Builder cfg = new ForgeConfigSpec.Builder(); ForgeConfigSpec.Builder cfg = new ForgeConfigSpec.Builder();
CommandDispatcher<CommandSource> dp = this.dispatcher; CommandDispatcher<CommandSource> dp = this.dispatcher;
@ -73,7 +73,7 @@ public class Boscovicino implements ICommons {
} }
} }
private void clientSetup(final FMLClientSetupEvent event) { private void onSetupComplete(final FMLLoadCompleteEvent event) {
LOGGER.info("Initializing modules"); LOGGER.info("Initializing modules");
for (IModule m : modManager.mods) { for (IModule m : modManager.mods) {