From e15eefc58f987c87032cc334418a0848a2a21954 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 18 Aug 2017 13:58:33 +0100 Subject: [PATCH] ... --- .../protocol/SetDefaultGameTypePacket.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php diff --git a/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php b/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php new file mode 100644 index 0000000000..6ca31d3d91 --- /dev/null +++ b/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php @@ -0,0 +1,47 @@ + + +use pocketmine\network\mcpe\NetworkSession; + +class SetDefaultGameTypePacket extends DataPacket{ + const NETWORK_ID = ProtocolInfo::SET_DEFAULT_GAME_TYPE_PACKET; + + /** @var int */ + public $gamemode; + + protected function decodePayload(){ + $this->gamemode = $this->getVarInt(); + } + + protected function encodePayload(){ + $this->putUnsignedVarInt($this->gamemode); + } + + public function handle(NetworkSession $session) : bool{ + return $session->handleSetDefaultGameType($this); + } +} \ No newline at end of file