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 6884ef9b..e9383ec4 100644 --- a/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/pro/gravit/launcher/server/ServerWrapper.java @@ -203,6 +203,9 @@ public void run(String... args) throws Throwable { } } launch.launch(config.mainclass, config.mainmodule, Arrays.asList(real_args)); + if(!config.keepJVMAfterMainMethodCompleted) { + System.exit(0); + } } catch (Throwable e) { LogHelper.error(e); System.exit(-1); @@ -245,6 +248,7 @@ public static final class Config { public String address; public String serverName; public boolean autoloadLibraries; + public boolean keepJVMAfterMainMethodCompleted; public String logFile; public List classpath; public ClientProfile.ClassLoaderConfig classLoaderConfig;