mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Forge 1.17+ exit crash
This commit is contained in:
parent
2709cbe95f
commit
dc27fc04aa
1 changed files with 11 additions and 11 deletions
|
@ -349,19 +349,19 @@ private static void launch(ClientProfile profile, ClientLauncherProcess.ClientPa
|
|||
}
|
||||
FMLPatcher.apply();
|
||||
LauncherEngine.modulesManager.invokeEvent(new ClientProcessPreInvokeMainClassEvent(params, profile, args));
|
||||
{
|
||||
List<String> compatClasses = profile.getCompatClasses();
|
||||
for (String e : compatClasses) {
|
||||
Class<?> clazz = classLoader.loadClass(e);
|
||||
MethodHandle runMethod = MethodHandles.publicLookup().findStatic(clazz, "run", MethodType.methodType(void.class));
|
||||
runMethod.invoke();
|
||||
}
|
||||
}
|
||||
MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)).asFixedArity();
|
||||
Launcher.LAUNCHED.set(true);
|
||||
JVMHelper.fullGC();
|
||||
// Invoke main method
|
||||
try {
|
||||
{
|
||||
List<String> compatClasses = profile.getCompatClasses();
|
||||
for (String e : compatClasses) {
|
||||
Class<?> clazz = classLoader.loadClass(e);
|
||||
MethodHandle runMethod = MethodHandles.publicLookup().findStatic(clazz, "run", MethodType.methodType(void.class));
|
||||
runMethod.invoke();
|
||||
}
|
||||
}
|
||||
MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)).asFixedArity();
|
||||
Launcher.LAUNCHED.set(true);
|
||||
JVMHelper.fullGC();
|
||||
mainMethod.invokeWithArguments((Object) args.toArray(new String[0]));
|
||||
LogHelper.debug("Main exit successful");
|
||||
} catch (Throwable e) {
|
||||
|
|
Loading…
Reference in a new issue