Class SubCommand
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.commands.SubCommand
- Direct Known Subclasses:
BanItemCommand,ClearDataCommand,DebugCommand,MigrateCommand,ReloadCommand,UnbanItemCommand
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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubCommand(Slimefun plugin, SlimefunCommand cmd, String name, boolean hidden) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetDescription(org.bukkit.command.CommandSender sender) This returns a description for thisSubCommand.final StringgetName()This returns the name of thisSubCommand, the name is equivalent to the first argument given to the actual command.final booleanisHidden()This method returns whether thisSubCommandis hidden from theHelpCommand.abstract voidprotected voidrecordUsage(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 thisSubCommandis hidden from theHelpCommand.- Returns:
- Whether to hide this
SubCommand
-
recordUsage
-
onExecute
public abstract void onExecute(@Nonnull org.bukkit.command.CommandSender sender, @Nonnull String[] args) -
getDescription
-
getDescription
This returns a description for thisSubCommand. If the givenCommandSenderis aPlayer, the description will be localized with the currently selectedLanguageof thatPlayer.- Parameters:
sender- TheCommandSenderwho requested the description- Returns:
- A possibly localized description of this
SubCommand
-