Class TippieCommand

java.lang.Object
me.tippie.tippieutils.v1_2_0.commands.TippieCommand
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor

public class TippieCommand extends Object implements org.bukkit.command.TabExecutor
Represents a TippieCommand which you can extend to use.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The description of this command used in generated help messages.
    protected String
    The name of this command.
    protected String
    The permission needed to execute this command
    protected String
    The prefix used in the help message.
    protected int
    The sublevel of this command.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    completes​(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
    Called when the command is tab completed.
    void
    executes​(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
    Called when the command is tab executed.
    The description of this command used in generated help messages.
    The name of this command.
    The permission needed to execute this command
    The prefix used in the help message.
    The registered subcommands of this command.
    int
    The sublevel of this command.
    boolean
    onCommand​(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args)
     
    @Nullable List<String>
    onTabComplete​(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, @NotNull String[] args)
     
    protected void
    sendHelpMessage​(org.bukkit.command.CommandSender sender, String label, String prefix)
    Sends a help message about the subcommands of this command when called.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      protected String name
      The name of this command.
    • description

      protected String description
      The description of this command used in generated help messages.
      See Also:
      sendHelpMessage(CommandSender, String, String)
    • permission

      protected String permission
      The permission needed to execute this command
    • subLevel

      protected int subLevel
      The sublevel of this command. This indicates how deep the command is within subcommands. For example, if this command is the root command, then this value is 0. If this command is a subcommand of another command, then this value is 1.
    • prefix

      protected String prefix
      The prefix used in the help message.
      See Also:
      sendHelpMessage(CommandSender, String, String)
  • Constructor Details

    • TippieCommand

      public TippieCommand()
  • Method Details

    • onCommand

      @Internal public final boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args)
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
    • onTabComplete

      @Nullable @Internal public final @Nullable List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, @NotNull @NotNull String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
    • completes

      public List<String> completes(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
      Called when the command is tab completed.
      Parameters:
      sender - The sender of the command.
      command - The command.
      alias - The alias of the command. This is the same as the name of the command.
      args - The arguments of the command. This does not include the subcommand.Example the command '/test subcommand argument' would only have 'argument' here
      Returns:
      The list of completions
    • executes

      public void executes(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, @NotNull @NotNull String[] args) throws NoSuchMethodException
      Called when the command is tab executed.
      Parameters:
      sender - The sender of the command.
      command - The command.
      label - The alias of the command. This is the same as the name of the command.
      args - The arguments of the command. This does not include the subcommand.Example the command '/test subcommand argument' would only have 'argument' here
      Throws:
      NoSuchMethodException
      See Also:
      me.tippie.tippieutils.v1_2_0.commands.annotations
    • sendHelpMessage

      protected void sendHelpMessage(org.bukkit.command.CommandSender sender, String label, String prefix)
      Sends a help message about the subcommands of this command when called.
      Parameters:
      sender - The command sender to send the help message to.
      label - The label of the command.
      prefix - The prefix used in the help message.
    • getName

      public String getName()
      The name of this command.
      Returns:
      The name of this command.
    • getDescription

      public String getDescription()
      The description of this command used in generated help messages.
      Returns:
      The description of this command.
      See Also:
      sendHelpMessage(CommandSender, String, String)
    • getPermission

      public String getPermission()
      The permission needed to execute this command
      Returns:
      The permission needed to execute this command
    • getSubLevel

      public int getSubLevel()
      The sublevel of this command. This indicates how deep the command is within subcommands. For example, if this command is the root command, then this value is 0. If this command is a subcommand of another command, then this value is 1.
      Returns:
      The sublevel of this command.
    • getPrefix

      public String getPrefix()
      The prefix used in the help message.
      Returns:
      The prefix used in the help message.
      See Also:
      sendHelpMessage(CommandSender, String, String)
    • getSubCommands

      public List<TippieCommand> getSubCommands()
      The registered subcommands of this command.
      Returns:
      The list of subcommands registered.