Skip to content

EightFactorial/facet-minecraft

Repository files navigation

facet-minecraft

Facet serialization/deserialization crates that support parts of the Minecraft protocol

Overview

Usage

use facet::Facet;

/// A player struct
#[derive(Facet)]
struct MyPlayer {
    name: String,
    #[facet(var)]
    health: u32,
}

// Create a `MyPlayer` instance
let player = MyPlayer {
    name: String::from("Steve"),
    health: 20,
};

// Serialize the player into the buffer
let mut buffer = Vec::new();
facet_minecraft::serialize(&player, &mut buffer).unwrap();

// The buffer now contains the data in the correct format
assert_eq!(buffer, vec![5u8, b'S', b't', b'e', b'v', b'e', 20u8]);

Todo List

  • Deserialization
  • Serialization
  • Protocol Assertions
    • Works in some cases but not all

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages