From 3de7a8c27f1bd3a612c1fb64b7e3628f515f949c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Mar 2023 18:08:10 +0000 Subject: [PATCH 1/5] Updated for 1.19.70 --- composer.json | 8 +-- composer.lock | 52 +++++++++---------- .../mcpe/handler/LoginPacketHandler.php | 23 -------- .../handler/SessionStartPacketHandler.php | 5 +- 4 files changed, 31 insertions(+), 57 deletions(-) diff --git a/composer.json b/composer.json index 47c2e448f..23bf5f126 100644 --- a/composer.json +++ b/composer.json @@ -34,10 +34,10 @@ "adhocore/json-comment": "^1.1", "fgrosse/phpasn1": "^2.3", "netresearch/jsonmapper": "^4.0", - "pocketmine/bedrock-block-upgrade-schema": "~1.0.0", - "pocketmine/bedrock-data": "~2.0.0+bedrock-1.19.60", - "pocketmine/bedrock-item-upgrade-schema": "~1.0.0", - "pocketmine/bedrock-protocol": "~19.3.0+bedrock-1.19.62", + "pocketmine/bedrock-block-upgrade-schema": "~1.1.1+bedrock-1.19.70", + "pocketmine/bedrock-data": "~2.1.1+bedrock-1.19.70", + "pocketmine/bedrock-item-upgrade-schema": "~1.1.0+bedrock-1.19.70", + "pocketmine/bedrock-protocol": "~20.0.0+bedrock-1.19.70", "pocketmine/binaryutils": "^0.2.1", "pocketmine/callback-validator": "^1.0.2", "pocketmine/classloader": "^0.2.0", diff --git a/composer.lock b/composer.lock index ba9e927a6..4f149eee9 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": "1911f5d75ca37c8390925a70f5e08210", + "content-hash": "1d0c1d2fe668d85ae87110a1e3cfac05", "packages": [ { "name": "adhocore/json-comment", @@ -250,16 +250,16 @@ }, { "name": "pocketmine/bedrock-block-upgrade-schema", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockBlockUpgradeSchema.git", - "reference": "a05ce434eb7f8c11058d26833bc975fe635b23b4" + "reference": "e0540343e649a92126a1d4071ec401a811416c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/a05ce434eb7f8c11058d26833bc975fe635b23b4", - "reference": "a05ce434eb7f8c11058d26833bc975fe635b23b4", + "url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/e0540343e649a92126a1d4071ec401a811416c76", + "reference": "e0540343e649a92126a1d4071ec401a811416c76", "shasum": "" }, "type": "library", @@ -270,22 +270,22 @@ "description": "Schemas describing how to upgrade saved block data in older Minecraft: Bedrock Edition world saves", "support": { "issues": "https://github.com/pmmp/BedrockBlockUpgradeSchema/issues", - "source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/1.0.0" + "source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/1.1.1" }, - "time": "2023-02-01T21:09:54+00:00" + "time": "2023-03-08T23:45:59+00:00" }, { "name": "pocketmine/bedrock-data", - "version": "2.0.0+bedrock-1.19.60", + "version": "2.1.1+bedrock-1.19.70", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockData.git", - "reference": "957e49b2381641af29f595e4f32ded3e76ce4723" + "reference": "cba0567bcb25f987f2712092f8d662056719e82d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/957e49b2381641af29f595e4f32ded3e76ce4723", - "reference": "957e49b2381641af29f595e4f32ded3e76ce4723", + "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/cba0567bcb25f987f2712092f8d662056719e82d", + "reference": "cba0567bcb25f987f2712092f8d662056719e82d", "shasum": "" }, "type": "library", @@ -296,22 +296,22 @@ "description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP", "support": { "issues": "https://github.com/pmmp/BedrockData/issues", - "source": "https://github.com/pmmp/BedrockData/tree/2.0.0+bedrock-1.19.60" + "source": "https://github.com/pmmp/BedrockData/tree/2.1.1+bedrock-1.19.70" }, - "time": "2023-02-23T21:25:04+00:00" + "time": "2023-03-14T18:03:19+00:00" }, { "name": "pocketmine/bedrock-item-upgrade-schema", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockItemUpgradeSchema.git", - "reference": "7e53f77ea34ba30b1f94d3c24e64e19d3c4296e7" + "reference": "aab89a1f121a0c127557a4a0cf981330301c9c45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/7e53f77ea34ba30b1f94d3c24e64e19d3c4296e7", - "reference": "7e53f77ea34ba30b1f94d3c24e64e19d3c4296e7", + "url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/aab89a1f121a0c127557a4a0cf981330301c9c45", + "reference": "aab89a1f121a0c127557a4a0cf981330301c9c45", "shasum": "" }, "type": "library", @@ -322,22 +322,22 @@ "description": "JSON schemas for upgrading items found in older Minecraft: Bedrock world saves", "support": { "issues": "https://github.com/pmmp/BedrockItemUpgradeSchema/issues", - "source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.0.0" + "source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.1.0" }, - "time": "2023-02-01T22:50:02+00:00" + "time": "2023-03-08T22:27:13+00:00" }, { "name": "pocketmine/bedrock-protocol", - "version": "19.3.0+bedrock-1.19.62", + "version": "20.0.0+bedrock-1.19.70", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "a5bf4753c7f30f781c4541918e238f5bb637e7ad" + "reference": "4892a5020187da805d7b46ab522d8185b0283726" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/a5bf4753c7f30f781c4541918e238f5bb637e7ad", - "reference": "a5bf4753c7f30f781c4541918e238f5bb637e7ad", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/4892a5020187da805d7b46ab522d8185b0283726", + "reference": "4892a5020187da805d7b46ab522d8185b0283726", "shasum": "" }, "require": { @@ -351,7 +351,7 @@ "ramsey/uuid": "^4.1" }, "require-dev": { - "phpstan/phpstan": "1.9.13", + "phpstan/phpstan": "1.10.1", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^9.5" @@ -369,9 +369,9 @@ "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", "support": { "issues": "https://github.com/pmmp/BedrockProtocol/issues", - "source": "https://github.com/pmmp/BedrockProtocol/tree/19.3.0+bedrock-1.19.62" + "source": "https://github.com/pmmp/BedrockProtocol/tree/20.0.0+bedrock-1.19.70" }, - "time": "2023-02-19T16:11:03+00:00" + "time": "2023-03-14T17:06:38+00:00" }, { "name": "pocketmine/binaryutils", diff --git a/src/network/mcpe/handler/LoginPacketHandler.php b/src/network/mcpe/handler/LoginPacketHandler.php index 5185eb707..82510fc11 100644 --- a/src/network/mcpe/handler/LoginPacketHandler.php +++ b/src/network/mcpe/handler/LoginPacketHandler.php @@ -25,7 +25,6 @@ namespace pocketmine\network\mcpe\handler; use pocketmine\entity\InvalidSkinException; use pocketmine\event\player\PlayerPreLoginEvent; -use pocketmine\lang\KnownTranslationFactory; use pocketmine\lang\KnownTranslationKeys; use pocketmine\network\mcpe\auth\ProcessLoginTask; use pocketmine\network\mcpe\convert\SkinAdapterSingleton; @@ -33,7 +32,6 @@ use pocketmine\network\mcpe\JwtException; use pocketmine\network\mcpe\JwtUtils; use pocketmine\network\mcpe\NetworkSession; use pocketmine\network\mcpe\protocol\LoginPacket; -use pocketmine\network\mcpe\protocol\PlayStatusPacket; use pocketmine\network\mcpe\protocol\types\login\AuthenticationData; use pocketmine\network\mcpe\protocol\types\login\ClientData; use pocketmine\network\mcpe\protocol\types\login\ClientDataToSkinDataHelper; @@ -45,7 +43,6 @@ use pocketmine\player\XboxLivePlayerInfo; use pocketmine\Server; use Ramsey\Uuid\Uuid; use function is_array; -use function preg_match; /** * Handles the initial login phase of the session. This handler is used as the initial state. @@ -73,26 +70,6 @@ class LoginPacketHandler extends PacketHandler{ $clientData = $this->parseClientData($packet->clientDataJwt); - //TODO: REMOVE THIS - //Mojang forgot to bump the protocol version when they changed protocol in 1.19.62. Check the game version instead. - if(preg_match('/^(\d+)\.(\d+)\.(\d+)/', $clientData->GameVersion, $matches) !== 1){ - throw new PacketHandlingException("Invalid game version format, expected at least 3 digits"); - } - $major = (int) $matches[1]; - $minor = (int) $matches[2]; - $patch = (int) $matches[3]; - if($major === 1 && $minor === 19 && $patch < 62){ - $this->session->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::LOGIN_FAILED_CLIENT), true); - - //This pocketmine disconnect message will only be seen by the console (PlayStatusPacket causes the messages to be shown for the client) - $this->session->disconnect( - $this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_disconnect_incompatibleProtocol("$packet->protocol (< v1.19.62)")), - false - ); - - return true; - } - try{ $skin = SkinAdapterSingleton::get()->fromSkinData(ClientDataToSkinDataHelper::fromClientData($clientData)); }catch(\InvalidArgumentException | InvalidSkinException $e){ diff --git a/src/network/mcpe/handler/SessionStartPacketHandler.php b/src/network/mcpe/handler/SessionStartPacketHandler.php index 5625869f1..687422de2 100644 --- a/src/network/mcpe/handler/SessionStartPacketHandler.php +++ b/src/network/mcpe/handler/SessionStartPacketHandler.php @@ -71,9 +71,6 @@ final class SessionStartPacketHandler extends PacketHandler{ } protected function isCompatibleProtocol(int $protocolVersion) : bool{ - //TODO: REMOVE THIS - //1.19.63 released with an unchanged protocol, but a bumped protocol version, since they forgot to do it in the - //previous release. Since they are functionally identical, we can accept both. - return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL || $protocolVersion === 568; + return $protocolVersion === ProtocolInfo::CURRENT_PROTOCOL; } } From 9564c815822343fcfa5ef5c700491ff041581503 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Mar 2023 18:14:40 +0000 Subject: [PATCH 2/5] Release 4.17.0 --- changelogs/4.17.md | 14 ++++++++++++++ src/VersionInfo.php | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelogs/4.17.md diff --git a/changelogs/4.17.md b/changelogs/4.17.md new file mode 100644 index 000000000..d35cc77d9 --- /dev/null +++ b/changelogs/4.17.md @@ -0,0 +1,14 @@ +**For Minecraft: Bedrock Edition 1.19.70** + +### Note about API versions +Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps. +Plugin developers should **only** update their required API to this version if you need the changes in this build. + +**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do. + +# 4.17.0 +Released 14th March 2023. + +## General +- Added support for Minecraft: Bedrock Edition 1.19.70. +- Removed support for older versions. \ No newline at end of file diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 079605b38..83b2180ae 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.16.1"; - public const IS_DEVELOPMENT_BUILD = true; + public const BASE_VERSION = "4.17.0"; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 590f6dad087f07c08133ad5a36bf3d2dc1491f40 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Mar 2023 18:14:40 +0000 Subject: [PATCH 3/5] 4.17.1 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 83b2180ae..880fda698 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.17.0"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.17.1"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 2f862a552a698f2c12d18e964371624b8cdae619 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Mar 2023 18:31:25 +0000 Subject: [PATCH 4/5] actions: Replace deprecated ::set-output commands --- .github/workflows/build-docker-image.yml | 10 +++++----- .github/workflows/discord-release-notify.yml | 2 +- .github/workflows/draft-release.yml | 14 +++++++------- .github/workflows/update-updater-api.yml | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index a209fd688..7ff0925df 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -30,20 +30,20 @@ jobs: id: tag-name run: | VERSION=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') - echo ::set-output name=TAG_NAME::$VERSION - echo ::set-output name=MAJOR::$(echo $VERSION | cut -d. -f1) - echo ::set-output name=MINOR::$(echo $VERSION | cut -d. -f1-2) + echo TAG_NAME=$VERSION >> $GITHUB_OUTPUT + echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT + echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT - name: Download new release information run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json - name: Detect channel id: channel - run: echo ::set-output name=CHANNEL::$(jq -r '.channel' new_build_info.json) + run: echo CHANNEL=$(jq -r '.channel' new_build_info.json) >> $GITHUB_OUTPUT - name: Get name of Docker repository name id: docker-repo-name - run: echo ::set-output name=NAME::$(echo "${GITHUB_REPOSITORY,,}") + run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT - name: Build image for tag uses: docker/build-push-action@v4.0.0 diff --git a/.github/workflows/discord-release-notify.yml b/.github/workflows/discord-release-notify.yml index 2a5cadf2d..deb8e9ff0 100644 --- a/.github/workflows/discord-release-notify.yml +++ b/.github/workflows/discord-release-notify.yml @@ -32,7 +32,7 @@ jobs: - name: Get actual tag name id: tag-name - run: echo ::set-output name=TAG_NAME::$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') + run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT - name: Run webhook post script run: php .github/workflows/discord-release-embed.php ${{ github.repository }} ${{ steps.tag-name.outputs.TAG_NAME }} ${{ github.token }} ${{ secrets.DISCORD_RELEASE_WEBHOOK }} ${{ secrets.DISCORD_NEWS_PING_ROLE_ID }} diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 112155ba4..cce750118 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -40,7 +40,7 @@ jobs: run: | BUILD_NUMBER=$((2000+$GITHUB_RUN_NUMBER)) #to stay above jenkins echo "Build number: $BUILD_NUMBER" - echo ::set-output name=BUILD_NUMBER::$BUILD_NUMBER + echo BUILD_NUMBER=$BUILD_NUMBER >> $GITHUB_OUTPUT - name: Minify BedrockData JSON files run: php vendor/pocketmine/bedrock-data/.minify_json.php @@ -51,12 +51,12 @@ jobs: - name: Get PocketMine-MP release version id: get-pm-version run: | - echo ::set-output name=PM_VERSION::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BASE_VERSION;') - echo ::set-output name=MCPE_VERSION::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK;') - echo ::set-output name=PM_VERSION_SHORT::$(php -r 'require "vendor/autoload.php"; $v = explode(".", \pocketmine\VersionInfo::BASE_VERSION); array_pop($v); echo implode(".", $v);') - echo ::set-output name=PM_VERSION_MD::$(php -r 'require "vendor/autoload.php"; echo str_replace(".", "", \pocketmine\VersionInfo::BASE_VERSION);') - echo ::set-output name=CHANGELOG_SUFFIX::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;') - echo ::set-output name=PRERELEASE::$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "false" : "true";') + echo PM_VERSION=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BASE_VERSION;') >> $GITHUB_OUTPUT + echo MCPE_VERSION=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\network\mcpe\protocol\ProtocolInfo::MINECRAFT_VERSION_NETWORK;') >> $GITHUB_OUTPUT + echo PM_VERSION_SHORT=$(php -r 'require "vendor/autoload.php"; $v = explode(".", \pocketmine\VersionInfo::BASE_VERSION); array_pop($v); echo implode(".", $v);') >> $GITHUB_OUTPUT + echo PM_VERSION_MD=$(php -r 'require "vendor/autoload.php"; echo str_replace(".", "", \pocketmine\VersionInfo::BASE_VERSION);') >> $GITHUB_OUTPUT + echo CHANGELOG_SUFFIX=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "" : "-" . \pocketmine\VersionInfo::BUILD_CHANNEL;') >> $GITHUB_OUTPUT + echo PRERELEASE=$(php -r 'require "vendor/autoload.php"; echo \pocketmine\VersionInfo::BUILD_CHANNEL === "stable" ? "false" : "true";') >> $GITHUB_OUTPUT - name: Generate build info run: php build/generate-build-info-json.php ${{ github.sha }} ${{ steps.get-pm-version.outputs.PM_VERSION }} ${{ github.repository }} ${{ steps.build-number.outputs.BUILD_NUMBER }} ${{ github.run_id }} > build_info.json diff --git a/.github/workflows/update-updater-api.yml b/.github/workflows/update-updater-api.yml index aaac9b4d2..dc40d17e9 100644 --- a/.github/workflows/update-updater-api.yml +++ b/.github/workflows/update-updater-api.yml @@ -20,14 +20,14 @@ jobs: - name: Get actual tag name id: tag-name - run: echo ::set-output name=TAG_NAME::$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') + run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT - name: Download new release information run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json - name: Detect channel id: channel - run: echo ::set-output name=CHANNEL::$(jq -r '.channel' new_build_info.json) + run: echo CHANNEL=$(jq -r '.channel' new_build_info.json) >> $GITHUB_OUTPUT - name: Copy release information run: | From 7cad9be0d24d238b4c51c61e912f76a1a393d166 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 18:32:10 +0000 Subject: [PATCH 5/5] Bump build/php from `b2207cf` to `71b9f9d` (#5634) Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `b2207cf` to `71b9f9d`. - [Release notes](https://github.com/pmmp/php-build-scripts/releases) - [Commits](https://github.com/pmmp/php-build-scripts/compare/b2207cf70d3fc5b81f50a655aba4730fcf40a37c...71b9f9d2d7b3ee45d9475803b96c080f5f22f373) --- updated-dependencies: - dependency-name: build/php dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index b2207cf70..71b9f9d2d 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit b2207cf70d3fc5b81f50a655aba4730fcf40a37c +Subproject commit 71b9f9d2d7b3ee45d9475803b96c080f5f22f373