SetDefaultGameTypePacket: added ::create()

not using this yet, but it was in my workspace and it might come in useful
This commit is contained in:
Dylan K. Taylor 2019-06-25 19:28:30 +01:00
parent e8d9acb59f
commit 44b7239847

View File

@ -33,6 +33,12 @@ class SetDefaultGameTypePacket extends DataPacket implements ClientboundPacket,
/** @var int */ /** @var int */
public $gamemode; public $gamemode;
public static function create(int $gameMode) : self{
$result = new self;
$result->gamemode = $gameMode;
return $result;
}
protected function decodePayload() : void{ protected function decodePayload() : void{
$this->gamemode = $this->getVarInt(); $this->gamemode = $this->getVarInt();
} }