0
0
mirror of https://github.com/pmmp/PocketMine-MP.git synced 2024-11-24 01:36:12 +00:00
PocketMine-MP/changelogs/4.16.md
2023-03-07 16:19:50 +00:00

3.7 KiB

For Minecraft: Bedrock Edition 1.19.62

Note about API versions

Plugins which don't touch the protocol and compatible with any previous 4.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.

4.16.0

Released 7th March 2023.

General

  • Added granular timings for packet encode, similar to the existing timings for packet decode.
  • Split Player Network Send - Compression timings into two timers, one for Session Buffer compression and one for Broadcast compression.
  • Timings now covers several areas of the network system which were previously not counted by network timings, but were counted by total timings. This provides a better insight into the performance of the network system.

Performance

  • Improved performance of packet batch handling by avoiding unnecessary object allocations.
  • Improved performance of packet broadcasting when the broadcast size is below the batch threshold. Previously, the packets would be encoded once by every recipient, but now they are encoded once and then added to the send buffer of each session in their raw form.
    • This change mostly affects servers with larger maps, where players are more widely distributed.
  • Improved performance of packet broadcasting when the broadcast has only one recipient (allow the session to compress the packet with the rest of its buffer).

Build system

  • Added a new script build/generate-bedrockdata-path-consts.php, which must be run whenever BedrockData is updated. This script generates a class of constants with the file paths of all BedrockData files.

API

pocketmine\entity

  • The following new API methods have been added:
    • public Entity->getGravity() : float - returns the entity's gravity acceleration in blocks/tick^2
    • public Entity->setGravity(float $gravity) : void - sets the entity's gravity acceleration in blocks/tick^2

Internals

  • Now uses pocketmine/bedrock-data 2.0.0.
    • This version is now used by both PM4 and PM5, reducing maintenance burden.
  • Now uses pocketmine/bedrock-protocol 19.3.0.
    • This version provides new APIs for handling packet batches which enabled improving performance and adding new features, such as detailed packet encode timings.
  • Crafting recipes and creative inventory data are now loaded from recipes/legacy_recipes.json and recipes/legacy_creativeitems.json respectively. Previously, these were loaded from BedrockData directly, but BedrockData 2.0 now uses a format which can't be supported in 4.x without BC breaks.
  • Added dependencies on pocketmine/bedrock-block-upgrade-schema and pocketmine/bedrock-item-upgrade-schema. These provide mapping files no longer present in BedrockData 2.0.
  • Reduced and/or eliminated most usages of PacketBatch, since it only appeared as a throwaway object and was therefore wasting performance.
  • Compressor now exposes getCompressionThreshold() instead of willCompress(), which allows determining whether a batch will be compressed without allocating it.
  • Added pocketmine\data\bedrock\BedrockDataFiles, an auto-generated class of constants with the file paths of all BedrockData files. This makes it easier to locate usages, detect unused files and avoid typos.