diff --git a/Slapper/src/slapper/entities/SlapperHuman.php b/Slapper/src/slapper/entities/SlapperHuman.php index ccc55a0..c346366 100755 --- a/Slapper/src/slapper/entities/SlapperHuman.php +++ b/Slapper/src/slapper/entities/SlapperHuman.php @@ -77,16 +77,9 @@ public function spawnTo(Player $player) { $pk->metadata[self::DATA_NAMETAG] = [self::DATA_TYPE_STRING, $this->getDisplayName($player)]; $player->dataPacket($pk); $this->inventory->sendArmorContents($player); - - $add = new PlayerListPacket(); - $add->type = 0; - $add->entries[] = [$uuid, $entityId, isset($this->namedtag->MenuName) ? $this->namedtag["MenuName"] : "", $this->skinId, $this->skin]; - $player->dataPacket($add); + $player->server->updatePlayerListData($uuid, $entityId, $this->namedtag["MenuName"] ?? "", $this->skinId, $this->skin, [$player]); if ($this->namedtag["MenuName"] === "") { - $remove = new PlayerListPacket(); - $remove->type = 1; - $remove->entries[] = [$uuid]; - $player->dataPacket($remove); + $player->server->removePlayerListData($uuid, [$player]); } } }