BlockStateUpgradeSchema: added isEmpty()

This commit is contained in:
Dylan K. Taylor 2022-02-10 13:03:29 +00:00
parent 1b3e50d0a3
commit 0a0383d9bd
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -73,4 +73,21 @@ final class BlockStateUpgradeSchema{
public function getVersionId() : int{
return ($this->maxVersionMajor << 24) | ($this->maxVersionMinor << 16) | ($this->maxVersionPatch << 8) | $this->maxVersionRevision;
}
public function isEmpty() : bool{
foreach([
$this->renamedIds,
$this->addedProperties,
$this->removedProperties,
$this->renamedProperties,
$this->remappedPropertyValues,
$this->remappedStates,
] as $list){
if(count($list) !== 0){
return false;
}
}
return true;
}
}