diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 9eb2aa5e7..3e8d0b756 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -95,7 +95,7 @@ class HypixelData { var bingo = false var profileName = "" - var joinedWorld = 0L + var joinedWorld = SimpleTimeMark.farPast() var skyBlockArea = "?" @@ -119,6 +119,7 @@ class HypixelData { fun checkCurrentServerId() { if (!LorenzUtils.inSkyBlock) return + if (LorenzUtils.lastWorldSwitch.passedSince() < 1.seconds) return ScoreboardData.sidebarLinesFormatted.forEach { serverIdScoreboardPattern.matchMatcher(it) { @@ -213,7 +214,7 @@ class HypixelData { inLimbo = false inLobby = false locraw.forEach { locraw[it.key] = "" } - joinedWorld = System.currentTimeMillis() + joinedWorld = SimpleTimeMark.now() serverId = null } diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index 18a8d2841..edc07287a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -25,6 +25,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds +import kotlin.time.Duration.Companion.seconds class OwnInventoryData { @@ -133,12 +134,10 @@ class OwnInventoryData { class IgnoredItem(val condition: (NEUInternalName) -> Boolean, val blockedUntil: SimpleTimeMark) private fun addItem(internalName: NEUInternalName, add: Int) { - val diffWorld = System.currentTimeMillis() - LorenzUtils.lastWorldSwitch - if (diffWorld < 3_000) return + if (LorenzUtils.lastWorldSwitch.passedSince() < 3.seconds) return ignoredItemsUntil.removeIf { it.blockedUntil.isInPast() } if (ignoredItemsUntil.any { it.condition(internalName) }) { -// println("ignored: $internalName") return } |