Use player account for skin URL. Fixes #2

This commit is contained in:
James Lyne 2020-12-22 13:15:59 +00:00
parent 4f00a2a325
commit 165afd762c
2 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ export class PlayerIcon extends DivIcon {
Util.getMinecraftHead(player, size).then(head => {
this._playerImage!.src = head.src;
});
}).catch(() => {});
} else {
this._playerImage = noSkinImage.cloneNode(false) as HTMLImageElement;
}

View File

@ -50,12 +50,12 @@ export default {
resolve(faceImage);
};
faceImage.onerror = function() {
console.warn('Failed to retrieve face of "', player, '" with size "', size, '"!');
reject();
faceImage.onerror = function(e) {
console.warn(`Failed to retrieve face of ${player.account} with size ${size}!`);
reject(e);
};
const src = (size === 'body') ? `faces/body/${player.name}.png` :`faces/${size}x${size}/${player.name}.png`;
const src = (size === 'body') ? `faces/body/${player.account}.png` :`faces/${size}x${size}/${player.account}.png`;
faceImage.src = this.concatURL(window.config.url.markers, src);
});
},