mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-27 20:59:12 +01:00
#3205: Don't forward tab completions if the root command is a bungee command
This commit is contained in:
parent
6613aaea95
commit
c3fffbc919
@ -171,10 +171,11 @@ public class UpstreamBridge extends PacketHandler
|
||||
public void handle(TabCompleteRequest tabComplete) throws Exception
|
||||
{
|
||||
List<String> 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
|
||||
|
Loading…
Reference in New Issue
Block a user