|
7 | 7 |
|
8 | 8 | @NullMarked |
9 | 9 | public interface CommandRegistry { |
| 10 | + /** |
| 11 | + * Retrieves the set of commands that are currently hidden from visibility. |
| 12 | + * <p> |
| 13 | + * Hidden commands are still accessible and executable but are not displayed |
| 14 | + * in suggestions or tab completions under normal conditions. |
| 15 | + * |
| 16 | + * @return an unmodifiable set of strings representing the commands that are currently hidden |
| 17 | + */ |
10 | 18 | @Unmodifiable |
11 | 19 | Set<String> hiddenCommands(); |
12 | 20 |
|
| 21 | + /** |
| 22 | + * Retrieves the set of commands that are currently unregistered in the system. |
| 23 | + * |
| 24 | + * @return an unmodifiable set of strings representing the commands that are unregistered |
| 25 | + */ |
13 | 26 | @Unmodifiable |
14 | 27 | Set<String> unregisteredCommands(); |
15 | 28 |
|
| 29 | + /** |
| 30 | + * Hides the specified command. |
| 31 | + * <p> |
| 32 | + * Hidden commands can be accessed as normal but are not shown during tab completion. |
| 33 | + * They remain visible to users who possess the appropriate bypass permission. |
| 34 | + * |
| 35 | + * @param command the name of the command to hide |
| 36 | + * @return true if the command was hidden, false if the command was already hidden or doesn't exist |
| 37 | + */ |
16 | 38 | boolean hide(String command); |
17 | 39 |
|
| 40 | + /** |
| 41 | + * Determines if the specified command is currently hidden. |
| 42 | + * |
| 43 | + * @param command the name of the command to check |
| 44 | + * @return true if the command is hidden, false otherwise |
| 45 | + */ |
18 | 46 | boolean isHidden(String command); |
19 | 47 |
|
| 48 | + /** |
| 49 | + * Checks if the specified command is currently unregistered. |
| 50 | + * |
| 51 | + * @param command the name of the command to check |
| 52 | + * @return true if the command is unregistered, false otherwise |
| 53 | + */ |
20 | 54 | boolean isUnregistered(String command); |
21 | 55 |
|
| 56 | + /** |
| 57 | + * Registers the specified command with the command registry. |
| 58 | + * <p> |
| 59 | + * This method attempts to add the given command back into the system's registry, |
| 60 | + * making it available for usage if it was previously unregistered. |
| 61 | + * |
| 62 | + * @param command the name of the command to register |
| 63 | + * @return true if the command was successfully registered, |
| 64 | + * false if the command was already registered or failed to register |
| 65 | + */ |
22 | 66 | boolean register(String command); |
23 | 67 |
|
| 68 | + /** |
| 69 | + * Reveals the specified command. |
| 70 | + * <p> |
| 71 | + * This method makes a previously hidden command visible again for suggestions and tab completions. |
| 72 | + * |
| 73 | + * @param command the name of the command to reveal |
| 74 | + * @return true if the command was successfully revealed, |
| 75 | + * false if the command was already visible or does not exist |
| 76 | + */ |
24 | 77 | boolean reveal(String command); |
25 | 78 |
|
| 79 | + /** |
| 80 | + * Unregisters the specified command from the command registry. |
| 81 | + * This method removes the command, making it unavailable for usage. |
| 82 | + * |
| 83 | + * @param command the name of the command to unregister |
| 84 | + * @return true if the command was successfully unregistered, |
| 85 | + * false if the command was already unregistered or does not exist |
| 86 | + */ |
26 | 87 | boolean unregister(String command); |
27 | 88 |
|
| 89 | + /** |
| 90 | + * Unregisters all currently registered commands in the command registry. |
| 91 | + * <p> |
| 92 | + * This method removes all commands from the registry, making them unavailable for execution |
| 93 | + * and preventing them from appearing in any suggestions or tab completions. |
| 94 | + * It is typically used during plugin lifecycle events to reset or clear the command state. |
| 95 | + */ |
28 | 96 | void unregisterCommands(); |
29 | 97 | } |
0 commit comments