Interface CommandHandlerWrappedSender

All Superinterfaces:
CommandHandler
All Known Implementing Classes:
CollectionCommandHandler, HelpCommandHandler

public interface CommandHandlerWrappedSender extends CommandHandler
A CommandHandler handles the execution of a command that supports CommandSenderWrapper.

An alternative to CommandHandler that allows the usage of CommandSenderWrapper. With this, you may permit e.g. players from remote server using this command.

  • Method Details

    • onFire

      void onFire(CommandSenderWrapper sender, String fullUsage, String[] args)
      Gets called whenever someone executes the command
      Parameters:
      sender - The person who executed the command
      fullUsage - The full usage, including the label and everything
      args - Passed arguments to this command
    • onFire

      default void onFire(CommandSender sender, String fullUsage, String[] args)
      Description copied from interface: CommandHandler
      Gets called whenever someone executes the command
      Specified by:
      onFire in interface CommandHandler
      Parameters:
      sender - The person who executed the command
      fullUsage - The full usage, including the label and everything
      args - Passed arguments to this command
    • onAutocomplete

      @Nullable @Nullable List<String> onAutocomplete(CommandSenderWrapper sender, String[] args)
      Gets called whenever someone autocompletes (presses tab) on the command
      Parameters:
      sender - The person who did the autocomplete
      args - The given arguments
      Returns:
      What shall be shown to the player as options. Returning null will display all players
    • onAutocomplete

      default List<String> onAutocomplete(CommandSender sender, String[] args)
      Description copied from interface: CommandHandler
      Gets called whenever someone autocompletes (presses tab) on the command
      Specified by:
      onAutocomplete in interface CommandHandler
      Parameters:
      sender - The person who did the autocomplete
      args - The given arguments
      Returns:
      What shall be shown to the player as options. Returning null will display all players
    • getContentAmount

      @Nullable default @Nullable Integer getContentAmount(CommandSenderWrapper sender)
      A command may display an amount as an additional info in /bw [...] help

      It's optional. It's not required to override it. Keep in mind that SubCommand.setHasContentAmount(boolean) must be set to true for it to be actually shown

      Parameters:
      sender - The sender to which this amount shall be shown
      Returns:
      The amount of entries this (list) command has. null if it shouldn't be shown in this event
    • getContentAmount

      @Nullable default @Nullable Integer getContentAmount(CommandSender sender)
      Description copied from interface: CommandHandler
      A command may display an amount as an additional info in /bw [...] help

      It's optional. It's not required to override it. Keep in mind that SubCommand.setHasContentAmount(boolean) must be set to true for it to be actually shown

      Specified by:
      getContentAmount in interface CommandHandler
      Parameters:
      sender - The sender to which this amount shall be shown
      Returns:
      The amount of entries this (list) command has. null if it shouldn't be shown in this event