mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Improved global entity motion encoding using per-player queues
This commit is contained in:
@ -24,7 +24,6 @@ namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\nbt\tag\Int;
|
||||
use pocketmine\network\protocol\AddMobPacket;
|
||||
use pocketmine\network\protocol\SetEntityMotionPacket;
|
||||
use pocketmine\Player;
|
||||
|
||||
class Villager extends Creature implements NPC, Ageable{
|
||||
@ -64,11 +63,7 @@ class Villager extends Creature implements NPC, Ageable{
|
||||
$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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user