13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::PLAYER_HOTBAR_PACKET;
23 public int $selectedHotbarSlot;
24 public int $windowId = ContainerIds::INVENTORY;
25 public bool $selectHotbarSlot =
true;
30 public static function create(
int $selectedHotbarSlot,
int $windowId,
bool $selectHotbarSlot) : self{
32 $result->selectedHotbarSlot = $selectedHotbarSlot;
33 $result->windowId = $windowId;
34 $result->selectHotbarSlot = $selectHotbarSlot;
39 $this->selectedHotbarSlot = $in->getUnsignedVarInt();
40 $this->windowId = $in->
getByte();
41 $this->selectHotbarSlot = $in->
getBool();
45 $out->putUnsignedVarInt($this->selectedHotbarSlot);
46 $out->putByte($this->windowId);
47 $out->putBool($this->selectHotbarSlot);
51 return $handler->handlePlayerHotbar($this);
handle(PacketHandlerInterface $handler)
static create(int $selectedHotbarSlot, int $windowId, bool $selectHotbarSlot)
decodePayload(PacketSerializer $in)
encodePayload(PacketSerializer $out)