implement skins (player properties)

This commit is contained in:
Romain Beaumont 2015-11-06 21:40:18 +01:00
parent d7aa0bca83
commit 591a4ed8df

View file

@ -92,12 +92,23 @@ function inject(serv,player)
function fillTabList() function fillTabList()
{ {
if(player._client.profile)
player.profileProperties=player._client.profile.properties
.map(property => ({
name:property.name,
value:property.value,
isSigned:true,
signature:property.signature
}));
else
player.profileProperties=[];
player._writeOthers('player_info',{ player._writeOthers('player_info',{
action: 0, action: 0,
data: [{ data: [{
UUID: player._client.uuid, UUID: player._client.uuid,
name: player.username, name: player.username,
properties: [], properties: player.profileProperties,
gamemode: player.gameMode, gamemode: player.gameMode,
ping: 1 ping: 1
}] }]
@ -108,7 +119,7 @@ function inject(serv,player)
data: serv.players.map((otherPlayer) => ({ data: serv.players.map((otherPlayer) => ({
UUID: otherPlayer._client.uuid, UUID: otherPlayer._client.uuid,
name: otherPlayer.username, name: otherPlayer.username,
properties: [], properties: otherPlayer.profileProperties,
gamemode: otherPlayer.gameMode, gamemode: otherPlayer.gameMode,
ping: 1 ping: 1
})) }))