Add system property for activating NbtCodecException debug traces

This commit is contained in:
booky committed 2025-12-16 13:30:34 +01:00
1 parent 28f14a7b42
commit 941bf7c30e
1 file changed
+4 -1
@@ -23,6 +23,8 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
public class NbtCodecException extends RuntimeException {
private static final boolean DEBUG_TRACES = Boolean.getBoolean("packetevents.debug.nbt-codec-trace");
public NbtCodecException(String message) {
super(message);
}
@@ -37,6 +39,7 @@ public class NbtCodecException extends RuntimeException {
@Override
public synchronized Throwable fillInStackTrace() {
return this; // no stack trace for us
// don't fill in stack traces by default
return DEBUG_TRACES ? super.fillInStackTrace() : this;
}
}