diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-25 02:49:25 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-25 02:49:25 +0100 |
commit | f142d7f2483247f541a24625af3f5789f3ee1ae6 (patch) | |
tree | 0f081f34084d2f269ea85e00e5568c5ee21afe43 /src/main/java | |
parent | 861f3bece9ee7e48c26392443f44aa75afba21c0 (diff) | |
download | skyhanni-f142d7f2483247f541a24625af3f5789f3ee1ae6.tar.gz skyhanni-f142d7f2483247f541a24625af3f5789f3ee1ae6.tar.bz2 skyhanni-f142d7f2483247f541a24625af3f5789f3ee1ae6.zip |
Added support for NEU Heavy Pearl todo fix working without nether sacks as well.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt | 16 |
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() } } } |