diff --git a/composer.json b/composer.json index fdc4d75eb1c..93585e0de4c 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "pocketmine/bedrock-block-upgrade-schema": "~4.2.0+bedrock-1.21.0", "pocketmine/bedrock-data": "~2.11.0+bedrock-1.21.0", "pocketmine/bedrock-item-upgrade-schema": "~1.10.0+bedrock-1.21.0", - "pocketmine/bedrock-protocol": "~31.0.0+bedrock-1.21.0", + "pocketmine/bedrock-protocol": "~32.1.0+bedrock-1.21.2", "pocketmine/binaryutils": "^0.2.1", "pocketmine/callback-validator": "^1.0.2", "pocketmine/classloader": "^0.2.0", diff --git a/composer.lock b/composer.lock index cff05b65086..c91e539245a 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": "9ff582c727a0315b9d0ca0a0ce3f813a", + "content-hash": "268e4ea96ee2183d40e702478d3c3814", "packages": [ { "name": "adhocore/json-comment", @@ -281,16 +281,16 @@ }, { "name": "pocketmine/bedrock-protocol", - "version": "31.0.0+bedrock-1.21.0", + "version": "32.1.0+bedrock-1.21.2", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "972373b6b8068963649f0a95163424eb5b645e29" + "reference": "bb23db51365bdc91d3135c3885986a691ae1cb44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/972373b6b8068963649f0a95163424eb5b645e29", - "reference": "972373b6b8068963649f0a95163424eb5b645e29", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/bb23db51365bdc91d3135c3885986a691ae1cb44", + "reference": "bb23db51365bdc91d3135c3885986a691ae1cb44", "shasum": "" }, "require": { @@ -321,9 +321,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/31.0.0+bedrock-1.21.0" + "source": "https://github.com/pmmp/BedrockProtocol/tree/32.1.0+bedrock-1.21.2" }, - "time": "2024-06-13T17:34:14+00:00" + "time": "2024-07-10T01:38:43+00:00" }, { "name": "pocketmine/binaryutils", @@ -3333,5 +3333,5 @@ "platform-overrides": { "php": "8.1.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 630beb51162..fa2b3c01b59 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,7 +31,7 @@ final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.30.0"; + public const BASE_VERSION = "4.31.0"; public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index cb4775d62bd..cb0d8473056 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -55,6 +55,7 @@ use pocketmine\network\mcpe\handler\SpawnResponsePacketHandler; use pocketmine\network\mcpe\protocol\AvailableCommandsPacket; use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket; +use pocketmine\network\mcpe\protocol\ClientboundCloseFormPacket; use pocketmine\network\mcpe\protocol\ClientboundPacket; use pocketmine\network\mcpe\protocol\DisconnectPacket; use pocketmine\network\mcpe\protocol\ModalFormRequestPacket; @@ -1005,6 +1006,10 @@ public function onFormSent(int $id, Form $form) : bool{ return $this->sendDataPacket(ModalFormRequestPacket::create($id, json_encode($form, JSON_THROW_ON_ERROR))); } + public function onCloseAllForms() : void{ + $this->sendDataPacket(ClientboundCloseFormPacket::create()); + } + /** * Instructs the networksession to start using the chunk at the given coordinates. This may occur asynchronously. * @param \Closure $onCompletion To be called when chunk sending has completed. diff --git a/src/player/Player.php b/src/player/Player.php index 830ea264a9d..a0ead8f30be 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -2122,6 +2122,13 @@ public function onFormSubmit(int $formId, $responseData) : bool{ return true; } + /** + * Closes the current viewing form and forms in queue. + */ + public function closeAllForms() : void{ + $this->getNetworkSession()->onCloseAllForms(); + } + /** * Transfers a player to another server. *