aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt b/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
new file mode 100644
index 0000000..f73572e
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/chat/FakeMsg.kt
@@ -0,0 +1,20 @@
+package dulkirmod.features.chat
+
+import net.minecraft.client.Minecraft
+import net.minecraft.util.ChatComponentText
+import net.minecraftforge.client.event.ClientChatReceivedEvent
+
+object FakeMsg {
+ fun handle(event: ClientChatReceivedEvent, unformatted: String) {
+ if (unformatted.startsWith("From [MVP++] Dulkir: c:")) {
+ event.isCanceled = true
+ val newst = unformatted.substring("From [MVP++] Dulkir: c:".length)
+ Minecraft.getMinecraft().thePlayer.addChatMessage(ChatComponentText(newst.replace("&", "§")))
+ }
+ if (unformatted.startsWith("From [MVP+] Dulkir: c:")) {
+ event.isCanceled = true
+ val newst = unformatted.substring("From [MVP+] Dulkir: c:".length)
+ Minecraft.getMinecraft().thePlayer.addChatMessage(ChatComponentText(newst.replace("&", "§")))
+ }
+ }
+} \ No newline at end of file