mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Player: remove sendDataPacket()
This commit is contained in:
@@ -1628,7 +1628,7 @@ abstract class Entity{
|
||||
$pk->attributes = $this->attributeMap->getAll();
|
||||
$pk->metadata = $this->getSyncedNetworkData(false);
|
||||
|
||||
$player->sendDataPacket($pk);
|
||||
$player->getNetworkSession()->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1670,7 +1670,7 @@ abstract class Entity{
|
||||
$id = spl_object_id($player);
|
||||
if(isset($this->hasSpawned[$id])){
|
||||
if($send){
|
||||
$player->sendDataPacket(RemoveActorPacket::create($this->id));
|
||||
$player->getNetworkSession()->sendDataPacket(RemoveActorPacket::create($this->id));
|
||||
}
|
||||
unset($this->hasSpawned[$id]);
|
||||
}
|
||||
@@ -1762,11 +1762,11 @@ abstract class Entity{
|
||||
if($p === $this){
|
||||
continue;
|
||||
}
|
||||
$p->sendDataPacket(clone $pk);
|
||||
$p->getNetworkSession()->sendDataPacket(clone $pk);
|
||||
}
|
||||
|
||||
if($this instanceof Player){
|
||||
$this->sendDataPacket($pk);
|
||||
$this->getNetworkSession()->sendDataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -405,7 +405,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
|
||||
protected function sendSpawnPacket(Player $player) : void{
|
||||
if(!($this instanceof Player)){
|
||||
$player->sendDataPacket(PlayerListPacket::add([PlayerListEntry::createAdditionEntry($this->uuid, $this->id, $this->getName(), $this->skin)]));
|
||||
$player->getNetworkSession()->sendDataPacket(PlayerListPacket::add([PlayerListEntry::createAdditionEntry($this->uuid, $this->id, $this->getName(), $this->skin)]));
|
||||
}
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
@@ -418,7 +418,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
$pk->pitch = $this->location->pitch;
|
||||
$pk->item = $this->getInventory()->getItemInHand();
|
||||
$pk->metadata = $this->getSyncedNetworkData(false);
|
||||
$player->sendDataPacket($pk);
|
||||
$player->getNetworkSession()->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, [EntityMetadataProperties::NAMETAG => new StringMetadataProperty($this->getNameTag())]);
|
||||
@@ -426,7 +426,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
$player->getNetworkSession()->onMobArmorChange($this);
|
||||
|
||||
if(!($this instanceof Player)){
|
||||
$player->sendDataPacket(PlayerListPacket::remove([PlayerListEntry::createRemovalEntry($this->uuid)]));
|
||||
$player->getNetworkSession()->sendDataPacket(PlayerListPacket::remove([PlayerListEntry::createRemovalEntry($this->uuid)]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -240,7 +240,7 @@ class ItemEntity extends Entity{
|
||||
$pk->item = $this->getItem();
|
||||
$pk->metadata = $this->getSyncedNetworkData(false);
|
||||
|
||||
$player->sendDataPacket($pk);
|
||||
$player->getNetworkSession()->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
public function onCollideWithPlayer(Player $player) : void{
|
||||
|
@@ -159,7 +159,7 @@ class Painting extends Entity{
|
||||
$pk->direction = self::FACING_TO_DATA[$this->facing];
|
||||
$pk->title = $this->motive;
|
||||
|
||||
$player->sendDataPacket($pk);
|
||||
$player->getNetworkSession()->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user