Merge branch 'stable' into minor-next

This commit is contained in:
Dylan K. Taylor 2023-07-13 12:59:53 +01:00
commit 0d8a06732a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
22 changed files with 268 additions and 94 deletions

View File

@ -8,6 +8,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
concurrency: update-updater-api # only one job can run at a time, to avoid git conflicts when updating the repository
steps:
- name: Install jq

View File

@ -139,7 +139,7 @@ function generateBlockStateNames(BlockPaletteReport $data) : void{
fwrite($output, generateClassHeader(BlockStateNames::class));
foreach(Utils::stringifyKeys($data->seenStateValues) as $state => $values){
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "", $state) ?? throw new AssumptionFailedError("This regex is not invalid"), 'US-ASCII');
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "mc_", $state) ?? throw new AssumptionFailedError("This regex is not invalid"), 'US-ASCII');
fwrite($output, "\tpublic const $constName = \"$state\";\n");
}
@ -159,7 +159,7 @@ function generateBlockStringValues(BlockPaletteReport $data) : void{
continue;
}
$anyWritten = true;
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "", $stateName) . "_" . $value, 'US-ASCII');
$constName = mb_strtoupper(preg_replace("/^minecraft:/", "mc_", $stateName) . "_" . $value, 'US-ASCII');
fwrite($output, "\tpublic const $constName = \"$value\";\n");
}
if($anyWritten){

@ -1 +1 @@
Subproject commit 2a21c579007a8fd7244f9faad498cd1c8c33004c
Subproject commit e0c918d1379465964acefd562d9e48f87cfc2c9e

View File

@ -46,3 +46,13 @@ Released 1st July 2023.
- Due to the lack of a hard date for the key changeover, we guessed that July 1st would be a safe bet, but this appears to have backfired.
- This version will accept both old and new keys indefinitely.
- A security release will be published to remove the old key after the transition occurs.
# 4.22.3
Released 11th July 2023.
## Fixes
- Fixed mishandling of NBT leading to a server crash when editing signs.
- Fixed an edge case crash that could occur in `AsyncTask->__destruct()` when thread-local storage referenced other `AsyncTask` objects.
## Internals
- Added a concurrency lock to prevent the `update-updater-api` GitHub Action from running for multiple releases at the same time (which would have caused one of them to fail due to git conflicts).

19
changelogs/4.23.md Normal file
View File

@ -0,0 +1,19 @@
# 4.23.0
Released 12th July 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a support release for Minecraft: Bedrock Edition 1.20.10.
**Plugin compatibility:** Plugins for previous 4.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` 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.
## General
- Added support for Minecraft: Bedrock Edition 1.20.10.
- Removed support for older versions.
## Fixes
- Fixed Docker image build failure due to outdated `build/php` submodule.

View File

@ -69,3 +69,11 @@ Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if
- `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.

23
changelogs/5.3.md Normal file
View File

@ -0,0 +1,23 @@
# 5.3.0
Released 12th July 2023.
**For Minecraft: Bedrock Edition 1.20.10**
This is a support release for Minecraft: Bedrock Edition 1.20.10.
**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.
## Interim releases
If you're upgrading directly from 5.1.x to 5.3.x, please also read the following changelogs, as the interim releases contain important changes:
- [5.2.0](https://github.com/pmmp/PocketMine-MP/blob/5.2.0/changelogs/5.2.md#520)
## Included releases
**This release includes changes from the following releases:**
- [4.23.0](https://github.com/pmmp/PocketMine-MP/blob/4.23.0/changelogs/4.23.md#4230) - Support for Minecraft: Bedrock Edition 1.20.10
## Internals
- `BlockTypeNames`, `BlockStateNames`, `BlockStateStringValues` and `ItemTypeNames` in the `pocketmine\data\bedrock` package have BC-breaking changes to accommodate Bedrock 1.20.10.

View File

@ -34,10 +34,10 @@
"adhocore/json-comment": "~1.2.0",
"fgrosse/phpasn1": "~2.5.0",
"pocketmine/netresearch-jsonmapper": "~v4.2.999",
"pocketmine/bedrock-block-upgrade-schema": "~3.0.0",
"pocketmine/bedrock-data": "~2.3.0+bedrock-1.20.0",
"pocketmine/bedrock-item-upgrade-schema": "~1.3.0+bedrock-1.20.0",
"pocketmine/bedrock-protocol": "~22.0.0+bedrock-1.20.0",
"pocketmine/bedrock-block-upgrade-schema": "~3.1.0+bedrock-1.20.10",
"pocketmine/bedrock-data": "~2.4.0+bedrock-1.20.10",
"pocketmine/bedrock-item-upgrade-schema": "~1.4.0+bedrock-1.20.10",
"pocketmine/bedrock-protocol": "~23.0.0+bedrock-1.20.10",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/color": "^0.3.0",

50
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ff0fa864a7853011bf4620d870c47ac7",
"content-hash": "e0c0208b3fc3d1b20fef20d2fc43fc90",
"packages": [
{
"name": "adhocore/json-comment",
@ -198,16 +198,16 @@
},
{
"name": "pocketmine/bedrock-block-upgrade-schema",
"version": "3.0.0",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockBlockUpgradeSchema.git",
"reference": "8b72c47109e174ac7f17c3ac546748f8e49a5fdf"
"reference": "6d4ae416043337946a22fc31e8065ca2c21f472d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/8b72c47109e174ac7f17c3ac546748f8e49a5fdf",
"reference": "8b72c47109e174ac7f17c3ac546748f8e49a5fdf",
"url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/6d4ae416043337946a22fc31e8065ca2c21f472d",
"reference": "6d4ae416043337946a22fc31e8065ca2c21f472d",
"shasum": ""
},
"type": "library",
@ -218,22 +218,22 @@
"description": "Schemas describing how to upgrade saved block data in older Minecraft: Bedrock Edition world saves",
"support": {
"issues": "https://github.com/pmmp/BedrockBlockUpgradeSchema/issues",
"source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/3.0.0"
"source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/3.1.0"
},
"time": "2023-07-03T16:35:44+00:00"
"time": "2023-07-12T12:05:36+00:00"
},
{
"name": "pocketmine/bedrock-data",
"version": "2.3.1+bedrock-1.20.0",
"version": "2.4.0+bedrock-1.20.10",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockData.git",
"reference": "fb89ccdc039252462d8d068a769635e24151b7e2"
"reference": "f98bd1cae46d2920058acf3b23c0bedeac79f4ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/fb89ccdc039252462d8d068a769635e24151b7e2",
"reference": "fb89ccdc039252462d8d068a769635e24151b7e2",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/f98bd1cae46d2920058acf3b23c0bedeac79f4ab",
"reference": "f98bd1cae46d2920058acf3b23c0bedeac79f4ab",
"shasum": ""
},
"type": "library",
@ -244,22 +244,22 @@
"description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP",
"support": {
"issues": "https://github.com/pmmp/BedrockData/issues",
"source": "https://github.com/pmmp/BedrockData/tree/2.3.1+bedrock-1.20.0"
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.20.10"
},
"time": "2023-06-13T16:42:09+00:00"
"time": "2023-07-12T11:51:54+00:00"
},
{
"name": "pocketmine/bedrock-item-upgrade-schema",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockItemUpgradeSchema.git",
"reference": "b16c59cfae08833f180dd82f88de7c1f43bc67c9"
"reference": "60d199afe5e371fd189b21d685ec1fed6ba54230"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/b16c59cfae08833f180dd82f88de7c1f43bc67c9",
"reference": "b16c59cfae08833f180dd82f88de7c1f43bc67c9",
"url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/60d199afe5e371fd189b21d685ec1fed6ba54230",
"reference": "60d199afe5e371fd189b21d685ec1fed6ba54230",
"shasum": ""
},
"type": "library",
@ -270,22 +270,22 @@
"description": "JSON schemas for upgrading items found in older Minecraft: Bedrock world saves",
"support": {
"issues": "https://github.com/pmmp/BedrockItemUpgradeSchema/issues",
"source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.3.0"
"source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.4.0"
},
"time": "2023-05-18T15:34:32+00:00"
"time": "2023-07-12T12:08:37+00:00"
},
{
"name": "pocketmine/bedrock-protocol",
"version": "22.0.0+bedrock-1.20.0",
"version": "23.0.0+bedrock-1.20.10",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "ceff28a0bd5d248f37fb97be3e836d536e37526e"
"reference": "0cfaafdc02cca882a50773d6c02ebfeb622614e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/ceff28a0bd5d248f37fb97be3e836d536e37526e",
"reference": "ceff28a0bd5d248f37fb97be3e836d536e37526e",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/0cfaafdc02cca882a50773d6c02ebfeb622614e2",
"reference": "0cfaafdc02cca882a50773d6c02ebfeb622614e2",
"shasum": ""
},
"require": {
@ -317,9 +317,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/22.0.0+bedrock-1.20.0"
"source": "https://github.com/pmmp/BedrockProtocol/tree/23.0.0+bedrock-1.20.10"
},
"time": "2023-06-07T19:22:05+00:00"
"time": "2023-07-12T12:19:40+00:00"
},
{
"name": "pocketmine/binaryutils",

View File

@ -31,7 +31,7 @@ use function str_repeat;
final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "5.2.1";
public const BASE_VERSION = "5.3.1";
public const IS_DEVELOPMENT_BUILD = true;
public const BUILD_CHANNEL = "stable";

View File

@ -42,8 +42,8 @@ final class BlockStateData{
public const CURRENT_VERSION =
(1 << 24) | //major
(20 << 16) | //minor
(0 << 8) | //patch
(33); //revision
(10 << 8) | //patch
(32); //revision
public const TAG_NAME = "name";
public const TAG_STATES = "states";

View File

@ -98,7 +98,8 @@ final class BlockStateNames{
public const LEVER_DIRECTION = "lever_direction";
public const LIQUID_DEPTH = "liquid_depth";
public const LIT = "lit";
public const CARDINAL_DIRECTION = "minecraft:cardinal_direction";
public const MC_CARDINAL_DIRECTION = "minecraft:cardinal_direction";
public const MC_FACING_DIRECTION = "minecraft:facing_direction";
public const MOISTURIZED_AMOUNT = "moisturized_amount";
public const MONSTER_EGG_STONE_TYPE = "monster_egg_stone_type";
public const MULTI_FACE_DIRECTION_BITS = "multi_face_direction_bits";

View File

@ -131,10 +131,17 @@ final class BlockStateStringValues{
public const LEVER_DIRECTION_UP_NORTH_SOUTH = "up_north_south";
public const LEVER_DIRECTION_WEST = "west";
public const CARDINAL_DIRECTION_EAST = "east";
public const CARDINAL_DIRECTION_NORTH = "north";
public const CARDINAL_DIRECTION_SOUTH = "south";
public const CARDINAL_DIRECTION_WEST = "west";
public const MC_CARDINAL_DIRECTION_EAST = "east";
public const MC_CARDINAL_DIRECTION_NORTH = "north";
public const MC_CARDINAL_DIRECTION_SOUTH = "south";
public const MC_CARDINAL_DIRECTION_WEST = "west";
public const MC_FACING_DIRECTION_DOWN = "down";
public const MC_FACING_DIRECTION_EAST = "east";
public const MC_FACING_DIRECTION_NORTH = "north";
public const MC_FACING_DIRECTION_SOUTH = "south";
public const MC_FACING_DIRECTION_UP = "up";
public const MC_FACING_DIRECTION_WEST = "west";
public const MONSTER_EGG_STONE_TYPE_CHISELED_STONE_BRICK = "chiseled_stone_brick";
public const MONSTER_EGG_STONE_TYPE_COBBLESTONE = "cobblestone";

View File

@ -98,7 +98,9 @@ final class BlockTypeNames{
public const BLACK_CANDLE = "minecraft:black_candle";
public const BLACK_CANDLE_CAKE = "minecraft:black_candle_cake";
public const BLACK_CARPET = "minecraft:black_carpet";
public const BLACK_CONCRETE = "minecraft:black_concrete";
public const BLACK_GLAZED_TERRACOTTA = "minecraft:black_glazed_terracotta";
public const BLACK_SHULKER_BOX = "minecraft:black_shulker_box";
public const BLACK_WOOL = "minecraft:black_wool";
public const BLACKSTONE = "minecraft:blackstone";
public const BLACKSTONE_DOUBLE_SLAB = "minecraft:blackstone_double_slab";
@ -109,8 +111,10 @@ final class BlockTypeNames{
public const BLUE_CANDLE = "minecraft:blue_candle";
public const BLUE_CANDLE_CAKE = "minecraft:blue_candle_cake";
public const BLUE_CARPET = "minecraft:blue_carpet";
public const BLUE_CONCRETE = "minecraft:blue_concrete";
public const BLUE_GLAZED_TERRACOTTA = "minecraft:blue_glazed_terracotta";
public const BLUE_ICE = "minecraft:blue_ice";
public const BLUE_SHULKER_BOX = "minecraft:blue_shulker_box";
public const BLUE_WOOL = "minecraft:blue_wool";
public const BONE_BLOCK = "minecraft:bone_block";
public const BOOKSHELF = "minecraft:bookshelf";
@ -122,9 +126,11 @@ final class BlockTypeNames{
public const BROWN_CANDLE = "minecraft:brown_candle";
public const BROWN_CANDLE_CAKE = "minecraft:brown_candle_cake";
public const BROWN_CARPET = "minecraft:brown_carpet";
public const BROWN_CONCRETE = "minecraft:brown_concrete";
public const BROWN_GLAZED_TERRACOTTA = "minecraft:brown_glazed_terracotta";
public const BROWN_MUSHROOM = "minecraft:brown_mushroom";
public const BROWN_MUSHROOM_BLOCK = "minecraft:brown_mushroom_block";
public const BROWN_SHULKER_BOX = "minecraft:brown_shulker_box";
public const BROWN_WOOL = "minecraft:brown_wool";
public const BUBBLE_COLUMN = "minecraft:bubble_column";
public const BUBBLE_CORAL = "minecraft:bubble_coral";
@ -188,7 +194,6 @@ final class BlockTypeNames{
public const COLORED_TORCH_RG = "minecraft:colored_torch_rg";
public const COMMAND_BLOCK = "minecraft:command_block";
public const COMPOSTER = "minecraft:composter";
public const CONCRETE = "minecraft:concrete";
public const CONCRETE_POWDER = "minecraft:concrete_powder";
public const CONDUIT = "minecraft:conduit";
public const COPPER_BLOCK = "minecraft:copper_block";
@ -229,7 +234,9 @@ final class BlockTypeNames{
public const CYAN_CANDLE = "minecraft:cyan_candle";
public const CYAN_CANDLE_CAKE = "minecraft:cyan_candle_cake";
public const CYAN_CARPET = "minecraft:cyan_carpet";
public const CYAN_CONCRETE = "minecraft:cyan_concrete";
public const CYAN_GLAZED_TERRACOTTA = "minecraft:cyan_glazed_terracotta";
public const CYAN_SHULKER_BOX = "minecraft:cyan_shulker_box";
public const CYAN_WOOL = "minecraft:cyan_wool";
public const DARK_OAK_BUTTON = "minecraft:dark_oak_button";
public const DARK_OAK_DOOR = "minecraft:dark_oak_door";
@ -455,12 +462,16 @@ final class BlockTypeNames{
public const GRAY_CANDLE = "minecraft:gray_candle";
public const GRAY_CANDLE_CAKE = "minecraft:gray_candle_cake";
public const GRAY_CARPET = "minecraft:gray_carpet";
public const GRAY_CONCRETE = "minecraft:gray_concrete";
public const GRAY_GLAZED_TERRACOTTA = "minecraft:gray_glazed_terracotta";
public const GRAY_SHULKER_BOX = "minecraft:gray_shulker_box";
public const GRAY_WOOL = "minecraft:gray_wool";
public const GREEN_CANDLE = "minecraft:green_candle";
public const GREEN_CANDLE_CAKE = "minecraft:green_candle_cake";
public const GREEN_CARPET = "minecraft:green_carpet";
public const GREEN_CONCRETE = "minecraft:green_concrete";
public const GREEN_GLAZED_TERRACOTTA = "minecraft:green_glazed_terracotta";
public const GREEN_SHULKER_BOX = "minecraft:green_shulker_box";
public const GREEN_WOOL = "minecraft:green_wool";
public const GRINDSTONE = "minecraft:grindstone";
public const HANGING_ROOTS = "minecraft:hanging_roots";
@ -513,18 +524,24 @@ final class BlockTypeNames{
public const LIGHT_BLUE_CANDLE = "minecraft:light_blue_candle";
public const LIGHT_BLUE_CANDLE_CAKE = "minecraft:light_blue_candle_cake";
public const LIGHT_BLUE_CARPET = "minecraft:light_blue_carpet";
public const LIGHT_BLUE_CONCRETE = "minecraft:light_blue_concrete";
public const LIGHT_BLUE_GLAZED_TERRACOTTA = "minecraft:light_blue_glazed_terracotta";
public const LIGHT_BLUE_SHULKER_BOX = "minecraft:light_blue_shulker_box";
public const LIGHT_BLUE_WOOL = "minecraft:light_blue_wool";
public const LIGHT_GRAY_CANDLE = "minecraft:light_gray_candle";
public const LIGHT_GRAY_CANDLE_CAKE = "minecraft:light_gray_candle_cake";
public const LIGHT_GRAY_CARPET = "minecraft:light_gray_carpet";
public const LIGHT_GRAY_CONCRETE = "minecraft:light_gray_concrete";
public const LIGHT_GRAY_SHULKER_BOX = "minecraft:light_gray_shulker_box";
public const LIGHT_GRAY_WOOL = "minecraft:light_gray_wool";
public const LIGHT_WEIGHTED_PRESSURE_PLATE = "minecraft:light_weighted_pressure_plate";
public const LIGHTNING_ROD = "minecraft:lightning_rod";
public const LIME_CANDLE = "minecraft:lime_candle";
public const LIME_CANDLE_CAKE = "minecraft:lime_candle_cake";
public const LIME_CARPET = "minecraft:lime_carpet";
public const LIME_CONCRETE = "minecraft:lime_concrete";
public const LIME_GLAZED_TERRACOTTA = "minecraft:lime_glazed_terracotta";
public const LIME_SHULKER_BOX = "minecraft:lime_shulker_box";
public const LIME_WOOL = "minecraft:lime_wool";
public const LIT_BLAST_FURNACE = "minecraft:lit_blast_furnace";
public const LIT_DEEPSLATE_REDSTONE_ORE = "minecraft:lit_deepslate_redstone_ore";
@ -538,7 +555,9 @@ final class BlockTypeNames{
public const MAGENTA_CANDLE = "minecraft:magenta_candle";
public const MAGENTA_CANDLE_CAKE = "minecraft:magenta_candle_cake";
public const MAGENTA_CARPET = "minecraft:magenta_carpet";
public const MAGENTA_CONCRETE = "minecraft:magenta_concrete";
public const MAGENTA_GLAZED_TERRACOTTA = "minecraft:magenta_glazed_terracotta";
public const MAGENTA_SHULKER_BOX = "minecraft:magenta_shulker_box";
public const MAGENTA_WOOL = "minecraft:magenta_wool";
public const MAGMA = "minecraft:magma";
public const MANGROVE_BUTTON = "minecraft:mangrove_button";
@ -600,7 +619,9 @@ final class BlockTypeNames{
public const ORANGE_CANDLE = "minecraft:orange_candle";
public const ORANGE_CANDLE_CAKE = "minecraft:orange_candle_cake";
public const ORANGE_CARPET = "minecraft:orange_carpet";
public const ORANGE_CONCRETE = "minecraft:orange_concrete";
public const ORANGE_GLAZED_TERRACOTTA = "minecraft:orange_glazed_terracotta";
public const ORANGE_SHULKER_BOX = "minecraft:orange_shulker_box";
public const ORANGE_WOOL = "minecraft:orange_wool";
public const OXIDIZED_COPPER = "minecraft:oxidized_copper";
public const OXIDIZED_CUT_COPPER = "minecraft:oxidized_cut_copper";
@ -613,8 +634,10 @@ final class BlockTypeNames{
public const PINK_CANDLE = "minecraft:pink_candle";
public const PINK_CANDLE_CAKE = "minecraft:pink_candle_cake";
public const PINK_CARPET = "minecraft:pink_carpet";
public const PINK_CONCRETE = "minecraft:pink_concrete";
public const PINK_GLAZED_TERRACOTTA = "minecraft:pink_glazed_terracotta";
public const PINK_PETALS = "minecraft:pink_petals";
public const PINK_SHULKER_BOX = "minecraft:pink_shulker_box";
public const PINK_WOOL = "minecraft:pink_wool";
public const PISTON = "minecraft:piston";
public const PISTON_ARM_COLLISION = "minecraft:piston_arm_collision";
@ -657,7 +680,9 @@ final class BlockTypeNames{
public const PURPLE_CANDLE = "minecraft:purple_candle";
public const PURPLE_CANDLE_CAKE = "minecraft:purple_candle_cake";
public const PURPLE_CARPET = "minecraft:purple_carpet";
public const PURPLE_CONCRETE = "minecraft:purple_concrete";
public const PURPLE_GLAZED_TERRACOTTA = "minecraft:purple_glazed_terracotta";
public const PURPLE_SHULKER_BOX = "minecraft:purple_shulker_box";
public const PURPLE_WOOL = "minecraft:purple_wool";
public const PURPUR_BLOCK = "minecraft:purpur_block";
public const PURPUR_STAIRS = "minecraft:purpur_stairs";
@ -672,6 +697,7 @@ final class BlockTypeNames{
public const RED_CANDLE = "minecraft:red_candle";
public const RED_CANDLE_CAKE = "minecraft:red_candle_cake";
public const RED_CARPET = "minecraft:red_carpet";
public const RED_CONCRETE = "minecraft:red_concrete";
public const RED_FLOWER = "minecraft:red_flower";
public const RED_GLAZED_TERRACOTTA = "minecraft:red_glazed_terracotta";
public const RED_MUSHROOM = "minecraft:red_mushroom";
@ -680,6 +706,7 @@ final class BlockTypeNames{
public const RED_NETHER_BRICK_STAIRS = "minecraft:red_nether_brick_stairs";
public const RED_SANDSTONE = "minecraft:red_sandstone";
public const RED_SANDSTONE_STAIRS = "minecraft:red_sandstone_stairs";
public const RED_SHULKER_BOX = "minecraft:red_shulker_box";
public const RED_WOOL = "minecraft:red_wool";
public const REDSTONE_BLOCK = "minecraft:redstone_block";
public const REDSTONE_LAMP = "minecraft:redstone_lamp";
@ -705,7 +732,6 @@ final class BlockTypeNames{
public const SEA_PICKLE = "minecraft:sea_pickle";
public const SEAGRASS = "minecraft:seagrass";
public const SHROOMLIGHT = "minecraft:shroomlight";
public const SHULKER_BOX = "minecraft:shulker_box";
public const SILVER_GLAZED_TERRACOTTA = "minecraft:silver_glazed_terracotta";
public const SKULL = "minecraft:skull";
public const SLIME = "minecraft:slime";
@ -856,7 +882,9 @@ final class BlockTypeNames{
public const WHITE_CANDLE = "minecraft:white_candle";
public const WHITE_CANDLE_CAKE = "minecraft:white_candle_cake";
public const WHITE_CARPET = "minecraft:white_carpet";
public const WHITE_CONCRETE = "minecraft:white_concrete";
public const WHITE_GLAZED_TERRACOTTA = "minecraft:white_glazed_terracotta";
public const WHITE_SHULKER_BOX = "minecraft:white_shulker_box";
public const WHITE_WOOL = "minecraft:white_wool";
public const WITHER_ROSE = "minecraft:wither_rose";
public const WOOD = "minecraft:wood";
@ -867,7 +895,9 @@ final class BlockTypeNames{
public const YELLOW_CANDLE = "minecraft:yellow_candle";
public const YELLOW_CANDLE_CAKE = "minecraft:yellow_candle_cake";
public const YELLOW_CARPET = "minecraft:yellow_carpet";
public const YELLOW_CONCRETE = "minecraft:yellow_concrete";
public const YELLOW_FLOWER = "minecraft:yellow_flower";
public const YELLOW_GLAZED_TERRACOTTA = "minecraft:yellow_glazed_terracotta";
public const YELLOW_SHULKER_BOX = "minecraft:yellow_shulker_box";
public const YELLOW_WOOL = "minecraft:yellow_wool";
}

View File

@ -370,6 +370,46 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
DyeColor::YELLOW() => Ids::YELLOW_CARPET,
default => throw new AssumptionFailedError("Unhandled dye colour " . $color->name())
}));
$this->map(Blocks::DYED_SHULKER_BOX(), fn(DyedShulkerBox $block) => Writer::create(match($color = $block->getColor()){
DyeColor::BLACK() => Ids::BLACK_SHULKER_BOX,
DyeColor::BLUE() => Ids::BLUE_SHULKER_BOX,
DyeColor::BROWN() => Ids::BROWN_SHULKER_BOX,
DyeColor::CYAN() => Ids::CYAN_SHULKER_BOX,
DyeColor::GRAY() => Ids::GRAY_SHULKER_BOX,
DyeColor::GREEN() => Ids::GREEN_SHULKER_BOX,
DyeColor::LIGHT_BLUE() => Ids::LIGHT_BLUE_SHULKER_BOX,
DyeColor::LIGHT_GRAY() => Ids::LIGHT_GRAY_SHULKER_BOX,
DyeColor::LIME() => Ids::LIME_SHULKER_BOX,
DyeColor::MAGENTA() => Ids::MAGENTA_SHULKER_BOX,
DyeColor::ORANGE() => Ids::ORANGE_SHULKER_BOX,
DyeColor::PINK() => Ids::PINK_SHULKER_BOX,
DyeColor::PURPLE() => Ids::PURPLE_SHULKER_BOX,
DyeColor::RED() => Ids::RED_SHULKER_BOX,
DyeColor::WHITE() => Ids::WHITE_SHULKER_BOX,
DyeColor::YELLOW() => Ids::YELLOW_SHULKER_BOX,
default => throw new AssumptionFailedError("Unhandled dye colour " . $color->name())
}));
$this->map(Blocks::CONCRETE(), fn(Concrete $block) => Writer::create(match($color = $block->getColor()){
DyeColor::BLACK() => Ids::BLACK_CONCRETE,
DyeColor::BLUE() => Ids::BLUE_CONCRETE,
DyeColor::BROWN() => Ids::BROWN_CONCRETE,
DyeColor::CYAN() => Ids::CYAN_CONCRETE,
DyeColor::GRAY() => Ids::GRAY_CONCRETE,
DyeColor::GREEN() => Ids::GREEN_CONCRETE,
DyeColor::LIGHT_BLUE() => Ids::LIGHT_BLUE_CONCRETE,
DyeColor::LIGHT_GRAY() => Ids::LIGHT_GRAY_CONCRETE,
DyeColor::LIME() => Ids::LIME_CONCRETE,
DyeColor::MAGENTA() => Ids::MAGENTA_CONCRETE,
DyeColor::ORANGE() => Ids::ORANGE_CONCRETE,
DyeColor::PINK() => Ids::PINK_CONCRETE,
DyeColor::PURPLE() => Ids::PURPLE_CONCRETE,
DyeColor::RED() => Ids::RED_CONCRETE,
DyeColor::WHITE() => Ids::WHITE_CONCRETE,
DyeColor::YELLOW() => Ids::YELLOW_CONCRETE,
default => throw new AssumptionFailedError("Unhandled dye colour " . $color->name())
}));
}
private function registerFlatCoralSerializers() : void{
@ -1066,10 +1106,6 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
->writeLegacyHorizontalFacing(Facing::opposite($block->getFacing()));
});
$this->map(Blocks::COMPOUND_CREATOR(), fn(ChemistryTable $block) => Helper::encodeChemistryTable($block, StringValues::CHEMISTRY_TABLE_TYPE_COMPOUND_CREATOR, new Writer(Ids::CHEMISTRY_TABLE)));
$this->map(Blocks::CONCRETE(), function(Concrete $block) : Writer{
return Writer::create(Ids::CONCRETE)
->writeColor($block->getColor());
});
$this->map(Blocks::CONCRETE_POWDER(), function(ConcretePowder $block) : Writer{
return Writer::create(Ids::CONCRETE_POWDER)
->writeColor($block->getColor());
@ -1136,10 +1172,6 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
});
});
$this->map(Blocks::DOUBLE_TALLGRASS(), fn(DoubleTallGrass $block) => Helper::encodeDoublePlant($block, StringValues::DOUBLE_PLANT_TYPE_GRASS, Writer::create(Ids::DOUBLE_PLANT)));
$this->map(Blocks::DYED_SHULKER_BOX(), function(DyedShulkerBox $block) : Writer{
return Writer::create(Ids::SHULKER_BOX)
->writeColor($block->getColor());
});
$this->map(Blocks::ELEMENT_CONSTRUCTOR(), fn(ChemistryTable $block) => Helper::encodeChemistryTable($block, StringValues::CHEMISTRY_TABLE_TYPE_ELEMENT_CONSTRUCTOR, new Writer(Ids::CHEMISTRY_TABLE)));
$this->map(Blocks::ENDER_CHEST(), function(EnderChest $block) : Writer{
return Writer::create(Ids::ENDER_CHEST)

View File

@ -214,12 +214,12 @@ final class BlockStateReader{
* @throws BlockStateDeserializeException
*/
public function readCardinalHorizontalFacing() : int{
return match($raw = $this->readString(BlockStateNames::CARDINAL_DIRECTION)){
StringValues::CARDINAL_DIRECTION_NORTH => Facing::NORTH,
StringValues::CARDINAL_DIRECTION_SOUTH => Facing::SOUTH,
StringValues::CARDINAL_DIRECTION_WEST => Facing::WEST,
StringValues::CARDINAL_DIRECTION_EAST => Facing::EAST,
default => throw $this->badValueException(BlockStateNames::CARDINAL_DIRECTION, $raw)
return match($raw = $this->readString(BlockStateNames::MC_CARDINAL_DIRECTION)){
StringValues::MC_CARDINAL_DIRECTION_NORTH => Facing::NORTH,
StringValues::MC_CARDINAL_DIRECTION_SOUTH => Facing::SOUTH,
StringValues::MC_CARDINAL_DIRECTION_WEST => Facing::WEST,
StringValues::MC_CARDINAL_DIRECTION_EAST => Facing::EAST,
default => throw $this->badValueException(BlockStateNames::MC_CARDINAL_DIRECTION, $raw)
};
}

View File

@ -244,6 +244,48 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
] as $id => $color){
$this->mapSimple($id, fn() => Blocks::CARPET()->setColor($color));
}
foreach([
Ids::BLACK_SHULKER_BOX => DyeColor::BLACK(),
Ids::BLUE_SHULKER_BOX => DyeColor::BLUE(),
Ids::BROWN_SHULKER_BOX => DyeColor::BROWN(),
Ids::CYAN_SHULKER_BOX => DyeColor::CYAN(),
Ids::GRAY_SHULKER_BOX => DyeColor::GRAY(),
Ids::GREEN_SHULKER_BOX => DyeColor::GREEN(),
Ids::LIGHT_BLUE_SHULKER_BOX => DyeColor::LIGHT_BLUE(),
Ids::LIGHT_GRAY_SHULKER_BOX => DyeColor::LIGHT_GRAY(),
Ids::LIME_SHULKER_BOX => DyeColor::LIME(),
Ids::MAGENTA_SHULKER_BOX => DyeColor::MAGENTA(),
Ids::ORANGE_SHULKER_BOX => DyeColor::ORANGE(),
Ids::PINK_SHULKER_BOX => DyeColor::PINK(),
Ids::PURPLE_SHULKER_BOX => DyeColor::PURPLE(),
Ids::RED_SHULKER_BOX => DyeColor::RED(),
Ids::WHITE_SHULKER_BOX => DyeColor::WHITE(),
Ids::YELLOW_SHULKER_BOX => DyeColor::YELLOW(),
] as $id => $color){
$this->mapSimple($id, fn() => Blocks::DYED_SHULKER_BOX()->setColor($color));
}
foreach([
Ids::BLACK_CONCRETE => DyeColor::BLACK(),
Ids::BLUE_CONCRETE => DyeColor::BLUE(),
Ids::BROWN_CONCRETE => DyeColor::BROWN(),
Ids::CYAN_CONCRETE => DyeColor::CYAN(),
Ids::GRAY_CONCRETE => DyeColor::GRAY(),
Ids::GREEN_CONCRETE => DyeColor::GREEN(),
Ids::LIGHT_BLUE_CONCRETE => DyeColor::LIGHT_BLUE(),
Ids::LIGHT_GRAY_CONCRETE => DyeColor::LIGHT_GRAY(),
Ids::LIME_CONCRETE => DyeColor::LIME(),
Ids::MAGENTA_CONCRETE => DyeColor::MAGENTA(),
Ids::ORANGE_CONCRETE => DyeColor::ORANGE(),
Ids::PINK_CONCRETE => DyeColor::PINK(),
Ids::PURPLE_CONCRETE => DyeColor::PURPLE(),
Ids::RED_CONCRETE => DyeColor::RED(),
Ids::WHITE_CONCRETE => DyeColor::WHITE(),
Ids::YELLOW_CONCRETE => DyeColor::YELLOW(),
] as $id => $color){
$this->mapSimple($id, fn() => Blocks::CONCRETE()->setColor($color));
}
}
private function registerFlatCoralDeserializers() : void{
@ -875,10 +917,6 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
Blocks::GREEN_TORCH()->setFacing($in->readTorchFacing()) :
Blocks::RED_TORCH()->setFacing($in->readTorchFacing());
});
$this->map(Ids::CONCRETE, function(Reader $in) : Block{
return Blocks::CONCRETE()
->setColor($in->readColor());
});
$this->map(Ids::CONCRETE_POWDER, function(Reader $in) : Block{
return Blocks::CONCRETE_POWDER()
->setColor($in->readColor());
@ -1162,7 +1200,7 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
$this->mapStairs(Ids::PRISMARINE_BRICKS_STAIRS, fn() => Blocks::PRISMARINE_BRICKS_STAIRS());
$this->mapStairs(Ids::PRISMARINE_STAIRS, fn() => Blocks::PRISMARINE_STAIRS());
$this->map(Ids::PUMPKIN, function(Reader $in) : Block{
$in->ignored(StateNames::CARDINAL_DIRECTION); //obsolete
$in->ignored(StateNames::MC_CARDINAL_DIRECTION); //obsolete
return Blocks::PUMPKIN();
});
$this->map(Ids::PUMPKIN_STEM, fn(Reader $in) => Helper::decodeStem(Blocks::PUMPKIN_STEM(), $in));
@ -1285,10 +1323,6 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
->setCount($in->readBoundedInt(StateNames::CLUSTER_COUNT, 0, 3) + 1)
->setUnderwater(!$in->readBool(StateNames::DEAD_BIT));
});
$this->map(Ids::SHULKER_BOX, function(Reader $in) : Block{
return Blocks::DYED_SHULKER_BOX()
->setColor($in->readColor());
});
$this->map(Ids::SKULL, function(Reader $in) : Block{
return Blocks::MOB_HEAD()
->setFacing($in->readFacingWithoutDown());

View File

@ -170,11 +170,11 @@ final class BlockStateWriter{
* @return $this
*/
public function writeCardinalHorizontalFacing(int $value) : self{
return $this->writeString(BlockStateNames::CARDINAL_DIRECTION, match($value){
Facing::SOUTH => StringValues::CARDINAL_DIRECTION_SOUTH,
Facing::WEST => StringValues::CARDINAL_DIRECTION_WEST,
Facing::NORTH => StringValues::CARDINAL_DIRECTION_NORTH,
Facing::EAST => StringValues::CARDINAL_DIRECTION_EAST,
return $this->writeString(BlockStateNames::MC_CARDINAL_DIRECTION, match($value){
Facing::SOUTH => StringValues::MC_CARDINAL_DIRECTION_SOUTH,
Facing::WEST => StringValues::MC_CARDINAL_DIRECTION_WEST,
Facing::NORTH => StringValues::MC_CARDINAL_DIRECTION_NORTH,
Facing::EAST => StringValues::MC_CARDINAL_DIRECTION_EAST,
default => throw new BlockStateSerializeException("Invalid horizontal facing $value")
});
}

View File

@ -124,6 +124,7 @@ final class ItemTypeNames{
public const COMPARATOR = "minecraft:comparator";
public const COMPASS = "minecraft:compass";
public const COMPOUND = "minecraft:compound";
public const CONCRETE = "minecraft:concrete";
public const COOKED_BEEF = "minecraft:cooked_beef";
public const COOKED_CHICKEN = "minecraft:cooked_chicken";
public const COOKED_COD = "minecraft:cooked_cod";
@ -405,6 +406,7 @@ final class ItemTypeNames{
public const SHEEP_SPAWN_EGG = "minecraft:sheep_spawn_egg";
public const SHELTER_POTTERY_SHERD = "minecraft:shelter_pottery_sherd";
public const SHIELD = "minecraft:shield";
public const SHULKER_BOX = "minecraft:shulker_box";
public const SHULKER_SHELL = "minecraft:shulker_shell";
public const SHULKER_SPAWN_EGG = "minecraft:shulker_spawn_egg";
public const SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = "minecraft:silence_armor_trim_smithing_template";

View File

@ -83,6 +83,7 @@ use pocketmine\network\mcpe\protocol\types\AbilitiesLayer;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\command\CommandData;
use pocketmine\network\mcpe\protocol\types\command\CommandEnum;
use pocketmine\network\mcpe\protocol\types\command\CommandOverload;
use pocketmine\network\mcpe\protocol\types\command\CommandParameter;
use pocketmine\network\mcpe\protocol\types\command\CommandPermissions;
use pocketmine\network\mcpe\protocol\types\DimensionIds;
@ -985,8 +986,9 @@ class NetworkSession{
0,
$aliasObj,
[
[CommandParameter::standard("args", AvailableCommandsPacket::ARG_TYPE_RAWTEXT, 0, true)]
]
new CommandOverload(chaining: false, parameters: [CommandParameter::standard("args", AvailableCommandsPacket::ARG_TYPE_RAWTEXT, 0, true)])
],
chainedSubCommandData: []
);
$commandData[$command->getLabel()] = $data;

View File

@ -111,9 +111,9 @@ use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
use pocketmine\world\format\Chunk;
use function array_push;
use function base64_encode;
use function count;
use function fmod;
use function get_debug_type;
use function implode;
use function in_array;
use function is_bool;
@ -743,27 +743,32 @@ class InGamePacketHandler extends PacketHandler{
if(!($nbt instanceof CompoundTag)) throw new AssumptionFailedError("PHPStan should ensure this is a CompoundTag"); //for phpstorm's benefit
if($block instanceof BaseSign){
if(($textBlobTag = $nbt->getCompoundTag(Sign::TAG_FRONT_TEXT)?->getTag(Sign::TAG_TEXT_BLOB)) instanceof StringTag){
try{
$text = SignText::fromBlob($textBlobTag->getValue());
}catch(\InvalidArgumentException $e){
throw PacketHandlingException::wrap($e, "Invalid sign text update");
}
try{
if(!$block->updateText($this->player, $text)){
foreach($this->player->getWorld()->createBlockUpdatePackets([$pos]) as $updatePacket){
$this->session->sendDataPacket($updatePacket);
}
}
}catch(\UnexpectedValueException $e){
throw PacketHandlingException::wrap($e);
}
return true;
$frontTextTag = $nbt->getTag(Sign::TAG_FRONT_TEXT);
if(!$frontTextTag instanceof CompoundTag){
throw new PacketHandlingException("Invalid tag type " . get_debug_type($frontTextTag) . " for tag \"" . Sign::TAG_FRONT_TEXT . "\" in sign update data");
}
$textBlobTag = $frontTextTag->getTag(Sign::TAG_TEXT_BLOB);
if(!$textBlobTag instanceof StringTag){
throw new PacketHandlingException("Invalid tag type " . get_debug_type($textBlobTag) . " for tag \"" . Sign::TAG_TEXT_BLOB . "\" in sign update data");
}
$this->session->getLogger()->debug("Invalid sign update data: " . base64_encode($packet->nbt->getEncodedNbt()));
try{
$text = SignText::fromBlob($textBlobTag->getValue());
}catch(\InvalidArgumentException $e){
throw PacketHandlingException::wrap($e, "Invalid sign text update");
}
try{
if(!$block->updateText($this->player, $text)){
foreach($this->player->getWorld()->createBlockUpdatePackets([$pos]) as $updatePacket){
$this->session->sendDataPacket($updatePacket);
}
}
}catch(\UnexpectedValueException $e){
throw PacketHandlingException::wrap($e);
}
return true;
}
return false;

View File

@ -51,11 +51,11 @@ use function time;
class BedrockWorldData extends BaseNbtWorldData{
public const CURRENT_STORAGE_VERSION = 10;
public const CURRENT_STORAGE_NETWORK_VERSION = 589;
public const CURRENT_STORAGE_NETWORK_VERSION = 594;
public const CURRENT_CLIENT_VERSION_TARGET = [
1, //major
20, //minor
0, //patch
10, //patch
1, //revision
0 //is beta
];