diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java index 57badd80..8f3578dc 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java @@ -35,7 +35,7 @@ public static void addJVMClassPath(JarFile file) throws IOException { inst.appendToSystemClassLoaderSearch(file); } - public boolean isAgentStarted() { + public static boolean isAgentStarted() { return isAgentStarted; } diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index 057fd6e0..3b8cad0d 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -109,7 +109,7 @@ public static void main(String[] args) throws Throwable { if(config.customClassPath) { String[] cp = config.classpath.split(":"); - if(ServerAgent.inst == null) + if(!ServerAgent.isAgentStarted()) { LogHelper.warning("JavaAgent not found. Using URLClassLoader"); URL[] urls = Arrays.stream(cp).map(Paths::get).map(IOHelper::toURL).toArray(URL[]::new); @@ -126,7 +126,7 @@ public static void main(String[] args) throws Throwable { } if(config.autoloadLibraries) { - if(ServerAgent.inst == null) + if(!ServerAgent.isAgentStarted()) { throw new UnsupportedOperationException("JavaAgent not found, autoloadLibraries not available"); } @@ -142,6 +142,7 @@ public static void main(String[] args) throws Throwable { modulesManager.postInitModules(); LogHelper.info("ServerWrapper: Project %s, LaunchServer address: %s port %d. Title: %s",config.projectname,config.address,config.port,config.title); LogHelper.info("Minecraft Version (for profile): %s",wrapper.profile.getVersion().name); + LogHelper.info("Start Minecraft Server"); LogHelper.debug("Invoke main method %s", mainClass.getName()); mainMethod.invoke(real_args); }