diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index 08918af669ed..29141991985b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConditionalUtils +import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -90,7 +91,7 @@ object GardenLevelDisplay { if (!config.overflowChat) return val newLevel = GardenAPI.getGardenLevel() if (newLevel != oldLevel + 1 || newLevel <= 15) return - LorenzUtils.runDelayed(50.milliseconds) { + DelayedRun.runDelayed(50.milliseconds) { // TODO utils function that is shared with Crop Milestone Display ChatUtils.clickableChat( " \n§b§lGARDEN LEVEL UP §8$oldLevel ➜ §b$newLevel\n" + diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt index 9660f8ab92a6..2abf2068e2b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt @@ -13,9 +13,9 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.utils.ConditionalUtils +import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland -import at.hannibal2.skyhanni.utils.LorenzUtils.runDelayed import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.mc.McSound @@ -77,7 +77,7 @@ object MiningNotifications { diamondGoblinSpawn.matches(message) -> sendNotification(MiningNotificationList.DIAMOND_GOBLIN) frostbitePattern.matches(message) -> { if (IslandType.MINESHAFT.isInIsland() && config.getAscensionRope) { - runDelayed(0.5.seconds) { + DelayedRun.runDelayed(0.5.seconds) { GetFromSackAPI.getFromChatMessageSackItems(ASCENSION_ROPE) } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index fc556f082d58..756cfcbdc2e3 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -234,14 +234,6 @@ object LorenzUtils { fun Int.ignoreDerpy() = if (Perk.DOUBLE_MOBS_HP.isActive) this * 2 else this - fun runDelayed(duration: Duration, runnable: () -> Unit) { - Timer().schedule(object : TimerTask() { - override fun run() { - runnable() - } - }, duration.inWholeMilliseconds) - } - fun sendTitle(text: String, duration: Duration, height: Double = 1.8, fontSize: Float = 4f) { TitleManager.sendTitle(text, duration, height, fontSize) }