From 446c2d2dcb944ede941abb5c7a371e5f285855c7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 12 Jun 2021 11:00:56 -0400 Subject: [PATCH] more mod loader fixes --- core/src/mindustry/mod/ModClassLoader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/mod/ModClassLoader.java b/core/src/mindustry/mod/ModClassLoader.java index 40d6fd07ef..3124c16fed 100644 --- a/core/src/mindustry/mod/ModClassLoader.java +++ b/core/src/mindustry/mod/ModClassLoader.java @@ -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); }