28 private int $blockRuntimeId,
29 private string $rawExtraData,
32 public static function null() : self{
33 return new self(0, 0, 0, 0,
"");
36 public function isNull() : bool{
37 return $this->id === 0;
40 public function getId() : int{
44 public function getMeta() : int{
48 public function getCount() : int{
52 public function getBlockRuntimeId() : int{ return $this->blockRuntimeId; }
63 public function equals(
ItemStack $itemStack) : bool{
64 return $this->equalsWithoutCount($itemStack) && $this->count === $itemStack->count;
67 public function equalsWithoutCount(
ItemStack $itemStack) : bool{
69 $this->id === $itemStack->id &&
70 $this->meta === $itemStack->meta &&
71 $this->blockRuntimeId === $itemStack->blockRuntimeId &&
72 $this->rawExtraData === $itemStack->rawExtraData;
79 "meta" => $this->meta,
80 "count" => $this->count,
81 "blockRuntimeId" => $this->blockRuntimeId,
82 "rawExtraData" => base64_encode($this->rawExtraData),