Make chat events use fabric events

[no changelog]
This commit is contained in:
nea
2023-09-04 20:22:51 +02:00
parent ee5591684d
commit d202ef5439
16 changed files with 185 additions and 157 deletions

View File

@@ -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>()
}