From 227f28a6d2d1a7fe4e293cebe08ccf27068d2fc4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 24 May 2022 15:47:27 +0100 Subject: [PATCH 1/6] Use VanillaItems::AIR() instead of ItemFactory --- src/item/Item.php | 2 +- src/network/mcpe/convert/TypeConverter.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/item/Item.php b/src/item/Item.php index 9c1119db3..a1ff42b9b 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -678,7 +678,7 @@ class Item implements \JsonSerializable{ */ public static function nbtDeserialize(CompoundTag $tag) : Item{ if($tag->getTag("id") === null || $tag->getTag("Count") === null){ - return ItemFactory::getInstance()->get(0); + return VanillaItems::AIR(); } $count = Binary::unsignByte($tag->getByte("Count")); diff --git a/src/network/mcpe/convert/TypeConverter.php b/src/network/mcpe/convert/TypeConverter.php index de17acdb0..a8b8a8375 100644 --- a/src/network/mcpe/convert/TypeConverter.php +++ b/src/network/mcpe/convert/TypeConverter.php @@ -36,6 +36,7 @@ use pocketmine\item\Durable; use pocketmine\item\Item; use pocketmine\item\ItemFactory; use pocketmine\item\ItemIds; +use pocketmine\item\VanillaItems; use pocketmine\nbt\NbtException; use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\IntTag; @@ -126,7 +127,7 @@ class TypeConverter{ public function recipeIngredientToCoreItemStack(RecipeIngredient $ingredient) : Item{ if($ingredient->getId() === 0){ - return ItemFactory::getInstance()->get(ItemIds::AIR, 0, 0); + return VanillaItems::AIR(); } [$id, $meta] = ItemTranslator::getInstance()->fromNetworkIdWithWildcardHandling($ingredient->getId(), $ingredient->getMeta()); return ItemFactory::getInstance()->get($id, $meta, $ingredient->getCount()); @@ -202,7 +203,7 @@ class TypeConverter{ */ public function netItemStackToCore(ItemStack $itemStack) : Item{ if($itemStack->getId() === 0){ - return ItemFactory::getInstance()->get(ItemIds::AIR, 0, 0); + return VanillaItems::AIR(); } $compound = $itemStack->getNbt(); From 39b8daeeec3fd2ad9a8593bb15edca65349948bd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 25 May 2022 22:23:14 +0100 Subject: [PATCH 2/6] Living: fixed a usage of hardcoded numeric ID --- src/entity/Living.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entity/Living.php b/src/entity/Living.php index 889e55fa2..74d38ef41 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -775,7 +775,7 @@ abstract class Living extends Entity{ $id = $block->getId(); if($transparent === null){ - if($id !== 0){ + if($id !== BlockLegacyIds::AIR){ break; } }else{ From 670fb4de74149d68ba4534587b2abddb75d1ff25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 16:09:30 +0100 Subject: [PATCH 3/6] Bump phpstan/phpstan from 1.7.1 to 1.7.4 (#5074) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.7.1 to 1.7.4. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.7.1...1.7.4) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 672b41f09..6cb924e10 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.7.1", + "phpstan/phpstan": "1.7.4", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 281b655dc..5eafe5789 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": "f0d0723913043e45e2831bf5da26b46f", + "content-hash": "17515fb57a89a15fd47579aefc904bbc", "packages": [ { "name": "adhocore/json-comment", @@ -1819,16 +1819,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.1", + "version": "1.7.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719" + "reference": "9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", - "reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc", + "reference": "9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc", "shasum": "" }, "require": { @@ -1854,7 +1854,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.7.1" + "source": "https://github.com/phpstan/phpstan/tree/1.7.4" }, "funding": [ { @@ -1874,7 +1874,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T09:05:09+00:00" + "time": "2022-05-30T12:42:52+00:00" }, { "name": "phpstan/phpstan-phpunit", From 6c080dae55b1c639e824a82f81748184e6799206 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 17:18:27 +0100 Subject: [PATCH 4/6] Bump shivammathur/setup-php from 2.18.1 to 2.19.0 (#5076) Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.18.1 to 2.19.0. - [Release notes](https://github.com/shivammathur/setup-php/releases) - [Commits](https://github.com/shivammathur/setup-php/compare/2.18.1...2.19.0) --- updated-dependencies: - dependency-name: shivammathur/setup-php dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/draft-release.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index eed290607..da5dac78b 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -18,7 +18,7 @@ jobs: submodules: true - name: Setup PHP - uses: shivammathur/setup-php@2.18.1 + uses: shivammathur/setup-php@2.19.0 with: php-version: 8.0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f501ba425..63c52921a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -195,7 +195,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.18.1 + uses: shivammathur/setup-php@2.19.0 with: php-version: 8.0 tools: php-cs-fixer:3.2 From 681a9bb0e18612f5d166ddbe2bf57713e032ba81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 17:18:47 +0100 Subject: [PATCH 5/6] Bump build/php from `8138c6a` to `1110349` (#5075) Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `8138c6a` to `1110349`. - [Release notes](https://github.com/pmmp/php-build-scripts/releases) - [Commits](https://github.com/pmmp/php-build-scripts/compare/8138c6a4a4a5b38047b9a5043c5aa0cefc32ee71...11103498ca761be83598f9759cc7196c167fcb7e) --- 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 8138c6a4a..11103498c 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit 8138c6a4a4a5b38047b9a5043c5aa0cefc32ee71 +Subproject commit 11103498ca761be83598f9759cc7196c167fcb7e From 533cb77c500bc59ecf60637dc933bb4901487c8f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 1 Jun 2022 15:29:39 +0100 Subject: [PATCH 6/6] Updated dependencies --- composer.json | 2 +- composer.lock | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index 6cb924e10..35f8d2823 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.7.4", + "phpstan/phpstan": "1.7.8", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 5eafe5789..1f19fadb4 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": "17515fb57a89a15fd47579aefc904bbc", + "content-hash": "190ad4cd8ffc2ba6f3276416f85479bb", "packages": [ { "name": "adhocore/json-comment", @@ -275,16 +275,16 @@ }, { "name": "pocketmine/bedrock-protocol", - "version": "9.0.1+bedrock-1.18.30", + "version": "9.0.2+bedrock-1.18.30", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e" + "reference": "37f1cd017caf7aaaa90330ee54690098283589cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/9d3cc87c4d26c002dd42aa9af20c0cd47a72018e", - "reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/37f1cd017caf7aaaa90330ee54690098283589cb", + "reference": "37f1cd017caf7aaaa90330ee54690098283589cb", "shasum": "" }, "require": { @@ -298,7 +298,7 @@ "ramsey/uuid": "^4.1" }, "require-dev": { - "phpstan/phpstan": "1.5.7", + "phpstan/phpstan": "1.7.4", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^9.5" @@ -316,9 +316,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/9.0.1+bedrock-1.18.30" + "source": "https://github.com/pmmp/BedrockProtocol/tree/9.0.2+bedrock-1.18.30" }, - "time": "2022-04-23T14:48:16+00:00" + "time": "2022-05-30T15:09:53+00:00" }, { "name": "pocketmine/binaryutils", @@ -1425,16 +1425,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -1475,9 +1475,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { "name": "phar-io/manifest", @@ -1819,16 +1819,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.4", + "version": "1.7.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc" + "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc", - "reference": "9381761d40a5daa3eee2ace98b9eaa8fed1f8ecc", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a", + "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a", "shasum": "" }, "require": { @@ -1854,7 +1854,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.7.4" + "source": "https://github.com/phpstan/phpstan/tree/1.7.8" }, "funding": [ { @@ -1874,7 +1874,7 @@ "type": "tidelift" } ], - "time": "2022-05-30T12:42:52+00:00" + "time": "2022-06-01T13:43:17+00:00" }, { "name": "phpstan/phpstan-phpunit",