Class Command

java.lang.Object
me.hackware.api.command.Command

public abstract class Command extends Object
Abstract base class for all hackware commands.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getDescription

      public String getDescription()
    • getUsage

      public String getUsage()
    • execute

      public abstract void execute(String[] args)
      Execute this command with the given arguments.
      Parameters:
      args - arguments after the command name, split by whitespace
    • getSuggestions

      public List<String> getSuggestions(String[] args)
      Return tab-completion suggestions for the given partial arguments.
      Parameters:
      args - the current arguments (may be empty or partial)
      Returns:
      list of suggestion strings
    • print

      protected void print(TextIcons.Icon icon, net.minecraft.ChatFormatting iconColor, String message)
      Sends message behind an [icon] prefix, with the icon tinted.
    • info

      protected void info(String message)
      Informational: aqua TextIcons.Icon.INFO.
    • warn

      protected void warn(String message)
      Advisory: yellow TextIcons.Icon.WARNING.
    • error

      protected void error(String message)
      Failure: red TextIcons.Icon.WARNING, message red too. Use for bad usage and failures.
    • usage

      protected void usage()
      Print command usage.