Correct command meta alias removal behavior and add appropriate unit tests.

Apparently @hugmanrique caught the issue but suggested the wrong fix. This is the correct fix, and respects the Javadoc.
This commit is contained in:
Andrew Steinborn
2021-10-31 19:05:21 -04:00
parent 895eb1a424
commit 0b0c36dcfc
3 changed files with 62 additions and 4 deletions

View File

@@ -75,6 +75,13 @@ public interface CommandManager {
*/
void unregister(String alias);
/**
* Unregisters the specified command from the manager, if registered.
*
* @param meta the command to unregister
*/
void unregister(CommandMeta meta);
/**
* Retrieves the {@link CommandMeta} from the specified command alias, if registered.
* @param alias the command alias to lookup