0
0
mirror of https://github.com/pmmp/PocketMine-MP.git synced 2024-11-24 06:16:13 +00:00
PocketMine-MP/changelogs/5.0-beta.md
2023-05-23 01:52:57 +01:00

216 lines
12 KiB
Markdown

**For Minecraft: Bedrock Edition 1.19.62**
5.0.0 is a major update to PocketMine-MP, including many new features and API changes. It is **not** compatible with plugins written for previous versions of PocketMine-MP.
**During the beta phase, no new features will be added.**
This stage of development is focused on stability and cleaning up any major issues introduced during the alpha stage.
## WARNING
**This is a BETA release.** This means that it may be unstable, and is not yet ready for production use.
Since this version has undergone substantial changes compared to 4.x, plugins written for 4.x will need to be updated to work on this version.
Breaking API changes may still occur during the beta phase, but only if they are strictly necessary to fix a problem prior to full release.
**BACK UP your data before testing this.** This version will work with worlds and player data from 4.x,
BUT any world or player data loaded in 5.0.0 will not work in 4.x due to backwards-incompatible storage format changes.
# 5.0.0-BETA1
Released 7th March 2023.
**This release includes changes from the following releases:**
- [All 5.0.0 alpha releases](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/5.0-alpha.md)
- [4.15.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.15.md#4152)
- [4.15.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.15.md#4153)
- [4.16.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA1/changelogs/4.16.md#4160)
## API
### `pocketmine\block`
- Improved documentation for the following methods:
- `Block->getTypeId()`
- `Block->getStateId()`
- `Block->describeType()`
- `Block->describeState()`
### `pocketmine\command`
- The following API methods have been renamed:
- `Command->getPermission()` -> `Command->getPermissions()`
## Internals
- The following methods have been renamed:
- `Block->computeStateData()` -> `Block->computeTypeAndStateData()`
- `Block->decodeStateData()` -> `Block->decodeTypeAndStateData()`
- Wall state data now packs connections into 7 bits instead of 8.
# 5.0.0-BETA2
Released 11th April 2023.
**This release includes changes from the following releases:**
- [4.17.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4170)
- [4.17.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4171)
- [4.17.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.17.md#4172)
- [4.18.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4180)
- [4.18.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4181)
- [4.18.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4182)
- [4.18.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4183)
- [4.18.4](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.18.md#4184)
- [4.19.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA2/changelogs/4.19.md#4190)
## Tools
- Added script `tools/generate-bedrock-data-from-packets.php`. This tool accepts a txt file containing base64-encoded packet dumps.
- This script has been used to generate data for [BedrockData](https://github.com/pmmp/BedrockData) for several years, but has only now been open-sourced.
- It's used to generate data such as crafting recipes, creative inventory data, and various other blobs of data needed to support the current version of Minecraft: Bedrock Edition.
## Gameplay
- Anvils now damage entities when they fall on top of them.
## API
### `pocketmine\block\utils`
- The following API interface requirements have been added (BC breaking):
- `public Fallable->getFallDamagePerBlock() : float` (default implementation provided by `FallableTrait`)
- `public Fallable->getMaxFallDamage() : float` (default implementation provided by `FallableTrait`)
### `pocketmine\data\bedrock\block`
- The following new API methods have been added:
- `public BlockStateData->getVersionAsString() : string`
#### `pocketmine\data\bedrock\block\upgrade\model`
- `BlockStateUpgradeSchemaModelBlockRemap` now accepts `null` for `oldState` and `newState`. This makes it easier to generate portable schemas for other languages to read.
### `pocketmine\event\entity`
- The following new API constants have been added:
- `EntityDamageEvent::CAUSE_FALLING_BLOCK`
- `EntityDamageEvent::MODIFIER_ARMOR_HELMET`
### `pocketmine\item`
- The following API methods have signature changes:
- `ItemTypeIds::toBlockTypeId()` may now return `null` if the item type ID is not a block.
### `pocketmine\player`
- The following classes have been removed:
- `PlayerChunkLoader` - deprecated in 4.19.0 (this was technically internal, but never marked as such)
## Internals
- Make use of `Item->canStackWith()` instead of `Item->equals()` wherever possible, to make the code more readable.
# 5.0.0-BETA3
Released 17th May 2023.
**This release includes changes from the following releases:**
- [4.19.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4191)
- [4.19.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4192)
- [4.19.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.19.md#4193)
- [4.20.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4200)
- [4.20.1](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4201)
- [4.20.2](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4202)
- [4.20.3](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4203)
- [4.20.4](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.20.md#4204)
- [4.21.0](https://github.com/pmmp/PocketMine-MP/blob/5.0.0-BETA3/changelogs/4.21.md#4210)
## General
- Improved light propagation performance by 10-15%.
## Fixes
- Fixed late initialization of coral type in `BaseCoral`.
## Tools
- `tools/generate-blockstate-upgrade-schema.php` has the following improvements:
- Now generates better errors when inconsistent blockstate versions are encountered.
- Now generates more stable outputs when re-run on the same input.
- Output now uses `copiedState` in `remappedStates` where possible. This significantly reduces the size of the output for blocks with partially flattened states.
## Gameplay
- The following blocks have been added:
- Cave Vines
- The following items have been added:
- Glow Berries
- Mangrove Boat (incomplete)
- Fixed flower pots being able to be placed inside flower pots.
## API
### `pocketmine\block`
- The following API methods have been renamed:
- `Block->isSameType()` -> `Block->hasSameTypeId()`
- `Block->describeType()` -> `Block->describeBlockItemState()`
- `Block->describeState()` -> `Block->describeBlockOnlyState()`
- The following API methods have been removed:
- `Block->getRequiredTypeDataBits()`
- `Block->getRequiredStateDataBits()`
- The following API methods have been added:
- `public Block->generateStatePermutations() : \Generator<int, Block, void, void>` - yields all possible states this block type can be in (used for `RuntimeBlockStateRegistry`)
- The following API methods have signature changes:
- `Sapling::__construct()` now accepts `SaplingType $saplingType` instead of `TreeType $treeType`
- `RuntimeBlockStateRegistry->register()` no longer accepts an `$override` parameter.
- The following classes have been added:
- `utils\SaplingType` - enum of all sapling types
- `utils\TreeType` has been moved to `pocketmine\world\generator\object` namespace.
### `pocketmine\data\bedrock\item\upgrade`
- The following API methods have been added:
- `public ItemIdMetaUpgrader->getSchemas() : array<int, BlockStateUpgradeSchema>` - returns a list of loaded schemas indexed by schema ID
- `public ItemIdMetaUpgradeSchema->getRenamedIds() : array<string, string>` - returns a map of old ID -> new ID
- `public ItemIdMetaUpgradeSchema->getRemappedMetas() : array<string, array<int, string>>` - returns a map of old ID -> list of old meta -> new ID
### `pocketmine\event\block`
- The following API methods have been added:
- `public BlockGrowEvent->getPlayer() : ?Player` - returns the player that triggered the block growth, or `null` if it was not triggered by a player
- The following API methods have signature changes:
- `BlockGrowEvent::__construct()` now accepts an optional `?Player $player` parameter.
### `pocketmine\event\world`
- The following classes have been added:
- `WorldDisplayNameChangeEvent` - called when a world's display name is changed
### `pocketmine\item`
- `Boat` now uses a new `BoatType` enum instead of `TreeType`. This is because not all tree types have an associated boat type, and some boat types are not made from tree materials (e.g. bamboo raft).
- The following API methods have been removed:
- `Boat->getWoodType()`
- The following API methods have been added:
- `public Boat->getType() : BoatType`
- `public Item->getStateId() : int` - returns an encoded ID containing the item type ID and encoded item state
- The following API methods have been renamed:
- `Item->describeType()` -> `Item->describeState()`
- The following classes have been added:
- `BoatType` - enum of all boat types
- The following API methods have signature changes:
- `BoatType::__construct()` now accepts `BoatType $boatType` instead of `TreeType $woodType`.
### `pocketmine\world`
- The following API methods have been added:
- `public World->setDisplayName(string $name) : void`
### `pocketmine\world\format`
- Fixed outdated documentation for various methods of `Chunk`.
### `pocketmine\world\format\io\data`
- The following API interface requirements have been added:
- `public WorldData->setDisplayName(string $value) : void`
## Internals
- Reduced global usage in world providers. In the future, we want to have blockstate deserializers etc. injected rather than being global singletons.
- `BlockStateUpgrader` now always updates the blockstate version, even if no changes were made. PM itself doesn't require this, but it's useful for tools to know whether to upgrade the data again (e.g. in testing scenarios).
- `BlockStateDictionary` memory usage is now reduced from 9 MB to 3.5 MB using various techniques, including string reuse and binary-encoded states.
- `RuntimeBlockMapping` has been renamed to `BlockTranslator`.
- Singletons in the `pocketmine\network\mcpe\convert` package have been centralized under `TypeConverter`. In the future, this will be injected where needed, allowing different converters to be used for different sessions (useful for multiversion).
- Overriding of serializers and deserializers of items and blocks is now consistently disallowed. Due to the lack of a good reason to allow overriding built-in blocks and items, this is no longer allowed.
# 5.0.0-BETA4
Released 23rd May 2023.
## General
- [`ext-pmmpthread` version 6.0.0](https://github.com/pmmp/ext-pmmpthread/releases/6.0.0) (renamed from `ext-pthreads`) is now required. This version has API changes compared to pthreads v5. Please read the linked changelog for details.
- [`pocketmine/snooze` version 0.5.0](https://github.com/pmmp/Snooze/releases/0.5.0) is now required.
- `pocketmine/classloader` and `pocketmine/log-pthreads` packages have been removed. The relevant classes from these packages are now included in-house in the `pocketmine/thread` namespace.
- `BaseClassLoader` is replaced with `pocketmine\thread\ThreadSafeClassLoader`
- `ThreadedLogger` is replaced by `pocketmine\thread\ThreadSafeLogger`
- `AttachableThreadedLogger` is replaced by `pocketmine\thread\AttachableThreadSafeLogger`
- `ThreadedLoggerAttachment` is replaced by `pocketmine\thread\ThreadSafeLoggerAttachment`
## Fixes
- Fixed crash on unknown blocks due to late initialization of properties in `UnknownBlock`.
## API changes
### `pocketmine\scheduler`
- `AsyncTask->setResult()` now works with thread-safe objects. This was previously not possible due to limitations in the `pthreads` extension.