1
0
mirror of https://github.com/chylex/Java-Checker.git synced 2025-06-21 00:38:55 +02:00

Fix 1.8.8

This commit is contained in:
chylex 2015-12-16 22:00:56 +01:00
parent eeb0dff456
commit b90c77e0ee

View File

@ -45,8 +45,11 @@ public final class JavaCheckerReporter{
else{
try{
Class cmm = findCoreModManager();
List coremods = (List)cmm.getMethod("getLoadedCoremods").invoke(null);
List reparsed = (List)cmm.getMethod("getReparseableCoremods").invoke(null);
List coremods = getListOrNullSafe(cmm,"getLoadedCoremods");
if (coremods == null)coremods = getListOrNullSafe(cmm,"getIgnoredMods");
List reparsed = getListOrNullSafe(cmm,"getReparseableCoremods");
String myFile = new File(JavaCheckerReporter.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getName();
coremods.remove(myFile);
@ -98,4 +101,15 @@ public final class JavaCheckerReporter{
return null;
}
private static List getListOrNullSafe(Class cls, String methodName){
try{
return (List)cls.getMethod(methodName).invoke(null);
}catch(NoSuchMethodError e){
}catch(Throwable t){
t.printStackTrace();
}
return null;
}
}