Skins, protocol changes, handle split packets

This commit is contained in:
Shoghi Cervantes
2015-04-08 13:00:15 +02:00
parent c9adc336ee
commit 141c0a297e
26 changed files with 292 additions and 507 deletions

View File

@ -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);
}