mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
Handle all mod loading exceptions
This commit is contained in:
parent
82cd21ddf9
commit
0fba4510df
@ -23,7 +23,6 @@ import org.xeustechnologies.jcl.JarClassLoader;
|
|||||||
import org.xeustechnologies.jcl.JclObjectFactory;
|
import org.xeustechnologies.jcl.JclObjectFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
@ -87,7 +86,12 @@ public class ModLoader {
|
|||||||
progress.countDown();
|
progress.countDown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
if (!instance.start(phase)) {
|
if (!instance.start(phase)) {
|
||||||
|
throw new ModLoadingException(String.format("Could not load nod %s", instance.getInfo()));
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
Log.warn(String.format("An error occurred while loading %s", instance.getInfo()));
|
Log.warn(String.format("An error occurred while loading %s", instance.getInfo()));
|
||||||
instance.setEnabled(false);
|
instance.setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -127,7 +131,7 @@ public class ModLoader {
|
|||||||
instance.setInfo(modInfo);
|
instance.setInfo(modInfo);
|
||||||
Log.verbose(String.format("[MOD] Mod file loaded and added to classpath (%s)", modInfo));
|
Log.verbose(String.format("[MOD] Mod file loaded and added to classpath (%s)", modInfo));
|
||||||
zipFile.close();
|
zipFile.close();
|
||||||
} catch (IOException | ModLoadingException | NullPointerException e) {
|
} catch (Throwable e) {
|
||||||
instance = null;
|
instance = null;
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Log.warn(String.format("Could not load mod: %s", file.getAbsolutePath()));
|
Log.warn(String.format("Could not load mod: %s", file.getAbsolutePath()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user