Package de.marcely.bedwars.api.command
Interface CommandsCollection
- All Superinterfaces:
SubCommand
A collection of sub commands
The default handler is the HelpCommandHandler
It'll display all commands, similar to /bw and /bw arena
The default handler is the HelpCommandHandler
It'll display all commands, similar to /bw and /bw arena
-
Method Summary
Modifier and TypeMethodDescription@Nullable SubCommandaddCommand(String name) Add a command to this collection@Nullable CommandsCollectionaddCommandsCollection(String name) Adds a new collection to this collectiondefault @Nullable SubCommandgetCommand(String name) Returns the sub command that has that name or an alias with that name@Nullable SubCommandgetCommand(String name, boolean deep) Returns the sub command that has a name equal to the givennameparameterReturns the command that have been already added to this collectionReturns the command that will be executed when the player only executes the command on this collection level and not deeperbooleanremoveCommand(SubCommand command) Removes the command from the collectionvoidSet the command that shall be executed when the player only executes the command on this collection level and not deeperMethods inherited from interface de.marcely.bedwars.api.command.SubCommand
getAliases, getFullName, getHandler, getName, getParent, getPermission, getUsage, getUsage, hasContentAmount, isOnlyForPlayers, isVisible, setAliases, setHandler, setHasContentAmount, setOnlyForPlayers, setPermission, setUsage, setVisible
-
Method Details
-
getCommands
Collection<SubCommand> getCommands()Returns the command that have been already added to this collection- Returns:
- The added commands
-
addCommand
Add a command to this collection- Parameters:
name- The name of the command- Returns:
trueif it hasn't already been added
-
addCommandsCollection
Adds a new collection to this collection- Parameters:
name- The name of the collection- Returns:
trueif it hasn't already been added
-
removeCommand
Removes the command from the collection- Parameters:
command- The command that shall be removed- Returns:
falseif its not not in the collection
-
getCommand
Returns the sub command that has a name equal to the givennameparameterMay also look for aliases when
deepis set to true, but names still have a higher priority- Parameters:
name- The name that with which we want to look updeep- Whether or not it should match the aliases- Returns:
- The sub command with that name (or alias)
-
getCommand
Returns the sub command that has that name or an alias with that name- Parameters:
name- The name that with which we want to look up- Returns:
- The sub command with that name or alias
-
getHelpCommand
CommandHandler getHelpCommand()Returns the command that will be executed when the player only executes the command on this collection level and not deeperThe command must not implement
HelpCommandHandler- Returns:
- The command that will be executed when no parameter is given
-
setHelpCommand
Set the command that shall be executed when the player only executes the command on this collection level and not deeperThe command must not implement
HelpCommandHandler- Parameters:
cmd- The new command that will be executed when no parameter is given
-