aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/ChatReceived.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-02-15 18:05:28 +0100
committerLinnea Gräf <nea@nea.moe>2024-02-15 18:05:28 +0100
commitee5d205578117d6fab9b2f89871e5442e480644f (patch)
tree60753f880972e85e39ed9c1e98bb534253cbd535 /src/main/kotlin/moe/nea/ledger/ChatReceived.kt
downloadLocalTransactionLedger-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.kt15
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