Remove system.out's

This commit is contained in:
CocoTheOwner 2021-08-13 20:12:35 +02:00
parent 30c5a0d9cd
commit 0f0c24d31b
3 changed files with 10 additions and 5 deletions

View File

@ -480,9 +480,14 @@ public class Iris extends VolmitPlugin implements Listener {
public static void msg(String string) { public static void msg(String string) {
try { try {
sender.sendMessage(string); sender.sendMessage(string);
} catch (Throwable ignored) { } catch (Throwable e) {
try { try {
System.out.println(string); if (sender.isPlayer()) {
Iris.reportError(e);
Iris.error("Failed to send message to player: " + string);
} else {
System.out.println("Failed to send message through logger: " + string + " because of " + e.getMessage());
}
} catch (Throwable ignored1) { } catch (Throwable ignored1) {
} }

View File

@ -265,7 +265,7 @@ public class Violator {
T f = c.getDeclaredAnnotation(a); T f = c.getDeclaredAnnotation(a);
p(id(f, c), f); p(id(f, c), f);
System.out.println("Set as " + id(f, c) + " as " + ("@" + a.getCanonicalName() + "[" + id(c, null) + "]")); Iris.debug("Set as " + id(f, c) + " as " + ("@" + a.getCanonicalName() + "[" + id(c, null) + "]"));
} }
return (T) g("@" + a.getCanonicalName() + "[" + id(c, null) + "]"); return (T) g("@" + a.getCanonicalName() + "[" + id(c, null) + "]");

View File

@ -65,7 +65,7 @@ public class J {
a.run(); a.run();
} catch (Throwable e) { } catch (Throwable e) {
Iris.reportError(e); Iris.reportError(e);
System.out.println("Failed to run async task"); Iris.error("Failed to run async task");
e.printStackTrace(); e.printStackTrace();
} }
}); });
@ -77,7 +77,7 @@ public class J {
a.run(); a.run();
} catch (Throwable e) { } catch (Throwable e) {
Iris.reportError(e); Iris.reportError(e);
System.out.println("Failed to run async task"); Iris.error.println("Failed to run async task");
e.printStackTrace(); e.printStackTrace();
} }
}); });