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;
27 public string $structureTemplateName;
30 public int $responseType;
38 $result->structureTemplateName = $structureTemplateName;
40 $result->responseType = $responseType;
45 $this->structureTemplateName = $in->getString();
47 $this->nbt =
new CacheableNbt($in->getNbtCompoundRoot());
49 $this->responseType = $in->
getByte();
53 $out->putString($this->structureTemplateName);
54 $out->putBool($this->nbt !==
null);
55 if($this->nbt !==
null){
56 $out->put($this->nbt->getEncodedNbt());
58 $out->putByte($this->responseType);
62 return $handler->handleStructureTemplateDataResponse($this);
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)
static create(string $structureTemplateName, ?CacheableNbt $nbt, int $responseType)