40 private static array $uniqueRawStates = [];
42 private string $rawStateProperties;
48 private string $stateName,
49 array $stateProperties,
53 $this->rawStateProperties = self::$uniqueRawStates[$rawStateProperties] ??= $rawStateProperties;
56 public function getStateName() : string{ return $this->stateName; }
58 public function getRawStateProperties() : string{ return $this->rawStateProperties; }
60 public function generateStateData() : BlockStateData{
61 return new BlockStateData(
63 self::decodeStateProperties($this->rawStateProperties),
64 BlockStateData::CURRENT_VERSION
68 public function getMeta() : int{ return $this->meta; }
74 if($rawProperties ===
""){
84 if(count($properties) === 0){
88 ksort($properties, SORT_STRING);
90 foreach($properties as $k => $v){
93 return (
new LittleEndianNbtSerializer())->write(
new TreeRoot($tag));
static decodeStateProperties(string $rawProperties)
__construct(private string $stateName, array $stateProperties, private int $meta)
static encodeStateProperties(array $properties)