From 5cc1068cd43264d3363295eb8d6901e02f467897 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:29:22 +0000 Subject: [PATCH 1/3] Bump docker/build-push-action from 6.7.0 to 6.8.0 (#6462) --- .github/workflows/build-docker-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 437ed963f..7f5eae32a 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -53,7 +53,7 @@ jobs: run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT - name: Build image for tag - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true context: ./pocketmine-mp @@ -66,7 +66,7 @@ jobs: - name: Build image for major tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true context: ./pocketmine-mp @@ -79,7 +79,7 @@ jobs: - name: Build image for minor tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true context: ./pocketmine-mp @@ -92,7 +92,7 @@ jobs: - name: Build image for latest tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true context: ./pocketmine-mp From 59d14de1d83d9babd30a9c45965feae90374d6ba Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 17 Oct 2024 20:51:17 +0100 Subject: [PATCH 2/3] generate-blockstate-upgrade-schema: fallback to exact state match when encountering ambiguous filters this popped up due to new changes in 1.20.40. Really we need to improve the way the filters are calculated, but this workaround solves the issue for now. --- tools/generate-blockstate-upgrade-schema.php | 27 ++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tools/generate-blockstate-upgrade-schema.php b/tools/generate-blockstate-upgrade-schema.php index 54984d459..e5eab822f 100644 --- a/tools/generate-blockstate-upgrade-schema.php +++ b/tools/generate-blockstate-upgrade-schema.php @@ -496,8 +496,31 @@ function processRemappedStates(array $upgradeTable) : array{ if($existing === null || $existing->equals($remap)){ $list[$rawOldState] = $remap; }else{ - //match criteria is borked - throw new AssumptionFailedError("Match criteria resulted in two ambiguous remaps"); + //TODO: ambiguous filter - this is a bug in the unchanged states calculation + //this is a real pain to fix, so workaround this for now + //this arose in 1.20.40 with brown_mushroom_block when variants 10 and 15 were remapped to mushroom_stem + //while also keeping the huge_mushroom_bits property with the same value + //this causes huge_mushroom_bits to be considered an "unchanged" state, which is *technically* correct, but + //means it can't be deleted from the filter + + //move stuff from newState to copiedState where possible, even if we can't delete it from the filter + $cleanedNewState2 = $newState; + $copiedState = []; + foreach(Utils::stringifyKeys($cleanedNewState2) as $newPropertyName => $newPropertyValue){ + if(isset($oldState[$newPropertyName]) && $oldState[$newPropertyName]->equals($newPropertyValue)){ + $copiedState[] = $newPropertyName; + unset($cleanedNewState2[$newPropertyName]); + } + } + + $list[encodeOrderedProperties($oldState)] = new BlockStateUpgradeSchemaBlockRemap( + $oldState, + $newName, + $cleanedNewState2, + $copiedState + ); + \GlobalLogger::get()->warning("Couldn't calculate an unambiguous partial remappedStates filter for some states of \"" . $pair->old->getName() . "\" - falling back to exact match"); + \GlobalLogger::get()->warning("The schema should still work, but may be larger than desired"); } } From f1b1a7022d7dc67d012d8891bc4c23c2652c825e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 17 Oct 2024 20:55:12 +0100 Subject: [PATCH 3/3] and a sanity check just in case --- tools/generate-blockstate-upgrade-schema.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/generate-blockstate-upgrade-schema.php b/tools/generate-blockstate-upgrade-schema.php index e5eab822f..741098f7a 100644 --- a/tools/generate-blockstate-upgrade-schema.php +++ b/tools/generate-blockstate-upgrade-schema.php @@ -513,7 +513,11 @@ function processRemappedStates(array $upgradeTable) : array{ } } - $list[encodeOrderedProperties($oldState)] = new BlockStateUpgradeSchemaBlockRemap( + $fallbackRawFilter = encodeOrderedProperties($oldState); + if(isset($list[$fallbackRawFilter])){ + throw new AssumptionFailedError("Exact match filter collision for \"" . $pair->old->getName() . "\" - this should never happen"); + } + $list[$fallbackRawFilter] = new BlockStateUpgradeSchemaBlockRemap( $oldState, $newName, $cleanedNewState2,