java.lang.Object
io.github.thebusybiscuit.slimefun4.core.commands.SubCommand
Direct Known Subclasses:
DebugCommand

public abstract class SubCommand extends Object
This class represents a SubCommand, it is a Command that starts with /sf ... and is followed by the name of this SubCommand.
Author:
TheBusyBiscuit
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      @Nonnull public final String getName()
      This returns the name of this SubCommand, the name is equivalent to the first argument given to the actual command.
      Returns:
      The name of this SubCommand
    • isHidden

      public final boolean isHidden()
      This method returns whether this SubCommand is hidden from the HelpCommand.
      Returns:
      Whether to hide this SubCommand
    • recordUsage

      protected void recordUsage(@Nonnull Map<SubCommand,Integer> commandUsage)
    • onExecute

      public abstract void onExecute(@Nonnull CommandSender sender, @Nonnull String[] args)
    • getDescription

      @Nonnull protected String getDescription()
    • getDescription

      @Nonnull public String getDescription(@Nonnull CommandSender sender)
      This returns a description for this SubCommand. If the given CommandSender is a Player, the description will be localized with the currently selected Language of that Player.
      Parameters:
      sender - The CommandSender who requested the description
      Returns:
      A possibly localized description of this SubCommand