diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-03-22 18:07:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 18:07:51 +0100 |
commit | 81783f79897b59bb5273301428087a408f0a5337 (patch) | |
tree | c716dd73704a5fc17eabcb1bb36a55b9cd02604e /src/main/java/at/hannibal2/skyhanni/features/dungeon | |
parent | a8973b851ad4d3edb0e6c605eb7aea29c6e66938 (diff) | |
download | skyhanni-81783f79897b59bb5273301428087a408f0a5337.tar.gz skyhanni-81783f79897b59bb5273301428087a408f0a5337.tar.bz2 skyhanni-81783f79897b59bb5273301428087a408f0a5337.zip |
Backend: Shorter inventory and sack amount (#1231)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/dungeon')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt index 082175794..5584ee216 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage.DungeonStorage.DungeonRunInfo import at.hannibal2.skyhanni.data.ProfileStorageData -import at.hannibal2.skyhanni.data.SackAPI +import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacks import at.hannibal2.skyhanni.events.DungeonCompleteEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI.DungeonChest import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.InventoryUtils.getAmountInInventory import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor @@ -89,7 +90,9 @@ class CroesusChestTracker { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { if (!LorenzUtils.inSkyBlock) return - if ((SkyHanniMod.feature.dungeon.croesusUnopenedChestTracker || config.showUsedKismets) && croesusPattern.matches(event.inventoryName)) { + if ((SkyHanniMod.feature.dungeon.croesusUnopenedChestTracker || config.showUsedKismets) && + croesusPattern.matches(event.inventoryName) + ) { pageSetup(event) if (croesusEmpty) { @@ -238,9 +241,7 @@ class CroesusChestTracker { private fun getKismetUsed(runIndex: Int) = getRun0(runIndex)?.kismetUsed ?: false - private fun getKismetAmount() = - (SackAPI.fetchSackItem(kismetInternalName).takeIf { it.statusIsCorrectOrAlright() }?.amount - ?: 0) + InventoryUtils.getAmountOfItemInInventory(kismetInternalName) + private fun getKismetAmount() = kismetInternalName.getAmountInSacks() + kismetInternalName.getAmountInInventory() private fun croesusSlotMapToRun(slotId: Int) = when (slotId) { in 10..16 -> slotId - 10 // 0 - 6 |