Having fun with a log message not showing exception + fixing obf data handling in case of error to avoid invalid internal state

This commit is contained in:
Marc Baloup 2022-06-24 00:34:58 +02:00
parent 37b73d3846
commit 013635e095
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -53,6 +53,8 @@ public class NMSReflect {
Log.info("[NMSReflect] Initializing NMS obfuscation mapping...");
boolean clearIfError = true;
try {
ReflectClass<?> obfHelperClass;
try {
@ -117,13 +119,19 @@ public class NMSReflect {
}
}
clearIfError = false;
if (missingRuntimeClasses)
throw new ClassNotFoundException("Unable to find all the following runtime classes referenced by the obfuscation mapping. They are removed from the mapping data.");
} catch (Throwable t) {
Log.severe("[NMSReflect] The plugin will hava limited access to access NMS stuff due to an error while loading the obfuscation mapping.");
if (clearIfError) {
CLASSES_BY_OBF.clear();
CLASSES_BY_MOJ.clear();
}
Log.severe("[NMSReflect] The plugin will have limited access to NMS stuff due to an error while loading the obfuscation mapping.");
Log.severe(t.toString());
Log.severe(t);
t.printStackTrace();
}
Log.info("[NMSReflect] Obfuscation mapping loaded for " + CLASSES_BY_OBF.size() + " classes.");
}