From c8043a2c0b4dbd0733a316f2ed9b4f8c8d605056 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 29 May 2024 08:39:06 +0200 Subject: auto updating trophy fish display on neu data load --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 +- .../at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt | 3 ++- .../at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 4cb09bfe9..ff905b3b0 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -735,7 +735,7 @@ class SkyHanniMod { loadModule(SharkFishCounter()) loadModule(PowerStoneGuideFeatures()) loadModule(OdgerWaypoint()) - loadModule(TrophyFishDisplay()) + loadModule(TrophyFishDisplay) loadModule(TiaRelayHelper()) loadModule(TiaRelayWaypoints()) loadModule(BasketWaypoints()) diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt index 847731c65..447a7bf54 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt @@ -38,7 +38,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds -class TrophyFishDisplay { +object TrophyFishDisplay { private val config get() = SkyHanniMod.feature.fishing.trophyFishing.display private var recentlyDroppedTrophies = TimeLimitedCache(5.seconds) @@ -89,6 +89,7 @@ class TrophyFishDisplay { } } + fun update() { if (!isEnabled()) return val list = mutableListOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt index 77701c1b0..2d8a7cb0e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt @@ -74,6 +74,7 @@ object TrophyFishManager { ChatUtils.debug("Updated trophy fishing data from NEU PV: $name $rarity: $current -> $newValue") } } + TrophyFishDisplay.update() ChatUtils.chat("Updated Trophy Fishing data via NEU PV!") } -- cgit