diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 37e99346..8e9915f2 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1273,13 +1273,8 @@ class Entity extends Position $this->player->teleport(new Vector3($this->x, $this->y, $this->z)); return; } - $pk = new MoveEntityPacket_PosRot(); - $pk->eid = $this->eid; - $pk->x = $this->x; - $pk->y = $this->y; - $pk->z = $this->z; - $pk->yaw = $this->yaw; - $pk->pitch = $this->pitch; + $pk = new MoveEntityPacket(); + $pk->entities = [[$this->eid, $this->x, $this->y, $this->z, $this->yaw, $this->pitch]]; $this->server->api->player->broadcastPacket($this->level->players, $pk); } diff --git a/src/network/protocol/packet/MoveEntityPacket.php b/src/network/protocol/packet/MoveEntityPacket.php index be59077c..16456d2a 100644 --- a/src/network/protocol/packet/MoveEntityPacket.php +++ b/src/network/protocol/packet/MoveEntityPacket.php @@ -1,7 +1,16 @@ reset(); + $this->putInt(count($this->entities)); + foreach($this->entities as $d){ + $this->putInt($d[0]); //eid + $this->putFloat($d[1]); //x + $this->putFloat($d[2]); //y + $this->putFloat($d[3]); //z + $this->putFloat($d[4]); //yaw + $this->putFloat($d[5]); //pitch + } } } \ No newline at end of file