mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into minor-next
This commit is contained in:
@@ -278,6 +278,10 @@ final class BlockStateUpgrader{
|
||||
private function applyPropertyFlattened(BlockStateUpgradeSchemaFlattenInfo $flattenInfo, string $oldName, array $states) : array{
|
||||
$flattenedValue = $states[$flattenInfo->flattenedProperty] ?? null;
|
||||
$expectedType = $flattenInfo->flattenedPropertyType;
|
||||
if($expectedType === null){
|
||||
//TODO: we can't make this non-nullable in a patch release
|
||||
throw new AssumptionFailedError("We never give this null");
|
||||
}
|
||||
if(!$flattenedValue instanceof $expectedType){
|
||||
//flattened property is not of the expected type, so this transformation is not applicable
|
||||
return [$oldName, $states];
|
||||
|
Reference in New Issue
Block a user