mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-09-28 13:47:27 +02:00
Add transaction id to TabCompleteEvent
This commit is contained in:
parent
b60a30c705
commit
d4b3a5e86f
@ -29,11 +29,25 @@ public class TabCompleteEvent extends TargetedEvent implements Cancellable
|
||||
* this list is empty, the request will be forwarded to the server.
|
||||
*/
|
||||
private final List<String> suggestions;
|
||||
/**
|
||||
* The transaction id for 1.13+ clients.
|
||||
*/
|
||||
private final int transactionId;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #TabCompleteEvent(Connection, Connection, String, List, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public TabCompleteEvent(Connection sender, Connection receiver, String cursor, List<String> suggestions)
|
||||
{
|
||||
this(sender, receiver, cursor, suggestions, 0);
|
||||
}
|
||||
|
||||
public TabCompleteEvent(Connection sender, Connection receiver, String cursor, List<String> suggestions, int transactionId)
|
||||
{
|
||||
super( sender, receiver );
|
||||
this.cursor = cursor;
|
||||
this.suggestions = suggestions;
|
||||
this.transactionId = transactionId;
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class UpstreamBridge extends PacketHandler
|
||||
bungee.getPluginManager().dispatchCommand( con, tabComplete.getCursor().substring( 1 ), suggestions );
|
||||
}
|
||||
|
||||
TabCompleteEvent tabCompleteEvent = new TabCompleteEvent( con, con.getServer(), tabComplete.getCursor(), suggestions );
|
||||
TabCompleteEvent tabCompleteEvent = new TabCompleteEvent( con, con.getServer(), tabComplete.getCursor(), suggestions, tabComplete.getTransactionId() );
|
||||
bungee.getPluginManager().callEvent( tabCompleteEvent );
|
||||
|
||||
if ( tabCompleteEvent.isCancelled() )
|
||||
|
Loading…
Reference in New Issue
Block a user