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