aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt b/src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt
new file mode 100644
index 0000000..4704217
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firmament/events/AllowChatEvent.kt
@@ -0,0 +1,20 @@
+/*
+ * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+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>()
+}