#minecraft #games #instances

cobble-core

Library for managing, installing and launching Minecraft instances

5 unstable releases

Uses new Rust 2021

0.3.0 Jun 11, 2022
0.2.3 Jun 9, 2022
0.2.1 Jun 8, 2022
0.2.0 Jun 7, 2022
0.1.1 Jun 2, 2022

#31 in Games

Download history 57/week @ 2022-06-02 59/week @ 2022-06-09 19/week @ 2022-06-16

135 downloads per month

MIT license

130KB
2.5K SLoC

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
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

Dependencies

~10–20MB
~409K SLoC