cobble-core 0.6.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())?;

Cargo Features

Feature Description Default
gobject Provides glib objects for the primary structs No
saves Provides ability to interact with save games Yes
servers Provides ability to interact with servers Yes
screenshots Provides ability to interact with servers Yes
resourcepacks Provides ability to interact with servers Yes
logs Provides ability to interact with logs Yes
fabric Provides ability to install and launch a fabric instance No
mods Provides ability to interact with mods No
shaderpacks Provides ability to interact with shaderpacks [WIP] No

Future Development

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