mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
New fields for MovePlayer and MoveEntity packets
This commit is contained in:
parent
e22bb213af
commit
db4027cdb2
@ -36,8 +36,8 @@ class MoveEntityPacket extends DataPacket{
|
||||
public $yaw;
|
||||
public $headYaw;
|
||||
public $pitch;
|
||||
public $byte1;
|
||||
public $byte2;
|
||||
public $onGround;
|
||||
public $teleported;
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getEntityRuntimeId();
|
||||
@ -45,8 +45,8 @@ class MoveEntityPacket extends DataPacket{
|
||||
$this->pitch = $this->getByte() * (360.0 / 256);
|
||||
$this->headYaw = $this->getByte() * (360.0 / 256);
|
||||
$this->yaw = $this->getByte() * (360.0 / 256);
|
||||
$this->byte1 = $this->getByte();
|
||||
$this->byte2 = $this->getByte();
|
||||
$this->onGround = $this->getByte();
|
||||
$this->teleported = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -56,8 +56,8 @@ class MoveEntityPacket extends DataPacket{
|
||||
$this->putByte($this->pitch / (360.0 / 256));
|
||||
$this->putByte($this->headYaw / (360.0 / 256));
|
||||
$this->putByte($this->yaw / (360.0 / 256));
|
||||
$this->putByte($this->byte1);
|
||||
$this->putByte($this->byte2);
|
||||
$this->putByte($this->onGround);
|
||||
$this->putByte($this->teleported);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
@ -42,7 +42,7 @@ class MovePlayerPacket extends DataPacket{
|
||||
public $pitch;
|
||||
public $mode = self::MODE_NORMAL;
|
||||
public $onGround;
|
||||
public $eid2; //???
|
||||
public $ridingEid;
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getEntityRuntimeId();
|
||||
@ -52,7 +52,7 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->bodyYaw = $this->getLFloat();
|
||||
$this->mode = $this->getByte();
|
||||
$this->onGround = $this->getBool();
|
||||
$this->eid2 = $this->getEntityRuntimeId();
|
||||
$this->ridingEid = $this->getEntityRuntimeId();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -64,7 +64,7 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->putLFloat($this->bodyYaw); //TODO
|
||||
$this->putByte($this->mode);
|
||||
$this->putBool($this->onGround);
|
||||
$this->putEntityRuntimeId($this->eid2);
|
||||
$this->putEntityRuntimeId($this->ridingEid);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user