aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-04-24 11:00:06 +0200
committerGitHub <noreply@github.com>2024-04-24 11:00:06 +0200
commit9f7ef2b05adaf526300018bf8fb4f42ca081c483 (patch)
tree6335a960b4cb606cf2ee6067682cc76cd4b375d6 /src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
parentd4c635abdc2db495659b0a64b3e035cd5f0aa222 (diff)
downloadskyhanni-9f7ef2b05adaf526300018bf8fb4f42ca081c483.tar.gz
skyhanni-9f7ef2b05adaf526300018bf8fb4f42ca081c483.tar.bz2
skyhanni-9f7ef2b05adaf526300018bf8fb4f42ca081c483.zip
Backend: HypixelCommands (#1525)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
index ad5ea7b6e..d3034d003 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
@@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ChatUtils.isCommand
import at.hannibal2.skyhanni.utils.ChatUtils.senderIsSkyhanni
+import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
@@ -54,9 +55,11 @@ object GetFromSackAPI {
fun getFromChatMessageSackItems(
item: PrimitiveItemStack,
- text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.itemName}§e from sacks!"
+ text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.itemName}§e from sacks!",
) =
- ChatUtils.clickableChat(text, "${commands.first()} ${item.internalName.asString()} ${item.amount}")
+ ChatUtils.clickableChat(text, onClick = {
+ HypixelCommands.getFromSacks(item.internalName.asString(), item.amount)
+ })
fun getFromSlotClickedSackItems(items: List<PrimitiveItemStack>, slotIndex: Int) = addToInventory(items, slotIndex)
@@ -86,7 +89,7 @@ object GetFromSackAPI {
if (!LorenzUtils.inSkyBlock) return
if (queue.isNotEmpty() && lastTimeOfCommand.passedSince() >= minimumDelay) {
val item = queue.poll()
- ChatUtils.sendCommandToServer("gfs ${item.internalName.asString().replace('-', ':')} ${item.amount}")
+ HypixelCommands.getFromSacks(item.internalName.asString().replace('-', ':'), item.amount)
lastTimeOfCommand = ChatUtils.getTimeWhenNewlyQueuedMessageGetsExecuted()
}
}
@@ -158,7 +161,7 @@ object GetFromSackAPI {
private fun bazaarMessage(item: String, amount: Int, isRemaining: Boolean = false) = ChatUtils.clickableChat(
"§lCLICK §r§eto get the ${if (isRemaining) "remaining " else ""}§ax${amount} §9$item §efrom bazaar",
- "bz ${item.removeColor()}"
+ onClick = { HypixelCommands.bazaar(item.removeColor()) }
)
private fun commandValidator(args: List<String>): Pair<CommandResult, PrimitiveItemStack?> {