PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){ return ProtocolInfo3::ADD_PLAYER_PACKET; } return ProtocolInfo::ADD_PLAYER_PACKET; } public function decode(){ } public function encode(){ $this->reset(); $this->putLong($this->clientID); $this->putString($this->username); $this->putInt($this->eid); $this->putFloat($this->x); $this->putFloat($this->y); $this->putFloat($this->z); $this->putByte($this->yaw); $this->putByte($this->pitch); $this->putShort($this->itemID); $this->putShort($this->itemAuxValue); //Example: bow shooting power if($this->PROTOCOL >= ProtocolInfo6::CURRENT_PROTOCOL_6){ $this->put(Utils::writeMetadata($this->metadata)); } } public function eidsToLocal(Player $p){ if(!$this->localEids){ $this->localEids = true; $this->eid = $p->global2localEID[$this->eid] ?? false; if($this->eid === false) return false; } return true; } }