From fe25cb6a0f5ccbf38b5ad8f50407a41eb7360716 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 23 May 2011 03:21:15 +0800 Subject: [PATCH] Fix player faces when aliases being used, and strip color from player display names sent to web UI --- src/main/java/org/dynmap/ClientUpdateComponent.java | 3 ++- web/js/playermarkers.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/ClientUpdateComponent.java b/src/main/java/org/dynmap/ClientUpdateComponent.java index e9e00d7c..46aa628e 100644 --- a/src/main/java/org/dynmap/ClientUpdateComponent.java +++ b/src/main/java/org/dynmap/ClientUpdateComponent.java @@ -3,6 +3,7 @@ package org.dynmap; import static org.dynmap.JSONUtils.a; import static org.dynmap.JSONUtils.s; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; @@ -37,7 +38,7 @@ public class ClientUpdateComponent extends Component { Location pl = p.getLocation(); JSONObject jp = new JSONObject(); s(jp, "type", "player"); - s(jp, "name", p.getDisplayName()); + s(jp, "name", ChatColor.stripColor(p.getDisplayName())); s(jp, "account", p.getName()); s(jp, "world", p.getWorld().getName()); s(jp, "x", pl.getX()); diff --git a/web/js/playermarkers.js b/web/js/playermarkers.js index 1c8d749f..83252507 100644 --- a/web/js/playermarkers.js +++ b/web/js/playermarkers.js @@ -15,7 +15,7 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) { .text(player.name)); if (configuration.showplayerfaces) { - getMinecraftHead(player.name, 32, function(head) { + getMinecraftHead(player.account, 32, function(head) { $(head) .addClass('playericon') .prependTo(div);