Skip to content

Commit 1dbc058

Browse files
authored
Merge branch 'stable' into bamboo
2 parents fb4eaa8 + 8ef5e73 commit 1dbc058

23 files changed

+155
-102
lines changed

changelogs/5.19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 5.19.0
2-
Released 21tst September 2024.
2+
Released 21st September 2024.
33

44
**For Minecraft: Bedrock Edition 1.21.30**
55

changelogs/5.20.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 5.20.0
2+
Released 26th October 2024.
3+
4+
**For Minecraft: Bedrock Edition 1.21.40**
5+
6+
This is a support release for Minecraft: Bedrock Edition 1.21.40.
7+
8+
**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.
9+
Do not update plugin minimum API versions unless you need new features added in this release.
10+
11+
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
12+
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
13+
14+
## General
15+
- Added support for Minecraft: Bedrock Edition 1.21.40.
16+
- Removed support for earlier versions.
17+
18+
## Fixes
19+
- Fixed a bug in `tools/generate-blockstate-upgrade-schema.php` that caused it to fail on 1.21.40 with the new mushroom block changes.

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"composer-runtime-api": "^2.0",
3434
"adhocore/json-comment": "~1.2.0",
3535
"pocketmine/netresearch-jsonmapper": "~v4.4.999",
36-
"pocketmine/bedrock-block-upgrade-schema": "~4.4.0+bedrock-1.21.30",
37-
"pocketmine/bedrock-data": "~2.13.0+bedrock-1.21.30",
38-
"pocketmine/bedrock-item-upgrade-schema": "~1.12.0+bedrock-1.21.30",
39-
"pocketmine/bedrock-protocol": "~34.0.0+bedrock-1.21.30",
36+
"pocketmine/bedrock-block-upgrade-schema": "~4.5.0+bedrock-1.21.40",
37+
"pocketmine/bedrock-data": "~2.14.0+bedrock-1.21.40",
38+
"pocketmine/bedrock-item-upgrade-schema": "~1.13.0+bedrock-1.21.40",
39+
"pocketmine/bedrock-protocol": "~35.0.0+bedrock-1.21.40",
4040
"pocketmine/binaryutils": "^0.2.1",
4141
"pocketmine/callback-validator": "^1.0.2",
4242
"pocketmine/color": "^0.3.0",

