aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-13 20:53:27 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-13 20:53:27 +0100
commite847edd33ea0acff53b941610a4ddcd17427fe92 (patch)
treeee8df72e17a85afe94d17b0ad25273c895359ac0 /src/main
parentd3f059ccdddeda951231389987e8c4582321084b (diff)
downloadskyhanni-e847edd33ea0acff53b941610a4ddcd17427fe92.tar.gz
skyhanni-e847edd33ea0acff53b941610a4ddcd17427fe92.tar.bz2
skyhanni-e847edd33ea0acff53b941610a4ddcd17427fe92.zip
Code cleanup.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt15
1 files changed, 4 insertions, 11 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 c0be20536..58e8235ba 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
@@ -116,7 +116,6 @@ class DailyQuestHelper(private val reputationHelper: CrimsonIsleReputationHelper
if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return
val message = event.message
-
if (message == "§aYou completed your Dojo quest! Visit the Town Board to claim the rewards.") {
val dojoQuest = getQuest<DojoQuest>() ?: return
dojoQuest.state = QuestState.READY_TO_COLLECT
@@ -124,9 +123,7 @@ class DailyQuestHelper(private val reputationHelper: CrimsonIsleReputationHelper
}
}
- private inline fun <reified T : Quest> getQuest(): T? {
- return quests.filterIsInstance<T>().firstOrNull()
- }
+ private inline fun <reified T : Quest> getQuest() = quests.filterIsInstance<T>().firstOrNull()
private fun checkInventoryForFetchItem() {
val fetchQuest = getQuest<FetchQuest>() ?: return
@@ -202,19 +199,15 @@ class DailyQuestHelper(private val reputationHelper: CrimsonIsleReputationHelper
val sacksText = if (quest is FetchQuest && quest.state != QuestState.COLLECTED) {
val name = quest.itemName.uppercase()
- val amount = sacksCache.getOrDefault(name, -1)
+ val amount = sacksCache.getOrDefault(name, 0)
val needAmount = quest.needAmount
+ val amountFormat = LorenzUtils.formatInteger(amount)
val color = if (amount >= needAmount) {
"§a"
} else {
"§c"
}
- val format = if (amount == -1L) {
- "§c?"
- } else {
- color + LorenzUtils.formatInteger(amount)
- }
- " §f($format §fin sacks)"
+ " §f($color$amountFormat §fin sacks)"
} else {
""
}