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;
22use Ramsey\Uuid\UuidInterface;
25 public const NETWORK_ID = ProtocolInfo::SHOW_STORE_OFFER_PACKET;
27 public UuidInterface $offerId;
28 public ShowStoreOfferRedirectType $redirectType;
33 public static function create(UuidInterface $offerId, ShowStoreOfferRedirectType $redirectType) : self{
35 $result->offerId = $offerId;
36 $result->redirectType = $redirectType;
42 $this->redirectType = ShowStoreOfferRedirectType::fromPacket(Byte::readUnsigned($in));
47 Byte::writeUnsigned($out, $this->redirectType->value);
51 return $handler->handleShowStoreOffer($this);
static create(UuidInterface $offerId, ShowStoreOfferRedirectType $redirectType)
handle(PacketHandlerInterface $handler)
decodePayload(ByteBufferReader $in)
encodePayload(ByteBufferWriter $out)