cobble-core 0.2.0

Library for managing, installing and launching Minecraft instances.
Documentation

cobble-core

crates.io Documentation MSRV Dependency Status License

A Rust library for managing, installing and launching Minecraft instances.

Usage

Authentication

use cobble_core::profile::Profile;
use std::sync::{atomic::AtomicBool, Arc};

let client_id = "<MS Graph Client ID>".to_string();
let client_secret = "<MS Graph Client Secret>".to_string();

let cancel = Arc::new(AtomicBool::new(false));
let (url, result) = Profile::authenticate(client_id, client_secret, cancel)?;

println!("{}", url);

let profile: Profile = result.recv()??;
println!("Minecraft Playername: {}", profile.player_name);

Installing

use cobble_core::instance::{Instance, InstanceBuilder};
use std::sync::atomic::AtomicBool;
use std::sync::Arc;

let instance: Instance = InstanceBuilder::default()
    .name("Test Instance".to_string())
    .version("1.18.2".to_string())
    .instance_path("./instance".to_string())
    .libraries_path("./libraries".to_string())
    .assets_path("./assets".to_string())
    .build()?;

let (tx, _rx) = Instance::update_channel();
let cancel = Arc::new(AtomicBool::new(false));

instance.full_install(tx, cancel)?;

Launching

use cobble_core::instance::{Instance, InstanceBuilder};
use cobble_core::minecraft::launch_options::LaunchOptionsBuilder;

let instance: Instance = InstanceBuilder::default()
    .name("Test Instance".to_string())
    .version("1.18.2".to_string())
    .instance_path("./instance".to_string())
    .libraries_path("./libraries".to_string())
    .assets_path("./assets".to_string())
    .build()?;

instance.launch(&LaunchOptionsBuilder::default().build()).unwrap();

Cargo Features

Feature Description
gobject Provides glib objects for the primary structs

Future Development

  • Minecraft
    • Installation
      • Current Versions
      • Old Versions (needs testing)
    • Launching
      • Current Versions
      • Old Versions (needs testing)
    • Saves
    • Servers
    • Resourcepacks
    • Logs
  • Support other platforms than linux (process forking)
  • Instances
    • Installation
    • Launching
    • Installed status
    • Removing
    • Export / Import
  • Fabric
    • Installation
    • Updating
    • Mods
    • Mod Manager