22 use GetTypeIdFromConstTrait;
24 public const ID = GameRuleType::BOOL;
28 public function __construct(
bool $value,
bool $isPlayerModifiable){
29 parent::__construct($isPlayerModifiable);
30 $this->value = $value;
33 public function getValue() :
bool{
37 public function encode(ByteBufferWriter $out,
bool $isStartGame) :
void{
38 CommonTypes::putBool($out, $this->value);
41 public static function decode(ByteBufferReader $in,
bool $isPlayerModifiable) :
self{
42 return new self(CommonTypes::getBool($in), $isPlayerModifiable);