From 4f845202f82e0f0829ed67258d962e0d14cb34fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D1=80=D0=BA=D0=BD=D0=B5=D1=81=D1=81=233729?= <79508138+Darkness6030@users.noreply.github.com> Date: Wed, 10 May 2023 19:52:47 +0300 Subject: [PATCH] sendUnformatted method in PlayerComp (#8575) --- core/src/mindustry/entities/comp/PlayerComp.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/entities/comp/PlayerComp.java b/core/src/mindustry/entities/comp/PlayerComp.java index 6c5d8b1cdf..ec3c5749f3 100644 --- a/core/src/mindustry/entities/comp/PlayerComp.java +++ b/core/src/mindustry/entities/comp/PlayerComp.java @@ -323,13 +323,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra } void sendMessage(String text){ - if(isLocal()){ - if(ui != null){ - ui.chatfrag.addMessage(text); - } - }else{ - Call.sendMessage(con, text, null, null); - } + sendMessage(text, null, null); } void sendMessage(String text, Player from){ @@ -346,6 +340,14 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra } } + void sendUnformatted(String unformatted){ + sendUnformatted(null, unformatted); + } + + void sendUnformatted(Player from, String unformatted){ + sendMessage(netServer.chatFormatter.format(from, unformatted), from, unformatted); + } + PlayerInfo getInfo(){ if(isLocal()){ throw new IllegalArgumentException("Local players cannot be traced and do not have info.");