From ff584304ec44a1ee6f50fc8dc4f36ce305defee6 Mon Sep 17 00:00:00 2001 From: Juan Patricio Date: Mon, 8 Jan 2024 11:39:44 -0300 Subject: [PATCH] Ensure essential Crucible classes are loaded ahead of time, avoid some issues with our tweakers tweaking ourselves --- .../github/crucible/bootstrap/CrucibleServerMainHook.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/github/crucible/bootstrap/CrucibleServerMainHook.java b/src/main/java/io/github/crucible/bootstrap/CrucibleServerMainHook.java index 6441fdec..78782f23 100644 --- a/src/main/java/io/github/crucible/bootstrap/CrucibleServerMainHook.java +++ b/src/main/java/io/github/crucible/bootstrap/CrucibleServerMainHook.java @@ -106,6 +106,13 @@ public static void restoreStreams() { // Too lazy for a coremod public static void coremodHandleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker) { + try { + // Ensure some essential classes are loaded before we register the tweaker + Class.forName("io.github.crucible.CrucibleConfigs", true, classLoader); + Class.forName("io.github.crucible.CrucibleModContainer", true, classLoader); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } Lwjgl3ifyGlue.doCoremodWork(classLoader); classLoader.addClassLoaderExclusion("io.github.crucible.bootstrap."); }