diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index 0075fce5..c9962e84 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -6,9 +6,9 @@ public final class Version implements Comparable { public static final int MAJOR = 5; public static final int MINOR = 3; - public static final int PATCH = 1; + public static final int PATCH = 2; public static final int BUILD = 1; - public static final Version.Type RELEASE = Type.STABLE; + public static final Version.Type RELEASE = Type.DEV; public final int major; public final int minor; public final int patch; diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java index 84d4288f..fa77103e 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -180,9 +180,9 @@ public void run(String... args) throws Throwable { break; } LogHelper.info("Start Minecraft Server"); - LogHelper.debug("Invoke main method %s with %s", config.mainclass, launch.getClass().getName()); + LogHelper.debug("Invoke main method %s with %s", classname, launch.getClass().getName()); try { - launch.run(config, real_args); + launch.run(classname, config, real_args); } catch (Throwable e) { LogHelper.error(e); System.exit(-1); diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ClasspathLaunch.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ClasspathLaunch.java index 05173094..554ca32f 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ClasspathLaunch.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ClasspathLaunch.java @@ -13,10 +13,10 @@ public class ClasspathLaunch implements Launch { @Override @SuppressWarnings("ConfusingArgumentToVarargsMethod") - public void run(ServerWrapper.Config config, String[] args) throws Throwable { + public void run(String mainclass, ServerWrapper.Config config, String[] args) throws Throwable { URL[] urls = config.classpath.stream().map(Paths::get).map(IOHelper::toURL).toArray(URL[]::new); ClassLoader ucl = new PublicURLClassLoader(urls); - Class mainClass = Class.forName(config.mainclass, true, ucl); + Class mainClass = Class.forName(mainclass, true, ucl); MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)); mainMethod.invoke(args); } diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/Launch.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/Launch.java index becc49f8..f4e915e8 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/Launch.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/Launch.java @@ -3,5 +3,5 @@ import pro.gravit.launcher.server.ServerWrapper; public interface Launch { - void run(ServerWrapper.Config config, String[] args) throws Throwable; + void run(String mainclass, ServerWrapper.Config config, String[] args) throws Throwable; } diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ModuleLaunch.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ModuleLaunch.java index 2cb55ad7..cc0707ee 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ModuleLaunch.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/ModuleLaunch.java @@ -4,7 +4,7 @@ public class ModuleLaunch implements Launch { @Override - public void run(ServerWrapper.Config config, String[] args) throws Throwable { + public void run(String mainclass, ServerWrapper.Config config, String[] args) throws Throwable { throw new UnsupportedOperationException("Module system not supported"); } } diff --git a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/SimpleLaunch.java b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/SimpleLaunch.java index 192f95dc..8b2b6df7 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/SimpleLaunch.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/launch/SimpleLaunch.java @@ -9,8 +9,8 @@ public class SimpleLaunch implements Launch { @Override @SuppressWarnings("ConfusingArgumentToVarargsMethod") - public void run(ServerWrapper.Config config, String[] args) throws Throwable { - Class mainClass = Class.forName(config.mainclass); + public void run(String mainclass, ServerWrapper.Config config, String[] args) throws Throwable { + Class mainClass = Class.forName(mainclass); MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)); mainMethod.invoke(args); } diff --git a/ServerWrapper/src/main/java11/pro/gravit/launcher/server/launch/ModuleLaunch.java b/ServerWrapper/src/main/java11/pro/gravit/launcher/server/launch/ModuleLaunch.java index 2539d3dd..53cbfa7a 100644 --- a/ServerWrapper/src/main/java11/pro/gravit/launcher/server/launch/ModuleLaunch.java +++ b/ServerWrapper/src/main/java11/pro/gravit/launcher/server/launch/ModuleLaunch.java @@ -13,12 +13,11 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.stream.Collectors; public class ModuleLaunch implements Launch { @Override @SuppressWarnings("ConfusingArgumentToVarargsMethod") - public void run(ServerWrapper.Config config, String[] args) throws Throwable { + public void run(String mainclass, ServerWrapper.Config config, String[] args) throws Throwable { URL[] urls = config.classpath.stream().map(Paths::get).map(IOHelper::toURL).toArray(URL[]::new); ClassLoader ucl = new PublicURLClassLoader(urls); // Create Module Layer @@ -55,7 +54,7 @@ public void run(ServerWrapper.Config config, String[] args) throws Throwable { } // Start main class ClassLoader loader = mainModule.getClassLoader(); - Class mainClass = Class.forName(config.mainclass, true, loader); + Class mainClass = Class.forName(mainclass, true, loader); MethodHandle mainMethod = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)); mainMethod.invoke(args); }