diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-19 20:38:13 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-02-19 20:38:13 +0100 |
commit | ac6f7f65e4ddcc2c6e0c24020629593089e0d379 (patch) | |
tree | fd212b960e63ea501b58e601c32d81cda7b3a9cb /src/main | |
parent | 0f6e221ee30423c3e3579c5aa7deac17f8be82f4 (diff) | |
download | skyhanni-ac6f7f65e4ddcc2c6e0c24020629593089e0d379.tar.gz skyhanni-ac6f7f65e4ddcc2c6e0c24020629593089e0d379.tar.bz2 skyhanni-ac6f7f65e4ddcc2c6e0c24020629593089e0d379.zip |
Fixed fishing profit tracker stop working when trophy fishing for 10 minutes.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt | 34 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt | 3 |
2 files changed, 0 insertions, 37 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt index 173f5a0d2..a3d3a1cb7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt @@ -1,14 +1,9 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.events.FishingBobberCastEvent -import at.hannibal2.skyhanni.events.IslandChangeEvent -import at.hannibal2.skyhanni.events.ItemInHandChangeEvent -import at.hannibal2.skyhanni.events.SkillExpGainEvent -import at.hannibal2.skyhanni.features.fishing.tracker.FishingProfitTracker import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager.getFilletValue import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity -import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -25,7 +20,6 @@ import net.minecraft.init.Blocks import net.minecraft.item.ItemStack import net.minecraftforge.event.entity.EntityJoinWorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import kotlin.time.Duration.Companion.seconds object FishingAPI { @@ -33,7 +27,6 @@ object FishingAPI { private val waterBlocks = listOf(Blocks.water, Blocks.flowing_water) var lastCastTime = SimpleTimeMark.farPast() - var lastActiveFishingTime = SimpleTimeMark.farPast() @SubscribeEvent fun onJoinWorld(event: EntityJoinWorldEvent) { @@ -46,33 +39,6 @@ object FishingAPI { FishingBobberCastEvent(entity).postAndCatch() } - @SubscribeEvent - fun onItemInHandChange(event: ItemInHandChangeEvent) { - if (event.oldItem.isFishingRod()) { - lastActiveFishingTime = SimpleTimeMark.now() - } - if (event.newItem.isFishingRod()) { - DelayedRun.runDelayed(1.seconds) { - lastActiveFishingTime = SimpleTimeMark.now() - } - } - } - - @SubscribeEvent - fun onSkillExpGain(event: SkillExpGainEvent) { - val skill = event.skill - if (FishingProfitTracker.isEnabled()) { - if (skill != "fishing") { - lastActiveFishingTime = SimpleTimeMark.farPast() - } - } - } - - @SubscribeEvent - fun onIslandChange(event: IslandChangeEvent) { - lastActiveFishingTime = SimpleTimeMark.farPast() - } - fun hasFishingRodInHand() = InventoryUtils.itemInHandId.isFishingRod() fun NEUInternalName.isFishingRod() = contains("ROD") 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 33ad68dcd..7cab35c6b 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 @@ -27,7 +27,6 @@ import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker import com.google.gson.annotations.Expose import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds -import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds typealias CategoryName = String @@ -194,8 +193,6 @@ object FishingProfitTracker { } private fun maybeAddItem(internalName: NEUInternalName, amount: Int) { - if (FishingAPI.lastActiveFishingTime.passedSince() > 10.minutes) return - if (!isAllowedItem(internalName)) { ChatUtils.debug("Ignored non-fishing item pickup: $internalName'") return |