#ifndef COMPILE use pocketmine\utils\Binary; #endif class AddMobPacket extends DataPacket{ public static $pool = []; public static $next = 0; public $eid; public $type; public $x; public $y; public $z; public $pitch; public $yaw; public $metadata; public function pid(){ return Info::ADD_MOB_PACKET; } public function decode(){ } public function encode(){ $this->reset(); $this->putLong($this->eid); $this->putInt($this->type); $this->putInt($this->x); $this->putInt($this->y); $this->putInt($this->z); $this->putByte(floor($this->yaw * (256 / 360))); $this->putByte(floor($this->pitch * (256 / 360))); $this->put(Binary::writeMetadata($this->metadata)); } }