mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-11 18:02:08 +01:00
feat: register multiple commands (#2394)
This commit is contained in:
parent
e257d4b4b2
commit
9fbff439e7
@ -60,6 +60,18 @@ public final class CommandManager {
|
||||
invalidateGraphCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register multiple {@link Command}s.
|
||||
*
|
||||
* @param commands the array of commands
|
||||
* @throws IllegalStateException if a command with the same name already exists
|
||||
*/
|
||||
public synchronized void register(@NotNull Command... commands) {
|
||||
for (Command command : commands) {
|
||||
register(command);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a command from the currently registered commands.
|
||||
* Does nothing if the command was not registered before
|
||||
|
Loading…
Reference in New Issue
Block a user