Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-06-12 16:08:17 -04:00
2 changed files with 7 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ public interface Platform{
loadedClass = findClass(name);
}catch(ClassNotFoundException e){
//use parent if not found
loadedClass = super.loadClass(name, resolve);
return parent.loadClass(name);
}
}

View File

@@ -26,16 +26,19 @@ public class ModClassLoader extends ClassLoader{
ClassNotFoundException last = null;
int size = children.size;
inChild.set(true);
//if it doesn't exist in the main class loader, try all the children
for(int i = 0; i < size; i++){
try{
return children.get(i).loadClass(name);
try{
inChild.set(true);
return children.get(i).loadClass(name);
}finally{
inChild.set(false);
}
}catch(ClassNotFoundException e){
last = e;
}
}
inChild.set(false);
throw (last == null ? new ClassNotFoundException(name) : last);
}