Class SubCommand

java.lang.Object
me.lorenzo0111.pluginslib.command.SubCommand

public abstract class SubCommand extends Object
  • Constructor Details

    • SubCommand

      public SubCommand(ICommand<?> command)
      Parameters:
      command - Parent of the subcommand
  • Method Details

    • getName

      public abstract String getName()
      Returns:
      Name of the subcommand ( /command name )
    • getCommand

      public ICommand<?> getCommand()
      Returns:
      Parent of the subcommand
    • perform

      public void perform(User<?> sender, String[] args)
      Parent of the handleSubcommand abstract method. This method is used for permission check
      Parameters:
      sender - Command executor
      args - Args of the command. The args[0] will be the getName()
    • handleSubcommand

      public abstract void handleSubcommand(User<?> sender, String[] args)
      Abstract method to handle the subcommand
      Parameters:
      sender - Command executor
      args - Args of the command. The args[0] will be the getName()
    • setPermission

      public void setPermission(String permission, String message) throws NoSuchMethodException, LibraryException
      Do not use this method
      Parameters:
      permission - Permission required from the subcommand
      message - Error message
      Throws:
      NoSuchMethodException - Strange, that methods exists..
      LibraryException - Caused when someone manually call this method.