aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-13 20:25:33 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-13 20:25:33 +0100
commita35b093c39c9dce7697d1daacecab199a44c9f40 (patch)
tree4c8a5b86e0ab38b898c28c49ba6509294070f006 /src/main/java/at/hannibal2/skyhanni/features/nether
parent5a75b69da9f8b1cfa7705c6d6b9850d72b5a0ab6 (diff)
downloadskyhanni-a35b093c39c9dce7697d1daacecab199a44c9f40.tar.gz
skyhanni-a35b093c39c9dce7697d1daacecab199a44c9f40.tar.bz2
skyhanni-a35b093c39c9dce7697d1daacecab199a44c9f40.zip
Show the time it takes to kill the Slayer boss.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
index 6fb7be0ff..2bafd6507 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
@@ -7,9 +7,9 @@ import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.StringUtils.matchRegex
+import at.hannibal2.skyhanni.utils.TimeUtils
import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-import java.text.DecimalFormat
class AshfangFreezeCooldown {
@@ -34,9 +34,8 @@ class AshfangFreezeCooldown {
val remainingLong = maxDuration - duration
if (remainingLong > 0) {
- val remaining = (remainingLong.toFloat() / 1000)
- val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s")
+ var format = TimeUtils.formatDuration(remainingLong, showMilliSeconds = true)
+ SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a$format")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
index 5fe8c7d8a..011c716df 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
@@ -5,13 +5,14 @@ import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
+import at.hannibal2.skyhanni.utils.TimeUnit
+import at.hannibal2.skyhanni.utils.TimeUtils
import net.minecraft.client.Minecraft
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent
-import java.text.DecimalFormat
class AshfangNextResetCooldown {
@@ -37,9 +38,8 @@ class AshfangNextResetCooldown {
val remainingTime = spawnTime + 46_100 - System.currentTimeMillis()
if (remainingTime > 0) {
- val remaining = (remainingTime.toFloat() / 1000)
- val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a${format}s")
+ val format = TimeUtils.formatDuration(remainingTime, TimeUnit.SECOND, showMilliSeconds = true)
+ SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a$format")
} else {
spawnTime = -1
}