diff --git a/src/data/bedrock/block/convert/VanillaBlockMappings.php b/src/data/bedrock/block/convert/VanillaBlockMappings.php index fc1c6acb6..f339ce3ef 100644 --- a/src/data/bedrock/block/convert/VanillaBlockMappings.php +++ b/src/data/bedrock/block/convert/VanillaBlockMappings.php @@ -118,10 +118,10 @@ use pocketmine\data\bedrock\block\convert\property\EnumFromRawStateMap; use pocketmine\data\bedrock\block\convert\property\FlattenedCaveVinesVariant; use pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap; use pocketmine\data\bedrock\block\convert\property\IntProperty; -use pocketmine\data\bedrock\block\convert\property\OptionSetFromIntProperty; use pocketmine\data\bedrock\block\convert\property\ValueFromIntProperty; use pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty; use pocketmine\data\bedrock\block\convert\property\ValueMappings; +use pocketmine\data\bedrock\block\convert\property\ValueSetFromIntProperty; use pocketmine\math\Facing; use function array_map; use function min; @@ -581,7 +581,7 @@ final class VanillaBlockMappings{ $reg->mapModel(Model::create(Blocks::RESIN_CLUMP(), Ids::RESIN_CLUMP)->properties([$commonProperties->multiFacingFlags])); $reg->mapModel(Model::create(Blocks::VINES(), Ids::VINE)->properties([ - new OptionSetFromIntProperty( + new ValueSetFromIntProperty( StateNames::VINE_DIRECTION_BITS, IntFromRawStateMap::int([ Facing::NORTH => BlockLegacyMetadata::VINE_FLAG_NORTH, @@ -1267,7 +1267,7 @@ final class VanillaBlockMappings{ $reg->mapModel(Model::create(Blocks::CHAIN(), Ids::CHAIN)->properties([$commonProperties->pillarAxis])); $reg->mapModel(Model::create(Blocks::CHISELED_BOOKSHELF(), Ids::CHISELED_BOOKSHELF)->properties([ $commonProperties->horizontalFacingSWNE, - new OptionSetFromIntProperty( + new ValueSetFromIntProperty( StateNames::BOOKS_STORED, EnumFromRawStateMap::int(ChiseledBookshelfSlot::class, fn(ChiseledBookshelfSlot $case) => match($case){ //these are (currently) the same as the internal values, but it's best not to rely on those in case Mojang mess with the flags diff --git a/src/data/bedrock/block/convert/property/CommonProperties.php b/src/data/bedrock/block/convert/property/CommonProperties.php index 35d7e21b6..666637027 100644 --- a/src/data/bedrock/block/convert/property/CommonProperties.php +++ b/src/data/bedrock/block/convert/property/CommonProperties.php @@ -80,8 +80,8 @@ final class CommonProperties{ /** @phpstan-var ValueFromIntProperty */ public readonly ValueFromIntProperty $anyFacingClassic; - /** @phpstan-var OptionSetFromIntProperty */ - public readonly OptionSetFromIntProperty $multiFacingFlags; + /** @phpstan-var ValueSetFromIntProperty */ + public readonly ValueSetFromIntProperty $multiFacingFlags; /** @phpstan-var IntProperty */ public readonly IntProperty $floorSignLikeRotation; @@ -242,7 +242,7 @@ final class CommonProperties{ fn(AnyFacing $b, int $v) => $b->setFacing($v) ); - $this->multiFacingFlags = new OptionSetFromIntProperty( + $this->multiFacingFlags = new ValueSetFromIntProperty( StateNames::MULTI_FACE_DIRECTION_BITS, IntFromRawStateMap::int([ Facing::DOWN => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_DOWN, diff --git a/src/data/bedrock/block/convert/property/OptionSetFromIntProperty.php b/src/data/bedrock/block/convert/property/ValueSetFromIntProperty.php similarity index 98% rename from src/data/bedrock/block/convert/property/OptionSetFromIntProperty.php rename to src/data/bedrock/block/convert/property/ValueSetFromIntProperty.php index a91c681b8..89913d78b 100644 --- a/src/data/bedrock/block/convert/property/OptionSetFromIntProperty.php +++ b/src/data/bedrock/block/convert/property/ValueSetFromIntProperty.php @@ -32,7 +32,7 @@ use pocketmine\utils\AssumptionFailedError; * @phpstan-template TOption of int|\UnitEnum * @phpstan-implements Property */ -class OptionSetFromIntProperty implements Property{ +class ValueSetFromIntProperty implements Property{ private int $maxValue = 0; diff --git a/src/data/bedrock/block/convert/property/WallConnectionTypeShim.php b/src/data/bedrock/block/convert/property/WallConnectionTypeShim.php index bdd878b52..c7d4913cf 100644 --- a/src/data/bedrock/block/convert/property/WallConnectionTypeShim.php +++ b/src/data/bedrock/block/convert/property/WallConnectionTypeShim.php @@ -30,6 +30,7 @@ use pocketmine\data\bedrock\block\BlockStateStringValues; * Internally we use null for no connections, but accepting this in the mapping code would require a fair amount of * extra complexity for this one case. This shim allows us to use the regular systems for handling walls. * TODO: get rid of this in PM6 and make the internal enum have a NONE case + * @internal */ enum WallConnectionTypeShim{ case NONE;