From 848cad2a5962e0db363d8993ea8c79ff3e279d53 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 7 Feb 2016 01:33:51 -0500 Subject: [PATCH] Fix cancelling TabCompleteEvent. The packet would get sent regardless if the event was cancelled, only if there were no suggestions available. --- .../net/md_5/bungee/connection/UpstreamBridge.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 13637df58..c075cd559 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 @@ -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 results = tabCompleteEvent.getSuggestions(); if ( !results.isEmpty() ) { con.unsafe().sendPacket( new TabCompleteResponse( results ) ); throw CancelSendSignal.INSTANCE; } - - if ( tabCompleteEvent.isCancelled() ) - { - throw CancelSendSignal.INSTANCE; - } } @Override