Skip to content

Commit 5d60ba3

Browse files
committed
Support for 1.21.2
1 parent 68d2e29 commit 5d60ba3

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"pocketmine/bedrock-block-upgrade-schema": "~4.2.0+bedrock-1.21.0",
3737
"pocketmine/bedrock-data": "~2.11.0+bedrock-1.21.0",
3838
"pocketmine/bedrock-item-upgrade-schema": "~1.10.0+bedrock-1.21.0",
39-
"pocketmine/bedrock-protocol": "~31.0.0+bedrock-1.21.0",
39+
"pocketmine/bedrock-protocol": "~32.1.0+bedrock-1.21.2",
4040
"pocketmine/binaryutils": "^0.2.1",
4141
"pocketmine/callback-validator": "^1.0.2",
4242
"pocketmine/color": "^0.3.0",

composer.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/network/mcpe/NetworkSession.php

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
use pocketmine\network\mcpe\handler\SpawnResponsePacketHandler;
5555
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
5656
use pocketmine\network\mcpe\protocol\ChunkRadiusUpdatedPacket;
57+
use pocketmine\network\mcpe\protocol\ClientboundCloseFormPacket;
5758
use pocketmine\network\mcpe\protocol\ClientboundPacket;
5859
use pocketmine\network\mcpe\protocol\DisconnectPacket;
5960
use pocketmine\network\mcpe\protocol\ModalFormRequestPacket;
@@ -1170,6 +1171,10 @@ public function onFormSent(int $id, Form $form) : bool{
11701171
return $this->sendDataPacket(ModalFormRequestPacket::create($id, json_encode($form, JSON_THROW_ON_ERROR)));
11711172
}
11721173

1174+
public function onCloseAllForms() : void{
1175+
$this->sendDataPacket(ClientboundCloseFormPacket::create());
1176+
}
1177+
11731178
/**
11741179
* Instructs the networksession to start using the chunk at the given coordinates. This may occur asynchronously.
11751180
* @param \Closure $onCompletion To be called when chunk sending has completed.

src/player/Player.php

+7
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,13 @@ public function onFormSubmit(int $formId, mixed $responseData) : bool{
21512151
return true;
21522152
}
21532153

2154+
/**
2155+
* Closes the current viewing form and forms in queue.
2156+
*/
2157+
public function closeAllForms() : void{
2158+
$this->getNetworkSession()->onCloseAllForms();
2159+
}
2160+
21542161
/**
21552162
* Transfers a player to another server.
21562163
*

0 commit comments

Comments
 (0)