diff --git a/src/CloseFormPacket.php b/src/CloseFormPacket.php new file mode 100644 index 00000000..d4972ea5 --- /dev/null +++ b/src/CloseFormPacket.php @@ -0,0 +1,40 @@ + + * + * BedrockProtocol is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + */ + +declare(strict_types=1); + +namespace pocketmine\network\mcpe\protocol; + +use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; + +class CloseFormPacket extends DataPacket implements ClientboundPacket{ + public const NETWORK_ID = ProtocolInfo::CLOSE_FORM_PACKET; + + /** + * @generate-create-func + */ + public static function create() : self{ + return new self; + } + + protected function decodePayload(PacketSerializer $in) : void{ + + } + + protected function encodePayload(PacketSerializer $out) : void{ + + } + + public function handle(PacketHandlerInterface $handler) : bool{ + return $handler->handleCloseForm($this); + } +} diff --git a/src/PacketHandlerDefaultImplTrait.php b/src/PacketHandlerDefaultImplTrait.php index b14d4944..1dc7c199 100644 --- a/src/PacketHandlerDefaultImplTrait.php +++ b/src/PacketHandlerDefaultImplTrait.php @@ -809,4 +809,8 @@ public function handleSetHud(SetHudPacket $packet) : bool{ public function handleAwardAchievement(AwardAchievementPacket $packet) : bool{ return false; } + + public function handleCloseForm(CloseFormPacket $packet) : bool{ + return false; + } } diff --git a/src/PacketHandlerInterface.php b/src/PacketHandlerInterface.php index 29996c8e..f0c1dee4 100644 --- a/src/PacketHandlerInterface.php +++ b/src/PacketHandlerInterface.php @@ -411,4 +411,6 @@ public function handleSetPlayerInventoryOptions(SetPlayerInventoryOptionsPacket public function handleSetHud(SetHudPacket $packet) : bool; public function handleAwardAchievement(AwardAchievementPacket $packet) : bool; + + public function handleCloseForm(CloseFormPacket $packet) : bool; } diff --git a/src/PacketPool.php b/src/PacketPool.php index 47321d23..1ac92148 100644 --- a/src/PacketPool.php +++ b/src/PacketPool.php @@ -230,6 +230,7 @@ public function __construct(){ $this->registerPacket(new SetPlayerInventoryOptionsPacket()); $this->registerPacket(new SetHudPacket()); $this->registerPacket(new AwardAchievementPacket()); + $this->registerPacket(new CloseFormPacket()); } public function registerPacket(Packet $packet) : void{ diff --git a/src/ProtocolInfo.php b/src/ProtocolInfo.php index bd088d81..1c521d56 100644 --- a/src/ProtocolInfo.php +++ b/src/ProtocolInfo.php @@ -32,7 +32,7 @@ private function __construct(){ */ /** Actual Minecraft: PE protocol version */ - public const CURRENT_PROTOCOL = self::PROTOCOL_1_21_0; + public const CURRENT_PROTOCOL = self::PROTOCOL_1_21_2; public const ACCEPTED_PROTOCOL = [ self::PROTOCOL_1_20_0, self::PROTOCOL_1_20_10, @@ -42,14 +42,16 @@ private function __construct(){ self::PROTOCOL_1_20_60, self::PROTOCOL_1_20_70, self::PROTOCOL_1_20_80, - self::CURRENT_PROTOCOL + self::PROTOCOL_1_21_0, + self::CURRENT_PROTOCOL, ]; /** Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */ - public const MINECRAFT_VERSION = 'v1.21.0'; + public const MINECRAFT_VERSION = 'v1.21.2'; /** Version number sent to clients in ping responses. */ - public const MINECRAFT_VERSION_NETWORK = '1.21.0'; + public const MINECRAFT_VERSION_NETWORK = '1.21.2'; + public const PROTOCOL_1_21_2 = 686; public const PROTOCOL_1_21_0 = 685; public const PROTOCOL_1_20_80 = 671; public const PROTOCOL_1_20_70 = 662; @@ -267,5 +269,6 @@ private function __construct(){ public const SET_PLAYER_INVENTORY_OPTIONS_PACKET = 0x133; public const SET_HUD_PACKET = 0x134; public const AWARD_ACHIEVEMENT_PACKET = 0x135; + public const CLOSE_FORM_PACKET = 0x136; }