aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/minion
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-06-14 05:58:40 +1000
committerGitHub <noreply@github.com>2024-06-13 21:58:40 +0200
commitb48e43dff9baf2710809debe47a4bd5b329d70a0 (patch)
treed6470d8e3f41ae3982cecab685ca034318397196 /src/main/java/at/hannibal2/skyhanni/features/minion
parent31344fc364cde2cef243a49f1e7d4c4fbb390699 (diff)
downloadskyhanni-b48e43dff9baf2710809debe47a4bd5b329d70a0.tar.gz
skyhanni-b48e43dff9baf2710809debe47a4bd5b329d70a0.tar.bz2
skyhanni-b48e43dff9baf2710809debe47a4bd5b329d70a0.zip
Backend: Remove deprecated time utils format (#1898)
* remove deprecated time utils format * cleanup file * mix merge * make it default to right amount * fix merge * fix merge * revert 2 changes * revert other thing --------- Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/minion')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
index 42de82cd8..2ccaba2e5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
@@ -45,8 +45,9 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
+import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SpecialColour
-import at.hannibal2.skyhanni.utils.TimeUtils
+import at.hannibal2.skyhanni.utils.TimeUtils.format
import at.hannibal2.skyhanni.utils.getLorenzVec
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import at.hannibal2.skyhanni.utils.toLorenzVec
@@ -90,6 +91,19 @@ object MinionFeatures {
"^§aCollect All$"
)
+ var lastMinion: LorenzVec? = null
+ private var lastStorage: LorenzVec? = null
+ var minionInventoryOpen = false
+ var minionStorageInventoryOpen = false
+
+ private var minions: Map<LorenzVec, ProfileSpecificStorage.MinionConfig>?
+ get() {
+ return ProfileStorageData.profileSpecific?.minions
+ }
+ set(value) {
+ ProfileStorageData.profileSpecific?.minions = value
+ }
+
@SubscribeEvent
fun onPlayerInteract(event: PlayerInteractEvent) {
if (!isEnabled()) return
@@ -361,8 +375,8 @@ object MinionFeatures {
}
if (config.emptiedTime.display && lastEmptied != 0L) {
- val duration = System.currentTimeMillis() - lastEmptied
- val format = TimeUtils.formatDuration(duration, longName = true) + " ago"
+ val passedSince = SimpleTimeMark(lastEmptied).passedSince()
+ val format = passedSince.format(longName = true) + " ago"
val text = "§eHopper Emptied: $format"
event.drawString(location.add(y = 1.15), text, true)
}
@@ -402,19 +416,6 @@ object MinionFeatures {
}
}
- var lastMinion: LorenzVec? = null
- var lastStorage: LorenzVec? = null
- var minionInventoryOpen = false
- var minionStorageInventoryOpen = false
-
- private var minions: Map<LorenzVec, ProfileSpecificStorage.MinionConfig>?
- get() {
- return ProfileStorageData.profileSpecific?.minions
- }
- set(value) {
- ProfileStorageData.profileSpecific?.minions = value
- }
-
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(3, "minions.lastClickedMinionDisplay", "minions.lastClickedMinion.display")