use pocketmine\item\Item; use pocketmine\network\mcpe\NetworkSession; class ContainerSetSlotPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::CONTAINER_SET_SLOT_PACKET; public $windowid; public $slot; public $hotbarSlot; /** @var Item */ public $item; public $unknown; public function decode(){ $this->windowid = $this->getByte(); $this->slot = $this->getVarInt(); $this->hotbarSlot = $this->getVarInt(); $this->item = $this->getSlot(); $this->unknown = $this->getByte(); } public function encode(){ $this->reset(); $this->putByte($this->windowid); $this->putVarInt($this->slot); $this->putVarInt($this->hotbarSlot); $this->putSlot($this->item); $this->putByte($this->unknown); } public function handle(NetworkSession $session) : bool{ return $session->handleContainerSetSlot($this); } }