github pmmp/PocketMine-MP 3.4.0
PocketMine-MP 3.4.0

latest releases: 5.15.0, 5.14.1, 5.14.0...
5 years ago

For Minecraft: Bedrock Edition 1.7.0

This is a cumulative minor release featuring performance improvements, memory usage improvements, some new minor gameplay features, some API deprecations and additions, and significant changes to error handling.

Note

Plugins compatible with any previous 3.x.y version will also run on this build and do not need API bumps.

However, some API features have been deprecated in this version. Plugin developers do not need to do anything about these deprecations immediately, however they may raise harmless warnings if used.

Features marked @deprecated are recommended not to be used, but will continue to work for any future 3.x.y versions. They will be removed in the next major release (4.0).

Core changes

Performance & memory improvements

  • Entity EXHAUSTION attribute is no longer synced to the client, which reduces network traffic for survival players and reduces client-sided lag.
  • A redundant call was removed from an Event call hot path which improves event calling performance by ~15% per event handler executed.
  • Light updates are now batched together and executed on the end of each tick. The effects of this are noticeable when setting a large number of blocks in a close area - significant performance improvements should be noticeable for world editors (the ones that didn't disable light updates) and liquid flow is now significantly less expensive.
  • Internal enhancements have been made to subchunk light array interfacing to reduce branching and improve access performance.
  • Memory usage of most chunks has dropped by ~30-40% due to some improvements to internal storage of unlit subchunks. In real terms this translates to ~30% memory usage reduction for a freshly generated world.

Error handling

The most notable core change in this release revolves around error handling. Internals have been cleaned up substantially to improve the server behaviour under occurrence of unexpected behaviour. The goal of this is to improve consistency and quality while reducing undefined runtime behaviour.
The following changes have been made:

  • Throwing unexpected Throwables in the following cases will now cause a server crash (except on network (this will be changed in the future)):
    • Event handlers
    • Task->onRun() on a scheduler
    • AsyncTask->onCompletion()
    • Command->execute() and CommandExecutor->onCommand()
  • Unexpected Throwables thrown during packet handling will now cause the target player to be disconnected with an Internal server error message.

Other changes

  • Anti-flight has been removed, along with the allow-flight directive in server.properties.
  • Server language is now controlled by the language directive in server.properties.
  • Added unban and unban-ip as aliases of pardon and pardon-ip commands respectively.

API changes

Block

  • BlockSpreadEvent is now fired when lava or water tries to flow into a block.
  • BlockFormEvent is now fired when lava and water collide to form cobblestone, obsidian or stone.

Event

  • Added new method Event->call(). This should be used instead of PluginManager->callEvent() in plugins only supporting 3.4+.
  • PluginManager->callEvent() has been @deprecated.

Level

  • Attempting to unload a level during its tick will now throw an InvalidStateException.
  • Added the following new methods:
    • Level->broadcastPacketToViewers()
    • Level->getViewersForPosition()
    • Level->broadcastGlobalPacket()
    • Level->getChunkAtPosition()
    • Level->isInLoadedTerrain()
  • Level->addGlobalPacket() has been @deprecated.
  • LightUpdate now allows calling setAndUpdateLight() for the same position multiple times (needed for light update batching).

Permission

  • Permission::getByName() now throws an exception on invalid values instead of silently returning DEFAULT_FALSE. This may cause new errors to appear if your plugins had broken permission defaults in plugin.yml.

Player

  • addWindow() now has stricter validity checks and will now throw exceptions in the following cases: No window IDs left to use, and when a forced window ID collides with an existing window.
  • The public $speed field has been removed (this was only used by anti-cheat which has now been removed).

Scheduler

  • AsyncTask->setResult() has had the $serialize parameter removed - now it will automatically serialize (or not) as appropriate.
  • Added a new ClosureTask which allows concisely scheduling closure execution on a TaskScheduler.
  • TaskScheduler->__construct() $logger parameter has been @deprecated and will be removed in a future major version.

Server

  • Added new method Server->hasOfflinePlayerData(string $name) : bool.
  • Server->getAllowFlight() has been @deprecated.

Utils

  • Config->save() will no longer catch unexpected exceptions thrown while encoding data.

Gameplay changes

Blocks

  • Rail connectivity has been implemented for normal, powered, detector and activator rails (but there are currently no minecarts).

Don't miss a new PocketMine-MP release

NewReleases is sending notifications on new releases.