cobble_core/lib.rs
1//! # cobble-core
2//!
3//! [](https://crates.io/crates/cobble-core)
4//! [](https://docs.rs/cobble-core)
5//! [](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html)
6//! [](https://deps.rs/repo/gitlab/stefan99353/cobble-core)
7//! [](https://opensource.org/licenses/MIT)
8//! [](https://gitlab.com/stefan99353/cobble-core/-/pipelines)
9//!
10//! **A Rust library for managing, installing and launching Minecraft instances and more.**
11//!
12//! This crate provides the following features (some are locked behind [features](#crate-features)):
13//!
14//! - Complete installation of Minecraft from the official resources
15//! - Launching the game in a vanilla fashion (No additional Java classes)
16//! - [Authentication](https://docs.rs/cobble-core/*/cobble_core/profile/struct.CobbleProfile.html) with Microsoft/Minecraft servers for online play
17//! - Usage of [instances](https://docs.rs/cobble-core/*/cobble_core/instance/struct.Instance.html) to ease [installation](https://docs.rs/cobble-core/*/cobble_core/instance/struct.Instance.html#method.full_installation), [launching](https://docs.rs/cobble-core/*/cobble_core/instance/struct.Instance.html#method.launch) and managing multiple installs
18//! - Supports installing and launching with the fabric loader.
19//! - Managing of various objects used and created by Minecraft (Logs, Resourcepacks, Save Games, Screenshots, Servers, Mods, Shaderpacks)
20//!
21//! ## Usage
22//!
23//! Add this to your `Cargo.toml`:
24//!
25//! ```toml
26//! [dependencies]
27//! cobble-core = "1.2"
28//! ```
29//!
30//! To get started, see various examples of this crate [here](https://gitlab.com/stefan99353/cobble-core/-/tree/main/examples).
31//!
32//! This crate is based on the tokio async crate. Some functionality requires a tokio runtime.
33//!
34//! ## Stability
35//!
36//! This crate can't be tested using every Minecraft version there is (I sadly do not have time for that).
37//! This means I try to test this crate with some different versions.
38//! Most tests are for the newer releases of Minecraft.
39//!
40//! The following versions have been tested:
41//!
42//! - 1.19.2
43//!
44//! *If you have success using different Minecraft versions, you can open a Pull Request to add it.*
45//!
46//! ## Crate Features
47//!
48//! - `auth`: Provides authentication support for online mode.
49//! - `backup`: Provides functionality creating and loading backups. Currently implemented for `save-games`.
50//! - `serde`: Provides `Deserialize` and `Serialize` implementation for many structs.
51//! - `vanilla` (default): Includes features `log-files`, `resourcepacks`, `save-games`, `screenshots` and `servers`.
52//! - `log-files` (default): Provides functionality for reading and extracting log files.
53//! - `resourcepacks` (default): Provides functionality for interacting with resourcepacks.
54//! - `save-games` (default): Provides functionality for interacting with save games.
55//! - `screenshots` (default): Provides functionality for interacting with screenshots.
56//! - `servers` (default): Provides functionality for interacting with servers.
57//! - `modded`: Includes features `fabric`, `loader-mods` and `shaderpacks`.
58//! - `fabric`: Provides functionality for installing and launching with the fabric loader.
59//! - `loader-mods`: Provides functionality for interacting with mods.
60//! - `shaderpacks`: Provides functionality for interacting with shaderpacks.
61//!
62//! ## License
63//!
64//! `cobble-core` is distributed under the terms of the MIT license.
65//!
66//! See [LICENSE](https://gitlab.com/stefan99353/cobble-core/-/tree/main/LICENSE) for details.
67
68#![warn(missing_docs)]
69#![warn(
70 missing_debug_implementations,
71 clippy::print_stderr,
72 clippy::print_stdout
73)]
74#![cfg_attr(doc_cfg, feature(doc_cfg))]
75
76#[macro_use]
77extern crate tracing;
78
79pub(crate) mod consts;
80/// Error types
81pub mod error;
82/// Instance related functionality
83pub mod instance;
84/// Minecraft related functionality
85pub mod minecraft;
86/// Utitlities for authentication and online play
87#[cfg_attr(doc_cfg, doc(cfg(feature = "auth")))]
88#[cfg(feature = "auth")]
89pub mod profile;
90/// Utilities used in this crate
91pub mod utils;
92
93pub use instance::{Instance, InstanceBuilder};