Class AddonCommand

java.lang.Object
org.bukkit.command.Command
com.palmergames.bukkit.towny.object.AddonCommand

public class AddonCommand extends org.bukkit.command.Command
  • Constructor Details

  • 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 class org.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

      public TownyCommandAddonAPI.CommandType getCommandType()
    • getName

      @NotNull public @NotNull String getName()
      Overrides:
      getName in class org.bukkit.command.Command
    • getCommandExecutor

      public org.bukkit.command.CommandExecutor getCommandExecutor()
    • getTabCompleter

      public org.bukkit.command.TabCompleter getTabCompleter()
    • getTabCompletions

      public Map<Integer,List<String>> getTabCompletions()
    • setCommandType

      public void setCommandType(TownyCommandAddonAPI.CommandType commandType)
    • setName

      public boolean setName(@NotNull @NotNull String name)
      Overrides:
      setName in class org.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

      public void setTabCompletions(Map<Integer,List<String>> tabCompletions)
    • setTabCompletion

      public void setTabCompletion(int index, List<String> completions)
    • getTabCompletion

      public List<String> getTabCompletion(org.bukkit.command.CommandSender sender, String[] args)