13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
22 public const NETWORK_ID = ProtocolInfo::UPDATE_TRADE_PACKET;
25 public int $windowType = WindowTypes::TRADING;
26 public int $windowSlotCount = 0;
27 public int $tradeTier;
28 public int $traderActorUniqueId;
29 public int $playerActorUniqueId;
30 public string $displayName;
31 public bool $isV2Trading;
32 public bool $isEconomyTrading;
45 int $traderActorUniqueId,
46 int $playerActorUniqueId,
49 bool $isEconomyTrading,
53 $result->windowId = $windowId;
54 $result->windowType = $windowType;
55 $result->windowSlotCount = $windowSlotCount;
56 $result->tradeTier = $tradeTier;
57 $result->traderActorUniqueId = $traderActorUniqueId;
58 $result->playerActorUniqueId = $playerActorUniqueId;
59 $result->displayName = $displayName;
60 $result->isV2Trading = $isV2Trading;
61 $result->isEconomyTrading = $isEconomyTrading;
67 $this->windowId = $in->getByte();
68 $this->windowType = $in->
getByte();
69 $this->windowSlotCount = $in->
getVarInt();
74 $this->isV2Trading = $in->
getBool();
75 $this->isEconomyTrading = $in->
getBool();
76 $this->offers =
new CacheableNbt($in->getNbtCompoundRoot());
80 $out->putByte($this->windowId);
81 $out->putByte($this->windowType);
84 $out->putActorUniqueId($this->traderActorUniqueId);
85 $out->putActorUniqueId($this->playerActorUniqueId);
86 $out->putString($this->displayName);
87 $out->putBool($this->isV2Trading);
88 $out->putBool($this->isEconomyTrading);
89 $out->put($this->offers->getEncodedNbt());
93 return $handler->handleUpdateTrade($this);
static create(int $windowId, int $windowType, int $windowSlotCount, int $tradeTier, int $traderActorUniqueId, int $playerActorUniqueId, string $displayName, bool $isV2Trading, bool $isEconomyTrading, CacheableNbt $offers,)
encodePayload(PacketSerializer $out)
decodePayload(PacketSerializer $in)
handle(PacketHandlerInterface $handler)