Add support for specialized flattenedProperties in schema format

This commit is contained in:
Dylan K. Taylor
2024-10-24 16:12:28 +01:00
parent acbfb0a3e9
commit 22718c4971
10 changed files with 251 additions and 101 deletions

View File

@ -43,7 +43,7 @@ final class BlockStateUpgradeSchemaModelBlockRemap{
* Either this or newName must be present
* Due to technical limitations of jsonmapper, we can't use a union type here
*/
public BlockStateUpgradeSchemaModelFlattenedName $newFlattenedName;
public BlockStateUpgradeSchemaModelFlattenInfo $newFlattenedName;
/**
* @var BlockStateUpgradeSchemaModelTag[]|null
@ -67,9 +67,9 @@ final class BlockStateUpgradeSchemaModelBlockRemap{
* @phpstan-param array<string, BlockStateUpgradeSchemaModelTag> $newState
* @phpstan-param list<string> $copiedState
*/
public function __construct(array $oldState, string|BlockStateUpgradeSchemaModelFlattenedName $newNameRule, array $newState, array $copiedState){
public function __construct(array $oldState, string|BlockStateUpgradeSchemaModelFlattenInfo $newNameRule, array $newState, array $copiedState){
$this->oldState = count($oldState) === 0 ? null : $oldState;
if($newNameRule instanceof BlockStateUpgradeSchemaModelFlattenedName){
if($newNameRule instanceof BlockStateUpgradeSchemaModelFlattenInfo){
$this->newFlattenedName = $newNameRule;
}else{
$this->newName = $newNameRule;