From cdb9fa0d7da4aafba67ef86fa23dde73e414a108 Mon Sep 17 00:00:00 2001 From: code-explorer786 <68312688+code-explorer786@users.noreply.github.com> Date: Fri, 7 Apr 2023 05:16:04 +0700 Subject: [PATCH] Add PlayerChatEvent on clients (#8432) * Add PlayerChatEvent on clients https://github.com/mindustry-antigrief/mindustry-client/commit/d32dd01097ef62fb0a1bd5aade2a738c04652854 Co-authored-by: buthed010203 * Only fire when valid. (Currently deciding on whether or not to add ChatEvent without the player.) --------- Co-authored-by: buthed010203 --- core/src/mindustry/core/NetClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 3de7838874..99608a6168 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -201,10 +201,12 @@ public class NetClient implements ApplicationListener{ Sounds.chatMessage.play(); } - //display raw unformatted text above player head if(playersender != null && unformatted != null){ + //display raw unformatted text above player head playersender.lastText(unformatted); playersender.textFadeTime(1f); + + Events.fire(new PlayerChatEvent(playersender, unformatted)); } }