mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Added teleport flag to MovePlayerPacket, improves player movement
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user