aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-05-03 17:25:52 +0200
committerGitHub <noreply@github.com>2024-05-03 17:25:52 +0200
commit323cd55125f1485c71c49568aa919e5311c6263f (patch)
treec4c246921fad48623fb81b769ee78f5fa1873993 /src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt
parent5b2a2d067e68d500bd1c19088dae9e624eeae51f (diff)
downloadskyhanni-323cd55125f1485c71c49568aa919e5311c6263f.tar.gz
skyhanni-323cd55125f1485c71c49568aa919e5311c6263f.tar.bz2
skyhanni-323cd55125f1485c71c49568aa919e5311c6263f.zip
Add hover/click events back to custom chat messages (#1516)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt
new file mode 100644
index 000000000..4a0d8ce76
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatComponentUtils.kt
@@ -0,0 +1,8 @@
+package at.hannibal2.skyhanni.utils
+
+import net.minecraft.util.ChatComponentText
+
+object ChatComponentUtils {
+ fun text(text: String, init: ChatComponentText.() -> Unit = {}): ChatComponentText =
+ ChatComponentText(text).also(init)
+}