From d1df72ec78334f6f3d3152b43c1184f07f9a8af8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2020 19:10:19 +0000 Subject: [PATCH 01/14] Bump phpstan/phpstan from 0.12.36 to 0.12.37 (#3765) --- composer.json | 2 +- composer.lock | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 8e14dff81..b2493d5c3 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "ocramius/package-versions": "^1.5" }, "require-dev": { - "phpstan/phpstan": "0.12.36", + "phpstan/phpstan": "0.12.37", "phpstan/phpstan-phpunit": "^0.12.6", "phpstan/phpstan-strict-rules": "^0.12.2", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 4cc6e3bf9..e973efe11 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": "b1129fbf37136eacf27cafa0b15f814a", + "content-hash": "14c3872a6f5a52b6087ed40d636fcddc", "packages": [ { "name": "adhocore/json-comment", @@ -527,6 +527,20 @@ "constructor", "instantiate" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -949,16 +963,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.36", + "version": "0.12.37", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "eaeff985e395ff4e7aebf3251a43fca6c9be1af3" + "reference": "5e16d83e6eb2dd784fbdaeaece5e2bca72e4f68a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/eaeff985e395ff4e7aebf3251a43fca6c9be1af3", - "reference": "eaeff985e395ff4e7aebf3251a43fca6c9be1af3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5e16d83e6eb2dd784fbdaeaece5e2bca72e4f68a", + "reference": "5e16d83e6eb2dd784fbdaeaece5e2bca72e4f68a", "shasum": "" }, "require": { @@ -1001,7 +1015,7 @@ "type": "tidelift" } ], - "time": "2020-08-05T09:29:40+00:00" + "time": "2020-08-09T14:32:41+00:00" }, { "name": "phpstan/phpstan-phpunit", From d6f35f23426642ce3f65a5e2c3d7b9972d129e68 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2020 19:15:28 +0000 Subject: [PATCH 02/14] Bump phpunit/phpunit from 9.3.2 to 9.3.5 (#3764) --- composer.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.lock b/composer.lock index e973efe11..bc9b77932 100644 --- a/composer.lock +++ b/composer.lock @@ -599,16 +599,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.7.0", + "version": "v4.8.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "21dce06dfbf0365c6a7cc8fdbdc995926c6a9300" + "reference": "8c58eb4cd4f3883f82611abeac2efbc3dbed787e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/21dce06dfbf0365c6a7cc8fdbdc995926c6a9300", - "reference": "21dce06dfbf0365c6a7cc8fdbdc995926c6a9300", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8c58eb4cd4f3883f82611abeac2efbc3dbed787e", + "reference": "8c58eb4cd4f3883f82611abeac2efbc3dbed787e", "shasum": "" }, "require": { @@ -616,8 +616,8 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "0.0.5", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + "ircmaxell/php-yacc": "^0.0.6", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -625,7 +625,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7-dev" + "dev-master": "4.8-dev" } }, "autoload": { @@ -647,7 +647,7 @@ "parser", "php" ], - "time": "2020-07-25T13:18:53+00:00" + "time": "2020-08-09T10:23:20+00:00" }, { "name": "phar-io/manifest", @@ -1126,23 +1126,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.0.0", + "version": "9.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ee24e82baca11d7d6fb3513e127d6000f541cf90" + "reference": "4abbce3b0ad05f2e7143ea5f775d5513cb5261e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ee24e82baca11d7d6fb3513e127d6000f541cf90", - "reference": "ee24e82baca11d7d6fb3513e127d6000f541cf90", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4abbce3b0ad05f2e7143ea5f775d5513cb5261e4", + "reference": "4abbce3b0ad05f2e7143ea5f775d5513cb5261e4", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.8", "php": "^7.3 || ^8.0", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1163,7 +1163,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.0-dev" + "dev-master": "9.1-dev" } }, "autoload": { @@ -1195,7 +1195,7 @@ "type": "github" } ], - "time": "2020-08-07T04:12:30+00:00" + "time": "2020-08-10T17:45:51+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1424,16 +1424,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.3.2", + "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "eacb57f3857cb6706550bd39ea500f9b1097b0bf" + "reference": "7115b00b23bcd4f62a73855c9615694d2f206e71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/eacb57f3857cb6706550bd39ea500f9b1097b0bf", - "reference": "eacb57f3857cb6706550bd39ea500f9b1097b0bf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7115b00b23bcd4f62a73855c9615694d2f206e71", + "reference": "7115b00b23bcd4f62a73855c9615694d2f206e71", "shasum": "" }, "require": { @@ -1449,7 +1449,7 @@ "phar-io/version": "^3.0.2", "php": "^7.3 || ^8.0", "phpspec/prophecy": "^1.11.1", - "phpunit/php-code-coverage": "^9.0", + "phpunit/php-code-coverage": "^9.1.1", "phpunit/php-file-iterator": "^3.0.4", "phpunit/php-invoker": "^3.1", "phpunit/php-text-template": "^2.0.2", @@ -1518,7 +1518,7 @@ "type": "github" } ], - "time": "2020-08-07T09:12:30+00:00" + "time": "2020-08-10T06:50:08+00:00" }, { "name": "sebastian/code-unit", From 6db51e2380287bd37c91bd958a7bb369314d8402 Mon Sep 17 00:00:00 2001 From: SOFe Date: Tue, 11 Aug 2020 12:35:12 +0800 Subject: [PATCH 03/14] Updated CONTRIBUTING.md RFC label name --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e773e45c7..7e4d30191 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -116,7 +116,7 @@ class ExampleClass{ ### RFC and Voting * These are big Pull Requests or contributions that change important behavior. -* RFCs will be tagged with the *PR: RFC* label +* RFCs will be tagged with the *Type: Request For Comments* label * A vote will be held once the RFC is ready. All users can vote commenting on the Pull Request * Comments MUST use "Yes" or "No" on the FIRST sentence to signify the vote, except when they don't want it to be counted. * If your comment is a voting comment, specify the reason of your vote or it won't be counted. From a7fc245291388551fe7eb1e82ac9de25641a4362 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:06:38 +0100 Subject: [PATCH 04/14] Release 3.14.3 --- changelogs/3.14.md | 8 ++++++++ src/pocketmine/VersionInfo.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelogs/3.14.md b/changelogs/3.14.md index b173ed049..d6a00b8da 100644 --- a/changelogs/3.14.md +++ b/changelogs/3.14.md @@ -30,3 +30,11 @@ Plugin developers should **only** update their required API to this version if y - Players will now correctly receive the needed number of spawn chunks if they are teleported between `PlayerLoginEvent` and `PlayerJoinEvent`. This fixes a bug that could occur when teleporting players in delayed tasks between login and join. - `PlayerRespawnEvent->setRespawnPosition()` now throws an exception if the provided `Position` has an invalid world associated with it (null or unloaded). - Fixed a crash that occurred when stats reporting was enabled. + +# 3.14.3 +- Fixed deprecation error when running `/whitelist list` on PHP 7.4. +- Fixed podzol breaking animation being incorrect (incorrect hardness). +- `Entity::getSaveId()` now reports the class name in the message thrown for unregistered entities. +- Fixed `CraftingManager->validate()` producing different results when called multiple times for the same transaction. +- Fixed various issues with batch-crafting items using the recipe book and shift-clicking. +- `tests/plugins/PocketMine-DevTools` submodule has been renamed to `tests/plugins/DevTools`. diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 2c09c9408..14bc93de8 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -34,5 +34,5 @@ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; const BASE_VERSION = "3.14.3"; -const IS_DEVELOPMENT_BUILD = true; +const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; From 11a0d9b502f3bf398526504f2b716c0a638f09e5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:06:38 +0100 Subject: [PATCH 05/14] 3.14.4 is next --- src/pocketmine/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 14bc93de8..f0799f2cd 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -33,6 +33,6 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.14.3"; -const IS_DEVELOPMENT_BUILD = false; +const BASE_VERSION = "3.14.4"; +const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; From 5b01cf72dd4c855f79ed31dabee664a108ce7c42 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:17:11 +0100 Subject: [PATCH 06/14] Data sync and version bump for 1.16.20 this version doesn't change any packets as far as I know, but it does change some packet content (most notably, some blockstates changed, which are troublesome when not in sync). --- src/pocketmine/network/mcpe/protocol/ProtocolInfo.php | 6 +++--- src/pocketmine/resources/vanilla | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php index c4a1fc568..5a326e198 100644 --- a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php +++ b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php @@ -37,11 +37,11 @@ interface ProtocolInfo{ */ /** Actual Minecraft: PE protocol version */ - public const CURRENT_PROTOCOL = 407; + public const CURRENT_PROTOCOL = 408; /** Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */ - public const MINECRAFT_VERSION = 'v1.16.0'; + public const MINECRAFT_VERSION = 'v1.16.20'; /** Version number sent to clients in ping responses. */ - public const MINECRAFT_VERSION_NETWORK = '1.16.0'; + public const MINECRAFT_VERSION_NETWORK = '1.16.20'; public const LOGIN_PACKET = 0x01; public const PLAY_STATUS_PACKET = 0x02; diff --git a/src/pocketmine/resources/vanilla b/src/pocketmine/resources/vanilla index 767676e2b..afc885ccc 160000 --- a/src/pocketmine/resources/vanilla +++ b/src/pocketmine/resources/vanilla @@ -1 +1 @@ -Subproject commit 767676e2b97843072220bad719c076b169c28fd3 +Subproject commit afc885cccae38048d309911f2c5ddcdcb6af8152 From a498b0415ab2edf18300470dfe6d182372f25190 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:26:12 +0100 Subject: [PATCH 07/14] Release 3.15.0 --- changelogs/3.15.md | 17 +++++++++++++++++ src/pocketmine/VersionInfo.php | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 changelogs/3.15.md diff --git a/changelogs/3.15.md b/changelogs/3.15.md new file mode 100644 index 000000000..43c168c48 --- /dev/null +++ b/changelogs/3.15.md @@ -0,0 +1,17 @@ +**For Minecraft: Bedrock Edition 1.16.20** + +### Note about API versions +Plugins which don't touch the protocol and compatible with any previous 3.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. + +# 3.14.0 +- Added support for Minecraft: Bedrock Edition 1.16.20. +- Removed compatibility with 1.16.0. + +## Known issues (please don't open issues for these) +- Walls don't connect to each other +- Pumpkin and melon stems may not connect to their corresponding pumpkin/melon +- New blocks, items & mobs aren't implemented +- Nether doesn't exist diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index f0799f2cd..720ec8b04 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -33,6 +33,6 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.14.4"; -const IS_DEVELOPMENT_BUILD = true; +const BASE_VERSION = "3.15.0"; +const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; From dbd015b8663d5d41922e69ddeedc460c41b478b6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:26:12 +0100 Subject: [PATCH 08/14] 3.15.1 is next --- src/pocketmine/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 720ec8b04..00ca54002 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -33,6 +33,6 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.15.0"; -const IS_DEVELOPMENT_BUILD = false; +const BASE_VERSION = "3.15.1"; +const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; From 4b9712fdeebc1d86ad0a5c6c8e113a09c000ca03 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:37:15 +0100 Subject: [PATCH 09/14] fixed changelog typo --- changelogs/3.15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/3.15.md b/changelogs/3.15.md index 43c168c48..e6439fd03 100644 --- a/changelogs/3.15.md +++ b/changelogs/3.15.md @@ -6,7 +6,7 @@ Plugin developers should **only** update their required API to this version if y **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. -# 3.14.0 +# 3.15.0 - Added support for Minecraft: Bedrock Edition 1.16.20. - Removed compatibility with 1.16.0. From 700e0afee06b3d6bebe728e0a3225b40c5a6338f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 11 Aug 2020 21:39:15 +0100 Subject: [PATCH 10/14] Updated build/php submodule to pmmp/php-build-scripts@cfc425ad63487d0b01ed232672a2a0da5a0976f1 --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index cec63c309..cfc425ad6 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit cec63c3093d126a4362b1959e0d4f9374320fd22 +Subproject commit cfc425ad63487d0b01ed232672a2a0da5a0976f1 From 730ee74a65988f8824a8c663f872c1597ed56b4c Mon Sep 17 00:00:00 2001 From: Dylan T Date: Sat, 15 Aug 2020 18:30:26 +0100 Subject: [PATCH 11/14] Use objects for internal structures created in TextFormat::toJSON() (#3747) --- src/pocketmine/utils/TextFormat.php | 89 +++++++++---------- src/pocketmine/utils/TextFormatJsonObject.php | 60 +++++++++++++ 2 files changed, 104 insertions(+), 45 deletions(-) create mode 100644 src/pocketmine/utils/TextFormatJsonObject.php diff --git a/src/pocketmine/utils/TextFormat.php b/src/pocketmine/utils/TextFormat.php index 6854089cb..c84879582 100644 --- a/src/pocketmine/utils/TextFormat.php +++ b/src/pocketmine/utils/TextFormat.php @@ -141,8 +141,8 @@ abstract class TextFormat{ if(!is_array($string)){ $string = self::tokenize($string); } - $newString = []; - $pointer =& $newString; + $newString = new TextFormatJsonObject(); + $pointer = $newString; $color = "white"; $bold = false; $italic = false; @@ -152,165 +152,164 @@ abstract class TextFormat{ $index = 0; foreach($string as $token){ - if(isset($pointer["text"])){ - if(!isset($newString["extra"])){ - $newString["extra"] = []; + if($pointer->text !== null){ + if($newString->extra === null){ + $newString->extra = []; } - $newString["extra"][$index] = []; - $pointer =& $newString["extra"][$index]; + $newString->extra[$index] = $pointer = new TextFormatJsonObject(); if($color !== "white"){ - $pointer["color"] = $color; + $pointer->color = $color; } if($bold){ - $pointer["bold"] = true; + $pointer->bold = true; } if($italic){ - $pointer["italic"] = true; + $pointer->italic = true; } if($underlined){ - $pointer["underlined"] = true; + $pointer->underlined = true; } if($strikethrough){ - $pointer["strikethrough"] = true; + $pointer->strikethrough = true; } if($obfuscated){ - $pointer["obfuscated"] = true; + $pointer->obfuscated = true; } ++$index; } switch($token){ case TextFormat::BOLD: if(!$bold){ - $pointer["bold"] = true; + $pointer->bold = true; $bold = true; } break; case TextFormat::OBFUSCATED: if(!$obfuscated){ - $pointer["obfuscated"] = true; + $pointer->obfuscated = true; $obfuscated = true; } break; case TextFormat::ITALIC: if(!$italic){ - $pointer["italic"] = true; + $pointer->italic = true; $italic = true; } break; case TextFormat::UNDERLINE: if(!$underlined){ - $pointer["underlined"] = true; + $pointer->underlined = true; $underlined = true; } break; case TextFormat::STRIKETHROUGH: if(!$strikethrough){ - $pointer["strikethrough"] = true; + $pointer->strikethrough = true; $strikethrough = true; } break; case TextFormat::RESET: if($color !== "white"){ - $pointer["color"] = "white"; + $pointer->color = "white"; $color = "white"; } if($bold){ - $pointer["bold"] = false; + $pointer->bold = false; $bold = false; } if($italic){ - $pointer["italic"] = false; + $pointer->italic = false; $italic = false; } if($underlined){ - $pointer["underlined"] = false; + $pointer->underlined = false; $underlined = false; } if($strikethrough){ - $pointer["strikethrough"] = false; + $pointer->strikethrough = false; $strikethrough = false; } if($obfuscated){ - $pointer["obfuscated"] = false; + $pointer->obfuscated = false; $obfuscated = false; } break; //Colors case TextFormat::BLACK: - $pointer["color"] = "black"; + $pointer->color = "black"; $color = "black"; break; case TextFormat::DARK_BLUE: - $pointer["color"] = "dark_blue"; + $pointer->color = "dark_blue"; $color = "dark_blue"; break; case TextFormat::DARK_GREEN: - $pointer["color"] = "dark_green"; + $pointer->color = "dark_green"; $color = "dark_green"; break; case TextFormat::DARK_AQUA: - $pointer["color"] = "dark_aqua"; + $pointer->color = "dark_aqua"; $color = "dark_aqua"; break; case TextFormat::DARK_RED: - $pointer["color"] = "dark_red"; + $pointer->color = "dark_red"; $color = "dark_red"; break; case TextFormat::DARK_PURPLE: - $pointer["color"] = "dark_purple"; + $pointer->color = "dark_purple"; $color = "dark_purple"; break; case TextFormat::GOLD: - $pointer["color"] = "gold"; + $pointer->color = "gold"; $color = "gold"; break; case TextFormat::GRAY: - $pointer["color"] = "gray"; + $pointer->color = "gray"; $color = "gray"; break; case TextFormat::DARK_GRAY: - $pointer["color"] = "dark_gray"; + $pointer->color = "dark_gray"; $color = "dark_gray"; break; case TextFormat::BLUE: - $pointer["color"] = "blue"; + $pointer->color = "blue"; $color = "blue"; break; case TextFormat::GREEN: - $pointer["color"] = "green"; + $pointer->color = "green"; $color = "green"; break; case TextFormat::AQUA: - $pointer["color"] = "aqua"; + $pointer->color = "aqua"; $color = "aqua"; break; case TextFormat::RED: - $pointer["color"] = "red"; + $pointer->color = "red"; $color = "red"; break; case TextFormat::LIGHT_PURPLE: - $pointer["color"] = "light_purple"; + $pointer->color = "light_purple"; $color = "light_purple"; break; case TextFormat::YELLOW: - $pointer["color"] = "yellow"; + $pointer->color = "yellow"; $color = "yellow"; break; case TextFormat::WHITE: - $pointer["color"] = "white"; + $pointer->color = "white"; $color = "white"; break; default: - $pointer["text"] = $token; + $pointer->text = $token; break; } } - if(isset($newString["extra"])){ - foreach($newString["extra"] as $k => $d){ - if(!isset($d["text"])){ - unset($newString["extra"][$k]); + if($newString->extra !== null){ + foreach($newString->extra as $k => $d){ + if($d->text === null){ + unset($newString->extra[$k]); } } } diff --git a/src/pocketmine/utils/TextFormatJsonObject.php b/src/pocketmine/utils/TextFormatJsonObject.php new file mode 100644 index 000000000..f6ebf02aa --- /dev/null +++ b/src/pocketmine/utils/TextFormatJsonObject.php @@ -0,0 +1,60 @@ +|null + */ + public $extra = null; + + public function jsonSerialize(){ + $result = (array) $this; + foreach($result as $k => $v){ + if($v === null){ + unset($result[$k]); + } + } + return $result; + } +} From 06623d788a9622503db059b81d9eebc7297c5bf2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 15 Aug 2020 17:46:26 +0000 Subject: [PATCH 12/14] Bump phpunit/phpunit from 9.3.5 to 9.3.7 (#3771) --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index bc9b77932..8f193efad 100644 --- a/composer.lock +++ b/composer.lock @@ -1424,16 +1424,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.3.5", + "version": "9.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7115b00b23bcd4f62a73855c9615694d2f206e71" + "reference": "c638a0cac77347980352485912de48c99b42ad00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7115b00b23bcd4f62a73855c9615694d2f206e71", - "reference": "7115b00b23bcd4f62a73855c9615694d2f206e71", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c638a0cac77347980352485912de48c99b42ad00", + "reference": "c638a0cac77347980352485912de48c99b42ad00", "shasum": "" }, "require": { @@ -1518,7 +1518,7 @@ "type": "github" } ], - "time": "2020-08-10T06:50:08+00:00" + "time": "2020-08-11T15:36:12+00:00" }, { "name": "sebastian/code-unit", From 4befd9095a6aacf0f47b62b060fd2dd4800438cd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 15 Aug 2020 20:16:29 +0100 Subject: [PATCH 13/14] Updated build/php submodule to pmmp/php-build-scripts@f93a6f0e31cd50964179035d1cd5b4463cdfd3b8 --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index cfc425ad6..f93a6f0e3 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit cfc425ad63487d0b01ed232672a2a0da5a0976f1 +Subproject commit f93a6f0e31cd50964179035d1cd5b4463cdfd3b8 From 9a0f723dff443db13e8e0ba3b1087ece9dc49ce1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 15 Aug 2020 20:19:37 +0100 Subject: [PATCH 14/14] Updated composer dependencies --- composer.lock | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/composer.lock b/composer.lock index 8f193efad..ad3eb9e62 100644 --- a/composer.lock +++ b/composer.lock @@ -527,20 +527,6 @@ "constructor", "instantiate" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -803,16 +789,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.0", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df" + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", "shasum": "" }, "require": { @@ -851,7 +837,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-07-20T20:05:34+00:00" + "time": "2020-08-15T11:14:08+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1126,16 +1112,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.1.3", + "version": "9.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "4abbce3b0ad05f2e7143ea5f775d5513cb5261e4" + "reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4abbce3b0ad05f2e7143ea5f775d5513cb5261e4", - "reference": "4abbce3b0ad05f2e7143ea5f775d5513cb5261e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4422fca28c3634e2de8c7c373af97a104dd1a45f", + "reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f", "shasum": "" }, "require": { @@ -1195,7 +1181,7 @@ "type": "github" } ], - "time": "2020-08-10T17:45:51+00:00" + "time": "2020-08-13T15:04:53+00:00" }, { "name": "phpunit/php-file-iterator",