forked from PaperMC/Waterfall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0054-Allow-to-disable-tablist-rewrite.patch
75 lines (68 loc) · 3.36 KB
/
0054-Allow-to-disable-tablist-rewrite.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From 56cb3c65d1f2e5f10b5b635bf49f12b9fb849f76 Mon Sep 17 00:00:00 2001
From: xDark <[email protected]>
Date: Fri, 31 May 2019 08:11:31 +0300
Subject: [PATCH] Allow to disable tablist rewrite
diff --git a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
index 4a198ee9..d69463f0 100644
--- a/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
+++ b/api/src/main/java/net/md_5/bungee/api/ProxyConfig.java
@@ -255,4 +255,10 @@ public interface ProxyConfig
* @return Should we disable entity metadata rewriting?
*/
boolean isDisableEntityMetadataRewrite();
+
+ /**
+ * Whether tablist rewriting should be disabled or not
+ * @return {@code true} if tablist rewriting is disabled, {@code false} otherwise
+ */
+ boolean isDisableTabListRewrite();
}
diff --git a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
index e860214f..527f310e 100644
--- a/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
+++ b/proxy/src/main/java/io/github/waterfallmc/waterfall/conf/WaterfallConfiguration.java
@@ -43,6 +43,7 @@ public class WaterfallConfiguration extends Configuration {
private boolean disableModernTabLimiter = true;
private boolean disableEntityMetadataRewrite = false;
+ private boolean disableTabListRewrite = false;
@Override
public void load() {
@@ -56,6 +57,7 @@ public class WaterfallConfiguration extends Configuration {
tabThrottle = config.getInt("throttling.tab_complete", tabThrottle);
disableModernTabLimiter = config.getBoolean("disable_modern_tab_limiter", disableModernTabLimiter);
disableEntityMetadataRewrite = config.getBoolean("disable_entity_metadata_rewrite", disableEntityMetadataRewrite);
+ disableTabListRewrite = config.getBoolean("disable_tab_list_rewrite", disableTabListRewrite);
}
@Override
@@ -87,4 +89,9 @@ public class WaterfallConfiguration extends Configuration {
public boolean isDisableEntityMetadataRewrite() {
return disableEntityMetadataRewrite;
}
+
+ @Override
+ public boolean isDisableTabListRewrite() {
+ return disableTabListRewrite;
+ }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
index ace177ba..f4494898 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
@@ -162,8 +162,14 @@ public class DownstreamBridge extends PacketHandler
@Override
public void handle(PlayerListItem playerList) throws Exception
{
- con.getTabListHandler().onUpdate( TabList.rewrite( playerList ) );
- throw CancelSendSignal.INSTANCE; // Always throw because of profile rewriting
+ //Waterfall start
+ boolean skipRewrites = bungee.getConfig().isDisableTabListRewrite();
+ con.getTabListHandler().onUpdate( skipRewrites ? playerList : TabList.rewrite( playerList ) );
+ if ( !skipRewrites )
+ {
+ throw CancelSendSignal.INSTANCE; // Only throw if profile rewriting is enabled
+ }
+ // Waterfall end
}
@Override
--
2.32.0