public class ModuleCommand
extends org.bukkit.command.Command
implements org.bukkit.command.PluginIdentifiableCommand
PluginCommand with elements retrofitted for modules.PluginCommand| Modifier | Constructor and Description |
|---|---|
protected |
ModuleCommand(@NotNull String name,
@NotNull Module owner) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(@NotNull org.bukkit.command.CommandSender sender,
@NotNull String commandLabel,
@NotNull String[] args)
Executes the command, returning its success
|
@NotNull org.bukkit.command.CommandExecutor |
getExecutor()
Gets the
CommandExecutor associated with this command |
@NotNull org.bukkit.plugin.Plugin |
getPlugin()
Gets the owner of this PluginCommand
|
@Nullable org.bukkit.command.TabCompleter |
getTabCompleter()
Gets the
TabCompleter associated with this command. |
void |
setExecutor(@Nullable org.bukkit.command.CommandExecutor executor)
Sets the
CommandExecutor to run when parsing this command |
void |
setTabCompleter(@Nullable org.bukkit.command.TabCompleter completer)
Sets the
TabCompleter to run when tab-completing this command. |
@NotNull List<String> |
tabComplete(@NotNull org.bukkit.command.CommandSender sender,
@NotNull String alias,
@NotNull String[] args) |
String |
toString() |
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, testPermissionSilent, unregisterpublic boolean execute(@NotNull
@NotNull org.bukkit.command.CommandSender sender,
@NotNull
@NotNull String commandLabel,
@NotNull
@NotNull String[] args)
execute in class org.bukkit.command.Commandsender - Source object which is executing this commandcommandLabel - The alias of the command usedargs - All arguments passed to the command, split via ' 'public void setExecutor(@Nullable
@Nullable org.bukkit.command.CommandExecutor executor)
CommandExecutor to run when parsing this commandexecutor - New executor to run@NotNull public @NotNull org.bukkit.command.CommandExecutor getExecutor()
CommandExecutor associated with this commandpublic void setTabCompleter(@Nullable
@Nullable org.bukkit.command.TabCompleter completer)
TabCompleter to run when tab-completing this command.
If no TabCompleter is specified, and the command's executor implements TabCompleter, then the executor will be used for tab completion.
completer - New tab completer@Nullable public @Nullable org.bukkit.command.TabCompleter getTabCompleter()
TabCompleter associated with this command.@NotNull public @NotNull org.bukkit.plugin.Plugin getPlugin()
getPlugin in interface org.bukkit.command.PluginIdentifiableCommand@NotNull public @NotNull List<String> tabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String alias, @NotNull @NotNull String[] args) throws org.bukkit.command.CommandException, IllegalArgumentException
Delegates to the tab completer if present.
If it is not present or returns null, will delegate to the current
command executor if it implements TabCompleter. If a non-null
list has not been found, will default to standard player name
completion in Command.tabComplete(CommandSender, String, String[]).
This method does not consider permissions.
tabComplete in class org.bukkit.command.Commandorg.bukkit.command.CommandException - if the completer or executor throw an
exception during the process of tab-completing.IllegalArgumentException - if sender, alias, or args is nullpublic String toString()
toString in class org.bukkit.command.CommandCopyright © 2020. All rights reserved.