aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
diff options
context:
space:
mode:
authorIlmarsXd <ilmars500@gmail.com>2023-03-21 17:37:12 +0200
committerIlmarsXd <ilmars500@gmail.com>2023-03-21 17:37:12 +0200
commit623f260e2f1d586336fca13dc86bf2ffb0c6565c (patch)
treed54f367541619b80ae1863f5acb3d9f09de7bada /src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
parente7723d5ff52da94eb65992b5bdd9c5bb316d5959 (diff)
downloadDulkirMod-623f260e2f1d586336fca13dc86bf2ffb0c6565c.tar.gz
DulkirMod-623f260e2f1d586336fca13dc86bf2ffb0c6565c.tar.bz2
DulkirMod-623f260e2f1d586336fca13dc86bf2ffb0c6565c.zip
refactor modules
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt b/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
index 8e4d2dd..ca78dae 100644
--- a/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
+++ b/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
@@ -6,9 +6,9 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent
object FakeMsg {
private val dulkirRegex = "^From \\[MVP(\\+|\\+\\+)] Dulkir: c:".toRegex()
fun handle(event: ClientChatReceivedEvent, unformatted: String) {
- if (dulkirRegex.matches(unformatted)) {
+ if (unformatted.contains(dulkirRegex)) {
event.isCanceled = true
- val message = unformatted.replace(dulkirRegex, "").replace("&", "§")
+ val message = unformatted.replace(dulkirRegex, "").replace("&", "§").trim()
TextUtils.info(message, false)
}
}