From 4be299f6ca8e47750ba522dc9d79f89c0fe08e94 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:43:00 +0700 Subject: [PATCH] [FIX] Add ClassLoader.registerAsParallelCapable() --- .../src/main/java/pro/gravit/utils/launch/LegacyLaunch.java | 4 ++++ .../src/main/java/pro/gravit/utils/launch/ModuleLaunch.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java index 1a155fe4..a7511ad9 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java @@ -54,6 +54,10 @@ private class LegacyClassLoader extends URLClassLoader { private final Map> classMap = new ConcurrentHashMap<>(); private String nativePath; + static { + ClassLoader.registerAsParallelCapable(); + } + private final List packages = new ArrayList<>(); public LegacyClassLoader(URL[] urls) { super(urls); diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java index 5a414ea8..d83e3c44 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java @@ -164,6 +164,11 @@ private class ModuleClassLoader extends URLClassLoader { private String nativePath; private final List packages = new ArrayList<>(); + + static { + ClassLoader.registerAsParallelCapable(); + } + public ModuleClassLoader(URL[] urls, ClassLoader parent) { super("LAUNCHER", urls, parent); packages.add("pro.gravit.launcher.");