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 => { Util.getMinecraftHead(player, size).then(head => {
this._playerImage!.src = head.src; this._playerImage!.src = head.src;
}); }).catch(() => {});
} else { } else {
this._playerImage = noSkinImage.cloneNode(false) as HTMLImageElement; this._playerImage = noSkinImage.cloneNode(false) as HTMLImageElement;
} }

View File

@ -50,12 +50,12 @@ export default {
resolve(faceImage); resolve(faceImage);
}; };
faceImage.onerror = function() { faceImage.onerror = function(e) {
console.warn('Failed to retrieve face of "', player, '" with size "', size, '"!'); console.warn(`Failed to retrieve face of ${player.account} with size ${size}!`);
reject(); 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); faceImage.src = this.concatURL(window.config.url.markers, src);
}); });
}, },