From 1da1c2d96b8e1b17ddcba2dbf4b6be101bbb61b6 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Wed, 19 Jun 2024 20:35:02 +0200 Subject: [PATCH] fix getting the ParallelLoaders class --- .../com/baseband/launcher/classloader/CustomClassLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java index bc8581b..000ad42 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java @@ -17,6 +17,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; +import java.util.Arrays; import java.util.HashSet; import java.util.Map; @@ -67,7 +68,7 @@ public class CustomClassLoader extends ClassLoader implements Util { throw new IllegalStateException(MixinService.getService().getClass().toString()); } - Method m = Class.forName("java.lang.ClassLoader.ParallelLoaders").getDeclaredMethod("register", Class.class); + Method m = Arrays.stream(Class.forName("java.lang.ClassLoader").getDeclaredClasses()).filter(x -> x.getSimpleName().equalsIgnoreCase("ParallelLoaders")).findFirst().get().getDeclaredMethod("register", Class.class); m.setAccessible(true); m.invoke(null, CustomClassLoader.class);