Package studio.mevera.imperat
Interface CommandRegistrar<S extends CommandSource>
- All Known Subinterfaces:
Imperat<S>
- All Known Implementing Classes:
BaseImperat
-
Method Summary
Modifier and TypeMethodDescriptiongetCommand(String name) getCommand(Argument<S> parameter) Collection<? extends Command<S>>Gets all registered commandsgetSubCommand(String owningCommand, String name) voidregisterCommand(Class<?> command) Registers a command class built by the annotations using a parservoidregisterCommand(Object commandInstance) Registers a command instance built by the annotations using a parserdefault voidregisterCommands(Class<?>... commands) Registers some commands into the dispatcher annotations using a parserdefault voidregisterCommands(Object... commandInstances) Registers some command instances built by the annotations using a parserdefault voidregisterCommands(Command<S>... commands) Registers some commands into the dispatchervoidregisterSimpleCommand(Command<S> command) Registering a command into the global registry, it will check for ambiguity with other commands and their tree before registering, if an ambiguity is detected it will throw anAmbiguousCommandExceptionvoidUnregisters all commands from the internal registryvoidunregisterCommand(String name) Unregisters a command from the internal registry
-
Method Details
-
registerSimpleCommand
Registering a command into the global registry, it will check for ambiguity with other commands and their tree before registering, if an ambiguity is detected it will throw anAmbiguousCommandException- Parameters:
command- the command to register
-
registerCommands
Registers some commands into the dispatcher- Parameters:
commands- the commands to register
-
registerCommand
Registers a command class built by the annotations using a parser- Parameters:
command- the annotated command instance to parse
-
registerCommands
Registers some commands into the dispatcher annotations using a parser- Parameters:
commands- the commands to register
-
registerCommand
Registers a command instance built by the annotations using a parser- Parameters:
commandInstance- the annotated command instance to parse
-
registerCommands
Registers some command instances built by the annotations using a parser- Parameters:
commandInstances- the annotated command instances to parse
-
unregisterCommand
Unregisters a command from the internal registry- Parameters:
name- the name of the command to unregister
-
unregisterAllCommands
void unregisterAllCommands()Unregisters all commands from the internal registry -
getCommand
- Parameters:
name- the name/alias of the command- Returns:
- fetches
Commandwith specific name
-
getCommand
- Parameters:
parameter- the parameter- Returns:
- the command from the parameter's name
-
getSubCommand
- Parameters:
owningCommand- the command owning this sub-commandname- the name of the subcommand you're looking for- Returns:
- the subcommand of a command
-
getRegisteredCommands
Collection<? extends Command<S>> getRegisteredCommands()Gets all registered commands- Returns:
- the registered commands
-