mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 01:57:55 +01:00
Fix cancelling TabCompleteEvent.
The packet would get sent regardless if the event was cancelled, only if there were no suggestions available.
This commit is contained in:
parent
9c4380a201
commit
848cad2a59
@ -134,17 +134,17 @@ public class UpstreamBridge extends PacketHandler
|
||||
TabCompleteEvent tabCompleteEvent = new TabCompleteEvent( con, con.getServer(), tabComplete.getCursor(), suggestions );
|
||||
bungee.getPluginManager().callEvent( tabCompleteEvent );
|
||||
|
||||
if ( tabCompleteEvent.isCancelled() )
|
||||
{
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
}
|
||||
|
||||
List<String> results = tabCompleteEvent.getSuggestions();
|
||||
if ( !results.isEmpty() )
|
||||
{
|
||||
con.unsafe().sendPacket( new TabCompleteResponse( results ) );
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
}
|
||||
|
||||
if ( tabCompleteEvent.isCancelled() )
|
||||
{
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user