aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/events/AllowChatEvent.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/events/AllowChatEvent.kt')
-rw-r--r--src/main/kotlin/events/AllowChatEvent.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/kotlin/events/AllowChatEvent.kt b/src/main/kotlin/events/AllowChatEvent.kt
new file mode 100644
index 0000000..3069843
--- /dev/null
+++ b/src/main/kotlin/events/AllowChatEvent.kt
@@ -0,0 +1,16 @@
+
+
+package moe.nea.firmament.events
+
+import moe.nea.firmament.util.unformattedString
+import net.minecraft.text.Text
+
+/**
+ * Filter whether the user should see a chat message altogether. May or may not be called for every chat packet sent by
+ * the server. When that quality is desired, consider [ProcessChatEvent] instead.
+ */
+data class AllowChatEvent(val text: Text) : FirmamentEvent.Cancellable() {
+ val unformattedString = text.unformattedString
+
+ companion object : FirmamentEventBus<AllowChatEvent>()
+}