use pocketmine\network\mcpe\handler\SessionHandler; class ContainerClosePacket extends DataPacket implements ClientboundPacket, ServerboundPacket{ public const NETWORK_ID = ProtocolInfo::CONTAINER_CLOSE_PACKET; /** @var int */ public $windowId; public static function create(int $windowId) : self{ $result = new self; $result->windowId = $windowId; return $result; } protected function decodePayload() : void{ $this->windowId = $this->getByte(); } protected function encodePayload() : void{ $this->putByte($this->windowId); } public function handle(SessionHandler $handler) : bool{ return $handler->handleContainerClose($this); } }