forked from SteamWar/SteamWar
Fix renaming for class name duplications
This commit is contained in:
@@ -153,13 +153,12 @@ public final class Reflection {
|
|||||||
return Class.forName(ORG_BUKKIT_CRAFTBUKKIT + name.substring(22));
|
return Class.forName(ORG_BUKKIT_CRAFTBUKKIT + name.substring(22));
|
||||||
} else if(MAJOR_VERSION < 17 && name.startsWith("net.minecraft")) {
|
} else if(MAJOR_VERSION < 17 && name.startsWith("net.minecraft")) {
|
||||||
return Class.forName(LEGACY_NET_MINECRAFT_SERVER + "." + name.split("[.](?=[^.]*$)")[1]);
|
return Class.forName(LEGACY_NET_MINECRAFT_SERVER + "." + name.split("[.](?=[^.]*$)")[1]);
|
||||||
|
} else if(MAJOR_VERSION < 21 || MINOR_VERSION < 4) {
|
||||||
|
return Class.forName(spigotClassnames.getOrDefault(name, name));
|
||||||
} else {
|
} else {
|
||||||
return Class.forName(name);
|
return Class.forName(name);
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
if(spigotClassnames.containsKey(name))
|
|
||||||
return getClass(spigotClassnames.get(name));
|
|
||||||
|
|
||||||
throw new IllegalArgumentException("Cannot find " + name, e);
|
throw new IllegalArgumentException("Cannot find " + name, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user