composer.lock

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VersionInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
final class VersionInfo{
3333
public const NAME = "PocketMine-MP";
34-
public const BASE_VERSION = "5.19.1";
34+
public const BASE_VERSION = "5.20.1";
3535
public const IS_DEVELOPMENT_BUILD = true;
3636
public const BUILD_CHANNEL = "stable";
3737

src/data/bedrock/BedrockDataFiles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ private function __construct(){
3535
public const BIOME_DEFINITIONS_FULL_NBT = BEDROCK_DATA_PATH . '/biome_definitions_full.nbt';
3636
public const BIOME_ID_MAP_JSON = BEDROCK_DATA_PATH . '/biome_id_map.json';
3737
public const BLOCK_ID_TO_ITEM_ID_MAP_JSON = BEDROCK_DATA_PATH . '/block_id_to_item_id_map.json';
38+
public const BLOCK_PROPERTIES_TABLE_JSON = BEDROCK_DATA_PATH . '/block_properties_table.json';
3839
public const BLOCK_STATE_META_MAP_JSON = BEDROCK_DATA_PATH . '/block_state_meta_map.json';
3940
public const CANONICAL_BLOCK_STATES_NBT = BEDROCK_DATA_PATH . '/canonical_block_states.nbt';
4041
public const COMMAND_ARG_TYPES_JSON = BEDROCK_DATA_PATH . '/command_arg_types.json';

src/data/bedrock/block/BlockStateData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ final class BlockStateData{
4545
public const CURRENT_VERSION =
4646
(1 << 24) | //major
4747
(21 << 16) | //minor
48-
(30 << 8) | //patch
49-
(7); //revision
48+
(40 << 8) | //patch
49+
(1); //revision
5050

5151
public const TAG_NAME = "name";
5252
public const TAG_STATES = "states";

src/data/bedrock/block/BlockStateNames.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ private function __construct(){
114114
public const SEA_GRASS_TYPE = "sea_grass_type";
115115
public const STABILITY = "stability";
116116
public const STABILITY_CHECK = "stability_check";
117-
public const STRIPPED_BIT = "stripped_bit";
118117
public const STRUCTURE_BLOCK_TYPE = "structure_block_type";
119118
public const SUSPENDED_BIT = "suspended_bit";
120119
public const TOGGLE_BIT = "toggle_bit";

src/data/bedrock/block/BlockTypeNames.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ private function __construct(){
262262
public const CRACKED_STONE_BRICKS = "minecraft:cracked_stone_bricks";
263263
public const CRAFTER = "minecraft:crafter";
264264
public const CRAFTING_TABLE = "minecraft:crafting_table";
265+
public const CREEPER_HEAD = "minecraft:creeper_head";
265266
public const CRIMSON_BUTTON = "minecraft:crimson_button";
266267
public const CRIMSON_DOOR = "minecraft:crimson_door";
267268
public const CRIMSON_DOUBLE_SLAB = "minecraft:crimson_double_slab";
@@ -384,6 +385,7 @@ private function __construct(){
384385
public const DISPENSER = "minecraft:dispenser";
385386
public const DOUBLE_CUT_COPPER_SLAB = "minecraft:double_cut_copper_slab";
386387
public const DRAGON_EGG = "minecraft:dragon_egg";
388+
public const DRAGON_HEAD = "minecraft:dragon_head";
387389
public const DRIED_KELP_BLOCK = "minecraft:dried_kelp_block";
388390
public const DRIPSTONE_BLOCK = "minecraft:dripstone_block";
389391
public const DROPPER = "minecraft:dropper";
@@ -797,6 +799,7 @@ private function __construct(){
797799
public const MUD_BRICK_WALL = "minecraft:mud_brick_wall";
798800
public const MUD_BRICKS = "minecraft:mud_bricks";
799801
public const MUDDY_MANGROVE_ROOTS = "minecraft:muddy_mangrove_roots";
802+
public const MUSHROOM_STEM = "minecraft:mushroom_stem";
800803
public const MYCELIUM = "minecraft:mycelium";
801804
public const NETHER_BRICK = "minecraft:nether_brick";
802805
public const NETHER_BRICK_DOUBLE_SLAB = "minecraft:nether_brick_double_slab";
@@ -857,6 +860,7 @@ private function __construct(){
857860
public const PEONY = "minecraft:peony";
858861
public const PETRIFIED_OAK_DOUBLE_SLAB = "minecraft:petrified_oak_double_slab";
859862
public const PETRIFIED_OAK_SLAB = "minecraft:petrified_oak_slab";
863+
public const PIGLIN_HEAD = "minecraft:piglin_head";
860864
public const PINK_CANDLE = "minecraft:pink_candle";
861865
public const PINK_CANDLE_CAKE = "minecraft:pink_candle_cake";
862866
public const PINK_CARPET = "minecraft:pink_carpet";
@@ -874,6 +878,7 @@ private function __construct(){
874878
public const PISTON_ARM_COLLISION = "minecraft:piston_arm_collision";
875879
public const PITCHER_CROP = "minecraft:pitcher_crop";
876880
public const PITCHER_PLANT = "minecraft:pitcher_plant";
881+
public const PLAYER_HEAD = "minecraft:player_head";
877882
public const PODZOL = "minecraft:podzol";
878883
public const POINTED_DRIPSTONE = "minecraft:pointed_dripstone";
879884
public const POLISHED_ANDESITE = "minecraft:polished_andesite";
@@ -1009,7 +1014,7 @@ private function __construct(){
10091014
public const SHORT_GRASS = "minecraft:short_grass";
10101015
public const SHROOMLIGHT = "minecraft:shroomlight";
10111016
public const SILVER_GLAZED_TERRACOTTA = "minecraft:silver_glazed_terracotta";
1012-
public const SKULL = "minecraft:skull";
1017+
public const SKELETON_SKULL = "minecraft:skeleton_skull";
10131018
public const SLIME = "minecraft:slime";
10141019
public const SMALL_AMETHYST_BUD = "minecraft:small_amethyst_bud";
10151020
public const SMALL_DRIPLEAF_BLOCK = "minecraft:small_dripleaf_block";
@@ -1229,6 +1234,7 @@ private function __construct(){
12291234
public const WHITE_TULIP = "minecraft:white_tulip";
12301235
public const WHITE_WOOL = "minecraft:white_wool";
12311236
public const WITHER_ROSE = "minecraft:wither_rose";
1237+
public const WITHER_SKELETON_SKULL = "minecraft:wither_skeleton_skull";
12321238
public const WOODEN_BUTTON = "minecraft:wooden_button";
12331239
public const WOODEN_DOOR = "minecraft:wooden_door";
12341240
public const WOODEN_PRESSURE_PLATE = "minecraft:wooden_pressure_plate";
@@ -1243,4 +1249,5 @@ private function __construct(){
12431249
public const YELLOW_STAINED_GLASS_PANE = "minecraft:yellow_stained_glass_pane";
12441250
public const YELLOW_TERRACOTTA = "minecraft:yellow_terracotta";
12451251
public const YELLOW_WOOL = "minecraft:yellow_wool";
1252+
public const ZOMBIE_HEAD = "minecraft:zombie_head";
12461253
}

src/data/bedrock/block/convert/BlockObjectToStateSerializer.php

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
use pocketmine\block\utils\DyeColor;
152152
use pocketmine\block\utils\FroglightType;
153153
use pocketmine\block\utils\LeverFacing;
154+
use pocketmine\block\utils\MobHeadType;
154155
use pocketmine\block\VanillaBlocks as Blocks;
155156
use pocketmine\block\Vine;
156157
use pocketmine\block\Wall;
@@ -205,6 +206,7 @@ public function __construct(){
205206
$this->registerFlatWoodBlockSerializers();
206207
$this->registerLeavesSerializers();
207208
$this->registerSaplingSerializers();
209+
$this->registerMobHeadSerializers();
208210
$this->registerSimpleSerializers();
209211
$this->registerSerializers();
210212
}
@@ -624,17 +626,7 @@ private function registerFlatWoodBlockSerializers() : void{
624626
$this->mapSimple(Blocks::CHERRY_PLANKS(), Ids::CHERRY_PLANKS);
625627
$this->mapSlab(Blocks::CHERRY_SLAB(), Ids::CHERRY_SLAB, Ids::CHERRY_DOUBLE_SLAB);
626628
$this->mapStairs(Blocks::CHERRY_STAIRS(), Ids::CHERRY_STAIRS);
627-
$this->map(Blocks::CHERRY_WOOD(), function(Wood $block) : Writer{
628-
//we can't use the standard method for this because cherry_wood has a useless property attached to it
629-
if(!$block->isStripped()){
630-
return Writer::create(Ids::CHERRY_WOOD)
631-
->writePillarAxis($block->getAxis())
632-
->writeBool(StateNames::STRIPPED_BIT, false); //this is useless, but it has to be written
633-
}else{
634-
return Writer::create(Ids::STRIPPED_CHERRY_WOOD)
635-
->writePillarAxis($block->getAxis());
636-
}
637-
});
629+
$this->mapLog(Blocks::CHERRY_WOOD(), Ids::CHERRY_WOOD, Ids::STRIPPED_CHERRY_WOOD);
638630

639631
$this->map(Blocks::BAMBOO_DOOR(), fn(Door $block) => Helper::encodeDoor($block, new Writer(Ids::BAMBOO_DOOR)));
640632
$this->map(Blocks::BAMBOO_BUTTON(), fn(Button $block) => Helper::encodeButton($block, new Writer(Ids::BAMBOO_BUTTON)));
@@ -702,17 +694,7 @@ private function registerFlatWoodBlockSerializers() : void{
702694
$this->mapSimple(Blocks::MANGROVE_PLANKS(), Ids::MANGROVE_PLANKS);
703695
$this->mapSlab(Blocks::MANGROVE_SLAB(), Ids::MANGROVE_SLAB, Ids::MANGROVE_DOUBLE_SLAB);
704696
$this->mapStairs(Blocks::MANGROVE_STAIRS(), Ids::MANGROVE_STAIRS);
705-
$this->map(Blocks::MANGROVE_WOOD(), function(Wood $block) : Writer{
706-
//we can't use the standard method for this because mangrove_wood has a useless property attached to it
707-
if(!$block->isStripped()){
708-
return Writer::create(Ids::MANGROVE_WOOD)
709-
->writePillarAxis($block->getAxis())
710-
->writeBool(StateNames::STRIPPED_BIT, false); //this is useless, but it has to be written
711-
}else{
712-
return Writer::create(Ids::STRIPPED_MANGROVE_WOOD)
713-
->writePillarAxis($block->getAxis());
714-
}
715-
});
697+
$this->mapLog(Blocks::MANGROVE_WOOD(), Ids::MANGROVE_WOOD, Ids::STRIPPED_MANGROVE_WOOD);
716698

717699
$this->map(Blocks::OAK_BUTTON(), fn(WoodenButton $block) => Helper::encodeButton($block, new Writer(Ids::WOODEN_BUTTON)));
718700
$this->map(Blocks::OAK_DOOR(), fn(WoodenDoor $block) => Helper::encodeDoor($block, new Writer(Ids::WOODEN_DOOR)));
@@ -787,6 +769,18 @@ private function registerSaplingSerializers() : void{
787769
}
788770
}
789771

772+
private function registerMobHeadSerializers() : void{
773+
$this->map(Blocks::MOB_HEAD(), fn(MobHead $block) => Writer::create(match ($block->getMobHeadType()){
774+
MobHeadType::CREEPER => Ids::CREEPER_HEAD,
775+
MobHeadType::DRAGON => Ids::DRAGON_HEAD,
776+
MobHeadType::PIGLIN => Ids::PIGLIN_HEAD,
777+
MobHeadType::PLAYER => Ids::PLAYER_HEAD,
778+
MobHeadType::SKELETON => Ids::SKELETON_SKULL,
779+
MobHeadType::WITHER_SKELETON => Ids::WITHER_SKELETON_SKULL,
780+
MobHeadType::ZOMBIE => Ids::ZOMBIE_HEAD,
781+
})->writeFacingWithoutDown($block->getFacing()));
782+
}
783+
790784
private function registerSimpleSerializers() : void{
791785
$this->mapSimple(Blocks::AIR(), Ids::AIR);
792786
$this->mapSimple(Blocks::AMETHYST(), Ids::AMETHYST_BLOCK);
@@ -1090,7 +1084,7 @@ private function registerSerializers() : void{
10901084
->writeBool(StateNames::RAIL_DATA_BIT, $block->isPowered())
10911085
->writeInt(StateNames::RAIL_DIRECTION, $block->getShape());
10921086
});
1093-
$this->map(Blocks::ALL_SIDED_MUSHROOM_STEM(), fn() => Writer::create(Ids::BROWN_MUSHROOM_BLOCK)
1087+
$this->map(Blocks::ALL_SIDED_MUSHROOM_STEM(), fn() => Writer::create(Ids::MUSHROOM_STEM)
10941088
->writeInt(StateNames::HUGE_MUSHROOM_BITS, BlockLegacyMetadata::MUSHROOM_BLOCK_ALL_STEM));
10951089
$this->map(Blocks::AMETHYST_CLUSTER(), fn(AmethystCluster $block) => Writer::create(
10961090
match($stage = $block->getStage()){
@@ -1495,10 +1489,6 @@ private function registerSerializers() : void{
14951489
});
14961490
$this->map(Blocks::MATERIAL_REDUCER(), fn(ChemistryTable $block) => Helper::encodeChemistryTable($block, Writer::create(Ids::MATERIAL_REDUCER)));
14971491
$this->map(Blocks::MELON_STEM(), fn(MelonStem $block) => Helper::encodeStem($block, new Writer(Ids::MELON_STEM)));
1498-
$this->map(Blocks::MOB_HEAD(), function(MobHead $block) : Writer{
1499-
return Writer::create(Ids::SKULL)
1500-
->writeFacingWithoutDown($block->getFacing());
1501-
});
15021492
$this->mapSlab(Blocks::MOSSY_COBBLESTONE_SLAB(), Ids::MOSSY_COBBLESTONE_SLAB, Ids::MOSSY_COBBLESTONE_DOUBLE_SLAB);
15031493
$this->mapStairs(Blocks::MOSSY_COBBLESTONE_STAIRS(), Ids::MOSSY_COBBLESTONE_STAIRS);
15041494
$this->map(Blocks::MOSSY_COBBLESTONE_WALL(), fn(Wall $block) => Helper::encodeWall($block, Writer::create(Ids::MOSSY_COBBLESTONE_WALL)));
@@ -1510,7 +1500,7 @@ private function registerSerializers() : void{
15101500
$this->map(Blocks::MUD_BRICK_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::MUD_BRICK_WALL)));
15111501
$this->map(Blocks::MUDDY_MANGROVE_ROOTS(), fn(SimplePillar $block) => Writer::create(Ids::MUDDY_MANGROVE_ROOTS)
15121502
->writePillarAxis($block->getAxis()));
1513-
$this->map(Blocks::MUSHROOM_STEM(), fn() => Writer::create(Ids::BROWN_MUSHROOM_BLOCK)
1503+
$this->map(Blocks::MUSHROOM_STEM(), fn() => Writer::create(Ids::MUSHROOM_STEM)
15141504
->writeInt(StateNames::HUGE_MUSHROOM_BITS, BlockLegacyMetadata::MUSHROOM_BLOCK_STEM));
15151505
$this->mapSlab(Blocks::NETHER_BRICK_SLAB(), Ids::NETHER_BRICK_SLAB, Ids::NETHER_BRICK_DOUBLE_SLAB);
15161506
$this->mapStairs(Blocks::NETHER_BRICK_STAIRS(), Ids::NETHER_BRICK_STAIRS);

0 commit comments

Comments
 (0)