aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-29 22:32:25 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-29 22:32:25 +0200
commitfc8016345d63a42d740e290ba7717d06444d2e8f (patch)
tree4aae3e324d04c436440fafb575cb689861a9ce84 /src/main/java/at/hannibal2/skyhanni/features/misc
parente30585a3323be457dea81b4bc33b020c8547cf54 (diff)
downloadskyhanni-fc8016345d63a42d740e290ba7717d06444d2e8f.tar.gz
skyhanni-fc8016345d63a42d740e290ba7717d06444d2e8f.tar.bz2
skyhanni-fc8016345d63a42d740e290ba7717d06444d2e8f.zip
using kotlin duration in TitleUtils
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt
index 2272cdd62..610acc9a2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.TimeUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import kotlin.time.Duration.Companion.seconds
class ServerRestartTitle {
private val config get() = SkyHanniMod.feature.misc
@@ -29,7 +30,7 @@ class ServerRestartTitle {
if (totalSeconds % 30 != 0) return
}
val time = TimeUtils.formatDuration(totalSeconds.toLong() * 1000)
- TitleUtils.sendTitle("§cServer Restart in §b$time", 2_000)
+ TitleUtils.sendTitle("§cServer Restart in §b$time", 2.seconds)
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
index 11c0504d8..c1b4ee3fc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt
@@ -26,6 +26,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import org.lwjgl.input.Keyboard
import kotlin.concurrent.fixedRateTimer
+import kotlin.time.Duration.Companion.seconds
class TrevorFeatures {
@@ -69,7 +70,7 @@ class TrevorFeatures {
if (event.message == "§aReturn to the Trapper soon to get a new animal to hunt!") {
TrevorSolver.resetLocation()
if (config.trapperMobDiedMessage) {
- TitleUtils.sendTitle("§2Mob Died ", 5_000)
+ TitleUtils.sendTitle("§2Mob Died ", 5.seconds)
SoundUtils.playBeepSound()
}
trapperReady = true
@@ -114,7 +115,7 @@ class TrevorFeatures {
if (timeUntilNextReady <= 0 && trapperReady) {
if (timeUntilNextReady == 0) {
- TitleUtils.sendTitle("§2Trapper Ready", 3_000)
+ TitleUtils.sendTitle("§2Trapper Ready", 3.seconds)
SoundUtils.playBeepSound()
}
currentStatus = TrapperStatus.READY
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt
index 4275e4698..475a9fda1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt
@@ -14,6 +14,7 @@ import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.entity.passive.EntityChicken
+import kotlin.time.Duration.Companion.seconds
object TrevorSolver {
private val animalHealths = intArrayOf(100, 200, 400, 500, 1000, 2000, 5000, 10000, 20000) //future proofing for Derpy :)
@@ -79,7 +80,7 @@ object TrevorSolver {
}
if (canSee) {
if (mobLocation != CurrentMobArea.FOUND) {
- TitleUtils.sendTitle("§2Saw Mob!", 3_000)
+ TitleUtils.sendTitle("§2Saw Mob!", 3.seconds)
}
mobLocation = CurrentMobArea.FOUND
mobCoordinates = entity.position.toLorenzVec()