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 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 diff --git a/composer.json b/composer.json index 7941fb417..9eed0cc15 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.7.1", + "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 739d582fc..77ada6251 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": "17e7814a247ffefd8c9cee9530263eb4", + "content-hash": "2132dbc0482fe77716eee2cfec934e20", "packages": [ { "name": "adhocore/json-comment", @@ -302,16 +302,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": { @@ -325,7 +325,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" @@ -343,9 +343,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", @@ -1452,16 +1452,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": { @@ -1502,9 +1502,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", @@ -1846,16 +1846,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.1", + "version": "1.7.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719" + "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", - "reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a", + "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a", "shasum": "" }, "require": { @@ -1881,7 +1881,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.8" }, "funding": [ { @@ -1901,7 +1901,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T09:05:09+00:00" + "time": "2022-06-01T13:43:17+00:00" }, { "name": "phpstan/phpstan-phpunit", diff --git a/src/block/Liquid.php b/src/block/Liquid.php index 3e9fb08b4..8aed66253 100644 --- a/src/block/Liquid.php +++ b/src/block/Liquid.php @@ -348,7 +348,7 @@ abstract class Liquid extends Transparent{ $ev = new BlockSpreadEvent($block, $this, $new); $ev->call(); if(!$ev->isCancelled()){ - if($block->getId() > 0){ + if($block->getId() !== BlockLegacyIds::AIR){ $this->position->getWorld()->useBreakOn($block->position); } 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{ diff --git a/src/item/Item.php b/src/item/Item.php index a84d2b4e6..9b7831f83 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -682,7 +682,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 c62f95d16..8d4fd63bd 100644 --- a/src/network/mcpe/convert/TypeConverter.php +++ b/src/network/mcpe/convert/TypeConverter.php @@ -126,7 +126,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());