From eedbc14e24abb7536d4e69eb09e54794527403e1 Mon Sep 17 00:00:00 2001 From: huanmeng-qwq Date: Mon, 19 Aug 2024 11:02:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96litecommands=E7=9A=84?= =?UTF-8?q?=E5=88=AB=E5=90=8D=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/litecommands/KookLitePlatform.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/snw/kookbc/impl/command/litecommands/KookLitePlatform.java b/src/main/java/snw/kookbc/impl/command/litecommands/KookLitePlatform.java index 4c50b1b1..f3c41551 100644 --- a/src/main/java/snw/kookbc/impl/command/litecommands/KookLitePlatform.java +++ b/src/main/java/snw/kookbc/impl/command/litecommands/KookLitePlatform.java @@ -52,15 +52,16 @@ protected KookLitePlatform(@NotNull LiteKookSettings settings, Plugin plugin, Co @Override protected void hook(CommandRoute commandRoute, PlatformInvocationListener platformInvocationListener, PlatformSuggestionListener platformSuggestionListener) { - for (String label : commandRoute.names()) { - List desc = commandRoute.meta().get(Meta.DESCRIPTION); - Set prefixes = commandRoute.meta().get(PREFIX); - // List perms = commandRoute.meta().get(Meta.PERMISSIONS); - JKookCommand command = new JKookCommand(label, prefixes) - .setDescription(String.join("\n", desc)) - .setExecutor(new LiteKookCommandExecutor(plugin.getCore(), settings, commandRoute, label, platformInvocationListener, platformSuggestionListener)); - commandMap.register(plugin, command); + List desc = commandRoute.meta().get(Meta.DESCRIPTION); + Set prefixes = commandRoute.meta().get(PREFIX); + // List perms = commandRoute.meta().get(Meta.PERMISSIONS); + JKookCommand command = new JKookCommand(commandRoute.getName(), prefixes) + .setDescription(String.join("\n", desc)) + .setExecutor(new LiteKookCommandExecutor(plugin.getCore(), settings, commandRoute, commandRoute.getName(), platformInvocationListener, platformSuggestionListener)); + for (String alias : commandRoute.getAliases()) { + command.addAlias(alias); } + commandMap.register(plugin, command); } @Override