LightyLauncher
⚠️ ACTIVE DEVELOPMENT - API may change between versions. Use with caution in production.
A modern, async Minecraft launcher library for Rust supporting multiple mod loaders with an optimized architecture based on an intelligent caching system.
Features
- Multi-Loader Support: Vanilla, Fabric, Quilt, NeoForge, Forge, OptiFine
- Async/Await Architecture: Built on Tokio for maximum performance
- Automatic Java Management: Download and manage JRE distributions (Temurin, GraalVM)
- Smart Caching System: Dual cache (raw + query) with configurable TTL and automatic cleanup
- Tauri Integration: Pre-configured commands for desktop applications
- Cross-Platform: Windows, Linux, and macOS support
- Type-Safe: Strongly typed API with comprehensive error handling via
thiserror - Performance Optimized:
- Parallel downloads with concurrency limits
- SHA1 verification for file integrity
- Async archive extraction
- Intelligent cache reuse
Installation
Add to your Cargo.toml:
[]
= { = "0.1", = ["all-loaders"] }
= { = "1.48", = ["full"] }
= "6.0"
= "1.21"
= "0.3"
Quick Start
Basic Example - Vanilla
use ;
use ProjectDirs;
use Lazy;
use ;
static LAUNCHER_DIRECTORY: = new;
async
Fabric Example
let mut fabric = new;
fabric.launch.await?;
Supported Loaders
| Loader | Status | Example Loader Version | Example MC Version |
|---|---|---|---|
| Vanilla | ✅ Stable | - | 1.21 |
| Fabric | ✅ Stable | 0.16.9 |
1.21 |
| Quilt | ✅ Stable | 0.27.1 |
1.21 |
| NeoForge | ⚠️ Testing | 21.1.80 |
1.21 |
| Forge | ⚠️ Testing | 51.0.38 |
1.21 |
| OptiFine | 🚧 Experimental | HD_U_I9 |
1.21 |
Examples by Loader
let mut vanilla = new;
vanilla.launch.await?;
let mut fabric = new;
fabric.launch.await?;
let mut quilt = new;
quilt.launch.await?;
let mut neoforge = new;
neoforge.launch.await?;
let mut forge = new;
forge.launch.await?;
let mut optifine = new;
optifine.launch.await?;
Java Distributions
LightyLauncher automatically manages Java runtime download and installation:
| Distribution | Support | Recommended For | Java Versions |
|---|---|---|---|
| Temurin | ✅ | General use | 8, 11, 17, 21 |
| GraalVM | ✅ | Maximum performance | 17+ |
// Temurin (recommended, supports Java 8-21)
Temurin
// GraalVM (high performance, Java 17+ only)
GraalVM
The library automatically:
- Detects the required Java version for each Minecraft version
- Downloads the JRE if not present
- Verifies SHA1 checksums
- Extracts and configures the runtime
Tauri Integration
LightyLauncher provides ready-to-use Tauri commands for desktop applications.
Installation
[]
= { = "0.1", = ["all-loaders", "tauri-commands"] }
Backend Setup
// src-tauri/src/lib.rs
use *;
Frontend Usage (TypeScript)
import { invoke } from '@tauri-apps/api/tauri';
await invoke('launch', {
versionConfig: {
name: 'fabric-1.21',
loader: 'fabric',
loaderVersion: '0.16.9',
minecraftVersion: '1.21',
},
launchConfig: {
username: 'Hamadi',
uuid: '37fefc81-1e26-4d31-a988-74196affc99b',
javaDistribution: 'temurin',
},
});
📖 Full documentation: See TAURI_USAGE.md
Cargo Features
Control which loaders are compiled into your binary:
# All loaders
= { = "0.1", = ["all-loaders"] }
# Specific loaders only
= { = "0.1", = ["vanilla", "fabric"] }
# With Tauri integration
= { = "0.1", = ["all-loaders", "tauri-commands"] }
Available features:
vanilla- Vanilla Minecraft support (base for all loaders)fabric- Fabric loader supportquilt- Quilt loader supportneoforge- NeoForge loader supportforge- Forge loader supportforge_legacy- Forge Legacy support (1.7.10 - 1.12.2)all-loaders- Enable all mod loaderstauri-commands- Pre-configured Tauri commands
Default features: None (choose your loaders)
Architecture
lightylauncher/
├── java/ # Java runtime management
│ ├── distribution.rs # JRE distributions (Temurin, GraalVM)
│ ├── jre_downloader.rs # Download and installation
│ └── runtime.rs # Java version detection
│
├── minecraft/
│ ├── auth/ # Authentication (WIP)
│ ├── launch/ # Launch logic
│ │ ├── arguments.rs # JVM and game arguments
│ │ ├── installer.rs # Assets/libraries installation
│ │ ├── launch.rs # Launch trait
│ │ └── errors.rs # Installer errors
│ │
│ ├── loaders/ # Mod loader implementations
│ │ ├── vanilla/
│ │ ├── fabric/
│ │ ├── quilt/
│ │ ├── neoforge/
│ │ ├── forge/
│ │ └── optifine/
│ │
│ ├── utils/ # Minecraft utilities
│ │ ├── cache.rs # Smart cache with TTL
│ │ ├── manifest.rs # Repository with dual cache
│ │ ├── query.rs # Query trait for loaders
│ │ └── error.rs # Query errors
│ │
│ └── version/ # Version management
│
├── utils/ # General utilities
│ ├── download.rs # Async downloads
│ ├── extract.rs # Archive extraction
│ ├── system.rs # OS/Architecture detection
│ └── macros.rs # Utility macros
│
└── tauri/ # Tauri integration
└── tauri_commands.rs # Ready-to-use commands
Caching System
LightyLauncher uses a dual cache architecture for optimal performance:
raw_version_cache: Stores complete JSON manifestsquery_cache: Stores extracted data by query
Each cache features:
- Configurable TTL per data type (via
Query::cache_ttl()) - Automatic cleanup with adaptive sleep
- Thread-safe with
Arc<RwLock<HashMap>>
Examples
The examples/ directory contains complete examples for each loader:
Requirements
- Rust 1.75+
- Tokio async runtime
- Internet connection for downloading game files and JRE
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Windows | ✅ Tested | x64, ARM64 |
| Linux | ✅ Tested | x64, ARM64 |
| macOS | ✅ Tested | x64 (Intel), ARM64 (Apple Silicon) |
Performance
LightyLauncher is optimized for performance:
- Async I/O: All filesystem and network operations are async
- Parallel Downloads: Configurable concurrency limits
- Smart Caching: Avoids re-downloads and re-extractions
- SHA1 Verification: Guaranteed integrity without overhead
- Minimal Dependencies: Only essential crates included
- Optimized Build Profiles:
dev: Optimizes dependencies (opt-level=2)release: LTO thin, codegen-units=1release-small: Binary size optimized
License
This project is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for details.
Disclaimer
- Minecraft is a trademark of Mojang Studios
- This project is not affiliated with Mojang Studios or Microsoft
- For educational and personal use
- Please respect the Minecraft EULA
Links
- Documentation: docs.rs/lightylauncher
- Crates.io: crates.io/crates/lightylauncher
- Repository: GitHub
- Issues: GitHub Issues
- Tauri Guide: TAURI_USAGE.md
Made with ❤️ by Hamadi
Built with the Rust ecosystem: Tokio, Reqwest, Serde, Thiserror, and more!