use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; class NetworkStackLatencyPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{ public const NETWORK_ID = ProtocolInfo::NETWORK_STACK_LATENCY_PACKET; /** @var int */ public $timestamp; /** @var bool */ public $needResponse; protected function decodePayload(PacketSerializer $in) : void{ $this->timestamp = $in->getLLong(); $this->needResponse = $in->getBool(); } protected function encodePayload(PacketSerializer $out) : void{ $out->putLLong($this->timestamp); $out->putBool($this->needResponse); } public function handle(PacketHandlerInterface $handler) : bool{ return $handler->handleNetworkStackLatency($this); } }