Class AddonCommand
java.lang.Object
org.bukkit.command.Command
com.palmergames.bukkit.towny.object.AddonCommand
public class AddonCommand
extends org.bukkit.command.Command
-
Field Summary
Fields inherited from class org.bukkit.command.Command
description, timings, usageMessage
-
Constructor Summary
ConstructorDescriptionAddonCommand
(TownyCommandAddonAPI.CommandType commandType, String name, org.bukkit.command.CommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
execute
(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] args, TownyObject object) Used when an AddonCommand should receive a TownyObject name as a preceding argument.boolean
execute
(@NotNull org.bukkit.command.CommandSender sender, @NotNull String label, @NotNull String[] args) org.bukkit.command.CommandExecutor
@NotNull String
getName()
org.bukkit.command.TabCompleter
getTabCompletion
(org.bukkit.command.CommandSender sender, String[] args) void
setCommandExecutor
(org.bukkit.command.CommandExecutor commandExecutor) void
setCommandType
(TownyCommandAddonAPI.CommandType commandType) boolean
void
setTabCompleter
(@Nullable org.bukkit.command.TabCompleter tabCompleter) Sets the tab completer for this command.void
setTabCompletion
(int index, List<String> completions) void
setTabCompletions
(Map<Integer, List<String>> tabCompletions) Methods inherited from class org.bukkit.command.Command
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setPermission, setPermissionMessage, setUsage, tabComplete, tabComplete, testPermission, testPermissionSilent, toString, unregister
-
Constructor Details
-
AddonCommand
public AddonCommand(TownyCommandAddonAPI.CommandType commandType, String name, org.bukkit.command.CommandExecutor commandExecutor)
-
-
Method Details
-
execute
public boolean execute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String label, @NotNull @NotNull String[] args) - Specified by:
execute
in classorg.bukkit.command.Command
-
execute
public boolean execute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args) -
execute
public boolean execute(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args, TownyObject object) Used when an AddonCommand should receive a TownyObject name as a preceding argument.- Parameters:
sender
- CommandSender using the addon command.args
- String[] args which will have the Town or Nation name as the first String.object
- A TownyObject, not actually used except to specify the desire to use this method.- Returns:
- true if the
CommandExecutor.onCommand(CommandSender, Command, String, String[])
is successful.
-
getCommandType
-
getName
- Overrides:
getName
in classorg.bukkit.command.Command
-
getCommandExecutor
public org.bukkit.command.CommandExecutor getCommandExecutor() -
getTabCompleter
public org.bukkit.command.TabCompleter getTabCompleter() -
getTabCompletions
-
setCommandType
-
setName
- Overrides:
setName
in classorg.bukkit.command.Command
-
setCommandExecutor
public void setCommandExecutor(org.bukkit.command.CommandExecutor commandExecutor) -
setTabCompleter
public void setTabCompleter(@Nullable @Nullable org.bukkit.command.TabCompleter tabCompleter) Sets the tab completer for this command. If the provided CommandExecutor already implements TabCompleter, this function is not required.- Parameters:
tabCompleter
- The tab completer to set.
-
setTabCompletions
-
setTabCompletion
-
getTabCompletion
-