From 85606925a1b9f747cc65357a1fc5e314503486d2 Mon Sep 17 00:00:00 2001 From: Dylan T <14214667+dktapps@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:26:51 +0100 Subject: [PATCH 01/10] BlockStateData: add a note about CURRENT_VERSION this is not the same as current game version, as the revision is determined by some Mojang internal factors. --- src/data/bedrock/block/BlockStateData.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/bedrock/block/BlockStateData.php b/src/data/bedrock/block/BlockStateData.php index 51899b72b..2c67ded73 100644 --- a/src/data/bedrock/block/BlockStateData.php +++ b/src/data/bedrock/block/BlockStateData.php @@ -38,6 +38,9 @@ use function implode; final class BlockStateData{ /** * Bedrock version of the most recent backwards-incompatible change to blockstates. + * + * This is *not* the same as current game version. It should match the numbers in the + * newest blockstate upgrade schema used in BedrockBlockUpgradeSchema. */ public const CURRENT_VERSION = (1 << 24) | //major From 786d84a9e1af79e7b9114fe1d6725bb291408534 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:43:18 +0000 Subject: [PATCH 02/10] Bump shivammathur/setup-php from 2.30.4 to 2.31.1 Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.30.4 to 2.31.1. - [Release notes](https://github.com/shivammathur/setup-php/releases) - [Commits](https://github.com/shivammathur/setup-php/compare/2.30.4...2.31.1) --- updated-dependencies: - dependency-name: shivammathur/setup-php dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/discord-release-notify.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-release-notify.yml b/.github/workflows/discord-release-notify.yml index ce8a16ebc..8d0add224 100644 --- a/.github/workflows/discord-release-notify.yml +++ b/.github/workflows/discord-release-notify.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: 8.2 diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 311e0c827..c47a4399b 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -20,7 +20,7 @@ jobs: submodules: true - name: Setup PHP - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: ${{ matrix.php-version }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92bd7171b..7c92c0b8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.30.4 + uses: shivammathur/setup-php@2.31.1 with: php-version: 8.2 tools: php-cs-fixer:3.49 From f750b01d8be7bc97e1c340b0450240c36520747e Mon Sep 17 00:00:00 2001 From: Dylan T <14214667+dktapps@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:10:14 +0100 Subject: [PATCH 03/10] dependabot: group patch updates into a single PR --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8acff71d6..39d5c68b8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,19 @@ updates: update-types: - "version-update:semver-major" - "version-update:semver-minor" + groups: + production-patch-updates: + dependency-type: production + patterns: + - "*" + update-types: + - "patch" + development-patch-updates: + dependency-type: development + patterns: + - "*" + update-types: + - "patch" - package-ecosystem: gitsubmodule directory: "/" From 32be474840630667785b1a5823b41d40e783598a Mon Sep 17 00:00:00 2001 From: Dylan T <14214667+dktapps@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:12:47 +0100 Subject: [PATCH 04/10] dependabot: group PHPStan dependency updates always these typically need to be updated together anyway --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39d5c68b8..97607ab8f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -25,6 +25,9 @@ updates: - "*" update-types: - "patch" + phpstan: + patterns: + - "phpstan/*" - package-ecosystem: gitsubmodule directory: "/" From 1f510caf88271f25f6e944919cd3bd04c00ad96a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:16:44 +0000 Subject: [PATCH 05/10] Bump the phpstan group with 2 updates (#6401) --- composer.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 0547560cc..a68d34533 100644 --- a/composer.lock +++ b/composer.lock @@ -1447,21 +1447,21 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.16", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95" + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d5242a59d035e46774f2e634b374bc39ff62cb95", - "reference": "d5242a59d035e46774f2e634b374bc39ff62cb95", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f3ea021866f4263f07ca3636bf22c64be9610c11", + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.11" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -1493,27 +1493,27 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.16" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.0" }, - "time": "2024-02-23T09:51:20+00:00" + "time": "2024-04-20T06:39:00+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.5.5", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918" + "reference": "363f921dd8441777d4fc137deb99beb486c77df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2e193a07651a6f4be3baa44ddb21d822681f5918", - "reference": "2e193a07651a6f4be3baa44ddb21d822681f5918", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/363f921dd8441777d4fc137deb99beb486c77df1", + "reference": "363f921dd8441777d4fc137deb99beb486c77df1", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.60" + "phpstan/phpstan": "^1.11" }, "require-dev": { "nikic/php-parser": "^4.13.0", @@ -1542,9 +1542,9 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.5" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.0" }, - "time": "2024-04-19T15:12:26+00:00" + "time": "2024-04-20T06:37:51+00:00" }, { "name": "phpunit/php-code-coverage", From a96f1a5083ae6a281736194a3ba70f88ceaae94e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:17:41 +0000 Subject: [PATCH 06/10] Bump docker/build-push-action from 5.3.0 to 6.3.0 (#6387) --- .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 6e035e735..c6d6fb896 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@v5.3.0 + uses: docker/build-push-action@v6.3.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@v5.3.0 + uses: docker/build-push-action@v6.3.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@v5.3.0 + uses: docker/build-push-action@v6.3.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@v5.3.0 + uses: docker/build-push-action@v6.3.0 with: push: true context: ./pocketmine-mp From df4ada81e5d74a14046f27cf44a37dcee69d657e Mon Sep 17 00:00:00 2001 From: Aleksey <45711510+Gaprix@users.noreply.github.com> Date: Tue, 16 Jul 2024 08:51:06 +0300 Subject: [PATCH 07/10] BedrockWorldData: Update version constants to 1.21.2 (#6399) Co-authored-by: Dylan T <14214667+dktapps@users.noreply.github.com> --- src/world/format/io/data/BedrockWorldData.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/world/format/io/data/BedrockWorldData.php b/src/world/format/io/data/BedrockWorldData.php index 9dc89ad99..7bcc44c0b 100644 --- a/src/world/format/io/data/BedrockWorldData.php +++ b/src/world/format/io/data/BedrockWorldData.php @@ -51,12 +51,12 @@ use function time; class BedrockWorldData extends BaseNbtWorldData{ public const CURRENT_STORAGE_VERSION = 10; - public const CURRENT_STORAGE_NETWORK_VERSION = 685; + public const CURRENT_STORAGE_NETWORK_VERSION = 686; public const CURRENT_CLIENT_VERSION_TARGET = [ 1, //major 21, //minor - 0, //patch - 3, //revision + 2, //patch + 2, //revision 0 //is beta ]; From 237677c0286238a65c42082fbbf3148f4cb1e0bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 06:47:56 +0000 Subject: [PATCH 08/10] Bump phpstan/phpstan from 1.11.2 to 1.11.8 in the development-patch-updates group (#6410) --- composer.json | 2 +- composer.lock | 12 ++++++------ src/resourcepacks/ResourcePack.php | 2 ++ src/resourcepacks/ZippedResourcePack.php | 3 +++ .../format/io/region/RegionLocationTableEntry.php | 4 ++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 299f69f78..d035ff935 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "symfony/filesystem": "~6.4.0" }, "require-dev": { - "phpstan/phpstan": "1.11.2", + "phpstan/phpstan": "1.11.8", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^10.5.24" diff --git a/composer.lock b/composer.lock index a68d34533..7cc34ff98 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d459605b85f247204988a879982aab50", + "content-hash": "3ee9506c0be6b8b202d790824344e79c", "packages": [ { "name": "adhocore/json-comment", @@ -1389,16 +1389,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.2", + "version": "1.11.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", "shasum": "" }, "require": { @@ -1443,7 +1443,7 @@ "type": "github" } ], - "time": "2024-05-24T13:23:04+00:00" + "time": "2024-07-24T07:01:22+00:00" }, { "name": "phpstan/phpstan-phpunit", diff --git a/src/resourcepacks/ResourcePack.php b/src/resourcepacks/ResourcePack.php index 04feeeb3d..cdab3447b 100644 --- a/src/resourcepacks/ResourcePack.php +++ b/src/resourcepacks/ResourcePack.php @@ -60,6 +60,8 @@ interface ResourcePack{ * @param int $start Offset to start reading the chunk from * @param int $length Maximum length of data to return. * + * @phpstan-param positive-int $length + * * @return string byte-array * @throws \InvalidArgumentException if the chunk does not exist */ diff --git a/src/resourcepacks/ZippedResourcePack.php b/src/resourcepacks/ZippedResourcePack.php index da7db1db7..c4daeedf7 100644 --- a/src/resourcepacks/ZippedResourcePack.php +++ b/src/resourcepacks/ZippedResourcePack.php @@ -154,6 +154,9 @@ class ZippedResourcePack implements ResourcePack{ } public function getPackChunk(int $start, int $length) : string{ + if($length < 1){ + throw new \InvalidArgumentException("Pack length must be positive"); + } fseek($this->fileResource, $start); if(feof($this->fileResource)){ throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset"); diff --git a/src/world/format/io/region/RegionLocationTableEntry.php b/src/world/format/io/region/RegionLocationTableEntry.php index abb92accf..ad0b1ce48 100644 --- a/src/world/format/io/region/RegionLocationTableEntry.php +++ b/src/world/format/io/region/RegionLocationTableEntry.php @@ -27,6 +27,7 @@ use function range; class RegionLocationTableEntry{ private int $firstSector; + /** @phpstan-var positive-int */ private int $sectorCount; private int $timestamp; @@ -61,6 +62,9 @@ class RegionLocationTableEntry{ return range($this->getFirstSector(), $this->getLastSector()); } + /** + * @phpstan-return positive-int + */ public function getSectorCount() : int{ return $this->sectorCount; } From 54e7749c0bb02ce64a3dac75bed2f45f9a7086cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 06:52:28 +0000 Subject: [PATCH 09/10] Bump docker/build-push-action from 6.3.0 to 6.5.0 (#6409) --- .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 c6d6fb896..b3d6661e9 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.3.0 + uses: docker/build-push-action@v6.5.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.3.0 + uses: docker/build-push-action@v6.5.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.3.0 + uses: docker/build-push-action@v6.5.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.3.0 + uses: docker/build-push-action@v6.5.0 with: push: true context: ./pocketmine-mp From 5a926a79cb97f284c64c754d3f60fba8348435b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:21:20 +0000 Subject: [PATCH 10/10] Bump phpstan/phpstan in the development-patch-updates group (#6412) --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d035ff935..28ef5e9c2 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "symfony/filesystem": "~6.4.0" }, "require-dev": { - "phpstan/phpstan": "1.11.8", + "phpstan/phpstan": "1.11.9", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^10.5.24" diff --git a/composer.lock b/composer.lock index 7cc34ff98..e3211e7c5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3ee9506c0be6b8b202d790824344e79c", + "content-hash": "cddee8096f4b575629ff671000543d3f", "packages": [ { "name": "adhocore/json-comment", @@ -1389,16 +1389,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.8", + "version": "1.11.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec" + "reference": "e370bcddadaede0c1716338b262346f40d296f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", - "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82", + "reference": "e370bcddadaede0c1716338b262346f40d296f82", "shasum": "" }, "require": { @@ -1443,7 +1443,7 @@ "type": "github" } ], - "time": "2024-07-24T07:01:22+00:00" + "time": "2024-08-01T16:25:18+00:00" }, { "name": "phpstan/phpstan-phpunit",