summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-22 18:07:51 +0100
committerGitHub <noreply@github.com>2024-03-22 18:07:51 +0100
commit81783f79897b59bb5273301428087a408f0a5337 (patch)
treec716dd73704a5fc17eabcb1bb36a55b9cd02604e /src/main/java/at/hannibal2/skyhanni/features/nether
parenta8973b851ad4d3edb0e6c605eb7aea29c6e66938 (diff)
downloadskyhanni-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/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
index b443997c1..580fdbc56 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
@@ -3,8 +3,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage
import at.hannibal2.skyhanni.data.IslandType
-import at.hannibal2.skyhanni.data.SackAPI
-import at.hannibal2.skyhanni.data.SackStatus
+import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacksOrNull
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
@@ -221,22 +220,14 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
}
val sacksText = if (quest is FetchQuest && quest.state != QuestState.COLLECTED) {
- val sackItem = SackAPI.fetchSackItem(quest.displayItem)
- val sackStatus = sackItem.getStatus()
-
- if (sackStatus == SackStatus.OUTDATED) {
- " §7(§eSack data outdated§7)"
- } else {
- val amountInSacks = sackItem.amount
- val needAmount = quest.needAmount
-
- val color = if (amountInSacks >= needAmount) {
+ quest.displayItem.getAmountInSacksOrNull()?.let {
+ val color = if (it >= quest.needAmount) {
"§a"
} else {
"§c"
}
- " §7($color${amountInSacks.addSeparators()} §7in sacks)"
- }
+ " §7($color${it.addSeparators()} §7in sacks)"
+ } ?: " §7(§eSack data outdated/missing§7)"
} else {
""
}