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

@ -28,7 +28,6 @@ use pocketmine\event\entity\ExplosionPrimeEvent;
use pocketmine\level\Explosion;
use pocketmine\nbt\tag\Byte;
use pocketmine\network\protocol\AddEntityPacket;
use pocketmine\network\protocol\SetEntityMotionPacket;
use pocketmine\Player;
class PrimedTNT extends Entity implements Explosive{
@ -147,11 +146,7 @@ class PrimedTNT extends Entity implements Explosive{
$pk->did = 0;
$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);
}