From 117b95d3fcf6578e301824b87d91ceb86acaf6a2 Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 11 Dec 2019 07:59:04 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20optional=20classpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/gravit/launcher/client/ClientLauncher.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index 066b4aab..1f189cea 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -465,18 +465,14 @@ public static void main(String... args) throws Throwable { LauncherEngine.modulesManager.invokeEvent(new ClientLauncherInitPhase(context)); // Verify ClientLauncher sign and classpath LogHelper.debug("Verifying ClientLauncher sign and classpath"); - LinkedList classPath = resolveClassPathList(params.clientDir, profile.getClassPath()); - for (Path classpathURL : classPath) { - //LauncherAgent.addJVMClassPath(classpathURL.normalize().toAbsolutePath()); - } + URL[] classpath = resolveClassPath(params.clientDir, profile.getClassPath()); + classLoader = new ClientClassLoader(classpath, ClassLoader.getSystemClassLoader()); profile.pushOptionalClassPath(cp -> { LinkedList optionalClassPath = resolveClassPathList(params.clientDir, cp); for (Path classpathURL : optionalClassPath) { - //LauncherAgent.addJVMClassPath(classpathURL.normalize().toAbsolutePath()); + classLoader.addURL(classpathURL.normalize().toAbsolutePath().toUri().toURL()); } }); - URL[] classpathurls = resolveClassPath(params.clientDir, profile.getClassPath()); - classLoader = new ClientClassLoader(classpathurls, ClassLoader.getSystemClassLoader()); Thread.currentThread().setContextClassLoader(classLoader); classLoader.nativePath = params.clientDir.resolve(NATIVES_DIR).toString(); // Start client with WatchService monitoring @@ -506,7 +502,7 @@ public static void main(String... args) throws Throwable { ClientService.classLoader = classLoader; classLoader.addURL(IOHelper.getCodeSource(ClientLauncher.class).toUri().toURL()); //classForName(classLoader, "com.google.common.collect.ForwardingMultimap"); - ClientService.baseURLs = classpathurls; + ClientService.baseURLs = classpath; LogHelper.debug("Starting JVM and client WatchService"); FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher(); FileNameMatcher clientMatcher = profile.getClientUpdateMatcher();