24 public const NETWORK_ID = ProtocolInfo::CHANGE_MOB_PROPERTY_PACKET;
26 private int $actorUniqueId;
27 private string $propertyName;
28 private bool $boolValue;
29 private string $stringValue;
30 private int $intValue;
31 private float $floatValue;
36 private static function create(
int $actorUniqueId,
string $propertyName,
bool $boolValue,
string $stringValue,
int $intValue,
float $floatValue) :
self{
38 $result->actorUniqueId = $actorUniqueId;
39 $result->propertyName = $propertyName;
40 $result->boolValue = $boolValue;
41 $result->stringValue = $stringValue;
42 $result->intValue = $intValue;
43 $result->floatValue = $floatValue;
47 public static function boolValue(
int $actorUniqueId,
string $propertyName,
bool $value) :
self{
48 return self::create($actorUniqueId, $propertyName, $value,
"", 0, 0);
51 public static function stringValue(
int $actorUniqueId,
string $propertyName,
string $value) :
self{
52 return self::create($actorUniqueId, $propertyName,
false, $value, 0, 0);
55 public static function intValue(
int $actorUniqueId,
string $propertyName,
int $value) :
self{
56 return self::create($actorUniqueId, $propertyName,
false,
"", $value, 0);
59 public static function floatValue(
int $actorUniqueId,
string $propertyName,
float $value) :
self{
60 return self::create($actorUniqueId, $propertyName,
false,
"", 0, $value);
63 public function getActorUniqueId() :
int{
return $this->actorUniqueId; }
65 public function getPropertyName() :
string{
return $this->propertyName; }
67 public function isBoolValue() :
bool{
return $this->boolValue; }
69 public function getStringValue() :
string{
return $this->stringValue; }
71 public function getIntValue() :
int{
return $this->intValue; }
73 public function getFloatValue() :
float{
return $this->floatValue; }
76 $this->actorUniqueId = $in->getActorUniqueId();
78 $this->boolValue = $in->
getBool();
85 $out->putActorUniqueId($this->actorUniqueId);
86 $out->putString($this->propertyName);
87 $out->putBool($this->boolValue);
88 $out->putString($this->stringValue);
90 $out->putLFloat($this->floatValue);
94 return $handler->handleChangeMobProperty($this);