Release 5.0.0-ALPHA9

This commit is contained in:
Dylan K. Taylor 2023-02-21 16:44:27 +00:00
parent 94ffef1a99
commit 9a67fbf27a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 129 additions and 2 deletions

View File

@ -908,4 +908,131 @@ Released 23rd January 2023.
- `Player->disconnect()` now accepts an additional `Translatable|string|null $disconnectScreenMessage` parameter, which is the message to be displayed on the disconnect screen (the message in `$reason` is used if null is passed)
## Internals
- `NetworkSession` disconnect methods have been altered to allow specifying a different disconnect reason and disconnection screen message.
- `NetworkSession` disconnect methods have been altered to allow specifying a different disconnect reason and disconnection screen message.
# 5.0.0-ALPHA9
Released 21st February 2023.
## Core
- Introduced timings for individual packet encoding.
- Network timings now cover more parts of the network system which weren't previously accounted for.
## API
### `pocketmine\block`
- Blocks are no longer required to explicitly specify how many type or state data bits they require. This is now automatically calculated using `RuntimeDataSizeCalculator`.
- The following API methods have changed signatures:
- `Block->describeState()` now accepts `RuntimeDataDescriber` instead of `RuntimeDataReader|RuntimeDataWriter`
- `Block->describeType()` now accepts `RuntimeDataDescriber` instead of `RuntimeDataReader|RuntimeDataWriter`
- `Block->getRequiredStateDataBits()` is now `final`.
- `Block->getRequiredTypeDataBits()` is now `final`.
- `Leaves->__construct()` now `LeavesType $leavesType` instead of `TreeType $treeType`
- The following API methods have been added:
- `public Leaves->getLeavesType() : LeavesType` - returns the type of leaves
- The following classes have been added:
- `LeavesType` - an enum of all the different types of leaves
- The following classes have been renamed:
- `BlockFactory` -> `RuntimeBlockStateRegistry` - this more accurately describes the purpose of the class
- The following API methods have changed behaviour:
- `RuntimeBlockStateRegistry->register()` now throws a `LogicException` if a block does not properly reject invalid state data.
### `pocketmine\command`
- `SimpleCommandMap` now requires all commands to have a permission set when registered.
- If you actually want to allow everyone to use your command (not advised), you can add a new permission to the `pocketmine.group.user` group, or use `default: true` for `plugin.yml` permissions.
- The following API methods have changed behaviour:
- `Command->testPermissionSilent()` now returns `false` if there are no permissions associated with the command. This is to prevent commands with no permissions being usable by everyone, which has previously been a source of security issues.
- The following API methods have been added:
- `public Command->getPermissions() : list<string>` - returns a list of permissions which grant usage access to this command. A user with one or more of these permissions will be able to invoke the command's `execute()` method
- `public Command->setPermissions(list<string> $permissions) : void` - sets the permissions which grant usage access to this command. This should be used instead of `setPermission()` with `;` separators (which is now deprecated)
### `pocketmine\data\bedrock\block`
- The following API methods have been added:
- `public static BlockStateData::current(string $name, array<string, Tag> $states) : BlockStateData` - creates a new `BlockStateData` instance with the current blockstate version
### `pocketmine\data\bedrock\block\upgrade`
- Blockstate upgrade schemas are now indexed by schema ID instead of Minecraft version. This is because the Minecraft blockstate version isn't consistently bumped when changes are made.
- `BlockStateUpgrader` now requires that every schema added must have a unique schema ID.
- The following API methods have been removed:
- `BlockStateUpgradeSchema->getPriority()`
- The following API methods have been added:
- `public BlockStateUpgradeSchema->getSchemaId() : int` - returns the schema ID of this upgrade schema, usually the number at the start of the JSON filename
- The following API methods have changed signatures:
- `BlockStateUpgradeSchemaUtils::fromJsonModel()` now accepts `int $schemaId` instead of `int $priority`
- `BlockStateUpgradeSchemaUtils::loadSchemaFromString()` now accepts `int $schemaId` instead of `int $priority`
- `BlockStateUpgradeSchemaUtils::loadSchemas()` now accepts `int $maxSchemaId` instead of `int $currentVersion`
### `pocketmine\data\bedrock\item\upgrade`
- The following API methods have changed signatures:
- `ItemUpgradeSchemaUtils::loadSchemas()` now accepts `int $maxSchemaId`
- The following API methods have been renamed:
- `ItemIdMetaUpgradeSchema->getPriority()` -> `ItemIdMetaUpgradeSchema->getSchemaId()`
- The following classes have been added:
- `ItemIdMetaUpgrader` - encapsulates handling for upgrading item string IDs and meta to newer versions
- The following API methods have been moved:
- `ItemDataUpgrader->addIdMetaUpgradeSchema()` -> `ItemIdMetaUpgrader->addSchema()`
- `ItemDataUpgrader->upgradeItemStringIdMeta()` -> `ItemIdMetaUpgrader->upgrade()`
### `pocketmine\data\runtime`
- The following interfaces have been added:
- `RuntimeDataDescriber` - contract for symmetric APIs exposed by `RuntimeDataReader`, `RuntimeDataWriter` and `RuntimeDataSizeCalculator`
### `pocketmine\event\player`
- `PlayerPreLoginEvent` now supports setting separate log reasons (disconnect reason) and disconnect screen messages.
- The following classes have inheritance changes:
- `PlayerPreLoginEvent` no longer implements `Cancellable`. This caused unexpected behaviour for most plugin devs due to default-ignoring cancelled events, forcing people to usually have to use `@handleCancelled` to handle the event when they wanted to use it.
- The following API methods have been added:
- `public PlayerPreLoginEvent->getDisconnectScreenMessage(int $flag) : Translatable|string|null` - returns the message to be displayed on the disconnect screen for the specified kick flag, if set
- `public PlayerPreLoginEvent->getFinalDisconnectScreenMessage() : Translatable|string|null` - returns the message to be displayed on the disconnect screen, taking into account the kick flags set
- The following API constants have been renamed:
- `PlayerPreLoginEvent::KICK_REASON_BANNED` -> `PlayerPreLoginEvent::KICK_FLAG_BANNED`
- `PlayerPreLoginEvent::KICK_REASON_PLUGIN` -> `PlayerPreLoginEvent::KICK_FLAG_PLUGIN`
- `PlayerPreLoginEvent::KICK_REASON_PRIORITY` -> `PlayerPreLoginEvent::KICK_FLAG_PRIORITY`
- `PlayerPreLoginEvent::KICK_REASON_SERVER_FULL` -> `PlayerPreLoginEvent::KICK_FLAG_SERVER_FULL`
- `PlayerPreLoginEvent::KICK_REASON_SERVER_WHITELISTED` -> `PlayerPreLoginEvent::KICK_FLAG_SERVER_WHITELISTED`
- The following API methods have been renamed:
- `PlayerPreLoginEvent->clearAllKickReasons()` -> `PlayerPreLoginEvent->clearAllKickFlags()`
- `PlayerPreLoginEvent->clearKickReason()` -> `PlayerPreLoginEvent->clearKickFlag()`
- `PlayerPreLoginEvent->getFinalKickMessage()` -> `PlayerPreLoginEvent->getFinalDisconnectReason()` (now used for logs only, if a disconnect screen message is set for the highest priority flag)
- `PlayerPreLoginEvent->getKickMessage()` -> `PlayerPreLoginEvent->getDisconnectReason()` (now used for logs only, if a disconnect screen message is set for the flag)
- `PlayerPreLoginEvent->getKickReasons()` -> `PlayerPreLoginEvent->getKickFlags()`
- `PlayerPreLoginEvent->isKickReasonSet()` -> `PlayerPreLoginEvent->isKickFlagSet()`
- `PlayerPreLoginEvent->setKickReason()` -> `PlayerPreLoginEvent->setKickFlag()`
- The following API methods have changed signatures:
- `PlayerPreLoginEvent->setKickFlag()` (previously `setKickReason()`) now accepts `Translatable|string $disconnectReason, Translatable|string|null $disconnectScreenMessage = null` instead of `Translatable|string $message`
### `pocketmine\event\block`
- The following classes have inheritance changes:
- `BlockPlaceEvent` no longer extends `BlockEvent`, and therefore no longer has `getBlock()`.
- The following API methods have been removed:
- `BlockPlaceEvent->getBlockReplaced()` - this information is now provided in the `BlockTransaction` object returned by `BlockPlaceEvent->getTransaction()`
- The following API methods have been added:
- `public BlockPlaceEvent->getTransaction() : BlockTransaction` - returns the transaction containing a list of changed block positions and the blockstates they will be changed to
- The following API methods have changed signatures:
- `BlockPlaceEvent->__construct()` now accepts `BlockTransaction $transaction` instead of `Block $blockPlace, Block $blockReplace`
### `pocketmine\item`
- The following API methods have signature changes:
- `Item->describeType()` now accepts `RuntimeDataDescriber` instead of `RuntimeDataReader|RuntimeDataWriter`
### `pocketmine\world\format`
- The following API methods have been renamed:
- `Chunk->getFullBlock()` -> `Chunk->getBlockStateId()`
- `Chunk->setFullBlock()` -> `Chunk->setBlockStateId()`
- `SubChunk->getFullBlock()` -> `SubChunk->getBlockStateId()`
- `SubChunk->setFullBlock()` -> `SubChunk->setBlockStateId()`
## Gameplay
### Blocks
- The following new blocks have been added:
- Mangrove Leaves
- Azalea Leaves
- Flowering Azalea Leaves
- Reinforced Deepslate
- Fixed incorrect drops of deepslate when mined without a Silk Touch tool.
- Bells now ring when hit by a projectile.
## Internals
- `build/generate-runtime-enum-serializers.php` now generates the following additional classes:
- `interface RuntimeEnumDescriber`
- `trait RuntimeEnumSizeCalculatorTrait`
- Block type/state data required bits are now calculated from `Block->describeType()` using `RuntimeDataSizeCalculator`.
- Commands now use an array for permissions internally, instead of a string separated by `;`.

View File

@ -32,7 +32,7 @@ use function str_repeat;
final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "5.0.0-ALPHA9";
public const IS_DEVELOPMENT_BUILD = true;
public const IS_DEVELOPMENT_BUILD = false;
public const BUILD_CHANNEL = "alpha";
private function __construct(){