20 public const NETWORK_ID = ProtocolInfo::MODAL_FORM_RESPONSE_PACKET;
22 public const CANCEL_REASON_CLOSED = 0;
27 public ?
string $formData;
28 public ?
int $cancelReason;
33 private static function create(
int $formId, ?
string $formData, ?
int $cancelReason) : self{
35 $result->formId = $formId;
36 $result->formData = $formData;
37 $result->cancelReason = $cancelReason;
41 public static function response(
int $formId,
string $formData) : self{
42 return self::create($formId, $formData, null);
45 public static function cancel(
int $formId,
int $cancelReason) : self{
46 return self::create($formId, null, $cancelReason);
50 $this->formId = $in->getUnsignedVarInt();
56 $out->putUnsignedVarInt($this->formId);
63 return $handler->handleModalFormResponse($this);