Add collision shapes and fix latest version
Signed-off-by: trivernis <trivernis@protonmail.com>pull/6/head
parent
aa151453de
commit
c2b1363560
@ -0,0 +1,20 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
#[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))]
|
||||||
|
pub struct BlockCollisionShapes {
|
||||||
|
pub blocks: HashMap<String, CollisionShapeIds>,
|
||||||
|
pub shapes: HashMap<u16, CollisionShape>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
#[serde(
|
||||||
|
rename_all(deserialize = "camelCase", serialize = "snake_case"),
|
||||||
|
untagged
|
||||||
|
)]
|
||||||
|
pub enum CollisionShapeIds {
|
||||||
|
Value(u16),
|
||||||
|
Array(Vec<u16>),
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type CollisionShape = Vec<Vec<f32>>;
|
@ -1,7 +1,11 @@
|
|||||||
|
/// A type wrapping a minecraft version
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
#[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))]
|
#[serde(rename_all(deserialize = "camelCase", serialize = "snake_case"))]
|
||||||
pub struct Version {
|
pub struct Version {
|
||||||
|
/// API Version
|
||||||
pub version: i32,
|
pub version: i32,
|
||||||
|
/// The full minecraft version (e.g. (`1.8.1`)
|
||||||
pub minecraft_version: String,
|
pub minecraft_version: String,
|
||||||
|
/// The major version of this minecraft version (e.g. `1.8`)
|
||||||
pub major_version: String,
|
pub major_version: String,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue