From ccdca342626e439f410f1de4bd5dc1a1790605f3 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:07:37 +0200 Subject: Fix: Odin Truffle (#2300) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/features/inventory/HeldTimeInLore.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HeldTimeInLore.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HeldTimeInLore.kt index 6b2f97fbd..327e38aab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HeldTimeInLore.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HeldTimeInLore.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.CollectionUtils.addOrInsert import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName @@ -28,7 +29,7 @@ object HeldTimeInLore { val seconds = event.itemStack.getSeconds() ?: return val formatted = seconds.seconds.format() - event.toolTip.add(10, "§7Time Held: §b$formatted") + event.toolTip.addOrInsert(10, "§7Time Held: §b$formatted") } private fun ItemStack.getSeconds(): Int? = when (getInternalName()) { @@ -37,3 +38,5 @@ object HeldTimeInLore { else -> null } } + + -- cgit