Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol changes for 1.21.2 #247

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/CloseFormPacket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/*
* This file is part of BedrockProtocol.
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
*
* 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{
//No payload
}

protected function encodePayload(PacketSerializer $out) : void{
//No payload
}

public function handle(PacketHandlerInterface $handler) : bool{
return $handler->handleCloseForm($this);
}
}
4 changes: 4 additions & 0 deletions src/PacketHandlerDefaultImplTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,8 @@ public function handleSetHud(SetHudPacket $packet) : bool{
public function handleAwardAchievement(AwardAchievementPacket $packet) : bool{
return false;
}

public function handleCloseForm(CloseFormPacket $packet) : bool{
return false;
}
}
2 changes: 2 additions & 0 deletions src/PacketHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,6 @@ public function handleSetPlayerInventoryOptions(SetPlayerInventoryOptionsPacket
public function handleSetHud(SetHudPacket $packet) : bool;

public function handleAwardAchievement(AwardAchievementPacket $packet) : bool;

public function handleCloseForm(CloseFormPacket $packet) : bool;
}
1 change: 1 addition & 0 deletions src/PacketPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,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{
Expand Down
7 changes: 4 additions & 3 deletions src/ProtocolInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ private function __construct(){
*/

/** Actual Minecraft: PE protocol version */
public const CURRENT_PROTOCOL = 685;
public const CURRENT_PROTOCOL = 686;
/** 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 LOGIN_PACKET = 0x01;
public const PLAY_STATUS_PACKET = 0x02;
Expand Down Expand Up @@ -245,5 +245,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;

}