23 public function __construct(
29 public function getEntryId() :
int{
return $this->entryId; }
31 public function getItem() :
ItemStack{
return $this->item; }
33 public function getGroupId() :
int{
return $this->groupId; }
35 public static function read(ByteBufferReader $in) :
self{
36 $entryId = CommonTypes::readCreativeItemNetId($in);
37 $item = CommonTypes::getItemStackWithoutStackId($in);
38 $groupId = VarInt::readUnsignedInt($in);
39 return new self($entryId, $item, $groupId);
42 public function write(ByteBufferWriter $out) :
void{
43 CommonTypes::writeCreativeItemNetId($out, $this->entryId);
44 CommonTypes::putItemStackWithoutStackId($out, $this->item);
45 VarInt::writeUnsignedInt($out, $this->groupId);