From f01c3e3dfd11cce73c890e4478691d84512e6161 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 5 Aug 2024 23:01:26 +1000 Subject: meta: fix /ahs command only taking 1 arg (#1290) * fix /ahs command only taking 1 arg * also fix it for /recipe and /bzs --- .../moulberry/notenoughupdates/commands/misc/SearchCommand.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SearchCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SearchCommand.kt index 7e72ebfb..ea1f8e54 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SearchCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/SearchCommand.kt @@ -19,7 +19,6 @@ package io.github.moulberry.notenoughupdates.commands.misc -import com.mojang.brigadier.arguments.StringArgumentType import io.github.moulberry.notenoughupdates.NotEnoughUpdates import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent @@ -38,7 +37,7 @@ class SearchCommand { @SubscribeEvent fun onCommands(event: RegisterBrigadierCommandEvent) { event.command("bzs") { - thenArgumentExecute("search", StringArgumentType.string()) { search -> + thenArgumentExecute("search", RestArgumentType) { search -> NotEnoughUpdates.INSTANCE.sendChatMessage("/bz ${this[search]}") }.withHelp("Search directly without opening the GUI") thenExecute { @@ -46,7 +45,7 @@ class SearchCommand { } }.withHelp("Search the bazaar directly with a custom search GUI") event.command("ahs") { - thenArgumentExecute("search", StringArgumentType.string()) { search -> + thenArgumentExecute("search", RestArgumentType) { search -> NotEnoughUpdates.INSTANCE.sendChatMessage("/ahs ${this[search]}") }.withHelp("Search directly without opening the GUI") thenExecute { @@ -72,7 +71,7 @@ class SearchCommand { } } event.command("recipe") { - thenArgumentExecute("search", StringArgumentType.string()) { search -> + thenArgumentExecute("search", RestArgumentType) { search -> NotEnoughUpdates.INSTANCE.sendChatMessage("/recipe ${this[search]}") } thenExecute { -> -- cgit