summaryrefslogtreecommitdiff
path: root/src/main/kotlin/event
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/event')
-rw-r--r--src/main/kotlin/event/CommandRegistrationEvent.kt10
-rw-r--r--src/main/kotlin/event/RegistrationFinishedEvent.kt6
-rw-r--r--src/main/kotlin/event/UltraEvent.kt4
3 files changed, 20 insertions, 0 deletions
diff --git a/src/main/kotlin/event/CommandRegistrationEvent.kt b/src/main/kotlin/event/CommandRegistrationEvent.kt
new file mode 100644
index 0000000..49bc637
--- /dev/null
+++ b/src/main/kotlin/event/CommandRegistrationEvent.kt
@@ -0,0 +1,10 @@
+package moe.nea.ultranotifier.event
+
+import com.mojang.brigadier.CommandDispatcher
+import moe.nea.ultranotifier.commands.UltraCommandSource
+
+/**
+ * Fired whenever commands need to be registered. This may be multiple times during each launch. Old commands will be
+ * automatically unregistered first.
+ */
+class CommandRegistrationEvent(val dispatcher: CommandDispatcher<UltraCommandSource>) : UltraEvent()
diff --git a/src/main/kotlin/event/RegistrationFinishedEvent.kt b/src/main/kotlin/event/RegistrationFinishedEvent.kt
new file mode 100644
index 0000000..325e1d8
--- /dev/null
+++ b/src/main/kotlin/event/RegistrationFinishedEvent.kt
@@ -0,0 +1,6 @@
+package moe.nea.ultranotifier.event
+
+/**
+ * Indicates that the registration of all ultra event handlers is done
+ */
+class RegistrationFinishedEvent : UltraEvent()
diff --git a/src/main/kotlin/event/UltraEvent.kt b/src/main/kotlin/event/UltraEvent.kt
index 42fa4f2..4f615c1 100644
--- a/src/main/kotlin/event/UltraEvent.kt
+++ b/src/main/kotlin/event/UltraEvent.kt
@@ -32,6 +32,10 @@ abstract class UltraEvent :
setCancelled(true)
}
+ fun post() {
+ UltraNotifierEvents.post(this)
+ }
+
}