aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-23 12:38:39 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-23 12:38:39 +0200
commitacc4455297c7ae5a920264f4e01088e877da31a4 (patch)
tree143d0f358d1eac1cbe44f61597804e83c4f3c76b /src/main/java/at/hannibal2/skyhanni/features/garden
parent1576f32ac6dc71f4b0578eb96682c3eb74f86cde (diff)
downloadskyhanni-acc4455297c7ae5a920264f4e01088e877da31a4.tar.gz
skyhanni-acc4455297c7ae5a920264f4e01088e877da31a4.tar.bz2
skyhanni-acc4455297c7ae5a920264f4e01088e877da31a4.zip
Delay the custom garden level up message by few milliseconds to not cut into the garden milestone message.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt11
1 files changed, 7 insertions, 4 deletions
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 5f2b50e82..38e1c319e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
@@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.math.roundToInt
+import kotlin.time.Duration.Companion.milliseconds
class GardenLevelDisplay {
private val config get() = SkyHanniMod.feature.garden
@@ -48,10 +49,12 @@ class GardenLevelDisplay {
val newLevel = GardenAPI.getLevelForExp(gardenExp.toLong())
if (newLevel == oldLevel + 1) {
if (newLevel > 15) {
- LorenzUtils.chat(
- " \n§b§lGARDEN LEVEL UP §8$oldLevel ➜ §b$newLevel\n" +
- " §8+§aRespect from Elite Farmers and SkyHanni members :)\n "
- )
+ LorenzUtils.runDelayed(50.milliseconds) {
+ LorenzUtils.chat(
+ " \n§b§lGARDEN LEVEL UP §8$oldLevel ➜ §b$newLevel\n" +
+ " §8+§aRespect from Elite Farmers and SkyHanni members :)\n "
+ )
+ }
}
}
update()