aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/fishing
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-24 04:20:56 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-24 04:20:56 +0100
commitb32344991743f53c94a48f8a0054d0126b15bbfd (patch)
treeac4b0ba7d95bb7d0dcc650c77d6e9272459bb8c1 /src/main/java/at/hannibal2/skyhanni/features/fishing
parent25efa3d4ee8c652a4d75b5357b7705b0267c08ae (diff)
downloadskyhanni-b32344991743f53c94a48f8a0054d0126b15bbfd.tar.gz
skyhanni-b32344991743f53c94a48f8a0054d0126b15bbfd.tar.bz2
skyhanni-b32344991743f53c94a48f8a0054d0126b15bbfd.zip
Created and used ItemAddEvent, /shtrackcollection now supports sack messages.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/fishing')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
index 4ee211310..69e6848a7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt
@@ -3,9 +3,8 @@ package at.hannibal2.skyhanni.features.fishing.tracker
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.FishingBobberCastEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
+import at.hannibal2.skyhanni.events.ItemAddEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.SackChangeEvent
-import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi.Companion.getBazaarData
import at.hannibal2.skyhanni.features.fishing.FishingAPI
import at.hannibal2.skyhanni.test.PriceSource
@@ -238,22 +237,8 @@ object FishingProfitTracker {
}
@SubscribeEvent
- fun onSackChange(event: SackChangeEvent) {
+ fun onItemAdd(event: ItemAddEvent) {
if (!isEnabled()) return
-
- for (sackChange in event.sackChanges) {
- val change = sackChange.delta
- if (change > 0) {
- val internalName = sackChange.internalName
- maybeAddItem(internalName, change)
- }
- }
- }
-
- @SubscribeEvent
- fun onItemAdd(event: ItemAddInInventoryEvent) {
- if (!isEnabled()) return
-
DelayedRun.runDelayed(500.milliseconds) {
maybeAddItem(event.internalName, event.amount)
}