9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-23 00:59:16 +00:00

Error Test

This commit is contained in:
Daniel Mills
2021-07-22 19:23:31 -04:00
parent 7e08f495a7
commit f0a89e99f5
2 changed files with 55 additions and 12 deletions

View File

@@ -561,6 +561,25 @@ public class Iris extends VolmitPlugin implements Listener {
return IrisSettings.get().getGenerator().isMcaPregenerator();
}
public static void reportErrorChunk(int x, int z, Throwable e) {
if (IrisSettings.get().getGeneral().isDebug()) {
File f = instance.getDataFile("debug", "chunk-errors", "chunk."+ x + "." + z + ".txt");
if (!f.exists()) {
J.attempt(() -> {
PrintWriter pw = new PrintWriter(f);
pw.println("Thread: " + Thread.currentThread().getName());
pw.println("First: " + new Date(M.ms()));
e.printStackTrace(pw);
pw.close();
});
}
Iris.debug("Chunk " + x + "," + z + " Exception Logged: " + e.getClass().getSimpleName() + ": " + C.RESET + "" + C.LIGHT_PURPLE + e.getMessage());
}
}
public static synchronized void reportError(Throwable e) {
if (IrisSettings.get().getGeneral().isDebug()) {
String n = e.getClass().getCanonicalName() + "-" + e.getStackTrace()[0].getClassName() + "-" + e.getStackTrace()[0].getLineNumber();