mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Skins, protocol changes, handle split packets
This commit is contained in:
@ -23,7 +23,7 @@ namespace pocketmine\entity;
|
||||
|
||||
|
||||
use pocketmine\nbt\tag\Int;
|
||||
use pocketmine\network\protocol\AddMobPacket;
|
||||
use pocketmine\network\protocol\AddEntityPacket;
|
||||
use pocketmine\Player;
|
||||
|
||||
class Villager extends Creature implements NPC, Ageable{
|
||||
@ -52,19 +52,20 @@ class Villager extends Creature implements NPC, Ageable{
|
||||
}
|
||||
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddMobPacket();
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->type = Villager::NETWORK_ID;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->speedX = $this->motionX;
|
||||
$pk->speedY = $this->motionY;
|
||||
$pk->speedZ = $this->motionZ;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->metadata = $this->dataProperties;
|
||||
$player->dataPacket($pk);
|
||||
|
||||
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
|
||||
|
||||
parent::spawnTo($player);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user