diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ToolTipData.kt | 11 |
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 |