Fixed player heads not being rotated

This commit is contained in:
Shoghi Cervantes 2013-12-13 01:17:55 +01:00
parent 2b0fdd5062
commit 1a7e916928
2 changed files with 22 additions and 12 deletions

View File

@ -388,17 +388,17 @@ class CustomPacketHandler{
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["bodyYaw"] = Utils::readFloat($this->get(4));
$this->data["pitch"] = Utils::readFloat($this->get(4));
$this->data["yaw"] = Utils::readFloat($this->get(4));
$this->data["pitch"] = Utils::readFloat($this->get(4));
$this->data["bodyYaw"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeFloat($this->data["bodyYaw"]);
$this->raw .= Utils::writeFloat($this->data["pitch"]);
$this->raw .= Utils::writeFloat($this->data["yaw"]);
$this->raw .= Utils::writeFloat($this->data["pitch"]);
$this->raw .= Utils::writeFloat($this->data["bodyYaw"]);
}
break;
case MC_PLACE_BLOCK:

View File

@ -565,15 +565,25 @@ class Entity extends Position{
$players = $this->server->api->player->getAll($this->level);
if($this->player instanceof Player){
unset($players[$this->player->CID]);
$this->server->api->player->broadcastPacket($players, MC_MOVE_PLAYER, array(
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
"yaw" => $this->yaw,
"pitch" => $this->pitch,
"bodyYaw" => $this->yaw,
));
}else{
$this->server->api->player->broadcastPacket($players, MC_MOVE_ENTITY_POSROT, array(
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
"yaw" => $this->yaw,
"pitch" => $this->pitch,
));
}
$this->server->api->player->broadcastPacket($players, MC_MOVE_ENTITY_POSROT, array(
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
"yaw" => $this->yaw,
"pitch" => $this->pitch,
));
}
}else{
$this->updatePosition($this->x, $this->y, $this->z, $this->yaw, $this->pitch);