summaryrefslogtreecommitdiff
path: root/src/main/kotlin/event/TickEvent.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/event/TickEvent.kt')
-rw-r--r--src/main/kotlin/event/TickEvent.kt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/kotlin/event/TickEvent.kt b/src/main/kotlin/event/TickEvent.kt
new file mode 100644
index 0000000..8643261
--- /dev/null
+++ b/src/main/kotlin/event/TickEvent.kt
@@ -0,0 +1,26 @@
+package moe.nea.ultranotifier.event
+
+//#if FABRIC
+import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
+//#endif
+
+class TickEvent : UltraEvent() {
+
+ companion object {
+ init {
+//#if FABRIC
+ ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick {
+ TickEvent().post()
+ })
+//#else
+//$$ net.minecraftforge.common.MinecraftForge.EVENT_BUS.register(object {
+//$$ @UltraSubscribe
+//$$ fun onForgeEvent(event: net.minecraftforge.event.TickEvent.ClientTickEvent) {
+//$$ if (event.phase == net.minecraftforge.event.TickEvent.Phase.END)
+//$$ TickEvent().post()
+//$$ }
+//$$ })
+//#endif
+ }
+ }
+}