From 5abe7965ad5b515bbb6368bb4f67950bf3714dda Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 28 Feb 2024 12:07:30 +0100 Subject: [PATCH] Update to latest minecraft-data version and adjust the api accordingly --- .github/stale.yml | 17 ----------------- Cargo.toml | 4 ++-- minecraft-data | 2 +- src/api/mod.rs | 25 ++++++++----------------- src/api/tests/blocks.rs | 2 +- src/models/biome.rs | 4 ++-- 6 files changed, 14 insertions(+), 40 deletions(-) delete mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index c4b2554..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 14 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index f980511..c246a4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "minecraft-data-rs" -version = "0.7.2" +version = "0.8.0" authors = ["trivernis "] -edition = "2018" +edition = "2021" readme = "README.md" license = "MIT" description = "A wrapper for minecraft-data" diff --git a/minecraft-data b/minecraft-data index 971d49d..46b7839 160000 --- a/minecraft-data +++ b/minecraft-data @@ -1 +1 @@ -Subproject commit 971d49da8395def7f54be6393198ffdebb1d94e1 +Subproject commit 46b78398b6f351958e02fbd266424f0ee0ab138b diff --git a/src/api/mod.rs b/src/api/mod.rs index 2ab9838..9efb33c 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1,12 +1,11 @@ -use crate::api::biomes::Biomes; -use crate::api::blocks::Blocks; -use crate::api::enchantments::Enchantments; -use crate::api::entities::Entities; -use crate::api::foods::Foods; -use crate::api::items::Items; -use crate::api::loot::Loot; -use crate::api::recipes::Recipes; -use crate::api::versions::latest_stable; +pub use crate::api::biomes::Biomes; +pub use crate::api::blocks::Blocks; +pub use crate::api::enchantments::Enchantments; +pub use crate::api::entities::Entities; +pub use crate::api::foods::Foods; +pub use crate::api::items::Items; +pub use crate::api::loot::Loot; +pub use crate::api::recipes::Recipes; use crate::models::version::Version; use crate::DataResult; use std::sync::Arc; @@ -26,14 +25,6 @@ mod recipes; mod versions; use crate::api::protocol::Protocol; -pub use biomes::*; -pub use blocks::*; -pub use enchantments::*; -pub use entities::*; -pub use foods::*; -pub use items::*; -pub use loot::*; -pub use recipes::*; pub use versions::*; /// A type wrapping access to all the metadata diff --git a/src/api/tests/blocks.rs b/src/api/tests/blocks.rs index 9e13a4c..df9a2fe 100644 --- a/src/api/tests/blocks.rs +++ b/src/api/tests/blocks.rs @@ -31,7 +31,7 @@ pub fn test_blocks_by_name() { let by_name = api.blocks.blocks_by_name().unwrap(); assert!(by_name.get("dirt").is_some()); assert!(by_name.get("stone").is_some()); - assert_eq!(by_name.get("grass").unwrap().stack_size, 64) + assert_eq!(by_name.get("grass_block").unwrap().stack_size, 64) } } diff --git a/src/models/biome.rs b/src/models/biome.rs index d4019c1..4ef3380 100644 --- a/src/models/biome.rs +++ b/src/models/biome.rs @@ -5,10 +5,10 @@ pub struct Biome { pub name: String, pub category: String, pub temperature: f32, - pub precipitation: String, + pub precipitation: Option, pub depth: Option, pub dimension: String, pub display_name: String, pub color: u32, - pub rainfall: f32, + pub rainfall: Option, }