27 public const ID = DataStoreType::UPDATE;
29 public function __construct(
31 private string $property,
34 private int $updateCount
37 public function getTypeId() :
int{
41 public function getName() :
string{
return $this->name; }
43 public function getProperty() :
string{
return $this->property; }
45 public function getPath() :
string{
return $this->path; }
49 public function getUpdateCount() :
int{
return $this->updateCount; }
51 public static function read(ByteBufferReader $in) :
self{
52 $name = CommonTypes::getString($in);
53 $property = CommonTypes::getString($in);
54 $path = CommonTypes::getString($in);
56 $data = match(VarInt::readUnsignedInt($in)){
57 DataStoreValueType::DOUBLE => DoubleDataStoreValue::read($in),
58 DataStoreValueType::BOOL => BoolDataStoreValue::read($in),
59 DataStoreValueType::STRING => StringDataStoreValue::read($in),
63 $updateCount = VarInt::readUnsignedInt($in);
74 public function write(ByteBufferWriter $out) :
void{
75 CommonTypes::putString($out, $this->name);
76 CommonTypes::putString($out, $this->property);
77 CommonTypes::putString($out, $this->path);
78 VarInt::writeUnsignedInt($out, $this->data->getTypeId());
79 $this->data->write($out);
80 VarInt::writeUnsignedInt($out, $this->updateCount);