mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Player: remove dataPacket() and directDataPacket()
I considered renaming sendDataPacket() to dataPacket() to reduce the BC breaks, but the parameter set has changed, which might cause astonishing behaviour, so it's better to break it in a loud way. Also, this has a clearer name.
This commit is contained in:
@ -842,7 +842,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk = new PlayerListPacket();
|
||||
$pk->type = PlayerListPacket::TYPE_ADD;
|
||||
$pk->entries = [PlayerListEntry::createAdditionEntry($this->uuid, $this->id, $this->getName(), $this->getName(), 0, $this->skin)];
|
||||
$player->dataPacket($pk);
|
||||
$player->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
@ -855,7 +855,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->item = $this->getInventory()->getItemInHand();
|
||||
$pk->metadata = $this->propertyManager->getAll();
|
||||
$player->dataPacket($pk);
|
||||
$player->sendDataPacket($pk);
|
||||
|
||||
//TODO: Hack for MCPE 1.2.13: DATA_NAMETAG is useless in AddPlayerPacket, so it has to be sent separately
|
||||
$this->sendData($player, [self::DATA_NAMETAG => [self::DATA_TYPE_STRING, $this->getNameTag()]]);
|
||||
@ -866,7 +866,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk = new PlayerListPacket();
|
||||
$pk->type = PlayerListPacket::TYPE_REMOVE;
|
||||
$pk->entries = [PlayerListEntry::createRemovalEntry($this->uuid)];
|
||||
$player->dataPacket($pk);
|
||||
$player->sendDataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user