Interface SimpleCommandImpl<C extends CommandSource<?,?>>

Type Parameters:
C - the type of the source implementing CommandSource, representing the context in which the command is executed
All Known Implementing Classes:
SimpleCommand

public interface SimpleCommandImpl<C extends CommandSource<?,?>>
Represents a command implementation designed to be executed by or for a specific source type.

Commands implementing this interface can be executed, provide suggestions for input, and verify permissions based on the context of the source.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(C source)
    Executes the command for the provided source.
    boolean
    hasPermission(C source)
    Checks if the given source has the required permissions to execute a command or perform an action.
    suggest(C source)
    Provides a list of suggestions based on the given source context.
  • Method Details

    • execute

      void execute(C source)
      Executes the command for the provided source.
      Parameters:
      source - the source context in which the command is executed, must not be null
    • suggest

      List<String> suggest(C source)
      Provides a list of suggestions based on the given source context.

      The suggestions are typically utilized for auto-completion or assistance purposes while interacting with commands associated with a specific source type.

      Parameters:
      source - the context of the source from which the suggestions are generated; must implement SimpleCommandImpl
      Returns:
      a list of suggested strings, or an empty list if no suggestions are available
    • hasPermission

      boolean hasPermission(C source)
      Checks if the given source has the required permissions to execute a command or perform an action.
      Parameters:
      source - the contextual source for which the permission check is being performed
      Returns:
      true if the source has the appropriate permissions, otherwise false