brarchive 0.1.1

Library for Bedrock Archives in Rust
Documentation
  • Coverage
  • 0%
    0 out of 10 items documented0 out of 3 items with examples
  • Size
  • Source code size: 266.02 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.62 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • theaddonn/brarchive-rs
    18 2 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • theaddonn

brarchive-rs

Crates.io Version Crates.io Total Downloads Crates.io License

Library for Bedrock Archives in Rust

So Mojang decided we don't have enough archive formats already and now invented their own for some reason, the .brarchive format.

It is basically nothing more than a simple uncompressed text archive format to bundle multiple files into one.

This library implements the format and includes a CLI to encode and decode directories/archives.

Library Usage Examples

One can easily decode/deserialize archives using the library:

fn main() {
    let bytes = include_bytes!("your_archive.brarchive");
    
    let archive = brarchive::deserialize(&bytes).unwrap();

    println!("{:#?}", archive);
}

One can also easily encode/serialize archives using the library:

use std::collections::BTreeMap;

fn main() {
    // You can use any data-structure such as HashMap, BTreeMap, Vec
    // Anything that implements IntoIterator<Item = (String, String)>
    let archive = BTreeMap::from([
        ("entry_name".to_string(), "entry_content".to_string())
    ]);

    let bytes = brarchive::serialize(&archive).unwrap();

    println!("{:?}", bytes);
}

CLI Usage Examples

The integrated brarchive-cli allows you to easily encode and decode archives with the command line.

How to encode a folder:

brarchive-cli encode "path/to/input/folder" "path/to/output/file"

How to decode an archive:

brarchive-cli decode "path/to/input/file" "path/to/output/folder

You can also get help via the help command:

brarchive-cli help