mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Updated composed packets
This commit is contained in:
@ -23,8 +23,10 @@ namespace pocketmine\network\protocol;
|
||||
|
||||
|
||||
class RotateHeadPacket extends DataPacket{
|
||||
public $eid;
|
||||
public $yaw;
|
||||
|
||||
// eid, yaw
|
||||
/** @var array[] */
|
||||
public $entities = [];
|
||||
|
||||
public function pid(){
|
||||
return Info::ROTATE_HEAD_PACKET;
|
||||
@ -36,8 +38,11 @@ class RotateHeadPacket extends DataPacket{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putByte((int) ($this->yaw / 360));
|
||||
$this->putInt(count($this->entities));
|
||||
foreach($this->entities as $d){
|
||||
$this->putInt($d[0]); //eid
|
||||
$this->putByte((int) ($d[1] / 360));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user