Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-06-01 15:32:37 +01:00
commit 3fcf6372e0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
8 changed files with 29 additions and 28 deletions

View File

@ -18,7 +18,7 @@ jobs:
submodules: true submodules: true
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@2.18.1 uses: shivammathur/setup-php@2.19.0
with: with:
php-version: 8.0 php-version: 8.0

View File

@ -195,7 +195,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup PHP and tools - name: Setup PHP and tools
uses: shivammathur/setup-php@2.18.1 uses: shivammathur/setup-php@2.19.0
with: with:
php-version: 8.0 php-version: 8.0
tools: php-cs-fixer:3.2 tools: php-cs-fixer:3.2

@ -1 +1 @@
Subproject commit 8138c6a4a4a5b38047b9a5043c5aa0cefc32ee71 Subproject commit 11103498ca761be83598f9759cc7196c167fcb7e

View File

@ -53,7 +53,7 @@
"webmozart/path-util": "^2.3" "webmozart/path-util": "^2.3"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "1.7.1", "phpstan/phpstan": "1.7.8",
"phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0", "phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2" "phpunit/phpunit": "^9.2"

40
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "940fa92ddd657ea8f093234660bf7be5", "content-hash": "1e967ff64cee3cae84242cc3e5a51752",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -275,16 +275,16 @@
}, },
{ {
"name": "pocketmine/bedrock-protocol", "name": "pocketmine/bedrock-protocol",
"version": "9.0.1+bedrock-1.18.30", "version": "9.0.2+bedrock-1.18.30",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git", "url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e" "reference": "37f1cd017caf7aaaa90330ee54690098283589cb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/9d3cc87c4d26c002dd42aa9af20c0cd47a72018e", "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/37f1cd017caf7aaaa90330ee54690098283589cb",
"reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e", "reference": "37f1cd017caf7aaaa90330ee54690098283589cb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -298,7 +298,7 @@
"ramsey/uuid": "^4.1" "ramsey/uuid": "^4.1"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "1.5.7", "phpstan/phpstan": "1.7.4",
"phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0",
"phpunit/phpunit": "^9.5" "phpunit/phpunit": "^9.5"
@ -316,9 +316,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": { "support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues", "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", "name": "pocketmine/binaryutils",
@ -1425,16 +1425,16 @@
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v4.13.2", "version": "v4.14.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077" "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077", "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1475,9 +1475,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "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", "name": "phar-io/manifest",
@ -1819,16 +1819,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.7.1", "version": "1.7.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719" "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a",
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719", "reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1854,7 +1854,7 @@
"description": "PHPStan - PHP Static Analysis Tool", "description": "PHPStan - PHP Static Analysis Tool",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan/issues", "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": [ "funding": [
{ {
@ -1874,7 +1874,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-05-24T09:05:09+00:00" "time": "2022-06-01T13:43:17+00:00"
}, },
{ {
"name": "phpstan/phpstan-phpunit", "name": "phpstan/phpstan-phpunit",

View File

@ -775,7 +775,7 @@ abstract class Living extends Entity{
$id = $block->getId(); $id = $block->getId();
if($transparent === null){ if($transparent === null){
if($id !== 0){ if($id !== BlockLegacyIds::AIR){
break; break;
} }
}else{ }else{

View File

@ -677,7 +677,7 @@ class Item implements \JsonSerializable{
*/ */
public static function nbtDeserialize(CompoundTag $tag) : Item{ public static function nbtDeserialize(CompoundTag $tag) : Item{
if($tag->getTag("id") === null || $tag->getTag("Count") === null){ if($tag->getTag("id") === null || $tag->getTag("Count") === null){
return ItemFactory::getInstance()->get(0); return VanillaItems::AIR();
} }
$count = Binary::unsignByte($tag->getByte("Count")); $count = Binary::unsignByte($tag->getByte("Count"));

View File

@ -37,6 +37,7 @@ use pocketmine\item\Durable;
use pocketmine\item\Item; use pocketmine\item\Item;
use pocketmine\item\ItemFactory; use pocketmine\item\ItemFactory;
use pocketmine\item\ItemIds; use pocketmine\item\ItemIds;
use pocketmine\item\VanillaItems;
use pocketmine\nbt\NbtException; use pocketmine\nbt\NbtException;
use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag; use pocketmine\nbt\tag\IntTag;
@ -126,7 +127,7 @@ class TypeConverter{
public function recipeIngredientToCoreItemStack(RecipeIngredient $ingredient) : Item{ public function recipeIngredientToCoreItemStack(RecipeIngredient $ingredient) : Item{
if($ingredient->getId() === 0){ if($ingredient->getId() === 0){
return ItemFactory::getInstance()->get(ItemIds::AIR, 0, 0); return VanillaItems::AIR();
} }
[$id, $meta] = ItemTranslator::getInstance()->fromNetworkIdWithWildcardHandling($ingredient->getId(), $ingredient->getMeta()); [$id, $meta] = ItemTranslator::getInstance()->fromNetworkIdWithWildcardHandling($ingredient->getId(), $ingredient->getMeta());
return ItemFactory::getInstance()->get($id, $meta, $ingredient->getCount()); return ItemFactory::getInstance()->get($id, $meta, $ingredient->getCount());
@ -202,7 +203,7 @@ class TypeConverter{
*/ */
public function netItemStackToCore(ItemStack $itemStack) : Item{ public function netItemStackToCore(ItemStack $itemStack) : Item{
if($itemStack->getId() === 0){ if($itemStack->getId() === 0){
return ItemFactory::getInstance()->get(ItemIds::AIR, 0, 0); return VanillaItems::AIR();
} }
$compound = $itemStack->getNbt(); $compound = $itemStack->getNbt();