Skip to content

Lighty-Launcher/LightyLauncherLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LightyLauncher

Crates.io Documentation License: MIT Rust Version

ACTIVE DEVELOPMENT - API may change between versions. Use with caution in production.

A modern, modular Minecraft launcher library for Rust with full async support, real-time event system, and automatic Java management.

LightyUpdater Banner

Features

  • Modular Architecture: Organized into logical crates (auth, event, java, launch, loaders, version, core)
  • Multi-Loader Support: Vanilla, Fabric, Quilt, NeoForge, Forge, OptiFine, LightyUpdater
  • Event System: Real-time progress tracking for all operations
  • Authentication: Offline, Microsoft OAuth 2.0, Azuriom CMS + extensibility for custom providers
  • Automatic Java Management: Download and manage JRE distributions (Temurin, GraalVM, Zulu, Liberica)
  • Cross-Platform: Windows, Linux, and macOS support

Installation

[dependencies]
lighty-launcher = "0.8.6"
tokio = { version = "1", features = ["full"] }
anyhow = "1.0"

Quick Start

use lighty_launcher::prelude::*;

const QUALIFIER: &str = "com";
const ORGANIZATION: &str = "MyLauncher";
const APPLICATION: &str = "";

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Initialize AppState
    let _app = AppState::new(
        QUALIFIER.to_string(),
        ORGANIZATION.to_string(),
        APPLICATION.to_string(),
    )?;

    let launcher_dir = AppState::get_project_dirs();

    // Create instance
    let mut instance = VersionBuilder::new(
        "my-instance",
        Loader::Vanilla,
        "",
        "1.21.1",
        launcher_dir
    );

    // Authenticate
    let mut auth = OfflineAuth::new("Player123");
    let profile = auth.authenticate().await?;

    // Launch
    instance.launch(&profile, JavaDistribution::Temurin)
        .run()
        .await?;

    Ok(())
}

Documentation

πŸ“– Guides

Comprehensive documentation in the docs/ directory:

Guide Description
Sequence Diagrams Visual diagrams of all workflows (launch, authentication, installation)
Re-exports Reference Complete list of all re-exported types and their sources
Architecture System architecture, design patterns, and module dependencies
Examples Detailed walkthrough of all examples with code explanations

πŸ“¦ Crate Documentation

Complete documentation for each crate:

Core Crates

Crate Description Documentation
lighty-core Core utilities and AppState management πŸ“š Docs
lighty-launcher Main package with re-exports πŸ“š Docs

Feature Crates

Crate Description Documentation
lighty-auth Authentication (Offline, Microsoft, Azuriom) πŸ“š Docs
lighty-java Java runtime management πŸ“š Docs
lighty-launch Game launching and process management πŸ“š Docs
lighty-loaders Mod loader implementations πŸ“š Docs
lighty-version Version builders πŸ“š Docs
lighty-event Event system for progress tracking πŸ“š Docs

Detailed Guides

lighty-launch Documentation

Guide Description
Launch Process Complete launch workflow (5 phases)
Arguments System Placeholders, JVM options, game arguments
Installation Asset/library installation details
Instance Control Process management and PID tracking
Events Event types reference
How to Use Practical examples
Exports Module exports reference

lighty-version Documentation

Guide Description
How to Use Practical usage guide
Overview Architecture and design
Exports Module exports reference
VersionBuilder Standard builder details
LightyVersionBuilder Custom server builder

Examples

The examples/ directory contains ready-to-use examples for all loaders and features:

Example Description Features Required
vanilla.rs Basic Vanilla Minecraft launcher vanilla
fabric.rs Fabric mod loader fabric
quilt.rs Quilt mod loader quilt
neoforge.rs NeoForge mod loader neoforge
forge.rs Forge mod loader forge
forge_legacy.rs Legacy Forge (1.7.10-1.12.2) forge_legacy
optifine.rs OptiFine launcher optifine
lighty_updater.rs Custom modpack server lighty_updater
with_events.rs Complete event system & instance management vanilla, events

Running Examples

# Vanilla Minecraft
cargo run --example vanilla --features vanilla

# Fabric with events
cargo run --example fabric --features fabric,events

# Complete demo with events and instance management
cargo run --example with_events --features vanilla,events

# LightyUpdater
cargo run --example lighty_updater --features lighty_updater

Advanced Examples

with_events.rs demonstrates:

  • Real-time event tracking for all operations
  • Instance lifecycle management (create, launch, monitor, close, delete)
  • Console output streaming
  • Instance size calculation
  • PID tracking and control

See docs/examples.md for detailed example documentation.

Cargo Features

# Minimal - Vanilla only
lighty-launcher = { version = "0.8.6", features = ["vanilla"] }

# With events
lighty-launcher = { version = "0.8.6", features = ["vanilla", "events"] }

# Multiple loaders
lighty-launcher = { version = "0.8.6", features = ["vanilla", "fabric", "quilt", "events"] }

# All loaders
lighty-launcher = { version = "0.8.6", features = ["all-loaders", "events"] }

Available Features:

  • vanilla - Vanilla Minecraft support (required base)
  • fabric - Fabric loader
  • quilt - Quilt loader
  • neoforge - NeoForge loader
  • forge - Forge loader
  • forge_legacy - Legacy Forge (1.7.10 - 1.12.2)
  • lighty_updater - Custom updater system
  • all-loaders - All mod loaders
  • events - Event system

Architecture

lighty-launcher/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ core/           # Core utilities and AppState
β”‚   β”œβ”€β”€ auth/           # Authentication providers
β”‚   β”œβ”€β”€ event/          # Event system
β”‚   β”œβ”€β”€ java/           # Java runtime management
β”‚   β”œβ”€β”€ launch/         # Launch orchestration
β”‚   β”œβ”€β”€ loaders/        # Mod loader implementations
β”‚   β”œβ”€β”€ version/        # Version builders
β”‚   └── launcher/       # Main package with re-exports
β”œβ”€β”€ examples/           # Usage examples
└── docs/              # Additional documentation

Contributing

Contributions are welcome! Please read the Contributing Guide before submitting a PR.

License

MIT License - see LICENSE file for details.

Related Projects

Releases

No releases published

Packages

 
 
 

Contributors

Languages