mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Use Bukkit's way to strip colors.
This commit is contained in:
parent
b8fe65bc99
commit
9eab216525
@ -1,5 +1,7 @@
|
||||
package org.dynmap;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class Client {
|
||||
public static class Update {
|
||||
public long timestamp;
|
||||
@ -15,7 +17,7 @@ public class Client {
|
||||
public double x, y, z;
|
||||
|
||||
public Player(String name, String world, double x, double y, double z) {
|
||||
this.name = name.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.name = ChatColor.stripColor(name);
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@ -35,8 +37,8 @@ public class Client {
|
||||
|
||||
public ChatMessage(String source, String playerName, String message) {
|
||||
this.source = source;
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.message = message.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.playerName = ChatColor.stripColor(playerName);
|
||||
this.message = ChatColor.stripColor(message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +46,7 @@ public class Client {
|
||||
public String type = "playerjoin";
|
||||
public String playerName;
|
||||
public PlayerJoinMessage(String playerName) {
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.playerName = ChatColor.stripColor(playerName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +54,7 @@ public class Client {
|
||||
public String type = "playerquit";
|
||||
public String playerName;
|
||||
public PlayerQuitMessage(String playerName) {
|
||||
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||
this.playerName = ChatColor.stripColor(playerName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user