mirror of
https://github.com/chylex/Java-Checker.git
synced 2025-07-24 10:59:03 +02:00
Fix 1.8.8
This commit is contained in:
parent
eeb0dff456
commit
b90c77e0ee
@ -45,8 +45,11 @@ public final class JavaCheckerReporter{
|
|||||||
else{
|
else{
|
||||||
try{
|
try{
|
||||||
Class cmm = findCoreModManager();
|
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();
|
String myFile = new File(JavaCheckerReporter.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getName();
|
||||||
coremods.remove(myFile);
|
coremods.remove(myFile);
|
||||||
@ -98,4 +101,15 @@ public final class JavaCheckerReporter{
|
|||||||
|
|
||||||
return null;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user