lighty-loaders

Crates.iolighty-loaders
lib.rslighty-loaders
version0.8.6
created_at2025-12-02 11:10:17.772903+00
updated_at2025-12-14 07:27:26.816736+00
descriptionMinecraft mod loaders support for Lighty Launcher
homepagehttps://github.com/Lighty-Launcher/LightyLauncherLib
repositoryhttps://github.com/Lighty-Launcher/LightyLauncherLib
max_upload_size
id1961619
size173,053
Hamadi (Kalandi)

documentation

https://docs.rs/lighty-launcher

README

lighty-loaders

Minecraft mod loader support for LightyLauncher.

Note

This is an internal crate for the LightyLauncher ecosystem. Most users should use the main lighty-launcher crate instead.

Features

  • Multiple Loaders: Vanilla, Fabric, Quilt, Forge, NeoForge, OptiFine, LightyUpdater
  • Smart Caching: Dual cache system with configurable TTL
  • Version Management: Query and resolve loader versions
  • Metadata Merging: Combine multiple loader metadata
  • Feature Flags: Compile only the loaders you need

Structure

lighty-loaders/
└── src/
    ├── lib.rs                  # Module declarations and re-exports
    ├── loaders/                # Loader implementations
    │   ├── mod.rs
    │   ├── vanilla/            # Vanilla Minecraft
    │   │   ├── vanilla.rs
    │   │   └── vanilla_metadata.rs
    │   ├── fabric/             # Fabric loader
    │   │   ├── fabric.rs
    │   │   └── fabric_metadata.rs
    │   ├── quilt/              # Quilt loader
    │   │   ├── quilt.rs
    │   │   └── quilt_metadata.rs
    │   ├── forge/              # Forge loader
    │   │   ├── forge.rs
    │   │   ├── forge_legacy.rs
    │   │   └── forge_metadata.rs
    │   ├── neoforge/           # NeoForge loader
    │   │   ├── neoforge.rs
    │   │   └── neoforge_metadata.rs
    │   ├── optifine/           # OptiFine
    │   │   ├── optifine.rs
    │   │   └── optifine_metadata.rs
    │   └── lighty_updater/     # Custom updater system
    │       ├── lighty_updater.rs
    │       ├── lighty_metadata.rs
    │       └── merge_metadata.rs
    ├── types/                  # Common types
    │   ├── mod.rs              # Type declarations
    │   └── version_metadata.rs # Version metadata structures
    ├── utils/                  # Utilities
    │   ├── mod.rs
    │   ├── cache.rs            # Dual cache system
    │   ├── error.rs            # Error types
    │   ├── manifest.rs         # Manifest repository
    │   └── query.rs            # Query trait
    └── lib.rs                  # Main exports

Usage

[dependencies]
lighty-loaders = { version = "0.6.3", features = ["all-loaders"] }
use lighty_loaders::version::{Version, Loader};
use directories::ProjectDirs;

#[tokio::main]
async fn main() {
    let launcher_dir = ProjectDirs::from("com", "MyLauncher", "").unwrap();

    // Create a Fabric instance
    let mut version = Version::new(
        "fabric-1.21",
        Loader::Fabric,
        "0.16.9",      // Fabric loader version
        "1.21",        // Minecraft version
        &launcher_dir
    );

    // Launch the game
    version.launch("Player", "uuid", JavaDistribution::Temurin).await?;
}

Supported Loaders

Vanilla

Pure Minecraft without modifications.

use lighty_loaders::{Loader, Version};

let version = Version::new("vanilla-1.21", Loader::Vanilla, "", "1.21", &dir);

Status: Stable

Fabric

Lightweight mod loader with excellent performance.

let version = Version::new("fabric-1.21", Loader::Fabric, "0.16.9", "1.21", &dir);

Status: Stable Example Versions: 0.15.11, 0.16.0, 0.16.9

Quilt

Fork of Fabric with additional features.

let version = Version::new("quilt-1.21", Loader::Quilt, "0.27.1", "1.21", &dir);

Status: Stable Example Versions: 0.26.0, 0.27.0, 0.27.1

Forge

Traditional mod loader with extensive mod support.

let version = Version::new("forge-1.21", Loader::Forge, "51.0.38", "1.21", &dir);

Status: Testing Example Versions: 47.3.0, 50.1.0, 51.0.38

NeoForge

Modern fork of Forge for newer Minecraft versions.

let version = Version::new("neoforge-1.21", Loader::NeoForge, "21.1.80", "1.21", &dir);

Status: Testing Example Versions: 20.4.109, 21.0.167, 21.1.80

OptiFine

Performance and graphics optimization mod.

let version = Version::new("optifine-1.21", Loader::Optifine, "HD_U_I9", "1.21", &dir);

Status: Experimental Example Versions: HD_U_I8, HD_U_I9

Features Flags

Control which loaders are compiled:

# All loaders
lighty-loaders = { version = "0.6.3", features = ["all-loaders"] }

# Specific loaders
lighty-loaders = { version = "0.6.3", features = ["vanilla", "fabric", "quilt"] }

Available features:

  • vanilla - Vanilla Minecraft
  • 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 - Enable all loaders

Caching System

The loader uses a dual cache architecture:

  1. Raw Version Cache: Stores complete JSON manifests
  2. Query Cache: Stores extracted data by query

Each cache features:

  • Configurable TTL per data type
  • Automatic cleanup
  • Thread-safe with Arc<RwLock<HashMap>>

License

MIT

Links

Commit count: 0

cargo fmt