24 use GetTypeIdFromConstTrait;
26 public const ID = ItemDescriptorType::STRING_ID_META;
28 public function __construct(
33 throw new \InvalidArgumentException(
"Meta cannot be negative");
37 public function getId() :
string{
return $this->id; }
39 public function getMeta() :
int{
return $this->meta; }
41 public static function read(ByteBufferReader $in) :
self{
42 $stringId = CommonTypes::getString($in);
43 $meta = LE::readUnsignedShort($in);
45 return new self($stringId, $meta);
48 public function write(ByteBufferWriter $out) :
void{
49 CommonTypes::putString($out, $this->
id);
50 LE::writeUnsignedShort($out, $this->meta);