Improved network packets allocation

This commit is contained in:
Shoghi Cervantes
2014-10-27 20:30:33 +01:00
parent 3f5b129cf5
commit db82f76c11
69 changed files with 366 additions and 222 deletions

View File

@ -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();