Class CustomCommand

java.lang.Object
net.gcnt.additionsplus.files.commands.CustomCommand

public class CustomCommand extends Object
Class that contains all information about a custom command.
  • Constructor Details

  • Method Details

    • getCommandByName

      public static CustomCommand getCommandByName(String name)
      Search a command by its name/identifier.
      Parameters:
      name - Name of the command.
      Returns:
      CustomCommand when found, null when invalid.
    • getCommandByAlias

      public static CustomCommand getCommandByAlias(String alias)
      Search a command by its alias.
      Parameters:
      alias - Alias of the command.
      Returns:
      CustomCommand when found, null when invalid.
    • getSimilarCommands

      public static List<CustomCommand> getSimilarCommands(String command)
      Get a list of custom commands that look most like the provided command string.
      Parameters:
      command - Command string as executed by the player/console.
      Returns:
      List of CustomCommand that match the query.
    • getPlugin

      public String getPlugin()
      Get the assigned plugin for this command. This is AdditionsPlus by default.
      Returns:
      String plugin when specified, null if not.
    • getCommandName

      public String getCommandName()
      Get the command query that has to be executed.
      Returns:
      Command string.
    • getAliases

      public List<String> getAliases()
      Get a list of aliases for this command.
      Returns:
      List String with aliases.
    • getPermission

      public String getPermission()
      Get the permission required to execute this command.
      Returns:
      String when specified, null if not.
    • getNoPermissionMessage

      public String getNoPermissionMessage()
      Get the no permission message that is sent when the sender does not have the right permission.
      Returns:
      String no-permission message.
    • getCooldown

      public long getCooldown()
      Get the cooldown in ticks of this command. Cooldown is how much time a user has to wait in order to execute the command again.
      Returns:
      Long cooldown in ticks.
    • getCooldownMessage

      public String getCooldownMessage()
      Get the on cooldown message that is sent when the sender is trying to execute the command again while on cooldown.
      Returns:
      String cooldown message.
    • isRegister

      public boolean isRegister()
      Whether the custom command should be registered to Bukkit. When true, the command can be executed from both console and in-game, and from other plugins as well.
      Returns:
      Boolean whether the command should be register.
    • getActions

      public List<String> getActions()
      Get a list of actions that will be performed when the command is being executed.
      Returns:
      List of String actions.
    • getUsage

      public String getUsage()
      Get the bukkit usage message that is displayed in /? command
      Returns:
      String usage message, null if not specified.
    • getDescription

      public String getDescription()
      Get the bukkit description message that is displayed in /? command
      Returns:
      String description message.