aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-28 02:24:27 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-28 02:24:27 +0200
commitee5f2d9bd2dac97eb5743959fd0ac9f7e71590b7 (patch)
tree442bcf3535ae060e95b83bd64764e51af2422ed2 /src/main/java/at/hannibal2/skyhanni
parent301d9ba31dd852aa1ce5d2e8f24141dcebc5478b (diff)
downloadskyhanni-ee5f2d9bd2dac97eb5743959fd0ac9f7e71590b7.tar.gz
skyhanni-ee5f2d9bd2dac97eb5743959fd0ac9f7e71590b7.tar.bz2
skyhanni-ee5f2d9bd2dac97eb5743959fd0ac9f7e71590b7.zip
Do not show SkyHanni chat message if neu already marked pearls as done.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt9
1 files 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()
+ }
}
}
}