Waterfall/BungeeCord-Patches/0056-Add-the-ability-to-generate-decoder-traces-for-debug.patch
_tomcraft 85c0a35f0b
Updated Upstream (BungeeCord) (#695)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
6613aaea Add test fix for library classes being visible to non-dependent plugins
53ce6b93 #3200: Fix protocol for 21w40a
d8e29384 #2466: Use switch in "BungeeCord" plugin message handling
5cf869df #3198: Remove terminally deprecated SecurityManager
f26f7d88 Add optional 1.18 (21w40a) snapshot protocol support
2021-10-09 10:43:12 +01:00

45 lines
1.5 KiB
Diff

From 8354e44c10d3e1a46b0fba7e5c38d10743b2580c Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 15 Sep 2020 18:11:49 +0100
Subject: [PATCH] Add the ability to generate decoder traces for debugging
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
index 2583aa2c..334d5054 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
@@ -4,6 +4,7 @@ import io.netty.handler.codec.DecoderException;
public class FastDecoderException extends DecoderException {
+ private static final boolean PROCESS_TRACES = Boolean.getBoolean("waterfall.decoder-traces"); // Waterfall
public FastDecoderException(String message, Throwable cause) {
super(message, cause);
}
@@ -15,12 +16,22 @@ public class FastDecoderException extends DecoderException {
@Override
public Throwable initCause(Throwable cause)
{
+ // Waterfall start
+ if (PROCESS_TRACES) {
+ return super.initCause(cause);
+ }
+ // Waterfall end
return this;
}
@Override
public Throwable fillInStackTrace()
{
+ // Waterfall start
+ if (PROCESS_TRACES) {
+ return super.fillInStackTrace();
+ }
+ // Waterfall end
return this;
}
}
--
2.30.1 (Apple Git-130)