Class AbstractCommand

java.lang.Object
com.ticxo.modelengine.api.command.AbstractCommand
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor

public abstract class AbstractCommand extends Object implements org.bukkit.command.TabExecutor
Viking-pillaged from LumineUtils Thanks Ash :kekw:
  • Field Details

  • Constructor Details

  • Method Details

    • addSubCommands

      public final void addSubCommands(AbstractCommand... commands)
    • onCommand

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

      public List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command cmd, @NotNull @NotNull String label, String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
    • onCommand

      public abstract boolean onCommand(org.bukkit.command.CommandSender sender, String[] args)
      Called when someone uses this command
      Parameters:
      sender - Sender of this command
      args - Arguments used
      Returns:
      same as a normal onCommand method
    • onTabComplete

      public abstract List<String> onTabComplete(org.bukkit.command.CommandSender sender, String[] args)
      Called when someone requests tab completion for this command
      Parameters:
      sender - The CommandSender who is tab-completing
      args - Tab completion arguments
      Returns:
      A list of possible completions
    • getPermissionNode

      public abstract String getPermissionNode()
      Permission node for this command.
      Returns:
      Permission node
    • isConsoleFriendly

      public abstract boolean isConsoleFriendly()
      Whether this command supports ConsoleCommandSender
      Returns:
      true if command can be used by console, false otherwise
    • getAliases

      public String[] getAliases()
      Can be overridden to add aliases for the command
      Returns:
      List
    • getName

      public abstract String getName()
      Returns:
      The name of this command (or subcommand)
    • getPlugin

      protected ModelEngineAPI getPlugin()