Slight launchwrapper formatting
ci/woodpecker/push/docs Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/docs Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2022-11-04 17:09:07 +01:00
parent e81c5765df
commit 8eee28f353
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 3 additions and 2 deletions

View File

@ -22,10 +22,10 @@ public class Main {
}
}
Class<?> mainClass = Class.forName(args[0]);
String[] newArgs = new String[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, args.length - 1);
Method mainMethod = mainClass.getMethod("main", String[].class);
Method mainMethod = Class.forName(args[0]).getMethod("main", String[].class);
MethodHandles.Lookup lookup = MethodHandles.lookup();
@SuppressWarnings("ConfusingArgumentToVarargsMethod") Runnable main = (Runnable) LambdaMetafactory.metafactory(
lookup,
@ -35,6 +35,7 @@ public class Main {
MethodHandles.lookup().unreflect(mainMethod),
MethodType.methodType(Void.TYPE)
).getTarget().invokeExact(newArgs);
Thread th = new Thread(main);
th.setName("Minecraft");
th.start();