*/ private array $states = []; public function __construct( private string $id ){} public static function create(string $id) : self{ return new self($id); } /** @return $this */ public function writeBool(string $name, bool $value) : self{ $this->states[$name] = new ByteTag($value ? 1 : 0); return $this; } /** @return $this */ public function writeInt(string $name, int $value) : self{ $this->states[$name] = new IntTag($value); return $this; } /** @return $this */ public function writeString(string $name, string $value) : self{ $this->states[$name] = new StringTag($value); return $this; } public function getBlockStateData() : BlockStateData{ return BlockStateData::current($this->id, $this->states); } }