From 14fba29400a41f994f2535dea822bba71b1df338 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 22 Apr 2023 22:53:33 +0200 Subject: Showing 'loaded crop milestone data from tablist' only once --- .../hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt index a6895392a..fb6453add 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt @@ -75,12 +75,17 @@ class GardenCropMilestoneFix { tabListCropProgress[crop] = newValue } + private val loadedCrops = mutableListOf() + private fun changedValue(crop: CropType, tabListValue: Long, source: String) { val calculated = crop.getCounter() val diff = calculated - tabListValue if (diff < -5_000) { crop.setCounter(tabListValue) - LorenzUtils.chat("§e[SkyHanni] Loaded ${crop.cropName} milestone data from $source!") + if (!loadedCrops.contains(crop)) { + LorenzUtils.chat("§e[SkyHanni] Loaded ${crop.cropName} milestone data from $source!") + loadedCrops.add(crop) + } } if (diff > 5_000) { LorenzUtils.debug("Fixed wrong ${crop.cropName} milestone data from $source: ${diff.addSeparators()}") -- cgit