From ee5f2d9bd2dac97eb5743959fd0ac9f7e71590b7 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:24:27 +0200 Subject: Do not show SkyHanni chat message if neu already marked pearls as done. --- .../at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt index 1608bb147..7afbf475c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import io.github.moulberry.notenoughupdates.NotEnoughUpdates import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.hours class FixNEUHeavyPearls { private val config get() = SkyHanniMod.feature.misc @@ -17,9 +18,11 @@ class FixNEUHeavyPearls { for (change in event.sackChanges) { if (change.internalName == heavyPearl && change.delta == 3) { - LorenzUtils.chat("§e[SkyHanni] Mark NEU Heavy Pearls as done.") - NotEnoughUpdates.INSTANCE.config.getProfileSpecific().dailyHeavyPearlCompleted = - System.currentTimeMillis() + val specific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific() + if (System.currentTimeMillis() > specific.dailyHeavyPearlCompleted + 1.hours.inWholeMilliseconds) { + LorenzUtils.chat("§e[SkyHanni] Mark NEU Heavy Pearls as done.") + specific.dailyHeavyPearlCompleted = System.currentTimeMillis() + } } } } -- cgit