mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-21 21:14:39 +00:00
Fixed Player->sendPosition() not working correctly
This commit is contained in:
parent
a3d21de559
commit
6d6283b7f3
@ -1896,7 +1896,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->playerGamemode = Player::getClientFriendlyGamemode($this->gamemode);
|
||||
|
||||
$pk->playerPosition = $this->getOffsetPosition();
|
||||
$pk->playerPosition = $this->getOffsetPosition($this);
|
||||
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->yaw = $this->yaw;
|
||||
@ -3693,7 +3693,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
$pk = new MovePlayerPacket();
|
||||
$pk->entityRuntimeId = $this->getId();
|
||||
$pk->position = $this->getOffsetPosition();
|
||||
$pk->position = $this->getOffsetPosition($pos);
|
||||
$pk->bodyYaw = $yaw;
|
||||
$pk->pitch = $pitch;
|
||||
$pk->yaw = $yaw;
|
||||
|
@ -1202,14 +1202,14 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function getOffsetPosition() : Vector3{
|
||||
return new Vector3($this->x, $this->y + $this->baseOffset, $this->z);
|
||||
public function getOffsetPosition(Vector3 $vector3) : Vector3{
|
||||
return new Vector3($vector3->x, $vector3->y + $this->baseOffset, $vector3->z);
|
||||
}
|
||||
|
||||
protected function broadcastMovement(){
|
||||
$pk = new MoveEntityPacket();
|
||||
$pk->entityRuntimeId = $this->id;
|
||||
$pk->position = $this->getOffsetPosition();
|
||||
$pk->position = $this->getOffsetPosition($this);
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->headYaw = $this->yaw; //TODO
|
||||
|
Loading…
x
Reference in New Issue
Block a user