Strip colors off chat, use getDisplayName instead of getName
This commit is contained in:
parent
5f32f8fb99
commit
63b9579fa5
4 changed files with 10 additions and 10 deletions
|
|
@ -15,7 +15,7 @@ public class Client {
|
|||
public double x, y, z;
|
||||
|
||||
public Player(String name, String world, double x, double y, double z) {
|
||||
this.name = name;
|
||||
this.name = name.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
|
|
@ -35,8 +35,8 @@ public class Client {
|
|||
|
||||
public ChatMessage(String source, String playerName, String message) {
|
||||
this.source = source;
|
||||
this.playerName = playerName;
|
||||
this.message = message;
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.message = message.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ public class Client {
|
|||
public String type = "playerjoin";
|
||||
public String playerName;
|
||||
public PlayerJoinMessage(String playerName) {
|
||||
this.playerName = playerName;
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ public class Client {
|
|||
public String type = "playerquit";
|
||||
public String playerName;
|
||||
public PlayerQuitMessage(String playerName) {
|
||||
this.playerName = playerName;
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue