mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
Использование isAgentStarted
This commit is contained in:
parent
c5d96f173d
commit
69a90dc806
2 changed files with 4 additions and 3 deletions
|
@ -35,7 +35,7 @@ public static void addJVMClassPath(JarFile file) throws IOException {
|
||||||
inst.appendToSystemClassLoaderSearch(file);
|
inst.appendToSystemClassLoaderSearch(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAgentStarted() {
|
public static boolean isAgentStarted() {
|
||||||
return isAgentStarted;
|
return isAgentStarted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ public static void main(String[] args) throws Throwable {
|
||||||
if(config.customClassPath)
|
if(config.customClassPath)
|
||||||
{
|
{
|
||||||
String[] cp = config.classpath.split(":");
|
String[] cp = config.classpath.split(":");
|
||||||
if(ServerAgent.inst == null)
|
if(!ServerAgent.isAgentStarted())
|
||||||
{
|
{
|
||||||
LogHelper.warning("JavaAgent not found. Using URLClassLoader");
|
LogHelper.warning("JavaAgent not found. Using URLClassLoader");
|
||||||
URL[] urls = Arrays.stream(cp).map(Paths::get).map(IOHelper::toURL).toArray(URL[]::new);
|
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(config.autoloadLibraries)
|
||||||
{
|
{
|
||||||
if(ServerAgent.inst == null)
|
if(!ServerAgent.isAgentStarted())
|
||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("JavaAgent not found, autoloadLibraries not available");
|
throw new UnsupportedOperationException("JavaAgent not found, autoloadLibraries not available");
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,7 @@ public static void main(String[] args) throws Throwable {
|
||||||
modulesManager.postInitModules();
|
modulesManager.postInitModules();
|
||||||
LogHelper.info("ServerWrapper: Project %s, LaunchServer address: %s port %d. Title: %s",config.projectname,config.address,config.port,config.title);
|
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("Minecraft Version (for profile): %s",wrapper.profile.getVersion().name);
|
||||||
|
LogHelper.info("Start Minecraft Server");
|
||||||
LogHelper.debug("Invoke main method %s", mainClass.getName());
|
LogHelper.debug("Invoke main method %s", mainClass.getName());
|
||||||
mainMethod.invoke(real_args);
|
mainMethod.invoke(real_args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue