diff options
author | Appability <appable@icloud.com> | 2022-11-12 23:39:20 -0800 |
---|---|---|
committer | Appability <appable@icloud.com> | 2022-11-12 23:39:20 -0800 |
commit | 129cb8b04c7ae239ffd2546e8e48e19506b9f4d1 (patch) | |
tree | 1a8f09b58efd609d0a0de6ca0718ef4a31237d4b /src/main/kotlin/com/ambientaddons/commands | |
parent | 21a3f8f1ed7230655cfe2f1e93b8edb14a2a21d0 (diff) | |
download | AmbientAddons-129cb8b04c7ae239ffd2546e8e48e19506b9f4d1.tar.gz AmbientAddons-129cb8b04c7ae239ffd2546e8e48e19506b9f4d1.tar.bz2 AmbientAddons-129cb8b04c7ae239ffd2546e8e48e19506b9f4d1.zip |
clean up help/usage messages
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/commands')
3 files changed, 39 insertions, 18 deletions
diff --git a/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt b/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt index 3d62954..ca5631c 100644 --- a/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt +++ b/src/main/kotlin/com/ambientaddons/commands/AmbientCommand.kt @@ -3,6 +3,7 @@ package com.ambientaddons.commands import AmbientAddons import AmbientAddons.Companion.mc import com.ambientaddons.config.Config +import com.ambientaddons.utils.Chat import com.ambientaddons.utils.Extensions.withModPrefix import com.ambientaddons.utils.SBLocation import gg.essential.universal.UChat @@ -25,15 +26,13 @@ class AmbientCommand : CommandBase() { "buy" -> AutoBuyCommand.processCommand(args.drop(1)) "salvage" -> SalvageCommand.processCommand(args.drop(1)) else -> { - val chatWidth = mc.ingameGUI?.chatGUI?.chatWidth ?: return - val chatBreak = "§9§m" + "-".repeat(chatWidth / mc.fontRendererObj.getStringWidth("-")) UChat.chat(""" - $chatBreak + ${Chat.getChatBreak()} §b§lUsage: §a/ambient §eto access GUI settings. §a/ambient buy §eto edit autobuy list. §a/ambient salvage §eto configure salvage features. - $chatBreak + ${Chat.getChatBreak()} """.trimIndent()) } } diff --git a/src/main/kotlin/com/ambientaddons/commands/AutoBuyCommand.kt b/src/main/kotlin/com/ambientaddons/commands/AutoBuyCommand.kt index 538485c..1cead71 100644 --- a/src/main/kotlin/com/ambientaddons/commands/AutoBuyCommand.kt +++ b/src/main/kotlin/com/ambientaddons/commands/AutoBuyCommand.kt @@ -1,6 +1,7 @@ package com.ambientaddons.commands import AmbientAddons.Companion.persistentData +import com.ambientaddons.utils.Chat import com.ambientaddons.utils.Extensions.withModPrefix import gg.essential.universal.UChat @@ -33,10 +34,14 @@ object AutoBuyCommand { } } else -> { - UChat.chat("§2§lUsage".withModPrefix()) - UChat.chat(" §aAdd item: §b/ambient buy add <Skyblock ID> [max allowable price]") - UChat.chat(" §aRemove item: §b/ambient buy remove <Skyblock ID>") - UChat.chat(" §aList: §b/ambient buy list") + UChat.chat(""" + ${Chat.getChatBreak()} + §b§lUsage: + §a/ambient buy add <Skyblock ID> [max price] §eto add an item. + §a/ambient buy remove <Skyblock ID> §eto remove an item. + §a/ambient buy list §eto view current autobuy list + ${Chat.getChatBreak()} + """.trimIndent()) } } } diff --git a/src/main/kotlin/com/ambientaddons/commands/SalvageCommand.kt b/src/main/kotlin/com/ambientaddons/commands/SalvageCommand.kt index 0d11e79..d5390b4 100644 --- a/src/main/kotlin/com/ambientaddons/commands/SalvageCommand.kt +++ b/src/main/kotlin/com/ambientaddons/commands/SalvageCommand.kt @@ -1,6 +1,7 @@ package com.ambientaddons.commands import AmbientAddons.Companion.persistentData +import com.ambientaddons.utils.Chat import com.ambientaddons.utils.Extensions.withModPrefix import com.ambientaddons.utils.SalvageStrategy import gg.essential.universal.UChat @@ -20,27 +21,43 @@ object SalvageCommand { persistentData.save() UChat.chat((if (allowed) "§aAllowing item §a§l${item}." else "§cItem already allowed.").withModPrefix()) } + "block" -> { + val item = args[1] + val blocked = persistentData.salvageMap.put(item, SalvageStrategy.Block) != SalvageStrategy.Block + persistentData.save() + UChat.chat((if (blocked) "§aBlocking item §a§l${item}." else "§cItem already blocked.").withModPrefix()) + } "remove" -> { val item = args[1] val removed = persistentData.salvageMap.remove(item) != null persistentData.save() - UChat.chat((if (removed) "§aRemoving item §a§l${item}." else "§cItem not in list.").withModPrefix()) + UChat.chat((if (removed) "§aRemoved item §a§l${item}." else "§cItem not in list.").withModPrefix()) } "list" -> { - UChat.chat("§2§lItems §7(§aalways salvage, §callow salvaging§7)".withModPrefix()) + UChat.chat("§2§lItems §7(§aalways salvage, §eallow salvaging, §cblock salvaging§7)".withModPrefix()) persistentData.salvageMap.forEach { - if (it.value == SalvageStrategy.Always) { - UChat.chat(" §a${it.key}") - } else { - UChat.chat(" §e${it.key}") + when (it.value) { + SalvageStrategy.Always -> UChat.chat(" §a${it.key}") + SalvageStrategy.Allow -> UChat.chat(" §e${it.key}") + else -> UChat.chat(" §c${it.key}") } } } else -> { - UChat.chat("§2§lUsage".withModPrefix()) - UChat.chat(" §aAlways salvage item: §b/ambient salvage auto <Skyblock ID>") - UChat.chat(" §aAllow salvaging item: §b/ambient salvage allow <Skyblock ID>") - UChat.chat(" §aBlock salvaging item: §b/ambient remove <Skyblock ID>") + UChat.chat(""" + ${Chat.getChatBreak()} + §b§lUsage: + §a/ambient salvage auto <Skyblock ID> §eto always salvage an item. + §a/ambient salvage allow <Skyblock ID> §eto allow salvaging an item. + §a/ambient salvage block <Skyblock ID> §eto block salvaging an item. + §a/ambient salvage remove <Skyblock ID> §eto remove an item. + §a/ambient salvage list §eto view current salvage list. + + §b§lNotes: + §eSome items are explicitly blocked due to past item quality bugs. + §eIf not blocked in list, this will salvage all dungeon mob drops unless starred. + ${Chat.getChatBreak()} + """.trimIndent()) } } } |