Improved global entity motion encoding using per-player queues

This commit is contained in:
Shoghi Cervantes
2014-11-27 14:26:36 +01:00
parent cd135b39ad
commit 38089af098
10 changed files with 44 additions and 67 deletions

View File

@ -25,7 +25,6 @@ namespace pocketmine\entity;
use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\item\Item as ItemItem;
use pocketmine\network\protocol\AddMobPacket;
use pocketmine\network\protocol\SetEntityMotionPacket;
use pocketmine\Player;
class Zombie extends Monster{
@ -52,11 +51,7 @@ class Zombie extends Monster{
$pk->metadata = $this->getData();
$player->dataPacket($pk);
$pk = new SetEntityMotionPacket();
$pk->entities = [
[$this->getID(), $this->motionX, $this->motionY, $this->motionZ]
];
$player->dataPacket($pk);
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
parent::spawnTo($player);
}