summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-05-02 09:25:07 +0200
committerGitHub <noreply@github.com>2024-05-02 09:25:07 +0200
commitb748f088328deaaf91f35ade7bd2fcb094c20d0d (patch)
treefec83463bcfb8a2fd92167126e4af45a992b30f8 /src/main/java/at/hannibal2/skyhanni/data
parentb0f1bc0b14c022876ec2a802bc10025e34cfe761 (diff)
downloadskyhanni-b748f088328deaaf91f35ade7bd2fcb094c20d0d.tar.gz
skyhanni-b748f088328deaaf91f35ade7bd2fcb094c20d0d.tar.bz2
skyhanni-b748f088328deaaf91f35ade7bd2fcb094c20d0d.zip
Fix: Estimated Item Value not visible in PV (#1620)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt11
1 files changed, 11 insertions, 0 deletions
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<String>): List<String> {
+ onHover(stack, toolTip)
+ return onTooltip(toolTip)
+ }
+
+ private fun onHover(stack: ItemStack, toolTip: MutableList<String>) {
+ ItemHoverEvent(stack, toolTip).postAndCatch()
+ }
+
fun onTooltip(toolTip: MutableList<String>): List<String> {
val slot = lastSlot ?: return toolTip
val itemStack = slot.stack ?: return toolTip