From 0a0383d9bda6e81998f4f0ba7610bd08418935e4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 10 Feb 2022 13:03:29 +0000 Subject: [PATCH] BlockStateUpgradeSchema: added isEmpty() --- .../upgrade/BlockStateUpgradeSchema.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/data/bedrock/blockstate/upgrade/BlockStateUpgradeSchema.php b/src/data/bedrock/blockstate/upgrade/BlockStateUpgradeSchema.php index 024b0d4b3..fa845acfb 100644 --- a/src/data/bedrock/blockstate/upgrade/BlockStateUpgradeSchema.php +++ b/src/data/bedrock/blockstate/upgrade/BlockStateUpgradeSchema.php @@ -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; + } }