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

@ -46,7 +46,7 @@ class Zombie extends Monster{
public function spawnTo(Player $player){
$pk = new AddMobPacket();
$pk = AddMobPacket::getFromPool();
$pk->eid = $this->getID();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
@ -57,7 +57,7 @@ class Zombie extends Monster{
$pk->metadata = $this->getData();
$player->dataPacket($pk);
$pk = new SetEntityMotionPacket();
$pk = SetEntityMotionPacket::getFromPool();
$pk->entities = [
[$this->getID(), $this->motionX, $this->motionY, $this->motionZ]
];