13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::MOB_EQUIPMENT_PACKET;
23 public int $actorRuntimeId;
25 public int $inventorySlot;
26 public int $hotbarSlot;
27 public int $windowId = 0;
32 public static function create(
int $actorRuntimeId,
ItemStackWrapper $item,
int $inventorySlot,
int $hotbarSlot,
int $windowId) : self{
34 $result->actorRuntimeId = $actorRuntimeId;
35 $result->item = $item;
36 $result->inventorySlot = $inventorySlot;
37 $result->hotbarSlot = $hotbarSlot;
38 $result->windowId = $windowId;
43 $this->actorRuntimeId = $in->getActorRuntimeId();
44 $this->item = $in->getItemStackWrapper();
45 $this->inventorySlot = $in->
getByte();
46 $this->hotbarSlot = $in->
getByte();
47 $this->windowId = $in->
getByte();
51 $out->putActorRuntimeId($this->actorRuntimeId);
52 $out->putItemStackWrapper($this->item);
53 $out->putByte($this->inventorySlot);
54 $out->putByte($this->hotbarSlot);
55 $out->putByte($this->windowId);
59 return $handler->handleMobEquipment($this);
encodePayload(PacketSerializer $out)
static create(int $actorRuntimeId, ItemStackWrapper $item, int $inventorySlot, int $hotbarSlot, int $windowId)
decodePayload(PacketSerializer $in)
handle(PacketHandlerInterface $handler)