13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
17use pmmp\encoding\Byte;
18use pmmp\encoding\ByteBufferReader;
19use pmmp\encoding\ByteBufferWriter;
21use pocketmine\network\mcpe\protocol\types\ShowStoreOfferRedirectType;
24 public const NETWORK_ID = ProtocolInfo::SHOW_STORE_OFFER_PACKET;
26 public string $offerId;
27 public ShowStoreOfferRedirectType $redirectType;
32 public static function create(
string $offerId, ShowStoreOfferRedirectType $redirectType) : self{
34 $result->offerId = $offerId;
35 $result->redirectType = $redirectType;
41 $this->redirectType = ShowStoreOfferRedirectType::fromPacket(Byte::readUnsigned($in));
46 Byte::writeUnsigned($out, $this->redirectType->value);
50 return $handler->handleShowStoreOffer($this);
handle(PacketHandlerInterface $handler)
static create(string $offerId, ShowStoreOfferRedirectType $redirectType)
decodePayload(ByteBufferReader $in)
encodePayload(ByteBufferWriter $out)