aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-12 04:48:34 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-12 04:48:34 +0200
commit0344ab23929f77f4f339cb0dc83d84d3f118d679 (patch)
tree251ed441be010d365a0c6d5bd3921eca702cdb3a /src/main/java/at/hannibal2/skyhanni/data
parent99f7e28332662f44996e73194b9d5ea0c38e89b3 (diff)
downloadskyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.tar.gz
skyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.tar.bz2
skyhanni-0344ab23929f77f4f339cb0dc83d84d3f118d679.zip
Added Living Metal Helper
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/TitleData.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt
new file mode 100644
index 000000000..fe776c8d0
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt
@@ -0,0 +1,21 @@
+package at.hannibal2.skyhanni.data
+
+import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.events.TitleReceivedEvent
+import net.minecraft.network.play.server.S45PacketTitle
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class TitleData {
+
+ @SubscribeEvent
+ fun onReceiveCurrentShield(event: PacketEvent.ReceiveEvent) {
+ val packet = event.packet
+
+ if (packet !is S45PacketTitle) return
+ val message = packet.message ?: return
+ val formattedText = message.formattedText
+ if (TitleReceivedEvent(formattedText).postAndCatch()) {
+ event.isCanceled = true
+ }
+ }
+} \ No newline at end of file