Fix for skins on players with nicknames - send up account name as well

as display name.
This commit is contained in:
Mike Primm 2011-05-21 00:59:08 -05:00
parent 325f069b46
commit 4fb1ddf49a
5 changed files with 11 additions and 6 deletions

View File

@ -18,14 +18,16 @@ public class Client {
public String world;
public double x, y, z;
public int health;
public String account;
public Player(String name, String world, double x, double y, double z, int health) {
public Player(String name, String world, double x, double y, double z, int health, String account) {
this.name = ChatColor.stripColor(name);
this.world = world;
this.x = x;
this.y = y;
this.z = z;
this.health = health;
this.account = account;
}
}

View File

@ -99,7 +99,8 @@ class JsonTimerTask extends TimerTask {
for (int i = 0; i < players.length; i++) {
Player p = players[i];
Location pl = p.getLocation();
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ(), showHealth?p.getHealth():-1);
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ(), showHealth?p.getHealth():-1,
p.getName());
}
update.updates = mapManager.getWorldUpdates(world.getName(), current - (jsonInterval + 10000));

View File

@ -76,7 +76,8 @@ public class ClientUpdateHandler implements HttpHandler {
for(int i=0;i<players.length;i++) {
Player p = players[i];
Location pl = p.getLocation();
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ(), showHealth?p.getHealth():-1);
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ(), showHealth?p.getHealth():-1,
p.getName());
}
update.updates = mapManager.getWorldUpdates(worldName, since);

View File

@ -453,7 +453,8 @@ DynMap.prototype = {
var player = me.players[update.name] = {
name: update.name,
location: new Location(me.worlds[update.world], parseFloat(update.x), parseFloat(update.y), parseFloat(update.z)),
health: update.health
health: update.health,
account: update.account
};
$(me).trigger('playeradded', [ player ]);
@ -486,7 +487,7 @@ DynMap.prototype = {
})
.appendTo(me.playerlist);
if (me.options.showplayerfacesinmenu) {
getMinecraftHead(player.name, 16, function(head) {
getMinecraftHead(player.account, 16, function(head) {
$('img', playerIconContainer).remove();
$(head).appendTo(playerIconContainer);
});

View File

@ -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);