diff options
author | Linnea Gräf <nea@nea.moe> | 2024-02-15 18:05:28 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-02-15 18:05:28 +0100 |
commit | ee5d205578117d6fab9b2f89871e5442e480644f (patch) | |
tree | 60753f880972e85e39ed9c1e98bb534253cbd535 /src/main/kotlin/moe/nea/ledger/ChatReceived.kt | |
download | LocalTransactionLedger-ee5d205578117d6fab9b2f89871e5442e480644f.tar.gz LocalTransactionLedger-ee5d205578117d6fab9b2f89871e5442e480644f.tar.bz2 LocalTransactionLedger-ee5d205578117d6fab9b2f89871e5442e480644f.zip |
Initial commit
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/ChatReceived.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/ChatReceived.kt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/ChatReceived.kt b/src/main/kotlin/moe/nea/ledger/ChatReceived.kt new file mode 100644 index 0000000..5e19083 --- /dev/null +++ b/src/main/kotlin/moe/nea/ledger/ChatReceived.kt @@ -0,0 +1,15 @@ +package moe.nea.ledger + +import net.minecraftforge.client.event.ClientChatReceivedEvent +import net.minecraftforge.fml.common.eventhandler.Event +import java.time.Instant + +data class ChatReceived( + val message: String, + val timestamp: Instant = Instant.now() +) : Event() { + constructor(event: ClientChatReceivedEvent) : this( + event.message.unformattedText + .replace("§.".toRegex(), "") + ) +}
\ No newline at end of file |