diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 8e9915f2..71c36d36 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1051,8 +1051,7 @@ class Entity extends Position public function sendHeadYaw(){ $pk = new RotateHeadPacket; - $pk->eid = $this->eid; - $pk->yaw = $this->headYaw; + $pk->entities = [[$this->eid, $this->headYaw]]; $this->server->api->player->broadcastPacket($this->level->players, $pk); } @@ -1180,6 +1179,7 @@ class Entity extends Position } if($this->class === ENTITY_FALLING){ $data["Tile"] = $this->data["Tile"]; + $data["Metadata"] = $this->data["Metadata"]; } if($this->class === ENTITY_ITEM){ $data["Item"] = [ diff --git a/src/network/protocol/packet/RotateHeadPacket.php b/src/network/protocol/packet/RotateHeadPacket.php index ea1ea298..7ddb4b47 100644 --- a/src/network/protocol/packet/RotateHeadPacket.php +++ b/src/network/protocol/packet/RotateHeadPacket.php @@ -1,8 +1,7 @@ * false = yaw / 360 / 0.0039062
@@ -22,8 +21,11 @@ class RotateHeadPacket extends RakNetDataPacket{ public function encode(){ $this->reset(); - $this->putInt($this->eid); - @$this->putByte($this->rawYaw ? $this->yaw : $this->yaw / 360 / 0.0039062); //dont ask me why does chr count float TODO find a better way + $this->putInt(count($this->entities)); + foreach($this->entities as $d){ + $this->putInt($d[0]); //eid + $this->putByte((int) ($d[1] / 360 / 0.0039062)); + } } } \ No newline at end of file