From c3fffbc919db0276a7ba1859179f6a2dcf764dae Mon Sep 17 00:00:00 2001 From: Frank van der Heijden Date: Thu, 4 Nov 2021 08:45:11 +0100 Subject: [PATCH] #3205: Don't forward tab completions if the root command is a bungee command --- .../java/net/md_5/bungee/connection/UpstreamBridge.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index 41101a6e..253c3287 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -171,10 +171,11 @@ public class UpstreamBridge extends PacketHandler public void handle(TabCompleteRequest tabComplete) throws Exception { List suggestions = new ArrayList<>(); + boolean isRegisteredCommand = false; if ( tabComplete.getCursor().startsWith( "/" ) ) { - bungee.getPluginManager().dispatchCommand( con, tabComplete.getCursor().substring( 1 ), suggestions ); + isRegisteredCommand = bungee.getPluginManager().dispatchCommand( con, tabComplete.getCursor().substring( 1 ), suggestions ); } TabCompleteEvent tabCompleteEvent = new TabCompleteEvent( con, con.getServer(), tabComplete.getCursor(), suggestions ); @@ -209,6 +210,12 @@ public class UpstreamBridge extends PacketHandler } throw CancelSendSignal.INSTANCE; } + + // Don't forward tab completions if the command is a registered bungee command + if ( isRegisteredCommand ) + { + throw CancelSendSignal.INSTANCE; + } } @Override