mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Added encode/decode for StructureTemplateDataExport(Request|Response)Packet (#3145)
This commit is contained in:
@ -26,16 +26,39 @@ namespace pocketmine\network\mcpe\protocol;
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\types\StructureSettings;
|
||||
|
||||
class StructureTemplateDataExportRequestPacket extends DataPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::STRUCTURE_TEMPLATE_DATA_EXPORT_REQUEST_PACKET;
|
||||
|
||||
public const TYPE_ALWAYS_LOAD = 1;
|
||||
public const TYPE_CREATE_AND_LOAD = 2;
|
||||
|
||||
/** @var string */
|
||||
public $structureTemplateName;
|
||||
/** @var int */
|
||||
public $structureBlockX;
|
||||
/** @var int */
|
||||
public $structureBlockY;
|
||||
/** @var int */
|
||||
public $structureBlockZ;
|
||||
/** @var StructureSettings */
|
||||
public $structureSettings;
|
||||
/** @var int */
|
||||
public $structureTemplateResponseType;
|
||||
|
||||
protected function decodePayload() : void{
|
||||
//TODO
|
||||
$this->structureTemplateName = $this->getString();
|
||||
$this->getBlockPosition($this->structureBlockX, $this->structureBlockY, $this->structureBlockZ);
|
||||
$this->structureSettings = $this->getStructureSettings();
|
||||
$this->structureTemplateResponseType = $this->getByte();
|
||||
}
|
||||
|
||||
protected function encodePayload() : void{
|
||||
//TODO
|
||||
$this->putString($this->structureTemplateName);
|
||||
$this->putBlockPosition($this->structureBlockX, $this->structureBlockY, $this->structureBlockZ);
|
||||
$this->putStructureSettings($this->structureSettings);
|
||||
$this->putByte($this->structureTemplateResponseType);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $handler) : bool{
|
||||
|
Reference in New Issue
Block a user