From b748f088328deaaf91f35ade7bd2fcb094c20d0d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 2 May 2024 09:25:07 +0200 Subject: Fix: Estimated Item Value not visible in PV (#1620) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: Cal --- src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt b/src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt index c9bfd61cb..709961ce6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt @@ -1,14 +1,25 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.LorenzToolTipEvent +import at.hannibal2.skyhanni.events.item.ItemHoverEvent import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import net.minecraft.inventory.Slot +import net.minecraft.item.ItemStack // Please use LorenzToolTipEvent over ItemTooltipEvent if no special EventPriority is necessary object ToolTipData { + fun getTooltip(stack: ItemStack, toolTip: MutableList): List { + onHover(stack, toolTip) + return onTooltip(toolTip) + } + + private fun onHover(stack: ItemStack, toolTip: MutableList) { + ItemHoverEvent(stack, toolTip).postAndCatch() + } + fun onTooltip(toolTip: MutableList): List { val slot = lastSlot ?: return toolTip val itemStack = slot.stack ?: return toolTip -- cgit