Expand description

cobble-core

crates.io Documentation MSRV Dependency Status License

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

Usage

Authentication

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

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

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

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

Re-exports

pub use error::CobbleResult;
pub use instance::Instance;
pub use instance::InstanceBuilder;
pub use minecraft::launch_options::LaunchOptions;
pub use minecraft::launch_options::LaunchOptionsBuilder;
pub use profile::Profile;

Modules

Contains URLs for authentication and minecraft resources.

Error for interaction with this crate.

Instance related structs and functions.

Minecraft related structs and functions.

Profile and authentication.