From 44b723984716b8cf2d8d604fee859de329de9890 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 25 Jun 2019 19:28:30 +0100 Subject: [PATCH] SetDefaultGameTypePacket: added ::create() not using this yet, but it was in my workspace and it might come in useful --- .../network/mcpe/protocol/SetDefaultGameTypePacket.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php b/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php index de16f014b..383c91266 100644 --- a/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php +++ b/src/pocketmine/network/mcpe/protocol/SetDefaultGameTypePacket.php @@ -33,6 +33,12 @@ class SetDefaultGameTypePacket extends DataPacket implements ClientboundPacket, /** @var int */ public $gamemode; + public static function create(int $gameMode) : self{ + $result = new self; + $result->gamemode = $gameMode; + return $result; + } + protected function decodePayload() : void{ $this->gamemode = $this->getVarInt(); }