UNPKG

minecraft-core-master

Version:

Núcleo avanzado para launchers de Minecraft. Descarga, instala y ejecuta versiones de Minecraft, assets, librerías, Java y loaders de forma automática y eficiente.

69 lines (68 loc) 2.3 kB
import { EventEmitter } from 'events'; import { type ClientDownloaderOptions } from "../Minecraft/Version.js"; import { type LibrariesDownloaderOptions } from "../Minecraft/Libraries.js"; import { type AssetsDownloaderOptions } from "../Minecraft/Assets.js"; import { type NativesDownloaderOptions } from "../Minecraft/Natives.js"; import { type RuntimeDownloaderOptions } from "../Minecraft/Runtime.js"; interface DownloadSections { Client?: Partial<ClientDownloaderOptions>; Natives?: Partial<NativesDownloaderOptions>; Libraries?: Partial<LibrariesDownloaderOptions>; Runtime?: Partial<RuntimeDownloaderOptions>; Assets?: Partial<AssetsDownloaderOptions>; } interface DownloadOptions { root: string; version: string; concurry: number; maxRetries: number; installJava: boolean | undefined; startOnFinish: boolean | undefined; sections: DownloadSections; } declare class MinecraftDownloader extends EventEmitter { private downloaders; private totalBytes; private downloadedBytes; private isDownloading; startTime: number; private lastUpdateTime; private lastDownloadedBytes; private currentSpeed; private eta; private progressInterval; private activeDownloads; private connectionErrors; private lastWarningTime; private warningCooldown; private highSpeedThreshold; private slowSpeedThreshold; constructor(); getTotalMB(): string; getTotalGB(): string; StartDownload(options: DownloadOptions): Promise<void>; private checkConcurrencyWarning; private calculateTotalConcurrency; private emitWarning; private calculateTotalSize; private executeParallelDownloads; private startSingleDownload; private handleDownloadError; private handleDownloadProgress; private startProgressMonitor; private stopProgressMonitor; private emitProgress; private formatBytes; pause(): void; resume(): void; stop(): void; adjustForNetworkIssues(): Partial<DownloadOptions>; getDownloadedMB(): string; getDownloadedGB(): string; getPercentage(): string; getCurrentSpeed(): string; getETA(): number; isCurrentlyDownloading(): boolean; getConnectionErrorCount(): number; } export { MinecraftDownloader };