aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt16
1 files changed, 7 insertions, 9 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 8f3920844..b5ce08ba7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.events.SackChangeEvent
+import at.hannibal2.skyhanni.events.ItemAddEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
@@ -13,16 +13,14 @@ class FixNEUHeavyPearls {
private val heavyPearl = "HEAVY_PEARL".asInternalName()
@SubscribeEvent
- fun onSackChange(event: SackChangeEvent) {
+ fun onSackChange(event: ItemAddEvent) {
if (!isEnabled()) return
- for (change in event.sackChanges) {
- if (change.internalName == heavyPearl && change.delta == 3) {
- val specific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific()
- if (System.currentTimeMillis() > specific.dailyHeavyPearlCompleted + 1.hours.inWholeMilliseconds) {
- LorenzUtils.chat("Mark NEU Heavy Pearls as done.")
- specific.dailyHeavyPearlCompleted = System.currentTimeMillis()
- }
+ if (event.internalName == heavyPearl && event.amount == 3) {
+ val specific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific()
+ if (System.currentTimeMillis() > specific.dailyHeavyPearlCompleted + 1.hours.inWholeMilliseconds) {
+ LorenzUtils.chat("Mark NEU Heavy Pearls as done.")
+ specific.dailyHeavyPearlCompleted = System.currentTimeMillis()
}
}
}