Package me.efekos.simpler.commands
Class SubCommand
java.lang.Object
org.bukkit.command.Command
me.efekos.simpler.commands.BaseCommand
me.efekos.simpler.commands.SubCommand
Used to make sub commands for
CoreCommand
s. Extend this class to make your own sub commands. Must be annotated with Command
to work properly.-
Field Summary
Fields inherited from class org.bukkit.command.Command
description, timings, usageMessage
-
Constructor Summary
ConstructorDescriptionSubCommand
(@NotNull String name) Creates an instance of this command.SubCommand
(@NotNull String name, @NotNull String description, @NotNull String usageMessage, @NotNull List<String> aliases) Creates an instance of this command. -
Method Summary
Modifier and TypeMethodDescriptionabstract Class<? extends CoreCommand>
Returns the parent of thisSubCommand
.@NotNull String
getUsage()
Generates a usage using theBaseCommand.getSyntax()
.Methods inherited from class me.efekos.simpler.commands.BaseCommand
execute, getDescription, getName, getPermission, getSyntax, hasPermission, isPlayerOnly, onConsoleUse, onPlayerUse, tabComplete, tabComplete
Methods inherited from class org.bukkit.command.Command
broadcastCommandMessage, broadcastCommandMessage, getAliases, getLabel, getPermissionMessage, isRegistered, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, testPermission, testPermissionSilent, toString, unregister
-
Constructor Details
-
SubCommand
Creates an instance of this command.- Parameters:
name
- Name of the command.
-
SubCommand
public SubCommand(@NotNull @NotNull String name, @NotNull @NotNull String description, @NotNull @NotNull String usageMessage, @NotNull @NotNull List<String> aliases) Creates an instance of this command.- Parameters:
name
- Name of the command.description
- Description of the command.usageMessage
- Usage message of the command.aliases
- Aliases for the command.
-
-
Method Details
-
getParent
Returns the parent of thisSubCommand
.- Returns:
- Class of the
CoreCommand
that thisSubCommand
should belong to.
-
getUsage
Generates a usage using theBaseCommand.getSyntax()
.- Overrides:
getUsage
in classBaseCommand
- Returns:
- Usage syntax of this command in
String
.
-