public class AsyncTabCompleteEvent extends Event implements Cancellable
Event.Result
Constructor and Description |
---|
AsyncTabCompleteEvent(CommandSender sender,
List<String> completions,
String buffer,
boolean isCommand,
Location loc) |
Modifier and Type | Method and Description |
---|---|
String |
getBuffer()
Return the entire buffer which formed the basis of this completion.
|
List<String> |
getCompletions()
The list of completions which will be offered to the sender, in order.
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
Location |
getLocation() |
CommandSender |
getSender()
Get the sender completing this command.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
boolean |
isCommand() |
boolean |
isHandled()
If true, the standard process of calling
Command.tabComplete(CommandSender, String, String[])
or current player names will not be called. |
void |
setCancelled(boolean cancelled)
Will provide no completions, and will not fire the synchronous process
|
void |
setCompletions(List<String> completions)
Set the completions offered, overriding any already set.
|
void |
setHandled(boolean handled)
Sets whether or not to consider the completion request handled.
|
callEvent, getEventName, isAsynchronous
public AsyncTabCompleteEvent(CommandSender sender, List<String> completions, String buffer, boolean isCommand, Location loc)
public CommandSender getSender()
CommandSender
instancepublic List<String> getCompletions()
Command.tabComplete(CommandSender, String, String[])
or current player names will not be called.public void setCompletions(List<String> completions)
Command.tabComplete(CommandSender, String, String[])
or current player names will not be called.
The passed collection will be cloned to a new List. You must call {getCompletions()
} to mutate from herecompletions
- the new completionspublic String getBuffer()
public boolean isCommand()
public Location getLocation()
public boolean isHandled()
Command.tabComplete(CommandSender, String, String[])
or current player names will not be called.public void setHandled(boolean handled)
Command.tabComplete(CommandSender, String, String[])
or current player names will not be called.handled
- if this completion should be marked as being handledpublic boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancelled)
setCancelled
in interface Cancellable
cancelled
- true if you wish to cancel this eventpublic HandlerList getHandlers()
getHandlers
in class Event
public static HandlerList getHandlerList()
Copyright © 2021. All rights reserved.