diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-06-07 13:36:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 13:36:40 +0200 |
commit | 5641066f42fef8f48eceb4cb39680a03f0b3a4db (patch) | |
tree | a5753e6324c32aefd00a166ddec67b62ce043471 | |
parent | 334ef4c0c49d48e649209676a69f0dacf81b112f (diff) | |
download | skyhanni-5641066f42fef8f48eceb4cb39680a03f0b3a4db.tar.gz skyhanni-5641066f42fef8f48eceb4cb39680a03f0b3a4db.tar.bz2 skyhanni-5641066f42fef8f48eceb4cb39680a03f0b3a4db.zip |
Backend/Fix : "Removed" HypixelCommands.getFromSack (#1999)
Co-authored-by: Cal <cwolfson58@gmail.com>
4 files changed, 23 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 15c52b009..7f69e7318 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -60,7 +60,7 @@ object GetFromSackAPI { text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.itemName}§e from sacks!", ) = ChatUtils.clickableChat(text, onClick = { - HypixelCommands.getFromSacks(item.internalName.asString(), item.amount) + getFromSack(item) }) fun getFromSlotClickedSackItems(items: List<PrimitiveItemStack>, slotIndex: Int) = addToInventory(items, slotIndex) @@ -91,7 +91,8 @@ object GetFromSackAPI { if (!LorenzUtils.inSkyBlock) return if (queue.isNotEmpty() && lastTimeOfCommand.passedSince() >= minimumDelay) { val item = queue.poll() - HypixelCommands.getFromSacks(item.internalName.asString().replace('-', ':'), item.amount) + // TODO find a better workaround + ChatUtils.sendMessageToServer("/gfs ${item.internalName.asString().replace('-', ':')} ${item.amount}") lastTimeOfCommand = ChatUtils.getTimeWhenNewlyQueuedMessageGetsExecuted() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt index d495972b0..662c36604 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt @@ -1,13 +1,13 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.GetFromSackAPI import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacks import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -42,16 +42,17 @@ object DungeonArchitectFeatures { } } + private val architectsFirstDraft = "ARCHITECT_FIRST_DRAFT".asInternalName().makePrimitiveStack() + private fun generateMessage(name: String, event: LorenzChatEvent) { val architectItemAmount = architectsFirstDraftItem.getAmountInSacks() if (architectItemAmount <= 0) return - ChatUtils.clickableChat( - "§c§lPUZZLE FAILED! §r§b$name §r§efailed a puzzle. \n" + - "§eClick here to get §5Architect's First Draft §7(§e${architectItemAmount}x left§7)", - { HypixelCommands.getFromSacks("ARCHITECT_FIRST_DRAFT", 1) }, - prefix = false + GetFromSackAPI.getFromChatMessageSackItems( + architectsFirstDraft, "§c§lPUZZLE FAILED! §r§b$name §r§efailed a puzzle. \n" + + "§eClick here to get §5Architect's First Draft §7(§e${architectItemAmount}x left§7)" ) + LorenzUtils.sendTitle("§c§lPUZZLE FAILED!", 3.seconds) event.blockedReason = "puzzle_fail" } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt index 2e8399065..0ada23ab4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt @@ -1,14 +1,15 @@ package at.hannibal2.skyhanni.features.nether import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.GetFromSackAPI import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack import at.hannibal2.skyhanni.utils.RegexUtils.matchMatchers import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -37,9 +38,11 @@ object PabloHelper { if (InventoryUtils.countItemsInLowerInventory { it.name.contains(itemName) } > 0) return - ChatUtils.clickableChat("Click here to grab an $itemName from sacks!", onClick = { - HypixelCommands.getFromSacks(itemName, 1) - }) + GetFromSackAPI.getFromChatMessageSackItems( + itemName.asInternalName().makePrimitiveStack(), + "Click here to grab an $itemName from sacks!" + ) + lastSentMessage = SimpleTimeMark.now() } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt b/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt index 3ae6548e9..156d4806b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt @@ -1,5 +1,8 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.api.GetFromSackAPI +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName + object HypixelCommands { fun skyblock() { send("skyblock") @@ -50,7 +53,7 @@ object HypixelCommands { } fun getFromSacks(itemName: String, amount: Int) { - send("gfs $itemName $amount") + GetFromSackAPI.getFromSack(itemName.asInternalName(), amount) } fun widget() { |