29 public function __construct(
30 private int $priority,
32 private bool $enabled,
33 private bool $transitionsPaused,
36 public function getPriority() :
int{
return $this->priority; }
40 public function isEnabled() :
bool{
return $this->enabled; }
42 public function isTransitionsPaused() :
bool{
return $this->transitionsPaused; }
44 public static function read(ByteBufferReader $in) :
self{
45 $priority = LE::readSignedInt($in);
46 $weight = match (VarInt::readUnsignedInt($in)){
47 AttributeLayerSettingsWeightFloat::ID => AttributeLayerSettingsWeightFloat::read($in),
48 AttributeLayerSettingsWeightString::ID => AttributeLayerSettingsWeightString::read($in),
51 $enabled = CommonTypes::getBool($in);
52 $transitionsPaused = CommonTypes::getBool($in);
62 public function write(ByteBufferWriter $out) :
void{
63 LE::writeSignedInt($out, $this->priority);
64 VarInt::writeUnsignedInt($out, $this->weight->getTypeId());
65 $this->weight->write($out);
66 CommonTypes::putBool($out, $this->enabled);
67 CommonTypes::putBool($out, $this->transitionsPaused);