New fields for MovePlayer and MoveEntity packets

This commit is contained in:
Dylan K. Taylor 2017-04-22 00:58:18 +01:00
parent e22bb213af
commit db4027cdb2
2 changed files with 9 additions and 9 deletions

View File

@ -36,8 +36,8 @@ class MoveEntityPacket extends DataPacket{
public $yaw; public $yaw;
public $headYaw; public $headYaw;
public $pitch; public $pitch;
public $byte1; public $onGround;
public $byte2; public $teleported;
public function decode(){ public function decode(){
$this->eid = $this->getEntityRuntimeId(); $this->eid = $this->getEntityRuntimeId();
@ -45,8 +45,8 @@ class MoveEntityPacket extends DataPacket{
$this->pitch = $this->getByte() * (360.0 / 256); $this->pitch = $this->getByte() * (360.0 / 256);
$this->headYaw = $this->getByte() * (360.0 / 256); $this->headYaw = $this->getByte() * (360.0 / 256);
$this->yaw = $this->getByte() * (360.0 / 256); $this->yaw = $this->getByte() * (360.0 / 256);
$this->byte1 = $this->getByte(); $this->onGround = $this->getByte();
$this->byte2 = $this->getByte(); $this->teleported = $this->getByte();
} }
public function encode(){ public function encode(){
@ -56,8 +56,8 @@ class MoveEntityPacket extends DataPacket{
$this->putByte($this->pitch / (360.0 / 256)); $this->putByte($this->pitch / (360.0 / 256));
$this->putByte($this->headYaw / (360.0 / 256)); $this->putByte($this->headYaw / (360.0 / 256));
$this->putByte($this->yaw / (360.0 / 256)); $this->putByte($this->yaw / (360.0 / 256));
$this->putByte($this->byte1); $this->putByte($this->onGround);
$this->putByte($this->byte2); $this->putByte($this->teleported);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -42,7 +42,7 @@ class MovePlayerPacket extends DataPacket{
public $pitch; public $pitch;
public $mode = self::MODE_NORMAL; public $mode = self::MODE_NORMAL;
public $onGround; public $onGround;
public $eid2; //??? public $ridingEid;
public function decode(){ public function decode(){
$this->eid = $this->getEntityRuntimeId(); $this->eid = $this->getEntityRuntimeId();
@ -52,7 +52,7 @@ class MovePlayerPacket extends DataPacket{
$this->bodyYaw = $this->getLFloat(); $this->bodyYaw = $this->getLFloat();
$this->mode = $this->getByte(); $this->mode = $this->getByte();
$this->onGround = $this->getBool(); $this->onGround = $this->getBool();
$this->eid2 = $this->getEntityRuntimeId(); $this->ridingEid = $this->getEntityRuntimeId();
} }
public function encode(){ public function encode(){
@ -64,7 +64,7 @@ class MovePlayerPacket extends DataPacket{
$this->putLFloat($this->bodyYaw); //TODO $this->putLFloat($this->bodyYaw); //TODO
$this->putByte($this->mode); $this->putByte($this->mode);
$this->putBool($this->onGround); $this->putBool($this->onGround);
$this->putEntityRuntimeId($this->eid2); $this->putEntityRuntimeId($this->ridingEid);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{