From e9a6c0ba5802fd01ba3135e9993bf5b8e6f8c6ed Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 28 Jan 2022 21:03:44 +0000 Subject: [PATCH 01/13] Liquid: added missing bounds check for setDecay() --- src/block/Liquid.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/block/Liquid.php b/src/block/Liquid.php index 6e3c8df35..711d148ca 100644 --- a/src/block/Liquid.php +++ b/src/block/Liquid.php @@ -83,6 +83,9 @@ abstract class Liquid extends Transparent{ /** @return $this */ public function setDecay(int $decay) : self{ + if($decay < 0 || $decay > 7){ + throw new \InvalidArgumentException("Decay must be in range 0-7"); + } $this->decay = $decay; return $this; } From cfdbfa3d585c708bf851916e51a1b1d276c59aa8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 28 Jan 2022 21:07:41 +0000 Subject: [PATCH 02/13] Liquid: fixed implicit assumption of 0 == air --- src/block/Liquid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/block/Liquid.php b/src/block/Liquid.php index 711d148ca..9d6b5bd0f 100644 --- a/src/block/Liquid.php +++ b/src/block/Liquid.php @@ -342,7 +342,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); } From 859f0622674b7a85cf8bda1d2d429589e0b3febf Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 1 Feb 2022 23:29:47 +0000 Subject: [PATCH 03/13] StringToItemParser: fixed *_concrete_powder giving concrete instead of concrete powder --- src/item/StringToItemParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item/StringToItemParser.php b/src/item/StringToItemParser.php index e2ae03a97..8b31f4f02 100644 --- a/src/item/StringToItemParser.php +++ b/src/item/StringToItemParser.php @@ -49,7 +49,7 @@ final class StringToItemParser extends StringToTParser{ $result->registerBlock($prefix("bed"), fn() => VanillaBlocks::BED()->setColor($color)); $result->registerBlock($prefix("carpet"), fn() => VanillaBlocks::CARPET()->setColor($color)); $result->registerBlock($prefix("concrete"), fn() => VanillaBlocks::CONCRETE()->setColor($color)); - $result->registerBlock($prefix("concrete_powder"), fn() => VanillaBlocks::CONCRETE()->setColor($color)); + $result->registerBlock($prefix("concrete_powder"), fn() => VanillaBlocks::CONCRETE_POWDER()->setColor($color)); $result->registerBlock($prefix("stained_clay"), fn() => VanillaBlocks::STAINED_CLAY()->setColor($color)); $result->registerBlock($prefix("stained_glass"), fn() => VanillaBlocks::STAINED_GLASS()->setColor($color)); $result->registerBlock($prefix("stained_glass_pane"), fn() => VanillaBlocks::STAINED_GLASS_PANE()->setColor($color)); From 3781b62d35ed5998d54adbf14554eb1824c769cc Mon Sep 17 00:00:00 2001 From: Dylan T Date: Tue, 1 Feb 2022 23:58:49 +0000 Subject: [PATCH 04/13] Update dependabot.yml --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 993b80367..b33ae2404 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,8 @@ updates: interval: daily time: "10:00" open-pull-requests-limit: 10 + +- package-ecosystem: gitsubmodule + directory: "/" + schedule: + interval: daily From 28dce8783f11d14c118eecdb383b807c2d532bc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:05:17 +0000 Subject: [PATCH 05/13] Bump build/php from `bd329db` to `30eed13` (#4787) Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `bd329db` to `30eed13`. - [Release notes](https://github.com/pmmp/php-build-scripts/releases) - [Commits](https://github.com/pmmp/php-build-scripts/compare/bd329dba08242b6ecb99ef7fbf9a0031dcbbb3ff...30eed13faaa8995814b1ada426b7e947f891ee3c) --- 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 bd329dba0..30eed13fa 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit bd329dba08242b6ecb99ef7fbf9a0031dcbbb3ff +Subproject commit 30eed13faaa8995814b1ada426b7e947f891ee3c From 123701ed7657f0ed3f947ddb2e2a3797ea0fed6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:05:33 +0000 Subject: [PATCH 06/13] Bump tests/plugins/DevTools from `39510af` to `e884a4c` (#4788) Bumps [tests/plugins/DevTools](https://github.com/pmmp/DevTools) from `39510af` to `e884a4c`. - [Release notes](https://github.com/pmmp/DevTools/releases) - [Commits](https://github.com/pmmp/DevTools/compare/39510af5bcf19eef3b3157c8c51d88a736811591...e884a4c234629126203e769df7c4dbbbc0dc2d49) --- updated-dependencies: - dependency-name: tests/plugins/DevTools dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/plugins/DevTools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/plugins/DevTools b/tests/plugins/DevTools index 39510af5b..e884a4c23 160000 --- a/tests/plugins/DevTools +++ b/tests/plugins/DevTools @@ -1 +1 @@ -Subproject commit 39510af5bcf19eef3b3157c8c51d88a736811591 +Subproject commit e884a4c234629126203e769df7c4dbbbc0dc2d49 From 2a4111868c9c9baa0cbfefd1baca3155b25fb267 Mon Sep 17 00:00:00 2001 From: Andrew1481432 Date: Wed, 2 Feb 2022 16:12:33 +0300 Subject: [PATCH 07/13] Fixed incorrect doc for EncryptionContext (#4791) * Fixed incorrect doc for EncryptionContext * Update src/network/mcpe/encryption/EncryptionContext.php Co-authored-by: Dylan T --- src/network/mcpe/encryption/EncryptionContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/mcpe/encryption/EncryptionContext.php b/src/network/mcpe/encryption/EncryptionContext.php index 18d469468..f8515c9c6 100644 --- a/src/network/mcpe/encryption/EncryptionContext.php +++ b/src/network/mcpe/encryption/EncryptionContext.php @@ -61,7 +61,7 @@ class EncryptionContext{ } /** - * Returns an EncryptionContext suitable for decrypting Minecraft packets from 1.16.200 and up. + * Returns an EncryptionContext suitable for decrypting Minecraft packets from 1.16.220.50 (protocol version 429) and up. * * MCPE uses GCM, but without the auth tag, which defeats the whole purpose of using GCM. * GCM is just a wrapper around CTR which adds the auth tag, so CTR can replace GCM for this case. From 712ffb3e3126ccc1e0cae3688902ccb13d685361 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 4 Feb 2022 19:21:46 +0000 Subject: [PATCH 08/13] WorldManager: fixed loading the default world's spawn chunk when unloading the default world yo dawg I heard you like loading and unloading so I put some loading inside your unloading so you can load while you unload --- src/world/WorldManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/world/WorldManager.php b/src/world/WorldManager.php index aa906e4ab..bbf4e6c06 100644 --- a/src/world/WorldManager.php +++ b/src/world/WorldManager.php @@ -154,12 +154,12 @@ class WorldManager{ $this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_level_unloading($world->getDisplayName()))); try{ - $safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null; + $safeSpawn = $this->defaultWorld !== null && $this->defaultWorld !== $world ? $this->defaultWorld->getSafeSpawn() : null; }catch(WorldException $e){ $safeSpawn = null; } foreach($world->getPlayers() as $player){ - if($world === $this->defaultWorld or $safeSpawn === null){ + if($safeSpawn === null){ $player->disconnect("Forced default world unload"); }else{ $player->teleport($safeSpawn); From 1dc0d5f96a3448da500c1efea78b9281d30a70b9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 4 Feb 2022 19:24:51 +0000 Subject: [PATCH 09/13] WorldManager: do not calculate safe spawn if there are no players in the unloaded world --- src/world/WorldManager.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/world/WorldManager.php b/src/world/WorldManager.php index bbf4e6c06..362557b13 100644 --- a/src/world/WorldManager.php +++ b/src/world/WorldManager.php @@ -153,16 +153,18 @@ class WorldManager{ } $this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_level_unloading($world->getDisplayName()))); - try{ - $safeSpawn = $this->defaultWorld !== null && $this->defaultWorld !== $world ? $this->defaultWorld->getSafeSpawn() : null; - }catch(WorldException $e){ - $safeSpawn = null; - } - foreach($world->getPlayers() as $player){ - if($safeSpawn === null){ - $player->disconnect("Forced default world unload"); - }else{ - $player->teleport($safeSpawn); + if(count($world->getPlayers()) !== 0){ + try{ + $safeSpawn = $this->defaultWorld !== null && $this->defaultWorld !== $world ? $this->defaultWorld->getSafeSpawn() : null; + }catch(WorldException $e){ + $safeSpawn = null; + } + foreach($world->getPlayers() as $player){ + if($safeSpawn === null){ + $player->disconnect("Forced default world unload"); + }else{ + $player->teleport($safeSpawn); + } } } From 7846ea8accc19aa0875ae530095229343671616c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 5 Feb 2022 04:18:37 +0000 Subject: [PATCH 10/13] LevelDB: do not barf on chunk version 8 this covers a wide range from 1.2.13 to 1.8. --- src/world/format/io/leveldb/LevelDB.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/world/format/io/leveldb/LevelDB.php b/src/world/format/io/leveldb/LevelDB.php index acd8ffed4..df271dd82 100644 --- a/src/world/format/io/leveldb/LevelDB.php +++ b/src/world/format/io/leveldb/LevelDB.php @@ -263,6 +263,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ case 11: //MCPE 1.11.0.1 beta (???) case 10: //MCPE 1.9 (???) case 9: //MCPE 1.8 (???) + case 8: //MCPE 1.2.13 (paletted subchunks) case 7: //MCPE 1.2 (???) case 6: //MCPE 1.2.0.2 beta (???) case 4: //MCPE 1.1 From df1cdbe921adafde406e787b34b818b7ca49b765 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 5 Feb 2022 16:08:10 +0000 Subject: [PATCH 11/13] Release 4.0.9 --- changelogs/4.0.md | 18 ++++++++++++++++++ src/VersionInfo.php | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/changelogs/4.0.md b/changelogs/4.0.md index ec6f7fa60..b7b66c4a4 100644 --- a/changelogs/4.0.md +++ b/changelogs/4.0.md @@ -1627,3 +1627,21 @@ Released 25th January 2022. ## Fixes - Fixed ender chest not dropping itself when mined with a Silk Touch pickaxe. - The correct amount of fall damage is now taken when falling from a height onto hay bales. + +# 4.0.9 +Released 5th February 2022. + +## Fixes +### Core +- The spawn chunk of the default world is no longer loaded during shutdown. Previously, it would attempt to find a safe spawn to teleport players to, only to unload the target world of that safe spawn and not use it. +- The spawn chunk of the default world is no longer loaded when unloading a non-default world containing zero players. +- Fixed chunk version `8` in Bedrock worlds being treated as corrupted. These appeared in worlds between 1.2.13 and 1.8.0. + +### API +- Added missing bounds check to `Liquid->setDecay()`. +- Fixed `StringToItemParser` returning concrete instead of concrete powder when given `_concrete_powder`. + +### Gameplay +- Cobwebs now drop themselves when broken using shears. +- Fixed spectator players being able to drop items. +- Fixed collision shapes of Bell in different orientations. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index cce49cbb1..04159e206 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -32,7 +32,7 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; public const BASE_VERSION = "4.0.9"; - public const IS_DEVELOPMENT_BUILD = true; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; private function __construct(){ From dd1ebb59157b5ba1765445eea6e1aed367b73ced Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 5 Feb 2022 16:08:23 +0000 Subject: [PATCH 12/13] 4.0.10 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 04159e206..e8e0ec9b3 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.0.9"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.0.10"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 38e34093cf63f2a70f8a76a2c6ad6f3cd13d9b53 Mon Sep 17 00:00:00 2001 From: Shaheryar Sohail <44123859+TheBlackPlague@users.noreply.github.com> Date: Sun, 6 Feb 2022 18:22:22 -0500 Subject: [PATCH 13/13] ResourcePackManifest: Stop throwing exceptions on extra properties (#4804) This code currently throws errors when properties other than the base required ones are added. This can be from resource packs created by "bridge.", where the IDE adds a "generated_with" property to the manifest. This leads to resource packs created by bridge., which are otherwise completely valid, not being loaded. --- src/resourcepacks/ZippedResourcePack.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/resourcepacks/ZippedResourcePack.php b/src/resourcepacks/ZippedResourcePack.php index 9f2593c84..9e9efb757 100644 --- a/src/resourcepacks/ZippedResourcePack.php +++ b/src/resourcepacks/ZippedResourcePack.php @@ -105,7 +105,6 @@ class ZippedResourcePack implements ResourcePack{ } $mapper = new \JsonMapper(); - $mapper->bExceptionOnUndefinedProperty = true; $mapper->bExceptionOnMissingData = true; try{