color = DyeColor::BLACK(); parent::__construct($identifier, $name); } public function getMeta() : int{ return match($this->color->id()){ DyeColor::BLACK()->id() => 16, DyeColor::BROWN()->id() => 17, DyeColor::BLUE()->id() => 18, DyeColor::WHITE()->id() => 19, default => DyeColorIdMap::getInstance()->toInvertedId($this->color) }; } public function getColor() : DyeColor{ return $this->color; } /** * @return $this */ public function setColor(DyeColor $color) : self{ $this->color = $color; return $this; } }