mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Improved network packets allocation
This commit is contained in:
@ -43,7 +43,7 @@ class ChestInventory extends ContainerInventory{
|
||||
parent::onOpen($who);
|
||||
|
||||
if(count($this->getViewers()) === 1){
|
||||
$pk = new TileEventPacket;
|
||||
$pk = TileEventPacket::getFromPool();
|
||||
$pk->x = $this->getHolder()->getX();
|
||||
$pk->y = $this->getHolder()->getY();
|
||||
$pk->z = $this->getHolder()->getZ();
|
||||
@ -57,7 +57,7 @@ class ChestInventory extends ContainerInventory{
|
||||
|
||||
public function onClose(Player $who){
|
||||
if(count($this->getViewers()) === 1){
|
||||
$pk = new TileEventPacket;
|
||||
$pk = TileEventPacket::getFromPool();
|
||||
$pk->x = $this->getHolder()->getX();
|
||||
$pk->y = $this->getHolder()->getY();
|
||||
$pk->z = $this->getHolder()->getZ();
|
||||
|
Reference in New Issue
Block a user