mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +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:
@@ -108,7 +108,7 @@ class ArmorInventory extends BaseInventory{
|
||||
$pk2->windowId = $player->getWindowId($this);
|
||||
$pk2->inventorySlot = $index;
|
||||
$pk2->item = $this->getItem($index);
|
||||
$player->dataPacket($pk2);
|
||||
$player->sendDataPacket($pk2);
|
||||
}else{
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
|
@@ -443,7 +443,7 @@ abstract class BaseInventory implements Inventory{
|
||||
continue;
|
||||
}
|
||||
$pk->windowId = $id;
|
||||
$player->dataPacket($pk);
|
||||
$player->sendDataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ abstract class BaseInventory implements Inventory{
|
||||
continue;
|
||||
}
|
||||
$pk->windowId = $id;
|
||||
$player->dataPacket($pk);
|
||||
$player->sendDataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@ abstract class ContainerInventory extends BaseInventory{
|
||||
$pk->z = $holder->getFloorZ();
|
||||
}
|
||||
|
||||
$who->dataPacket($pk);
|
||||
$who->sendDataPacket($pk);
|
||||
|
||||
$this->sendContents($who);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ abstract class ContainerInventory extends BaseInventory{
|
||||
public function onClose(Player $who) : void{
|
||||
$pk = new ContainerClosePacket();
|
||||
$pk->windowId = $who->getWindowId($this);
|
||||
$who->dataPacket($pk);
|
||||
$who->sendDataPacket($pk);
|
||||
parent::onClose($who);
|
||||
}
|
||||
|
||||
|
@@ -144,7 +144,7 @@ class PlayerInventory extends BaseInventory{
|
||||
$pk->windowId = ContainerIds::INVENTORY;
|
||||
|
||||
if(!is_array($target)){
|
||||
$target->dataPacket($pk);
|
||||
$target->sendDataPacket($pk);
|
||||
if($target === $this->getHolder()){
|
||||
$this->sendSlot($this->getHeldItemIndex(), $target);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ class PlayerInventory extends BaseInventory{
|
||||
}
|
||||
}
|
||||
|
||||
$this->getHolder()->dataPacket($pk);
|
||||
$this->getHolder()->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -149,7 +149,7 @@ class CraftingTransaction extends InventoryTransaction{
|
||||
*/
|
||||
$pk = new ContainerClosePacket();
|
||||
$pk->windowId = ContainerIds::NONE;
|
||||
$this->source->dataPacket($pk);
|
||||
$this->source->sendDataPacket($pk);
|
||||
}
|
||||
|
||||
public function execute() : bool{
|
||||
|
Reference in New Issue
Block a user