aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-22 20:41:16 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-22 20:41:16 +0100
commitcef4e16de581c9165008c5e00019cdce4ccf68ac (patch)
tree437f29ee48f212ba57270d438c35638367518f40 /src
parent91f1580f89f3f62943c7de671158ea8293026f85 (diff)
downloadskyhanni-cef4e16de581c9165008c5e00019cdce4ccf68ac.tar.gz
skyhanni-cef4e16de581c9165008c5e00019cdce4ccf68ac.tar.bz2
skyhanni-cef4e16de581c9165008c5e00019cdce4ccf68ac.zip
Fixed time until death of slayer in damage indicator to be off by one second.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityData.kt7
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
index 9d20ee2b7..679c6e97c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
@@ -36,6 +36,7 @@ import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
+import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -800,7 +801,7 @@ class DamageIndicatorManager {
entityResult.delayedStart?.asTimeMark(),
entityResult.finalDungeonBoss,
entityResult.bossType,
- foundTime = System.currentTimeMillis()
+ foundTime = SimpleTimeMark.now()
)
DamageIndicatorDetectedEvent(entityData).postAndCatch()
return entityData
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityData.kt
index 7d8f52a74..af07242a6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/EntityData.kt
@@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.combat.damageindicator
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.TimeUnit
-import at.hannibal2.skyhanni.utils.TimeUtils
+import at.hannibal2.skyhanni.utils.TimeUtils.format
import net.minecraft.entity.EntityLivingBase
class EntityData(
@@ -13,7 +13,7 @@ class EntityData(
val finalDungeonBoss: Boolean,
val bossType: BossType,
val damageCounter: DamageCounter = DamageCounter(),
- val foundTime: Long,
+ val foundTime: SimpleTimeMark,
var lastHealth: Long = 0L,
var healthText: String = "",
@@ -26,7 +26,6 @@ class EntityData(
var deathLocation: LorenzVec? = null,
) {
val timeToKill by lazy {
- val duration = System.currentTimeMillis() - foundTime
- "§e" + TimeUtils.formatDuration(duration, TimeUnit.SECOND, showMilliSeconds = true)
+ "§e" + foundTime.passedSince().format(TimeUnit.SECOND, showMilliSeconds = true)
}
}