summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config/commands')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index b8a0f2c54..b4a2c336e 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.data.GuiEditManager
import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.data.SackAPI
import at.hannibal2.skyhanni.data.TitleManager
+import at.hannibal2.skyhanni.data.bazaar.HypixelBazaarFetcher
import at.hannibal2.skyhanni.features.bingo.card.BingoCardDisplay
import at.hannibal2.skyhanni.features.bingo.card.nextstephelper.BingoNextStepHelper
import at.hannibal2.skyhanni.features.chat.Translator
@@ -380,6 +381,10 @@ object Commands {
"shupdate",
"Updates the mod to the specified update stream."
) { forceUpdate(it) }
+ registerCommand(
+ "shUpdateBazaarPrices",
+ "Forcefully updating the bazaar prices right now."
+ ) { HypixelBazaarFetcher.fetchNow() }
}
private fun developersDebugFeatures() {
@@ -623,8 +628,9 @@ object Commands {
}
}
- private fun registerCommand(name: String, description: String, function: (Array<String>) -> Unit) {
- if (commands.any { it.name.equals(name, ignoreCase = true) }) {
+ private fun registerCommand(rawName: String, description: String, function: (Array<String>) -> Unit) {
+ val name = rawName.lowercase()
+ if (commands.any { it.name == name }) {
error("The command '$name is already registered!'")
}
ClientCommandHandler.instance.registerCommand(SimpleCommand(name, createCommand(function)))