20 public function __construct(
22 private int $hotbarSlot,
24 private int $itemStackId,
25 private string $customName,
26 private int $durabilityCorrection
29 public function getSlot() :
int{
return $this->slot; }
31 public function getHotbarSlot() :
int{
return $this->hotbarSlot; }
33 public function getCount() :
int{
return $this->count; }
35 public function getItemStackId() :
int{
return $this->itemStackId; }
37 public function getCustomName() :
string{
return $this->customName; }
39 public function getDurabilityCorrection() :
int{
return $this->durabilityCorrection; }
45 $itemStackId = $in->readServerItemStackId();
48 return new self($slot, $hotbarSlot, $count, $itemStackId, $customName, $durabilityCorrection);
52 $out->putByte($this->slot);
53 $out->putByte($this->hotbarSlot);
54 $out->putByte($this->count);
55 $out->writeServerItemStackId($this->itemStackId);
56 $out->putString($this->customName);
57 $out->
putVarInt($this->durabilityCorrection);