diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 4a957fd16..f1f909a1f 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -741,7 +741,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ public function setDisplayName(string $name){ $this->displayName = $name; if($this->spawned){ - $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $this->getSkin()); + $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $this->getSkin(), $this->getXuid()); } } diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 3daa7693c..d6f8ca238 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -2317,7 +2317,7 @@ class Server{ } public function addOnlinePlayer(Player $player){ - $this->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkin()); + $this->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkin(), $player->getXuid()); $this->playerList[$player->getRawUniqueId()] = $player; } @@ -2335,13 +2335,14 @@ class Server{ * @param int $entityId * @param string $name * @param Skin $skin + * @param string $xboxUserId * @param Player[]|null $players */ - public function updatePlayerListData(UUID $uuid, int $entityId, string $name, Skin $skin, array $players = null){ + public function updatePlayerListData(UUID $uuid, int $entityId, string $name, Skin $skin, string $xboxUserId = "", array $players = null){ $pk = new PlayerListPacket(); $pk->type = PlayerListPacket::TYPE_ADD; - $pk->entries[] = PlayerListEntry::createAdditionEntry($uuid, $entityId, $name, $skin); + $pk->entries[] = PlayerListEntry::createAdditionEntry($uuid, $entityId, $name, $skin, $xboxUserId); $this->broadcastPacket($players ?? $this->playerList, $pk); } @@ -2363,7 +2364,7 @@ class Server{ $pk = new PlayerListPacket(); $pk->type = PlayerListPacket::TYPE_ADD; foreach($this->playerList as $player){ - $pk->entries[] = PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkin()); + $pk->entries[] = PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkin(), $player->getXuid()); } $p->dataPacket($pk);