From 5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4 Mon Sep 17 00:00:00 2001 From: nea Date: Mon, 6 Feb 2023 23:26:25 +0100 Subject: properly follow redirects and no more syntax error --- .../moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt | 1 - .../github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt b/src/main/java/io/github/moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt index abe13be0..668c412a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt @@ -72,7 +72,6 @@ class NEUBrigadierHook( try { brigadierRoot.dispatcher.execute(results) } catch (syntax: CommandSyntaxException) { - sender.addChatMessage(ChatComponentText("${YELLOW}[NEU] $RED${syntax.message}")) brigadierRoot.getAllUsages("/$commandName", commandNode, mutableSetOf()).forEach { sender.addChatMessage(ChatComponentText("${YELLOW}[NEU] ${it.path} - ${it.help}")) } diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt index 8035c77e..66008044 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt @@ -62,7 +62,7 @@ object BrigadierRoot { visited.add(node) val redirect = node.redirect if (redirect != null) { - yieldAll(getAllUsages(path, node, visited)) + yieldAll(getAllUsages(path, node.redirect, visited)) visited.remove(node) return@sequence } -- cgit