finally figured the lockups out.
why java must you make classloaders so overcomplicated ask me to send you documentation on how i fixed this
This commit is contained in:
parent
8bb116a1fe
commit
b512f48ad3
1 changed files with 16 additions and 11 deletions
|
@ -67,6 +67,8 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
throw new IllegalStateException(MixinService.getService().getClass().toString());
|
||||
}
|
||||
|
||||
registerAsParallelCapable();
|
||||
|
||||
Field parent = ClassLoader.class.getDeclaredField("parent");
|
||||
parent.setAccessible(true);
|
||||
parent.set(this, parent.get(Launch.classLoader));
|
||||
|
@ -97,8 +99,11 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
URL r = Launch.classLoader.findResource(name);
|
||||
if(r == null)
|
||||
URL r;
|
||||
synchronized (Launch.classLoader) {
|
||||
r = Launch.classLoader.findResource(name);
|
||||
}
|
||||
if (r == null)
|
||||
return super.findResource(name);
|
||||
return r;
|
||||
}
|
||||
|
@ -120,17 +125,17 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
|
||||
@Override
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
synchronized (Launch.classLoader) {
|
||||
if (names.contains(name.replace('.', '/') + ".class")) {
|
||||
Class<?> clazz = loadBBClass(name);
|
||||
if (clazz != null)
|
||||
return clazz;
|
||||
}
|
||||
try {
|
||||
if (names.contains(name.replace('.', '/') + ".class")) {
|
||||
Class<?> clazz = loadBBClass(name);
|
||||
if (clazz != null)
|
||||
return clazz;
|
||||
}
|
||||
try {
|
||||
synchronized (Launch.classLoader) {
|
||||
return Launch.classLoader.findClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return super.findClass(name);
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
return super.findClass(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue