diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 15 |
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 { "" } |