Enforce at least one parameter in CommandManager#register()

The old register method has been deprecated.
This commit is contained in:
Andrew Steinborn
2019-06-22 21:13:20 -04:00
parent ed8209cfd1
commit 81840abc86
3 changed files with 32 additions and 11 deletions

View File

@@ -10,9 +10,22 @@ public interface CommandManager {
*
* @param command the command to register
* @param aliases the alias to use
*
* @deprecated This method requires at least one alias, but this is only enforced at runtime.
* Prefer {@link #register(String, Command, String...)} instead.
*/
@Deprecated
void register(Command command, String... aliases);
/**
* Registers the specified command with the manager with the specified aliases.
*
* @param alias the first alias to register
* @param command the command to register
* @param otherAliases the other aliases to use
*/
void register(String alias, Command command, String... otherAliases);
/**
* Unregisters a command.
*