[Test Minecraft on other thread] Compile fix

This commit is contained in:
Duy Tran Khanh committed 2021-01-01 14:04:49 +07:00
1 parent 056ab4e7a8
commit f3a2dad6dc
1 file changed
+5 -2
@@ -83,14 +83,17 @@ public final class Tools
}
}
// new Thread(() -> {
new Thread(() -> { try {
URLClassLoader loader = new URLClassLoader(urlList.toArray(new URL[0]), Tools.class.getClassLoader());
Class<?> clazz = loader.loadClass(versionInfo.mainClass);
Method method = clazz.getMethod("main", String[].class);
method.invoke(null, new Object[]{Arrays.asList(launchArgs)});
// }).start();
} catch (Throwable th) {
throw new RuntimeException(th);
}
}).start();
// JREUtils.launchJavaVM(javaArgList);
}