Interface CommandsCollection

All Superinterfaces:
SubCommand

public interface CommandsCollection extends SubCommand
A collection of sub commands
The default handler is the HelpCommandHandler
It'll display all commands, similar to /bw and /bw arena
  • Method Details

    • getCommands

      Collection<SubCommand> getCommands()
      Returns the command that have been already added to this collection
      Returns:
      The added commands
    • addCommand

      @Nullable @Nullable SubCommand addCommand(String name)
      Add a command to this collection
      Parameters:
      name - The name of the command
      Returns:
      true if it hasn't already been added
    • addCommandsCollection

      @Nullable @Nullable CommandsCollection addCommandsCollection(String name)
      Adds a new collection to this collection
      Parameters:
      name - The name of the collection
      Returns:
      true if it hasn't already been added
    • removeCommand

      boolean removeCommand(SubCommand command)
      Removes the command from the collection
      Parameters:
      command - The command that shall be removed
      Returns:
      false if its not not in the collection
    • getCommand

      @Nullable @Nullable SubCommand getCommand(String name, boolean deep)
      Returns the sub command that has a name equal to the given name parameter

      May also look for aliases when deep is set to true, but names still have a higher priority

      Parameters:
      name - The name that with which we want to look up
      deep - Whether or not it should match the aliases
      Returns:
      The sub command with that name (or alias)
    • getCommand

      @Nullable default @Nullable SubCommand getCommand(String name)
      Returns the sub command that has that name or an alias with that name
      Parameters:
      name - The name that with which we want to look up
      Returns:
      The sub command with that name or alias
    • getHelpCommand

      CommandHandler getHelpCommand()
      Returns the command that will be executed when the player only executes the command on this collection level and not deeper

      The command must not implement HelpCommandHandler

      Returns:
      The command that will be executed when no parameter is given
    • setHelpCommand

      void setHelpCommand(CommandHandler cmd)
      Set the command that shall be executed when the player only executes the command on this collection level and not deeper

      The command must not implement HelpCommandHandler

      Parameters:
      cmd - The new command that will be executed when no parameter is given