aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-02-06 23:26:25 +0100
committernea <nea@nea.moe>2023-02-06 23:26:25 +0100
commit5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4 (patch)
tree86076f6f901fd447ceccd8e0cda0f022ec2878e8
parent8d2e0c985334fc90a1da1a1a8a5693da61c1e1de (diff)
downloadNotEnoughUpdates-5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4.tar.gz
NotEnoughUpdates-5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4.tar.bz2
NotEnoughUpdates-5ed0ab3b6d9af0d621e72fcff88c6fe6cd260cf4.zip
properly follow redirects and no more syntax error
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/brigadier/NEUBrigadierHook.kt1
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/util/brigadier/BrigadierRoot.kt2
2 files changed, 1 insertions, 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
}