# 5.2.0 Released 4th July 2023. **For Minecraft: Bedrock Edition 1.20.0** This is a minor technical update, including changes to AsyncTask error handling and support for BedrockBlockUpgradeSchema version 3.0.0. **Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace. Do not update plugin minimum API versions unless you need new features added in this release. **WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.** Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly. ## Core - [BedrockBlockUpgradeSchema version 3.0.0](https://github.com/pmmp/BedrockBlockUpgradeSchema/releases/tag/3.0.0) is now supported. - [`ext-pmmpthread` version 6.0.4](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.4) is now required (bug fixes required to support technical changes in this release). ## Performance - Improved performance of `AsyncPool->submitTask()` and `AsyncPool->submitTaskToWorker()`. - Added new timings for `AsyncTask->onProgressUpdate()` and `AsyncTask->onCompletion()`. ## Gameplay ### Blocks - Added the following new blocks: - Cherry Button - Cherry Door - Cherry Fence - Cherry Fence Gate - Cherry Leaves - Cherry Log - Cherry Planks - Cherry Pressure Plate - Cherry Sign - Cherry Slab - Cherry Stairs - Cherry Trapdoor - Cherry Wood - Glow Lichen - Piglin Head ## Tools - `generate-block-upgrade-schema.php` now supports generating schemas a la BedrockBlockUpgradeSchema version 3.0.0, using `newFlattenedName` to reduce schema size. - Improved property remapping detection in `generate-block-upgrade-schema.php`. It now detects related properties with more confidence (even when multiple properties were change), and no longer considers unrelated properties as mapped (e.g. `mapped_type` and `deprecated` in 1.9->1.10). ## API ### `pocketmine\data\bedrock\block` - The following new API methods have been added: - `public BlockStateData->toVanillaNbt() : CompoundTag` - returns the NBT for the blockstate without any PMMP extra metadata (`toNbt()` will normally include a `PMMPDataVersion` tag). ### `pocketmine\data\runtime` - The following new API methods have been added: - `public RuntimeDataDescriber->facingFlags(list $faces) : void` ### `pocketmine\scheduler` - `AsyncTask->onRun()` no longer tolerates uncaught exceptions. - This means that any uncaught exceptions thrown from `AsyncTask->onRun()` will now crash the worker thread, and by extension, the server. - This change makes it easier to debug errors by detecting them earlier. - The following API methods have been deprecated: - `AsyncTask->onError()` ## Internals - `AsyncTask->progressUpdates` is now lazily initialized when a task publishes a progress update. - This was previously not possible due to technical limitations of the `ext-pmmpthread` extension. - This change improves performance of `AsyncPool->submitTask()` and `AsyncPool->submitTaskToWorker()`, as well as reducing the amount of work needed to check for progress updates on tick. - Errors in `AsyncWorker` now cascade and crash the whole server. - This makes it easier to debug errors by detecting them earlier. - This includes all types of unexpected errors, such as OOM, uncaught exceptions, etc. - This change is not expected to affect normal server operation, as worker threads are not expected to crash under normal circumstances. - `AsyncTask::$threadLocalStorage` now uses a plain `array` instead of `ArrayObject`. The `ArrayObject` was a workaround for `ext-pthreads` to prevent thread-locals getting copied to the worker thread, and is no longer necessary. - Regenerated `pocketmine\data\bedrock\item\ItemTypeNames` for Bedrock 1.20 (BC breaking, some item names have changed). - Fixed `build/generate-item-type-names.php` not including some newer blockitems, such as doors and hanging signs. # 5.2.1 Released 11th July 2023. **This release includes changes from the following releases:** - [4.22.3](https://github.com/pmmp/PocketMine-MP/blob/4.22.3/changelogs/4.22.md#4223) - Fixes for some crash issues This release contains no other changes.