mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-13 21:54:01 +00:00
Grimoire compatibility patch. Fixes #1.
This commit is contained in:
1 file changed
+16
-2
@@ -77,6 +77,8 @@ public class MixinPlugin implements IMixinConfigPlugin {
|
||||
return mixins;
|
||||
}
|
||||
|
||||
private int grimoireDetected = -1;
|
||||
|
||||
private boolean loadJarOf(final TargetedMod mod) {
|
||||
try {
|
||||
val jar = findJarOf(mod);
|
||||
@@ -86,10 +88,22 @@ public class MixinPlugin implements IMixinConfigPlugin {
|
||||
}
|
||||
|
||||
LOG.info("Attempting to add " + jar + " to the URL Class Path");
|
||||
if(!jar.exists()) {
|
||||
if (!jar.exists()) {
|
||||
throw new FileNotFoundException(jar.toString());
|
||||
}
|
||||
MinecraftURLClassPath.addJar(jar);
|
||||
if (grimoireDetected < 0) {
|
||||
try {
|
||||
Class.forName("io.github.crucible.grimoire.Grimoire", false, getClass().getClassLoader());
|
||||
grimoireDetected = 1;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
grimoireDetected = 0;
|
||||
}
|
||||
}
|
||||
if (grimoireDetected == 1) {
|
||||
LOG.info("Not adding " + jar + " to the URL Class Path, because Grimoire breaks our utility class.");
|
||||
} else {
|
||||
MinecraftURLClassPath.addJar(jar);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
Reference in new issue
Block a user