diff options
author | Linnea Gräf <nea@nea.moe> | 2024-05-24 18:16:37 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-05-24 18:16:37 +0200 |
commit | 5b68a5f3f716c8d12117b39efba8c4b8d09fcb98 (patch) | |
tree | 77fbd5503748073a4cf4968bda4d592d2aebd977 /src/main/kotlin/event | |
parent | b681f11ea5a72d4ec6a34c2807f6ed781bbd19bc (diff) | |
download | ultra-notifier-5b68a5f3f716c8d12117b39efba8c4b8d09fcb98.tar.gz ultra-notifier-5b68a5f3f716c8d12117b39efba8c4b8d09fcb98.tar.bz2 ultra-notifier-5b68a5f3f716c8d12117b39efba8c4b8d09fcb98.zip |
Add basic chat commands
Diffstat (limited to 'src/main/kotlin/event')
-rw-r--r-- | src/main/kotlin/event/ChatGuiLineEvent.kt | 10 | ||||
-rw-r--r-- | src/main/kotlin/event/ChatLineAddedEvent.kt | 7 | ||||
-rw-r--r-- | src/main/kotlin/event/PacketChatLineEvent.kt | 5 | ||||
-rw-r--r-- | src/main/kotlin/event/UltraNotifierEvents.kt | 8 |
4 files changed, 23 insertions, 7 deletions
diff --git a/src/main/kotlin/event/ChatGuiLineEvent.kt b/src/main/kotlin/event/ChatGuiLineEvent.kt new file mode 100644 index 0000000..e37d31f --- /dev/null +++ b/src/main/kotlin/event/ChatGuiLineEvent.kt @@ -0,0 +1,10 @@ +package moe.nea.ultranotifier.event + +import net.minecraft.text.Text + +class ChatGuiLineEvent(val component: Text) : UltraEvent() { + val string = component.string + override fun toString(): String { + return "ChatLineAddedEvent($string)" + } +} diff --git a/src/main/kotlin/event/ChatLineAddedEvent.kt b/src/main/kotlin/event/ChatLineAddedEvent.kt deleted file mode 100644 index 0460f83..0000000 --- a/src/main/kotlin/event/ChatLineAddedEvent.kt +++ /dev/null @@ -1,7 +0,0 @@ -package moe.nea.ultranotifier.event - -import net.minecraft.text.Text - -class ChatLineAddedEvent(val component: Text) : UltraEvent() { - val string = component.string -} diff --git a/src/main/kotlin/event/PacketChatLineEvent.kt b/src/main/kotlin/event/PacketChatLineEvent.kt new file mode 100644 index 0000000..2d5887c --- /dev/null +++ b/src/main/kotlin/event/PacketChatLineEvent.kt @@ -0,0 +1,5 @@ +package moe.nea.ultranotifier.event + +import net.minecraft.text.Text + +class PacketChatLineEvent(val component: Text) : UltraEvent() diff --git a/src/main/kotlin/event/UltraNotifierEvents.kt b/src/main/kotlin/event/UltraNotifierEvents.kt index 8c8fb13..34d1769 100644 --- a/src/main/kotlin/event/UltraNotifierEvents.kt +++ b/src/main/kotlin/event/UltraNotifierEvents.kt @@ -15,6 +15,14 @@ object UltraNotifierEvents { eventBus.post(event) return event } + + fun register(obj: Any) { +//#if FORGE +//$$ eventBus.register(obj) +//#else + eventBus.subscribe(obj) +//#endif + } } |