From dc71eb5246e688b2cc47bf3e37bffa2b29dc3299 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 27 Apr 2017 11:24:16 +0100 Subject: [PATCH] Protocol updates for 1.1.0.9 --- .../network/mcpe/protocol/MovePlayerPacket.php | 13 ++++++++++++- .../network/mcpe/protocol/ProtocolInfo.php | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/network/mcpe/protocol/MovePlayerPacket.php b/src/pocketmine/network/mcpe/protocol/MovePlayerPacket.php index 0a988042f..eac23c8b9 100644 --- a/src/pocketmine/network/mcpe/protocol/MovePlayerPacket.php +++ b/src/pocketmine/network/mcpe/protocol/MovePlayerPacket.php @@ -31,7 +31,8 @@ class MovePlayerPacket extends DataPacket{ const MODE_NORMAL = 0; const MODE_RESET = 1; - const MODE_ROTATION = 2; + const MODE_TELEPORT = 2; + const MODE_PITCH = 3; //facepalm Mojang public $eid; public $x; @@ -43,6 +44,8 @@ class MovePlayerPacket extends DataPacket{ public $mode = self::MODE_NORMAL; public $onGround; public $ridingEid; + public $int1 = 0; + public $int2 = 0; public function decode(){ $this->eid = $this->getEntityRuntimeId(); @@ -53,6 +56,10 @@ class MovePlayerPacket extends DataPacket{ $this->mode = $this->getByte(); $this->onGround = $this->getBool(); $this->ridingEid = $this->getEntityRuntimeId(); + if($this->mode === MovePlayerPacket::MODE_TELEPORT){ + $this->int1 = $this->getLInt(); + $this->int2 = $this->getLInt(); + } } public function encode(){ @@ -65,6 +72,10 @@ class MovePlayerPacket extends DataPacket{ $this->putByte($this->mode); $this->putBool($this->onGround); $this->putEntityRuntimeId($this->ridingEid); + if($this->mode === MovePlayerPacket::MODE_TELEPORT){ + $this->putLInt($this->int1); + $this->putLInt($this->int2); + } } public function handle(NetworkSession $session) : bool{ diff --git a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php index ca0a97bdf..f19bff067 100644 --- a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php +++ b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php @@ -31,9 +31,9 @@ interface ProtocolInfo{ /** * Actual Minecraft: PE protocol version */ - const CURRENT_PROTOCOL = 111; - const MINECRAFT_VERSION = 'v1.1.0.8 beta'; - const MINECRAFT_VERSION_NETWORK = '1.1.0.8'; + const CURRENT_PROTOCOL = 112; + const MINECRAFT_VERSION = 'v1.1.0.9 beta'; + const MINECRAFT_VERSION_NETWORK = '1.1.0.9'; const LOGIN_PACKET = 0x01; const PLAY_STATUS_PACKET = 0x02;