Skip to content

Commit

Permalink
Remove LorenzUtils runDelayed
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGravyBoat committed May 14, 2024
1 parent 48018b6 commit 732b737
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 732b737

Please sign in to comment.