Use Bukkit's way to strip colors.

This commit is contained in:
zeeZ 2011-05-08 18:26:40 +02:00 committed by FrozenCow
parent b8fe65bc99
commit 9eab216525

View File

@ -1,5 +1,7 @@
package org.dynmap; package org.dynmap;
import org.bukkit.ChatColor;
public class Client { public class Client {
public static class Update { public static class Update {
public long timestamp; public long timestamp;
@ -15,7 +17,7 @@ public class Client {
public double x, y, z; public double x, y, z;
public Player(String name, String world, double x, double y, double 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.world = world;
this.x = x; this.x = x;
this.y = y; this.y = y;
@ -35,8 +37,8 @@ public class Client {
public ChatMessage(String source, String playerName, String message) { public ChatMessage(String source, String playerName, String message) {
this.source = source; this.source = source;
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", ""); this.playerName = ChatColor.stripColor(playerName);
this.message = message.replaceAll("\u00A7[0-9a-fA-F]", ""); this.message = ChatColor.stripColor(message);
} }
} }
@ -44,7 +46,7 @@ public class Client {
public String type = "playerjoin"; public String type = "playerjoin";
public String playerName; public String playerName;
public PlayerJoinMessage(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 type = "playerquit";
public String playerName; public String playerName;
public PlayerQuitMessage(String playerName) { public PlayerQuitMessage(String playerName) {
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", ""); this.playerName = ChatColor.stripColor(playerName);
} }
} }