style(CommandManager): Consistency with other managers style

This commit is contained in:
xgraza
2026-01-26 13:50:02 -06:00
parent 56c4a82b54
commit 2fce98f01c
2 changed files with 12 additions and 12 deletions
@@ -32,12 +32,12 @@ public class CommandManager extends Feature implements Jsonable {
}
public void init() {
registerExecutor(new BindCommand());
registerExecutor(new DrawnCommand());
registerExecutor(new FriendCommand());
registerExecutor(new HelpCommand());
registerExecutor(new PrefixCommand());
registerExecutor(new ToggleCommand());
register(new BindCommand());
register(new DrawnCommand());
register(new FriendCommand());
register(new HelpCommand());
register(new PrefixCommand());
register(new ToggleCommand());
LOGGER.info("Registered {} commands", commandList.size());
OyVey.configManager.addConfig(this);
@@ -58,12 +58,12 @@ public class CommandManager extends Feature implements Jsonable {
}
}
public void registerExecutor(Command executor) {
commandList.add(executor);
for (String alias : executor.getAliases()) {
commandAliasMap.put(alias, executor);
public void register(Command command) {
commandList.add(command);
for (String alias : command.getAliases()) {
commandAliasMap.put(alias, command);
LiteralArgumentBuilder<CommandManager> builder = Command.literal(alias);
executor.createArgumentBuilder(builder);
command.createArgumentBuilder(builder);
dispatcher.register(builder);
}
}
@@ -56,7 +56,7 @@ public class ModuleManager implements Jsonable, Util {
// Create a command for each module for modules to be configurable via command line
for (Module module : modules) {
OyVey.commandManager.registerExecutor(new ModuleCommand(module));
OyVey.commandManager.register(new ModuleCommand(module));
}
OyVey.configManager.addConfig(this);