13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::STRUCTURE_TEMPLATE_DATA_RESPONSE_PACKET;
23 public const TYPE_FAILURE = 0;
24 public const TYPE_EXPORT = 1;
25 public const TYPE_QUERY = 2;
26 public const TYPE_IMPORT = 3;
28 public string $structureTemplateName;
31 public int $responseType;
39 $result->structureTemplateName = $structureTemplateName;
41 $result->responseType = $responseType;
46 $this->structureTemplateName = $in->getString();
48 $this->nbt =
new CacheableNbt($in->getNbtCompoundRoot());
50 $this->responseType = $in->
getByte();
54 $out->putString($this->structureTemplateName);
55 $out->putBool($this->nbt !==
null);
56 if($this->nbt !==
null){
57 $out->put($this->nbt->getEncodedNbt());
59 $out->putByte($this->responseType);
63 return $handler->handleStructureTemplateDataResponse($this);
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)
static create(string $structureTemplateName, ?CacheableNbt $nbt, int $responseType)