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\level\format\FullChunk;
use pocketmine\nbt\tag\Compound;
use pocketmine\network\protocol\AddEntityPacket;
use pocketmine\network\protocol\SetEntityMotionPacket;
use pocketmine\Player;
class Snowball extends Projectile{
@ -72,11 +71,7 @@ class Snowball extends Projectile{
$pk->did = 0; //TODO: send motion here
$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);
}