aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/ClientChatLineReceivedEvent.kt
blob: 0345afc7eabaa83ef183aa4384ad61836e38ab11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

package moe.nea.firmament.events

import net.minecraft.text.Text
import moe.nea.firmament.util.unformattedString

/**
 * Published just before a message is added to the chat gui. Cancelling only prevents rendering, not logging to the
 * console.
 */
data class ClientChatLineReceivedEvent(val text: Text) : FirmamentEvent.Cancellable() {
    val unformattedString = text.unformattedString
    var replaceWith: Text = text

    companion object : FirmamentEventBus<ClientChatLineReceivedEvent>()
}