diff --git a/changelogs/5.22.md b/changelogs/5.22.md new file mode 100644 index 00000000000..6c9ba6d7eee --- /dev/null +++ b/changelogs/5.22.md @@ -0,0 +1,16 @@ +# 5.22.0 +Released 4th December 2024. + +**For Minecraft: Bedrock Edition 1.21.50** + +This is a support release for Minecraft: Bedrock Edition 1.21.50. + +**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. + +## General +- Added support for Minecraft: Bedrock Edition 1.21.50. +- Removed support for earlier versions. diff --git a/composer.json b/composer.json index ed5bb582f37..4a6ad5daf2d 100644 --- a/composer.json +++ b/composer.json @@ -34,9 +34,9 @@ "adhocore/json-comment": "~1.2.0", "pocketmine/netresearch-jsonmapper": "~v4.4.999", "pocketmine/bedrock-block-upgrade-schema": "~5.0.0+bedrock-1.21.40", - "pocketmine/bedrock-data": "~2.14.0+bedrock-1.21.40", - "pocketmine/bedrock-item-upgrade-schema": "~1.13.0+bedrock-1.21.40", - "pocketmine/bedrock-protocol": "~35.0.0+bedrock-1.21.40", + "pocketmine/bedrock-data": "~2.15.0+bedrock-1.21.50", + "pocketmine/bedrock-item-upgrade-schema": "~1.14.0+bedrock-1.21.50", + "pocketmine/bedrock-protocol": "~35.0.0+bedrock-1.21.50", "pocketmine/binaryutils": "^0.2.1", "pocketmine/callback-validator": "^1.0.2", "pocketmine/color": "^0.3.0", diff --git a/composer.lock b/composer.lock index eb1061ff50a..89e7b3af434 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "b2fbf6e7a9d650341dc71fa4dd124681", + "content-hash": "26d10b9381ab4e19684ca0b7a5a11a42", "packages": [ { "name": "adhocore/json-comment", @@ -153,16 +153,16 @@ }, { "name": "pocketmine/bedrock-data", - "version": "2.14.1+bedrock-1.21.40", + "version": "2.15.0+bedrock-1.21.50", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockData.git", - "reference": "4a41864ed09613ecec6791e2ae076a8ec7089cc4" + "reference": "6e819f36d781866ce63d2406be2ce7f2d1afd9ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/4a41864ed09613ecec6791e2ae076a8ec7089cc4", - "reference": "4a41864ed09613ecec6791e2ae076a8ec7089cc4", + "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/6e819f36d781866ce63d2406be2ce7f2d1afd9ad", + "reference": "6e819f36d781866ce63d2406be2ce7f2d1afd9ad", "shasum": "" }, "type": "library", @@ -173,22 +173,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.14.1+bedrock-1.21.40" + "source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.21.50" }, - "time": "2024-11-12T21:36:20+00:00" + "time": "2024-12-04T12:59:12+00:00" }, { "name": "pocketmine/bedrock-item-upgrade-schema", - "version": "1.13.1", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockItemUpgradeSchema.git", - "reference": "1cf81305f2ffcf7dde9577c4f16a55c765192b03" + "reference": "9fc7c9bbb558a017395c1cb7dd819c033ee971bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/1cf81305f2ffcf7dde9577c4f16a55c765192b03", - "reference": "1cf81305f2ffcf7dde9577c4f16a55c765192b03", + "url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/9fc7c9bbb558a017395c1cb7dd819c033ee971bb", + "reference": "9fc7c9bbb558a017395c1cb7dd819c033ee971bb", "shasum": "" }, "type": "library", @@ -199,22 +199,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.13.1" + "source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.14.0" }, - "time": "2024-11-12T21:33:17+00:00" + "time": "2024-12-04T12:22:49+00:00" }, { "name": "pocketmine/bedrock-protocol", - "version": "35.0.0+bedrock-1.21.40", + "version": "35.0.0+bedrock-1.21.50", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459" + "reference": "bd1ec79bae8c88aa984e1c5f0c3313be5ae9b435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459", - "reference": "6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/bd1ec79bae8c88aa984e1c5f0c3313be5ae9b435", + "reference": "bd1ec79bae8c88aa984e1c5f0c3313be5ae9b435", "shasum": "" }, "require": { @@ -245,9 +245,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/35.0.0+bedrock-1.21.40" + "source": "https://github.com/pmmp/BedrockProtocol/tree/35.0.0+bedrock-1.21.50" }, - "time": "2024-10-24T15:45:43+00:00" + "time": "2024-12-04T13:02:00+00:00" }, { "name": "pocketmine/binaryutils", diff --git a/src/VersionInfo.php b/src/VersionInfo.php index efb38d71ba7..460e34bf707 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "5.21.3"; - public const IS_DEVELOPMENT_BUILD = true; + public const BASE_VERSION = "5.22.0"; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; /** diff --git a/src/data/bedrock/BedrockDataFiles.php b/src/data/bedrock/BedrockDataFiles.php index 5c476ca1c68..3341c05031c 100644 --- a/src/data/bedrock/BedrockDataFiles.php +++ b/src/data/bedrock/BedrockDataFiles.php @@ -45,6 +45,7 @@ private function __construct(){ public const ITEM_TAGS_JSON = BEDROCK_DATA_PATH . '/item_tags.json'; public const LEVEL_SOUND_ID_MAP_JSON = BEDROCK_DATA_PATH . '/level_sound_id_map.json'; public const PARTICLE_ID_MAP_JSON = BEDROCK_DATA_PATH . '/particle_id_map.json'; + public const PROTOCOL_INFO_JSON = BEDROCK_DATA_PATH . '/protocol_info.json'; public const R12_TO_CURRENT_BLOCK_MAP_BIN = BEDROCK_DATA_PATH . '/r12_to_current_block_map.bin'; public const R16_TO_CURRENT_ITEM_MAP_JSON = BEDROCK_DATA_PATH . '/r16_to_current_item_map.json'; public const REQUIRED_ITEM_LIST_JSON = BEDROCK_DATA_PATH . '/required_item_list.json'; diff --git a/src/data/bedrock/BiomeIds.php b/src/data/bedrock/BiomeIds.php index 1169a51eaee..f3c38d3ed10 100644 --- a/src/data/bedrock/BiomeIds.php +++ b/src/data/bedrock/BiomeIds.php @@ -122,4 +122,5 @@ private function __construct(){ public const DEEP_DARK = 190; public const MANGROVE_SWAMP = 191; public const CHERRY_GROVE = 192; + public const PALE_GARDEN = 193; } diff --git a/src/data/bedrock/block/BlockStateNames.php b/src/data/bedrock/block/BlockStateNames.php index 0f4b8742613..68a3e1b1d2d 100644 --- a/src/data/bedrock/block/BlockStateNames.php +++ b/src/data/bedrock/block/BlockStateNames.php @@ -93,12 +93,17 @@ private function __construct(){ public const MC_VERTICAL_HALF = "minecraft:vertical_half"; public const MOISTURIZED_AMOUNT = "moisturized_amount"; public const MULTI_FACE_DIRECTION_BITS = "multi_face_direction_bits"; + public const NATURAL = "natural"; public const OCCUPIED_BIT = "occupied_bit"; public const OMINOUS = "ominous"; public const OPEN_BIT = "open_bit"; public const ORIENTATION = "orientation"; public const OUTPUT_LIT_BIT = "output_lit_bit"; public const OUTPUT_SUBTRACT_BIT = "output_subtract_bit"; + public const PALE_MOSS_CARPET_SIDE_EAST = "pale_moss_carpet_side_east"; + public const PALE_MOSS_CARPET_SIDE_NORTH = "pale_moss_carpet_side_north"; + public const PALE_MOSS_CARPET_SIDE_SOUTH = "pale_moss_carpet_side_south"; + public const PALE_MOSS_CARPET_SIDE_WEST = "pale_moss_carpet_side_west"; public const PERSISTENT_BIT = "persistent_bit"; public const PILLAR_AXIS = "pillar_axis"; public const PORTAL_AXIS = "portal_axis"; @@ -116,6 +121,7 @@ private function __construct(){ public const STABILITY_CHECK = "stability_check"; public const STRUCTURE_BLOCK_TYPE = "structure_block_type"; public const SUSPENDED_BIT = "suspended_bit"; + public const TIP = "tip"; public const TOGGLE_BIT = "toggle_bit"; public const TORCH_FACING_DIRECTION = "torch_facing_direction"; public const TRIAL_SPAWNER_STATE = "trial_spawner_state"; diff --git a/src/data/bedrock/block/BlockStateStringValues.php b/src/data/bedrock/block/BlockStateStringValues.php index 9dfdcfb6340..e8171e4da23 100644 --- a/src/data/bedrock/block/BlockStateStringValues.php +++ b/src/data/bedrock/block/BlockStateStringValues.php @@ -106,6 +106,22 @@ private function __construct(){ public const ORIENTATION_UP_WEST = "up_west"; public const ORIENTATION_WEST_UP = "west_up"; + public const PALE_MOSS_CARPET_SIDE_EAST_NONE = "none"; + public const PALE_MOSS_CARPET_SIDE_EAST_SHORT = "short"; + public const PALE_MOSS_CARPET_SIDE_EAST_TALL = "tall"; + + public const PALE_MOSS_CARPET_SIDE_NORTH_NONE = "none"; + public const PALE_MOSS_CARPET_SIDE_NORTH_SHORT = "short"; + public const PALE_MOSS_CARPET_SIDE_NORTH_TALL = "tall"; + + public const PALE_MOSS_CARPET_SIDE_SOUTH_NONE = "none"; + public const PALE_MOSS_CARPET_SIDE_SOUTH_SHORT = "short"; + public const PALE_MOSS_CARPET_SIDE_SOUTH_TALL = "tall"; + + public const PALE_MOSS_CARPET_SIDE_WEST_NONE = "none"; + public const PALE_MOSS_CARPET_SIDE_WEST_SHORT = "short"; + public const PALE_MOSS_CARPET_SIDE_WEST_TALL = "tall"; + public const PILLAR_AXIS_X = "x"; public const PILLAR_AXIS_Y = "y"; public const PILLAR_AXIS_Z = "z"; diff --git a/src/data/bedrock/block/BlockTypeNames.php b/src/data/bedrock/block/BlockTypeNames.php index 029a5f6aadb..eec1ab8d190 100644 --- a/src/data/bedrock/block/BlockTypeNames.php +++ b/src/data/bedrock/block/BlockTypeNames.php @@ -192,6 +192,7 @@ private function __construct(){ public const CAVE_VINES_HEAD_WITH_BERRIES = "minecraft:cave_vines_head_with_berries"; public const CHAIN = "minecraft:chain"; public const CHAIN_COMMAND_BLOCK = "minecraft:chain_command_block"; + public const CHALKBOARD = "minecraft:chalkboard"; public const CHEMICAL_HEAT = "minecraft:chemical_heat"; public const CHERRY_BUTTON = "minecraft:cherry_button"; public const CHERRY_DOOR = "minecraft:cherry_door"; @@ -219,6 +220,7 @@ private function __construct(){ public const CHISELED_POLISHED_BLACKSTONE = "minecraft:chiseled_polished_blackstone"; public const CHISELED_QUARTZ_BLOCK = "minecraft:chiseled_quartz_block"; public const CHISELED_RED_SANDSTONE = "minecraft:chiseled_red_sandstone"; + public const CHISELED_RESIN_BRICKS = "minecraft:chiseled_resin_bricks"; public const CHISELED_SANDSTONE = "minecraft:chiseled_sandstone"; public const CHISELED_STONE_BRICKS = "minecraft:chiseled_stone_bricks"; public const CHISELED_TUFF = "minecraft:chiseled_tuff"; @@ -227,6 +229,7 @@ private function __construct(){ public const CHORUS_PLANT = "minecraft:chorus_plant"; public const CLAY = "minecraft:clay"; public const CLIENT_REQUEST_PLACEHOLDER_BLOCK = "minecraft:client_request_placeholder_block"; + public const CLOSED_EYEBLOSSOM = "minecraft:closed_eyeblossom"; public const COAL_BLOCK = "minecraft:coal_block"; public const COAL_ORE = "minecraft:coal_ore"; public const COARSE_DIRT = "minecraft:coarse_dirt"; @@ -262,6 +265,7 @@ private function __construct(){ public const CRACKED_STONE_BRICKS = "minecraft:cracked_stone_bricks"; public const CRAFTER = "minecraft:crafter"; public const CRAFTING_TABLE = "minecraft:crafting_table"; + public const CREAKING_HEART = "minecraft:creaking_heart"; public const CREEPER_HEAD = "minecraft:creeper_head"; public const CRIMSON_BUTTON = "minecraft:crimson_button"; public const CRIMSON_DOOR = "minecraft:crimson_door"; @@ -831,6 +835,7 @@ private function __construct(){ public const OBSERVER = "minecraft:observer"; public const OBSIDIAN = "minecraft:obsidian"; public const OCHRE_FROGLIGHT = "minecraft:ochre_froglight"; + public const OPEN_EYEBLOSSOM = "minecraft:open_eyeblossom"; public const ORANGE_CANDLE = "minecraft:orange_candle"; public const ORANGE_CANDLE_CAKE = "minecraft:orange_candle_cake"; public const ORANGE_CARPET = "minecraft:orange_carpet"; @@ -856,6 +861,26 @@ private function __construct(){ public const OXIDIZED_DOUBLE_CUT_COPPER_SLAB = "minecraft:oxidized_double_cut_copper_slab"; public const PACKED_ICE = "minecraft:packed_ice"; public const PACKED_MUD = "minecraft:packed_mud"; + public const PALE_HANGING_MOSS = "minecraft:pale_hanging_moss"; + public const PALE_MOSS_BLOCK = "minecraft:pale_moss_block"; + public const PALE_MOSS_CARPET = "minecraft:pale_moss_carpet"; + public const PALE_OAK_BUTTON = "minecraft:pale_oak_button"; + public const PALE_OAK_DOOR = "minecraft:pale_oak_door"; + public const PALE_OAK_DOUBLE_SLAB = "minecraft:pale_oak_double_slab"; + public const PALE_OAK_FENCE = "minecraft:pale_oak_fence"; + public const PALE_OAK_FENCE_GATE = "minecraft:pale_oak_fence_gate"; + public const PALE_OAK_HANGING_SIGN = "minecraft:pale_oak_hanging_sign"; + public const PALE_OAK_LEAVES = "minecraft:pale_oak_leaves"; + public const PALE_OAK_LOG = "minecraft:pale_oak_log"; + public const PALE_OAK_PLANKS = "minecraft:pale_oak_planks"; + public const PALE_OAK_PRESSURE_PLATE = "minecraft:pale_oak_pressure_plate"; + public const PALE_OAK_SAPLING = "minecraft:pale_oak_sapling"; + public const PALE_OAK_SLAB = "minecraft:pale_oak_slab"; + public const PALE_OAK_STAIRS = "minecraft:pale_oak_stairs"; + public const PALE_OAK_STANDING_SIGN = "minecraft:pale_oak_standing_sign"; + public const PALE_OAK_TRAPDOOR = "minecraft:pale_oak_trapdoor"; + public const PALE_OAK_WALL_SIGN = "minecraft:pale_oak_wall_sign"; + public const PALE_OAK_WOOD = "minecraft:pale_oak_wood"; public const PEARLESCENT_FROGLIGHT = "minecraft:pearlescent_froglight"; public const PEONY = "minecraft:peony"; public const PETRIFIED_OAK_DOUBLE_SLAB = "minecraft:petrified_oak_double_slab"; @@ -994,6 +1019,13 @@ private function __construct(){ public const REINFORCED_DEEPSLATE = "minecraft:reinforced_deepslate"; public const REPEATING_COMMAND_BLOCK = "minecraft:repeating_command_block"; public const RESERVED6 = "minecraft:reserved6"; + public const RESIN_BLOCK = "minecraft:resin_block"; + public const RESIN_BRICK_DOUBLE_SLAB = "minecraft:resin_brick_double_slab"; + public const RESIN_BRICK_SLAB = "minecraft:resin_brick_slab"; + public const RESIN_BRICK_STAIRS = "minecraft:resin_brick_stairs"; + public const RESIN_BRICK_WALL = "minecraft:resin_brick_wall"; + public const RESIN_BRICKS = "minecraft:resin_bricks"; + public const RESIN_CLUMP = "minecraft:resin_clump"; public const RESPAWN_ANCHOR = "minecraft:respawn_anchor"; public const ROSE_BUSH = "minecraft:rose_bush"; public const SAND = "minecraft:sand"; @@ -1096,6 +1128,8 @@ private function __construct(){ public const STRIPPED_MANGROVE_WOOD = "minecraft:stripped_mangrove_wood"; public const STRIPPED_OAK_LOG = "minecraft:stripped_oak_log"; public const STRIPPED_OAK_WOOD = "minecraft:stripped_oak_wood"; + public const STRIPPED_PALE_OAK_LOG = "minecraft:stripped_pale_oak_log"; + public const STRIPPED_PALE_OAK_WOOD = "minecraft:stripped_pale_oak_wood"; public const STRIPPED_SPRUCE_LOG = "minecraft:stripped_spruce_log"; public const STRIPPED_SPRUCE_WOOD = "minecraft:stripped_spruce_wood"; public const STRIPPED_WARPED_HYPHAE = "minecraft:stripped_warped_hyphae"; diff --git a/src/data/bedrock/item/ItemTypeNames.php b/src/data/bedrock/item/ItemTypeNames.php index 03b32d48269..b0d49fc3163 100644 --- a/src/data/bedrock/item/ItemTypeNames.php +++ b/src/data/bedrock/item/ItemTypeNames.php @@ -75,6 +75,7 @@ final class ItemTypeNames{ public const BLEACH = "minecraft:bleach"; public const BLUE_BUNDLE = "minecraft:blue_bundle"; public const BLUE_DYE = "minecraft:blue_dye"; + public const BOARD = "minecraft:board"; public const BOAT = "minecraft:boat"; public const BOGGED_SPAWN_EGG = "minecraft:bogged_spawn_egg"; public const BOLT_ARMOR_TRIM_SMITHING_TEMPLATE = "minecraft:bolt_armor_trim_smithing_template"; @@ -154,6 +155,7 @@ final class ItemTypeNames{ public const CORAL_FAN = "minecraft:coral_fan"; public const CORAL_FAN_DEAD = "minecraft:coral_fan_dead"; public const COW_SPAWN_EGG = "minecraft:cow_spawn_egg"; + public const CREAKING_SPAWN_EGG = "minecraft:creaking_spawn_egg"; public const CREEPER_BANNER_PATTERN = "minecraft:creeper_banner_pattern"; public const CREEPER_SPAWN_EGG = "minecraft:creeper_spawn_egg"; public const CRIMSON_DOOR = "minecraft:crimson_door"; @@ -398,6 +400,11 @@ final class ItemTypeNames{ public const ORANGE_DYE = "minecraft:orange_dye"; public const OXIDIZED_COPPER_DOOR = "minecraft:oxidized_copper_door"; public const PAINTING = "minecraft:painting"; + public const PALE_OAK_BOAT = "minecraft:pale_oak_boat"; + public const PALE_OAK_CHEST_BOAT = "minecraft:pale_oak_chest_boat"; + public const PALE_OAK_DOOR = "minecraft:pale_oak_door"; + public const PALE_OAK_HANGING_SIGN = "minecraft:pale_oak_hanging_sign"; + public const PALE_OAK_SIGN = "minecraft:pale_oak_sign"; public const PANDA_SPAWN_EGG = "minecraft:panda_spawn_egg"; public const PAPER = "minecraft:paper"; public const PARROT_SPAWN_EGG = "minecraft:parrot_spawn_egg"; @@ -448,6 +455,7 @@ final class ItemTypeNames{ public const RED_FLOWER = "minecraft:red_flower"; public const REDSTONE = "minecraft:redstone"; public const REPEATER = "minecraft:repeater"; + public const RESIN_BRICK = "minecraft:resin_brick"; public const RIB_ARMOR_TRIM_SMITHING_TEMPLATE = "minecraft:rib_armor_trim_smithing_template"; public const ROTTEN_FLESH = "minecraft:rotten_flesh"; public const SADDLE = "minecraft:saddle"; diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index f1cfaec1982..8a42371e694 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -77,6 +77,7 @@ use pocketmine\network\mcpe\protocol\PlayerInputPacket; use pocketmine\network\mcpe\protocol\PlayerSkinPacket; use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket; +use pocketmine\network\mcpe\protocol\serializer\BitSet; use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket; use pocketmine\network\mcpe\protocol\SetActorMotionPacket; use pocketmine\network\mcpe\protocol\SetPlayerGameTypePacket; @@ -135,7 +136,7 @@ class InGamePacketHandler extends PacketHandler{ protected ?Vector3 $lastPlayerAuthInputPosition = null; protected ?float $lastPlayerAuthInputYaw = null; protected ?float $lastPlayerAuthInputPitch = null; - protected ?int $lastPlayerAuthInputFlags = null; + protected ?BitSet $lastPlayerAuthInputFlags = null; public bool $forceMoveSync = false; @@ -161,9 +162,9 @@ public function handleMovePlayer(MovePlayerPacket $packet) : bool{ return true; } - private function resolveOnOffInputFlags(int $inputFlags, int $startFlag, int $stopFlag) : ?bool{ - $enabled = ($inputFlags & (1 << $startFlag)) !== 0; - $disabled = ($inputFlags & (1 << $stopFlag)) !== 0; + private function resolveOnOffInputFlags(BitSet $inputFlags, int $startFlag, int $stopFlag) : ?bool{ + $enabled = $inputFlags->get($startFlag); + $disabled = $inputFlags->get($stopFlag); if($enabled !== $disabled){ return $enabled; } @@ -215,7 +216,7 @@ public function handlePlayerAuthInput(PlayerAuthInputPacket $packet) : bool{ if($inputFlags !== $this->lastPlayerAuthInputFlags){ $this->lastPlayerAuthInputFlags = $inputFlags; - $sneaking = $packet->hasFlag(PlayerAuthInputFlags::SNEAKING); + $sneaking = $inputFlags->get(PlayerAuthInputFlags::SNEAKING); if($this->player->isSneaking() === $sneaking){ $sneaking = null; } @@ -233,10 +234,10 @@ public function handlePlayerAuthInput(PlayerAuthInputPacket $packet) : bool{ $this->player->sendData([$this->player]); } - if($packet->hasFlag(PlayerAuthInputFlags::START_JUMPING)){ + if($inputFlags->get(PlayerAuthInputFlags::START_JUMPING)){ $this->player->jump(); } - if($packet->hasFlag(PlayerAuthInputFlags::MISSED_SWING)){ + if($inputFlags->get(PlayerAuthInputFlags::MISSED_SWING)){ $this->player->missSwing(); } } diff --git a/src/network/mcpe/handler/ItemStackResponseBuilder.php b/src/network/mcpe/handler/ItemStackResponseBuilder.php index 1369e3ba722..faf479ee2db 100644 --- a/src/network/mcpe/handler/ItemStackResponseBuilder.php +++ b/src/network/mcpe/handler/ItemStackResponseBuilder.php @@ -93,6 +93,7 @@ public function build() : ItemStackResponse{ $item->getCount(), $itemStackInfo->getStackId(), $item->getCustomName(), + $item->getCustomName(), $item instanceof Durable ? $item->getDamage() : 0, ); } diff --git a/src/network/mcpe/handler/ResourcePacksPacketHandler.php b/src/network/mcpe/handler/ResourcePacksPacketHandler.php index 5e26713946f..a1df394dae7 100644 --- a/src/network/mcpe/handler/ResourcePacksPacketHandler.php +++ b/src/network/mcpe/handler/ResourcePacksPacketHandler.php @@ -37,6 +37,7 @@ use pocketmine\network\mcpe\protocol\types\resourcepacks\ResourcePackStackEntry; use pocketmine\network\mcpe\protocol\types\resourcepacks\ResourcePackType; use pocketmine\resourcepacks\ResourcePack; +use Ramsey\Uuid\Uuid; use function array_keys; use function array_map; use function ceil; @@ -103,7 +104,7 @@ public function setUp() : void{ //TODO: more stuff return new ResourcePackInfoEntry( - $pack->getPackId(), + Uuid::fromString($pack->getPackId()), $pack->getPackVersion(), $pack->getPackSize(), $this->encryptionKeys[$pack->getPackId()] ?? "", @@ -117,7 +118,9 @@ public function setUp() : void{ resourcePackEntries: $resourcePackEntries, mustAccept: $this->mustAccept, hasAddons: false, - hasScripts: false + hasScripts: false, + worldTemplateId: Uuid::fromString(Uuid::NIL), + worldTemplateVersion: "" )); $this->session->getLogger()->debug("Waiting for client to accept resource packs"); }