From f3b3b44296b8a6ac77ecad433ca28e7a03a9eaf2 Mon Sep 17 00:00:00 2001 From: Vixid <52578495+VixidDev@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:43:01 +0100 Subject: Feature: SBA style Enchant Parsing (#654) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt (limited to 'src/main/java/at/hannibal2/skyhanni/events') diff --git a/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt new file mode 100644 index 000000000..38118bac6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt @@ -0,0 +1,17 @@ +package at.hannibal2.skyhanni.events + +import net.minecraft.event.HoverEvent +import net.minecraft.util.ChatComponentText + +/** + * This event is mainly used for doing things on chat hover and reading the chat component + * of the hovered chat. + * + * To edit the chat component, add to, or use methods in [GuiChatHook][at.hannibal2.skyhanni.mixins.hooks.GuiChatHook]. + * + * The edited chat component in [GuiChatHook][at.hannibal2.skyhanni.mixins.hooks.GuiChatHook] does not change the actual + * chat component, but rather makes a new one just before rendering. + */ +class ChatHoverEvent(val component: ChatComponentText) : LorenzEvent() { + fun getHoverEvent(): HoverEvent = component.chatStyle.chatHoverEvent +} -- cgit