diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-22 22:53:33 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-22 22:53:33 +0200 |
commit | 14fba29400a41f994f2535dea822bba71b1df338 (patch) | |
tree | b859acf1630b9d8c18f3eac0ddf55130e9d72c64 /src/main/java/at/hannibal2 | |
parent | 2b5755dc1e3a1d9a93005e28421feb457415c0bb (diff) | |
download | skyhanni-14fba29400a41f994f2535dea822bba71b1df338.tar.gz skyhanni-14fba29400a41f994f2535dea822bba71b1df338.tar.bz2 skyhanni-14fba29400a41f994f2535dea822bba71b1df338.zip |
Showing 'loaded crop milestone data from tablist' only once
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt | 7 |
1 files changed, 6 insertions, 1 deletions
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<CropType>() + 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()}") |