| Crates.io | lighty-launch |
| lib.rs | lighty-launch |
| version | 0.8.6 |
| created_at | 2025-12-02 11:22:25.684716+00 |
| updated_at | 2025-12-14 07:28:45.19185+00 |
| description | Minecraft launch logic for Lighty Launcher |
| homepage | https://github.com/Lighty-Launcher/LightyLauncherLib |
| repository | https://github.com/Lighty-Launcher/LightyLauncherLib |
| max_upload_size | |
| id | 1961640 |
| size | 135,624 |
Minecraft launch logic for LightyLauncher.
This is an internal crate for the LightyLauncher ecosystem. Most users should use the main lighty-launcher crate instead.
[dependencies]
lighty-launch = "0.6.3"
use lighty_launch::launch::Launch;
use lighty_java::JavaDistribution;
#[tokio::main]
async fn main() {
// Assuming you have a Version object from lighty-loaders
let mut version = /* ... */;
// Launch the game
version.launch(
"PlayerName",
"player-uuid",
JavaDistribution::Temurin
).await?;
}
lighty-launch/
└── src/
├── lib.rs # Module declarations
├── launch.rs # Launch trait and implementation
├── installer/ # Assets and libraries installation
│ ├── mod.rs # Installer trait
│ ├── assets.rs # Assets installation
│ └── libraries.rs # Libraries installation
├── arguments.rs # JVM and game arguments generation
└── errors.rs # Error types (InstallerError, InstallerResult)
The Launch trait defines the interface for launching Minecraft:
use async_trait::async_trait;
use lighty_java::JavaDistribution;
use lighty_launch::errors::InstallerResult;
#[async_trait]
pub trait Launch {
async fn launch(
&mut self,
username: &str,
uuid: &str,
java_distribution: JavaDistribution
) -> InstallerResult<()>;
}
Handles downloading and installing game files (assets, libraries):
use lighty_launch::installer::Installer;
#[async_trait]
pub trait Installer {
async fn install(&self, builder: &VersionBuilder) -> InstallerResult<()>;
}
Generates optimized JVM and game arguments:
use lighty_launch::arguments::Arguments;
let args = Arguments::new(&version_metadata, &java_path);
let jvm_args = args.get_jvm_arguments();
let game_args = args.get_game_arguments("PlayerName", "uuid");
Features:
All operations return InstallerResult<T> with detailed error information:
use lighty_launch::errors::{InstallerError, InstallerResult};
match version.launch(username, uuid, java_dist).await {
Ok(()) => println!("Game launched successfully"),
Err(InstallerError::DownloadFailed(url)) => {
eprintln!("Failed to download: {}", url);
}
Err(e) => eprintln!("Launch error: {:?}", e),
}
MIT