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 SubCommand
addCommand
(String name) Add a command to this collection@Nullable CommandsCollection
addCommandsCollection
(String name) Adds a new collection to this collectiondefault @Nullable SubCommand
getCommand
(String name) Returns the sub command that has that name or an alias with that name@Nullable SubCommand
getCommand
(String name, boolean deep) Returns the sub command that has a name equal to the givenname
parameterReturns 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 deeperboolean
removeCommand
(SubCommand command) Removes the command from the collectionvoid
Set 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:
true
if it hasn't already been added
-
addCommandsCollection
Adds a new collection to this collection- Parameters:
name
- The name of the collection- Returns:
true
if it hasn't already been added
-
removeCommand
Removes the command from the collection- Parameters:
command
- The command that shall be removed- Returns:
false
if its not not in the collection
-
getCommand
Returns the sub command that has a name equal to the givenname
parameterMay also look for aliases when
deep
is 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
-