Class SubCommand
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.commands.SubCommand
- Direct Known Subclasses:
DebugCommand
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 Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
SubCommand
(Slimefun plugin, SlimefunCommand cmd, String name, boolean hidden) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getDescription
(CommandSender sender) This returns a description for thisSubCommand
.final String
getName()
This returns the name of thisSubCommand
, the name is equivalent to the first argument given to the actual command.final boolean
isHidden()
This method returns whether thisSubCommand
is hidden from theHelpCommand
.abstract void
onExecute
(CommandSender sender, String[] args) protected void
recordUsage
(Map<SubCommand, Integer> commandUsage)
-
Field Details
-
plugin
-
cmd
-
-
Constructor Details
-
SubCommand
@ParametersAreNonnullByDefault protected SubCommand(Slimefun plugin, SlimefunCommand cmd, String name, boolean hidden)
-
-
Method Details
-
getName
This returns the name of thisSubCommand
, 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 thisSubCommand
is hidden from theHelpCommand
.- Returns:
- Whether to hide this
SubCommand
-
recordUsage
-
onExecute
-
getDescription
-
getDescription
This returns a description for thisSubCommand
. If the givenCommandSender
is aPlayer
, the description will be localized with the currently selectedLanguage
of thatPlayer
.- Parameters:
sender
- TheCommandSender
who requested the description- Returns:
- A possibly localized description of this
SubCommand
-