diff options
author | Obsidian <108832807+Obsidianninja11@users.noreply.github.com> | 2024-05-01 00:45:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 10:45:15 +0200 |
commit | b7bba09e48f61b4eb10ecfe6334391b373fd4867 (patch) | |
tree | 50aeb8e4101694ccda878019e7ee525194f27269 | |
parent | e096447a212484b269626cd42ab09356b76717d3 (diff) | |
download | skyhanni-b7bba09e48f61b4eb10ecfe6334391b373fd4867.tar.gz skyhanni-b7bba09e48f61b4eb10ecfe6334391b373fd4867.tar.bz2 skyhanni-b7bba09e48f61b4eb10ecfe6334391b373fd4867.zip |
Fix: Composter GfS Messages (#1398)
3 files changed, 20 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 c3d04076a..5eeb1b6ef 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.data.ChatManager import at.hannibal2.skyhanni.data.GardenCropMilestonesCommunityFix 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.features.bingo.card.BingoCardDisplay import at.hannibal2.skyhanni.features.bingo.card.nextstephelper.BingoNextStepHelper @@ -398,6 +399,10 @@ object Commands { "shtestburrow", "Sets a test burrow waypoint at your location" ) { GriffinBurrowHelper.setTestBurrow(it) } + registerCommand( + "shtestsackapi", + "Get the amount of an item in sacks according to internal feature SackAPI" + ) { SackAPI.testSackAPI(it) } } private fun developersCodingHelp() { diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index 1193cae1c..d9b86c615 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.events.SackDataUpdateEvent import at.hannibal2.skyhanni.features.fishing.FishingAPI import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity import at.hannibal2.skyhanni.features.inventory.SackDisplay +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -379,6 +380,17 @@ object SackAPI { fetchSackItem(this).takeIf { it.statusIsCorrectOrAlright() }?.amount fun NEUInternalName.getAmountInSacks(): Int = getAmountInSacksOrNull() ?: 0 + + fun testSackAPI (args: Array<String>) { + if (args.size == 1) { + if (sackListInternalNames.contains(args[0].uppercase())) { + ChatUtils.chat("Sack data for ${args[0]}: ${fetchSackItem(args[0].asInternalName())}") + } else { + ChatUtils.userError("That item isn't a valid sack item.") + } + } + else ChatUtils.userError("/shtestsackapi <internal name>") + } } data class SackItem( diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 6516d9a2e..f19288a97 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -517,11 +517,12 @@ object ComposterOverlay { } HypixelCommands.getFromSacks(internalName.asString(), itemsNeeded - havingInInventory) - if (itemsNeeded > havingInInventory - havingInSacks) { + val havingInTotal = havingInInventory + havingInSacks + if (itemsNeeded >= havingInTotal) { if (LorenzUtils.noTradeMode) { ChatUtils.chat("You're out of $itemName §ein your sacks!") } else { - ChatUtils.clickableChat( + ChatUtils.clickableChat( // TODO Add this as a separate feature, and then don't send any msg if the feature is disabled "You're out of $itemName §ein your sacks! Click here to buy more on the Bazaar!", onClick = { HypixelCommands.bazaar(itemName.removeColor()) |