mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added teleport flag to MovePlayerPacket, improves player movement
This commit is contained in:
parent
87b800ebb9
commit
46e502430e
@ -2323,6 +2323,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->bodyYaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->teleport = true;
|
||||
$this->directDataPacket($pk);
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ class MovePlayerPacket extends DataPacket{
|
||||
public $yaw;
|
||||
public $pitch;
|
||||
public $bodyYaw;
|
||||
public $teleport = false;
|
||||
|
||||
public function pid(){
|
||||
return Info::MOVE_PLAYER_PACKET;
|
||||
@ -43,6 +44,8 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->yaw = $this->getFloat();
|
||||
$this->pitch = $this->getFloat();
|
||||
$this->bodyYaw = $this->getFloat();
|
||||
$flags = $this->getByte();
|
||||
$this->teleport = (($flags & 0x80) > 0);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -54,6 +57,7 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->putFloat($this->yaw);
|
||||
$this->putFloat($this->pitch);
|
||||
$this->putFloat($this->bodyYaw);
|
||||
$this->putByte($this->teleport == true ? 0x80 : 0x00);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user