14 stable releases

1.16.5 Mar 29, 2024
1.3.4 Oct 25, 2024
1.3.3 Sep 29, 2024
1.2.3 Jun 27, 2024
1.0.2 Dec 31, 2023

#62 in Games

Download history 31/week @ 2024-07-29 36/week @ 2024-09-16 366/week @ 2024-09-23 179/week @ 2024-09-30 12/week @ 2024-10-07 1/week @ 2024-10-14 121/week @ 2024-10-21 13/week @ 2024-10-28 4/week @ 2024-11-04

139 downloads per month

MIT/Apache

380KB
7.5K SLoC

minecraft_data

Supported version:
1.16.5 1.17.1 1.18.2 1.19.4 1.20.6

Usage

[dependencies]
minecraft_data = { version = "1.3", default-features = false, features = [
    "1_16",
] }
pub use minecraft_data::v1_16::*;
pub use minecraft_data::{decode_state, encode_state};

fn main() {
    assert_eq!(core::mem::size_of::<block_state>(), 2);
    assert_eq!(core::mem::size_of::<block>(), 2);
    let offset = oak_log::new().with_axis(prop_axis_x_y_z::z).encode() as raw_block_state;
    let state: block_state = block_state::new(block::oak_log.state_index() + offset);
    assert_eq!(
        oak_log::decode((state.id() - block::oak_log.state_index()) as _).axis(),
        prop_axis_x_y_z::z
    );
    let state: block_state = encode_state!(oak_log(oak_log::new().with_axis(prop_axis_x_y_z::z)));
    assert_eq!(decode_state!(oak_log(state)).axis(), prop_axis_x_y_z::z);
    assert_eq!(state.to_fluid().to_fluid(), fluid::empty);
}

Dependencies

~610KB
~12K SLoC