mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
StructureBlockUpdatePacket: Added encode/decode (#3148)
This commit is contained in:
@ -26,16 +26,32 @@ namespace pocketmine\network\mcpe\protocol;
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\types\StructureEditorData;
|
||||
|
||||
class StructureBlockUpdatePacket extends DataPacket{
|
||||
class StructureBlockUpdatePacket extends DataPacket/* implements ServerboundPacket*/{
|
||||
public const NETWORK_ID = ProtocolInfo::STRUCTURE_BLOCK_UPDATE_PACKET;
|
||||
|
||||
/** @var int */
|
||||
public $x;
|
||||
/** @var int */
|
||||
public $y;
|
||||
/** @var int */
|
||||
public $z;
|
||||
/** @var StructureEditorData */
|
||||
public $structureEditorData;
|
||||
/** @var bool */
|
||||
public $isPowered;
|
||||
|
||||
protected function decodePayload(){
|
||||
//TODO
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->structureEditorData = $this->getStructureEditorData();
|
||||
$this->isPowered = $this->getBool();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
//TODO
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putStructureEditorData($this->structureEditorData);
|
||||
$this->putBool($this->isPowered);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user