mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-11 19:37:34 +00:00
detect both legacy and new grimoire classes
This commit is contained in:
1 file changed
+11
-6
@@ -26,12 +26,17 @@ public final class MinecraftURLClassPath {
|
||||
private static final boolean GRIMOIRE;
|
||||
|
||||
static {
|
||||
boolean grimoire;
|
||||
try {
|
||||
Class.forName("io.github.crucible.grimoire.common.GrimoireCore", false, MinecraftURLClassPath.class.getClassLoader());
|
||||
grimoire = true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
grimoire = false;
|
||||
boolean grimoire = false;
|
||||
String[] knownGrimoireClassNames = new String[]{
|
||||
"io.github.crucible.grimoire.Grimoire",
|
||||
"io.github.crucible.grimoire.common.GrimoireCore"
|
||||
};
|
||||
for (val className: knownGrimoireClassNames) {
|
||||
try {
|
||||
Class.forName(className, false, MinecraftURLClassPath.class.getClassLoader());
|
||||
grimoire = true;
|
||||
break;
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
GRIMOIRE = grimoire;
|
||||
if (!GRIMOIRE) {
|
||||
|
||||
Reference in new issue
Block a user