SetCommandsEnabledPacket: added ::create()

This commit is contained in:
Dylan K. Taylor 2020-11-16 19:11:10 +00:00
parent ca6a892834
commit 869c9dabf1

View File

@ -33,6 +33,12 @@ class SetCommandsEnabledPacket extends DataPacket implements ClientboundPacket{
/** @var bool */
public $enabled;
public static function create(bool $enabled) : self{
$result = new self;
$result->enabled = $enabled;
return $result;
}
protected function decodePayload(PacketSerializer $in) : void{
$this->enabled = $in->getBool();
}