diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-06 00:01:30 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-05 16:01:30 +0200 |
| commit | eb7fd3da94cec90674e29e93ca0d744e2a2889fb (patch) | |
| tree | a83d663c1229207b0cf5977290aa2609ba22efec /src/main/java/at/hannibal2/skyhanni/features/mining | |
| parent | 5a04ad230cc4fb94884b34f795124d3b65af07ea (diff) | |
| download | skyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.tar.gz skyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.tar.bz2 skyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.zip | |
Backend: More second passed (#1899)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
3 files changed, 16 insertions, 23 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 09a2c5377..7268c1925 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha @@ -52,7 +52,7 @@ class HighlightMiningCommissionMobs { } @SubscribeEvent - fun onTick(event: LorenzTickEvent) { + fun onSecondPassed(event: SecondPassedEvent) { if (!isEnabled()) return if (!event.repeatSeconds(2)) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt index 0a23e2aaa..ca4fcc9c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.mining.MiningEventConfig import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.mining.eventtracker.MiningEventType.Companion.CompressFormat import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -26,8 +26,7 @@ object MiningEventDisplay { private val islandEventData: MutableMap<IslandType, MiningIslandEventInfo> = mutableMapOf() @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!event.repeatSeconds(1)) return + fun onSecondPassed(event: SecondPassedEvent) { updateDisplay() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt index 9e0857285..ff6af36fb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt @@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList @@ -85,6 +84,18 @@ object PowderTracker { calculateResourceHour(diamondEssenceInfo) calculateResourceHour(goldEssenceInfo) calculateResourceHour(chestInfo) + + doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find() + powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) { + powderTimer = group("time") + doublePowder = powderTimer != "00:00" + + tracker.update() + } + + if (lastChestPicked.passedSince() > 1.minutes) { + isGrinding = false + } } private val tracker = SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker }) @@ -154,23 +165,6 @@ object PowderTracker { } @SubscribeEvent - fun onTick(event: LorenzTickEvent) { - if (!isEnabled()) return - if (event.repeatSeconds(1)) { - doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find() - powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) { - powderTimer = group("time") - doublePowder = powderTimer != "00:00" - - tracker.update() - } - } - if (lastChestPicked.passedSince() > 1.minutes) { - isGrinding = false - } - } - - @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { config.textFormat.afterChange { tracker.update() |
