From 7350fba3b0e780f6184b9ca57408f7bdabc1c529 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Wed, 5 Aug 2026 12:23:44 +0200 Subject: [PATCH] chore: chunk loading/saving move from serde to manual should be faster now --- Cargo.lock | 9 +- Cargo.toml | 2 +- pumpkin-codegen/Cargo.lock | 51 +- pumpkin-codegen/Cargo.toml | 2 +- pumpkin-codegen/src/bedrock_creative.rs | 99 +- pumpkin-codegen/src/block.rs | 2 +- pumpkin-codegen/src/damage_type.rs | 8 +- pumpkin-codegen/src/data_component.rs | 2 +- pumpkin-codegen/src/fluid.rs | 6 +- pumpkin-codegen/src/item.rs | 25 +- pumpkin-codegen/src/jukebox_song.rs | 2 +- pumpkin-codegen/src/registry.rs | 43 +- pumpkin-data/src/generated/block.rs | 16758 ++++++++-------- .../src/generated/chunk_gen_settings.rs | 12 +- pumpkin-data/src/generated/chunk_view_lut.rs | 2 +- pumpkin-data/src/generated/damage_type.rs | 8 +- pumpkin-data/src/generated/data_component.rs | 2 +- pumpkin-data/src/generated/jukebox_song.rs | 2 +- pumpkin-nbt/Cargo.toml | 2 - pumpkin-nbt/benches/nbt.rs | 70 +- pumpkin-nbt/fuzz/Cargo.toml | 29 - .../fuzz_targets/deserialize_serde_bedrock.rs | 26 - .../fuzz_targets/deserialize_serde_java.rs | 29 - .../fuzz/fuzz_targets/roundtrip_bedrock.rs | 52 - .../fuzz/fuzz_targets/roundtrip_java.rs | 52 - pumpkin-nbt/src/compound.rs | 47 +- pumpkin-nbt/src/deserializer.rs | 357 +- pumpkin-nbt/src/lib.rs | 850 +- pumpkin-nbt/src/nbt_compress.rs | 173 +- pumpkin-nbt/src/serializer.rs | 475 +- pumpkin-nbt/src/tag.rs | 125 +- pumpkin-protocol/src/codec/data_component.rs | 2 +- .../src/java/client/play/chunk_data.rs | 23 +- .../src/java/client/play/update_objectives.rs | 9 +- pumpkin-util/src/random/mod.rs | 10 + pumpkin-util/src/text/mod.rs | 143 +- pumpkin-world/src/chunk/format/mod.rs | 130 +- pumpkin-world/src/chunk/format/pump.rs | 80 +- pumpkin-world/src/chunk/mod.rs | 18 +- .../structure/template/structure_template.rs | 31 +- pumpkin-world/src/level.rs | 34 +- pumpkin-world/src/poi/mod.rs | 74 +- pumpkin-world/src/tick/mod.rs | 54 +- pumpkin-world/src/world_info/anvil.rs | 140 +- pumpkin-world/src/world_info/data_files.rs | 77 +- pumpkin-world/src/world_info/mod.rs | 47 +- pumpkin/src/command/args/resource/item.rs | 4 +- pumpkin/src/entity/living.rs | 6 +- pumpkin/src/net/java/config.rs | 4 +- .../wasm/wasm_host/wit/v0_1/commands/mod.rs | 2 +- pumpkin/src/world/mod.rs | 12 +- 51 files changed, 9073 insertions(+), 11149 deletions(-) delete mode 100644 pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_bedrock.rs delete mode 100644 pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_java.rs delete mode 100644 pumpkin-nbt/fuzz/fuzz_targets/roundtrip_bedrock.rs delete mode 100644 pumpkin-nbt/fuzz/fuzz_targets/roundtrip_java.rs diff --git a/Cargo.lock b/Cargo.lock index 7228c5193..b13aa469d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -192,9 +192,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25655df2c3cdd83c5e5b293b88acd880332b2ddadd7c30ac43144fdc0033da9" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" [[package]] name = "base64ct" @@ -2615,7 +2615,7 @@ name = "pumpkin" version = "0.1.0-dev+26.2" dependencies = [ "arc-swap", - "base64 0.23.0", + "base64 0.23.1", "bitflags", "bytes", "colored", @@ -2749,7 +2749,6 @@ dependencies = [ "criterion", "flate2", "pumpkin-codecs", - "serde", "tempfile", "thiserror 2.0.19", "tracing", @@ -2795,7 +2794,7 @@ dependencies = [ name = "pumpkin-util" version = "0.1.0-dev+26.2" dependencies = [ - "base64 0.23.0", + "base64 0.23.1", "bytes", "colored", "crypto-bigint", diff --git a/Cargo.toml b/Cargo.toml index 39ec2c48f..9df9e40e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,7 +119,7 @@ tempfile = { version = "3.27.0", default-features = false } proc-macro-error2 = { version = "2", default-features = false } aes = { version = "0.9", default-features = false } async-compression = { version = "0.4.43", default-features = false } -base64 = { version = "0.23.0", default-features = false, features = ["std"] } +base64 = { version = "0.23.1", default-features = false, features = ["std"] } bitflags = { version = "2.13.1", default-features = false, features = ["std"] } cesu8 = { version = "1.1", default-features = false } cfb8 = { version = "0.9", default-features = false } diff --git a/pumpkin-codegen/Cargo.lock b/pumpkin-codegen/Cargo.lock index 4aeb05697..49e6512ba 100644 --- a/pumpkin-codegen/Cargo.lock +++ b/pumpkin-codegen/Cargo.lock @@ -10,9 +10,9 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "anyhow" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "autocfg" @@ -34,9 +34,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25655df2c3cdd83c5e5b293b88acd880332b2ddadd7c30ac43144fdc0033da9" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" [[package]] name = "base64ct" @@ -584,7 +584,7 @@ checksum = "e4e98dc3b890f6c23a0f9d3d491a2823d0dea0fa656302a13dd225fa924112a8" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -749,9 +749,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] @@ -781,7 +781,7 @@ dependencies = [ "serde_json", "serde_json5", "serde_repr", - "syn 3.0.2", + "syn 3.0.3", "wit-encoder", ] @@ -793,7 +793,6 @@ dependencies = [ "cesu8", "flate2", "pumpkin-codecs", - "serde", "thiserror", "tracing", "uuid", @@ -803,7 +802,7 @@ dependencies = [ name = "pumpkin-util" version = "0.1.0-dev+26.2" dependencies = [ - "base64 0.23.0", + "base64 0.23.1", "bytes", "colored", "crypto-bigint", @@ -820,7 +819,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.11.0", - "syn 3.0.2", + "syn 3.0.3", "thiserror", "tokio", "ureq", @@ -829,9 +828,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -1002,7 +1001,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.2", + "syn 3.0.3", ] [[package]] @@ -1124,9 +1123,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ "proc-macro2", "quote", @@ -1381,9 +1380,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.254.0" +version = "0.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27" +checksum = "e8e329ef4b5d46e73b91d3ac6924417cad55a8cbbf869c199283383427c3320b" dependencies = [ "bitflags", "indexmap", @@ -1559,15 +1558,15 @@ dependencies = [ [[package]] name = "wit-encoder" -version = "0.254.0" +version = "0.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c565f1f3dcf3b659d6c15052739e35937227590d7dded3d3ce274f7bd9c34d93" +checksum = "7cebd2d14c3296dada506c67c1ee5c9440811a2fe88a83367a606ccbd30ebfde" dependencies = [ "id-arena", "pretty_assertions", "semver", "serde", - "wit-parser 0.254.0", + "wit-parser 0.255.0", ] [[package]] @@ -1590,9 +1589,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.254.0" +version = "0.255.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1655131e4f7d3f0cb141f6eca71315ca40eff0f3d4de7cff0a82bacedd8c89b4" +checksum = "ab5f6371fc71f15730b756c1dea3562a67adab1a7e519c4ca010173d883695bb" dependencies = [ "anyhow", "hashbrown 0.17.1", @@ -1604,7 +1603,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-ident", - "wasmparser 0.254.0", + "wasmparser 0.255.0", ] [[package]] @@ -1632,6 +1631,6 @@ checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/pumpkin-codegen/Cargo.toml b/pumpkin-codegen/Cargo.toml index c08c0199f..9fa882d89 100644 --- a/pumpkin-codegen/Cargo.toml +++ b/pumpkin-codegen/Cargo.toml @@ -16,7 +16,7 @@ serde_repr = { version = "0.1" } serde_json = { version = "1.0", features = ["preserve_order"] } serde_json5 = "0.2" -wit-encoder = "0.254.0" +wit-encoder = "0.255.0" semver = "1.0" rayon = "1.12.0" diff --git a/pumpkin-codegen/src/bedrock_creative.rs b/pumpkin-codegen/src/bedrock_creative.rs index 3fd90ed7a..f5f91043b 100644 --- a/pumpkin-codegen/src/bedrock_creative.rs +++ b/pumpkin-codegen/src/bedrock_creative.rs @@ -45,67 +45,60 @@ pub fn build() -> TokenStream { let nbt_bytes = fs::read(nbt_path).expect("Failed to read bedrock/creative_items.nbt"); let mut cursor = Cursor::new(nbt_bytes); - #[derive(serde::Deserialize)] - struct CreativeGroupEntry { - category: i32, - name: String, - icon: Option, - } - - #[derive(serde::Deserialize)] - struct CreativeItemEntry { - name: String, - meta: Option, - group_index: Option, - } - - #[derive(serde::Deserialize)] - struct CreativeData { - groups: Vec, - items: Vec, - } - - let data: CreativeData = pumpkin_nbt::deserializer::from_bytes_bedrock(&mut cursor) - .expect("Failed to deserialize creative_items.nbt"); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperBedrock::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read(&mut reader).expect("Failed to read creative_items.nbt"); let mut group_tokens = Vec::new(); - for g in &data.groups { - let category = g.category; - let name = &g.name; - let mut icon_item_id = 0i16; - let mut icon_item_aux_value = 0u32; + if let Some(pumpkin_nbt::tag::NbtTag::List(groups_list)) = nbt.get("groups") { + for g_tag in groups_list { + if let pumpkin_nbt::tag::NbtTag::Compound(g) = g_tag { + let category = g.get_int("category").unwrap_or(0); + let name = g.get_string("name").unwrap_or_default().to_string(); + let mut icon_item_id = 0i16; + let mut icon_item_aux_value = 0u32; - if let Some(ref icon) = g.icon - && let Some(&id) = bedrock_items_map.get(icon.name.as_str()) - { - icon_item_id = id; - icon_item_aux_value = icon.meta.unwrap_or(0) as u32; - } + if let Some(pumpkin_nbt::tag::NbtTag::Compound(icon)) = g.get("icon") { + if let Some(icon_name) = icon.get_string("name") { + if let Some(&id) = bedrock_items_map.get(icon_name) { + icon_item_id = id; + icon_item_aux_value = icon.get_short("meta").unwrap_or(0) as u32; + } + } + } - group_tokens.push(quote! { - CreativeGroup { - category: #category, - name: #name, - icon_item_id: #icon_item_id, - icon_item_aux_value: #icon_item_aux_value, + group_tokens.push(quote! { + CreativeGroup { + category: #category, + name: #name, + icon_item_id: #icon_item_id, + icon_item_aux_value: #icon_item_aux_value, + } + }); } - }); + } } - // 4. Build entry definitions TokenStream let mut entry_tokens = Vec::new(); - for item in &data.items { - if let Some(&id) = bedrock_items_map.get(item.name.as_str()) { - let item_aux_value = item.meta.unwrap_or(0) as u32; - let group_index = item.group_index.unwrap_or(0) as u32; + if let Some(pumpkin_nbt::tag::NbtTag::List(items_list)) = nbt.get("items") { + for item_tag in items_list { + if let pumpkin_nbt::tag::NbtTag::Compound(item) = item_tag { + if let Some(item_name) = item.get_string("name") { + if let Some(&id) = bedrock_items_map.get(item_name) { + let item_aux_value = item.get_short("meta").unwrap_or(0) as u32; + let group_index = item.get_int("group_index").unwrap_or(0) as u32; - entry_tokens.push(quote! { - CreativeEntry { - item_id: #id, - item_aux_value: #item_aux_value, - group_index: #group_index, + entry_tokens.push(quote! { + CreativeEntry { + item_id: #id, + item_aux_value: #item_aux_value, + group_index: #group_index, + } + }); + } } - }); + } } } @@ -113,7 +106,7 @@ pub fn build() -> TokenStream { let entries_len = entry_tokens.len(); quote! { - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] pub struct CreativeGroup { pub category: i32, pub name: &'static str, @@ -121,7 +114,7 @@ pub fn build() -> TokenStream { pub icon_item_aux_value: u32, } - #[derive(Clone, Copy, Debug)] + #[derive(Clone, Copy)] pub struct CreativeEntry { pub item_id: i16, pub item_aux_value: u32, diff --git a/pumpkin-codegen/src/block.rs b/pumpkin-codegen/src/block.rs index cd8b6e1cb..e23664aad 100644 --- a/pumpkin-codegen/src/block.rs +++ b/pumpkin-codegen/src/block.rs @@ -366,7 +366,7 @@ impl ToTokens for BlockPropertyStruct { }; tokens.extend(quote! { - #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub struct #name { #(#fields),* } diff --git a/pumpkin-codegen/src/damage_type.rs b/pumpkin-codegen/src/damage_type.rs index 907bdaae5..f86df210a 100644 --- a/pumpkin-codegen/src/damage_type.rs +++ b/pumpkin-codegen/src/damage_type.rs @@ -115,7 +115,7 @@ pub fn build() -> TokenStream { quote! { use crate::tag::{RegistryKey, Tag, Taggable}; - #[derive(Clone, Copy, Debug, PartialEq)] + #[derive(Clone, Copy, PartialEq)] pub struct DamageType { pub death_message_type: DeathMessageType, pub exhaustion: f32, @@ -125,14 +125,14 @@ pub fn build() -> TokenStream { pub id: u8, } - #[derive(Clone, Copy, Debug, PartialEq)] + #[derive(Clone, Copy, PartialEq)] pub enum DeathMessageType { Default, FallVariants, IntentionalGameDesign, } - #[derive(Clone, Copy, Debug, PartialEq)] + #[derive(Clone, Copy, PartialEq)] pub enum DamageEffects { Hurt, Thorns, @@ -142,7 +142,7 @@ pub fn build() -> TokenStream { Freezing, } - #[derive(Clone, Copy, Debug, PartialEq)] + #[derive(Clone, Copy, PartialEq)] pub enum DamageScaling { Never, WhenCausedByLivingNonPlayer, diff --git a/pumpkin-codegen/src/data_component.rs b/pumpkin-codegen/src/data_component.rs index 82d44a023..f9b90aa62 100644 --- a/pumpkin-codegen/src/data_component.rs +++ b/pumpkin-codegen/src/data_component.rs @@ -48,7 +48,7 @@ pub fn build() -> TokenStream { quote! { use crate::data_component_impl::*; - #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] + #[derive(Copy, Clone, Hash, PartialEq, Eq)] #[repr(u8)] pub enum DataComponent { #enum_variants diff --git a/pumpkin-codegen/src/fluid.rs b/pumpkin-codegen/src/fluid.rs index 0a82d9b7e..1f1c0972a 100644 --- a/pumpkin-codegen/src/fluid.rs +++ b/pumpkin-codegen/src/fluid.rs @@ -109,7 +109,7 @@ impl ToTokens for PropertyStruct { }); tokens.extend(quote! { - #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub enum #name { #(#ident_values),* } @@ -208,7 +208,7 @@ impl ToTokens for FluidPropertyStruct { }); tokens.extend(quote! { - #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub struct #name { #(pub #values),* } @@ -242,7 +242,7 @@ impl ToTokens for FluidPropertyStruct { fn to_state_id(&self, fluid: &Fluid) -> BlockStateId { if ![#(#fluid_names),*].contains(&fluid.name) { - panic!("{} is not a valid fluid for {}", &fluid.name, #struct_name); + panic!("{} is not a valid fluid for {}", fluid.name, #struct_name); } let prop_index = self.to_index(); diff --git a/pumpkin-codegen/src/item.rs b/pumpkin-codegen/src/item.rs index db80431ca..50ffa6215 100644 --- a/pumpkin-codegen/src/item.rs +++ b/pumpkin-codegen/src/item.rs @@ -1077,12 +1077,6 @@ pub enum Operation { AddMultipliedTotal, } -#[derive(Deserialize, Debug)] -#[serde(deny_unknown_fields)] -struct BedrockItemComponents { - components: Option, -} - #[derive(Deserialize_repr, Debug)] #[repr(i32)] enum BedrockItemVersion { @@ -1156,12 +1150,21 @@ pub fn build() -> TokenStream { .into_keys() .collect::>(); - let be_item_components: BTreeMap = { + let be_item_components: BTreeMap> = { let data = fs::read("../assets/bedrock/item_components.nbt").unwrap(); - let mut cursor = Cursor::new(data); - pumpkin_nbt::nbt_compress::from_gzip_bytes(&mut cursor) - .expect("Failed to parse bedrock/item_components.nbt") + let nbt = pumpkin_nbt::nbt_compress::read_gzip_compound_tag(&mut cursor) + .expect("Failed to parse bedrock/item_components.nbt"); + nbt.child_tags + .into_iter() + .map(|(k, v)| { + let comp = match v { + pumpkin_nbt::tag::NbtTag::Compound(c) => Some(c), + _ => None, + }; + (k.into_string(), comp) + }) + .collect() }; let be_runtime_item_states: Vec = serde_json::from_str( @@ -1349,7 +1352,7 @@ pub fn build() -> TokenStream { let mut bedrock_item_definitions = Vec::new(); for item in be_runtime_item_states { - let components = &be_item_components.get(&item.name).unwrap().components; + let components = be_item_components.get(&item.name).cloned().flatten(); bedrock_item_definitions.push(BedrockItem { id: item.id, diff --git a/pumpkin-codegen/src/jukebox_song.rs b/pumpkin-codegen/src/jukebox_song.rs index de61239ce..db8d2e168 100644 --- a/pumpkin-codegen/src/jukebox_song.rs +++ b/pumpkin-codegen/src/jukebox_song.rs @@ -98,7 +98,7 @@ pub fn build() -> TokenStream { .collect::(); quote! { - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] + #[derive(Clone, Copy, PartialEq, Eq, Hash)] #[repr(u32)] pub enum JukeboxSong { #variants diff --git a/pumpkin-codegen/src/registry.rs b/pumpkin-codegen/src/registry.rs index 8d35f58fc..426d9f639 100644 --- a/pumpkin-codegen/src/registry.rs +++ b/pumpkin-codegen/src/registry.rs @@ -69,8 +69,47 @@ pub(crate) fn build() -> TokenStream { let entry_tokens: Vec = entries .iter() .map(|(entry_name, entry_data)| { - let mut bytes = Vec::new(); - pumpkin_nbt::serializer::to_bytes_unnamed(entry_data, &mut bytes).unwrap(); + fn json_to_nbt_tag(v: &Value) -> pumpkin_nbt::tag::NbtTag { + match v { + Value::Null => pumpkin_nbt::tag::NbtTag::End, + Value::Bool(b) => { + pumpkin_nbt::tag::NbtTag::Byte(if *b { 1 } else { 0 }) + } + Value::Number(num) => { + if let Some(i) = num.as_i64() { + if i >= i32::MIN as i64 && i <= i32::MAX as i64 { + pumpkin_nbt::tag::NbtTag::Int(i as i32) + } else { + pumpkin_nbt::tag::NbtTag::Long(i) + } + } else if let Some(f) = num.as_f64() { + pumpkin_nbt::tag::NbtTag::Double(f) + } else { + pumpkin_nbt::tag::NbtTag::Int(0) + } + } + Value::String(s) => { + pumpkin_nbt::tag::NbtTag::String(s.clone().into()) + } + Value::Array(arr) => pumpkin_nbt::tag::NbtTag::List( + arr.iter().map(json_to_nbt_tag).collect(), + ), + Value::Object(obj) => { + let mut compound = pumpkin_nbt::compound::NbtCompound::new(); + for (k, val) in obj { + compound.put(k, json_to_nbt_tag(val)); + } + pumpkin_nbt::tag::NbtTag::Compound(compound) + } + } + } + + let nbt_tag = json_to_nbt_tag(entry_data); + let bytes = if let pumpkin_nbt::tag::NbtTag::Compound(compound) = nbt_tag { + pumpkin_nbt::Nbt::from(compound).write_unnamed() + } else { + Vec::new().into() + }; let byte_literal = Literal::byte_string(&bytes); quote! { diff --git a/pumpkin-data/src/generated/block.rs b/pumpkin-data/src/generated/block.rs index f6c2fcd17..02f010421 100644 --- a/pumpkin-data/src/generated/block.rs +++ b/pumpkin-data/src/generated/block.rs @@ -568498,441 +568498,6 @@ impl Block { #[doc = r" Get the properties of the block."] pub fn properties(&self, state_id: BlockStateId) -> Option> { Some(match self.id.as_u16() { - 369 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::OAK_FENCE_GATE, - )), - 628 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::SPRUCE_FENCE_GATE, - )), - 629 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::BIRCH_FENCE_GATE, - )), - 630 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::JUNGLE_FENCE_GATE, - )), - 631 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::ACACIA_FENCE_GATE, - )), - 632 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::CHERRY_FENCE_GATE, - )), - 633 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::DARK_OAK_FENCE_GATE, - )), - 634 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::PALE_OAK_FENCE_GATE, - )), - 635 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::MANGROVE_FENCE_GATE, - )), - 636 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::BAMBOO_FENCE_GATE, - )), - 893 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::CRIMSON_FENCE_GATE, - )), - 894 => Box::new(OakFenceGateLikeProperties::from_state_id( - state_id, - &Block::WARPED_FENCE_GATE, - )), - 298 => Box::new(CakeLikeProperties::from_state_id(state_id, &Block::CAKE)), - 283 => Box::new(JukeboxLikeProperties::from_state_id( - state_id, - &Block::JUKEBOX, - )), - 295 => Box::new(NetherPortalLikeProperties::from_state_id( - state_id, - &Block::NETHER_PORTAL, - )), - 1189 => Box::new(PaleMossCarpetLikeProperties::from_state_id( - state_id, - &Block::PALE_MOSS_CARPET, - )), - 379 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::RESIN_BRICK_WALL, - )), - 409 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::COBBLESTONE_WALL, - )), - 410 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::MOSSY_COBBLESTONE_WALL, - )), - 824 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::BRICK_WALL, - )), - 825 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::PRISMARINE_WALL, - )), - 826 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::RED_SANDSTONE_WALL, - )), - 827 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::MOSSY_STONE_BRICK_WALL, - )), - 828 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::GRANITE_WALL, - )), - 829 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::STONE_BRICK_WALL, - )), - 830 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::MUD_BRICK_WALL, - )), - 831 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::NETHER_BRICK_WALL, - )), - 832 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::ANDESITE_WALL, - )), - 833 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::RED_NETHER_BRICK_WALL, - )), - 834 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::SANDSTONE_WALL, - )), - 835 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::END_STONE_BRICK_WALL, - )), - 836 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::DIORITE_WALL, - )), - 926 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::BLACKSTONE_WALL, - )), - 934 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_BLACKSTONE_BRICK_WALL, - )), - 940 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_BLACKSTONE_WALL, - )), - 987 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::TUFF_WALL, - )), - 991 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_TUFF_WALL, - )), - 996 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::TUFF_BRICK_WALL, - )), - 1002 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::SULFUR_WALL, - )), - 1006 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_SULFUR_WALL, - )), - 1010 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::SULFUR_BRICK_WALL, - )), - 1015 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::CINNABAR_WALL, - )), - 1019 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_CINNABAR_WALL, - )), - 1023 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::CINNABAR_BRICK_WALL, - )), - 1155 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::COBBLED_DEEPSLATE_WALL, - )), - 1159 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::POLISHED_DEEPSLATE_WALL, - )), - 1163 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::DEEPSLATE_TILE_WALL, - )), - 1167 => Box::new(ResinBrickWallLikeProperties::from_state_id( - state_id, - &Block::DEEPSLATE_BRICK_WALL, - )), - 747 => Box::new(DriedGhastLikeProperties::from_state_id( - state_id, - &Block::DRIED_GHAST, - )), - 156 => Box::new(MovingPistonLikeProperties::from_state_id( - state_id, - &Block::MOVING_PISTON, - )), - 139 => Box::new(PistonHeadLikeProperties::from_state_id( - state_id, - &Block::PISTON_HEAD, - )), - 1029 => Box::new(CalibratedSculkSensorLikeProperties::from_state_id( - state_id, - &Block::CALIBRATED_SCULK_SENSOR, - )), - 1028 => Box::new(SculkSensorLikeProperties::from_state_id( - state_id, - &Block::SCULK_SENSOR, - )), - 128 => Box::new(StickyPistonLikeProperties::from_state_id( - state_id, - &Block::STICKY_PISTON, - )), - 138 => Box::new(StickyPistonLikeProperties::from_state_id( - state_id, - &Block::PISTON, - )), - 202 => Box::new(RedstoneWireLikeProperties::from_state_id( - state_id, - &Block::REDSTONE_WIRE, - )), - 179 => Box::new(ChiseledBookshelfLikeProperties::from_state_id( - state_id, - &Block::CHISELED_BOOKSHELF, - )), - 905 => Box::new(StructureBlockLikeProperties::from_state_id( - state_id, - &Block::STRUCTURE_BLOCK, - )), - 657 => Box::new(ChorusFlowerLikeProperties::from_state_id( - state_id, - &Block::CHORUS_FLOWER, - )), - 279 => Box::new(CactusLikeProperties::from_state_id( - state_id, - &Block::CACTUS, - )), - 282 => Box::new(CactusLikeProperties::from_state_id( - state_id, - &Block::SUGAR_CANE, - )), - 196 => Box::new(FireLikeProperties::from_state_id(state_id, &Block::FIRE)), - 477 => Box::new(HopperLikeProperties::from_state_id( - state_id, - &Block::HOPPER, - )), - 1185 => Box::new(TrialSpawnerLikeProperties::from_state_id( - state_id, - &Block::TRIAL_SPAWNER, - )), - 837 => Box::new(ScaffoldingLikeProperties::from_state_id( - state_id, - &Block::SCAFFOLDING, - )), - 473 => Box::new(ComparatorLikeProperties::from_state_id( - state_id, - &Block::COMPARATOR, - )), - 195 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::WALL_TORCH, - )), - 291 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::SOUL_WALL_TORCH, - )), - 293 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::COPPER_WALL_TORCH, - )), - 296 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::CARVED_PUMPKIN, - )), - 297 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::JACK_O_LANTERN, - )), - 362 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::ATTACHED_PUMPKIN_STEM, - )), - 363 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::ATTACHED_MELON_STEM, - )), - 467 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::ANVIL, - )), - 468 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::CHIPPED_ANVIL, - )), - 469 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::DAMAGED_ANVIL, - )), - 579 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::WHITE_WALL_BANNER, - )), - 580 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::ORANGE_WALL_BANNER, - )), - 581 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::MAGENTA_WALL_BANNER, - )), - 582 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIGHT_BLUE_WALL_BANNER, - )), - 583 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::YELLOW_WALL_BANNER, - )), - 584 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIME_WALL_BANNER, - )), - 585 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::PINK_WALL_BANNER, - )), - 586 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::GRAY_WALL_BANNER, - )), - 587 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIGHT_GRAY_WALL_BANNER, - )), - 588 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::CYAN_WALL_BANNER, - )), - 589 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::PURPLE_WALL_BANNER, - )), - 590 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BLUE_WALL_BANNER, - )), - 591 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BROWN_WALL_BANNER, - )), - 592 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::GREEN_WALL_BANNER, - )), - 593 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::RED_WALL_BANNER, - )), - 594 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BLACK_WALL_BANNER, - )), - 694 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::WHITE_GLAZED_TERRACOTTA, - )), - 695 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::ORANGE_GLAZED_TERRACOTTA, - )), - 696 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::MAGENTA_GLAZED_TERRACOTTA, - )), - 697 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIGHT_BLUE_GLAZED_TERRACOTTA, - )), - 698 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::YELLOW_GLAZED_TERRACOTTA, - )), - 699 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIME_GLAZED_TERRACOTTA, - )), - 700 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::PINK_GLAZED_TERRACOTTA, - )), - 701 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::GRAY_GLAZED_TERRACOTTA, - )), - 702 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LIGHT_GRAY_GLAZED_TERRACOTTA, - )), - 703 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::CYAN_GLAZED_TERRACOTTA, - )), - 704 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::PURPLE_GLAZED_TERRACOTTA, - )), - 705 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BLUE_GLAZED_TERRACOTTA, - )), - 706 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BROWN_GLAZED_TERRACOTTA, - )), - 707 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::GREEN_GLAZED_TERRACOTTA, - )), - 708 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::RED_GLAZED_TERRACOTTA, - )), - 709 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::BLACK_GLAZED_TERRACOTTA, - )), - 838 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::LOOM, - )), - 847 => Box::new(WallTorchLikeProperties::from_state_id( - state_id, - &Block::STONECUTTER, - )), - 1186 => Box::new(VaultLikeProperties::from_state_id(state_id, &Block::VAULT)), 844 => Box::new(GrindstoneLikeProperties::from_state_id( state_id, &Block::GRINDSTONE, @@ -568994,93 +568559,346 @@ impl Block { state_id, &Block::POLISHED_BLACKSTONE_BUTTON, )), - 299 => Box::new(RepeaterLikeProperties::from_state_id( + 369 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::REPEATER, + &Block::OAK_FENCE_GATE, )), - 220 => Box::new(OakDoorLikeProperties::from_state_id( + 628 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::OAK_DOOR, + &Block::SPRUCE_FENCE_GATE, )), - 260 => Box::new(OakDoorLikeProperties::from_state_id( + 629 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::IRON_DOOR, + &Block::BIRCH_FENCE_GATE, )), - 646 => Box::new(OakDoorLikeProperties::from_state_id( + 630 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::SPRUCE_DOOR, + &Block::JUNGLE_FENCE_GATE, )), - 647 => Box::new(OakDoorLikeProperties::from_state_id( + 631 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::BIRCH_DOOR, + &Block::ACACIA_FENCE_GATE, )), - 648 => Box::new(OakDoorLikeProperties::from_state_id( + 632 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::JUNGLE_DOOR, + &Block::CHERRY_FENCE_GATE, )), - 649 => Box::new(OakDoorLikeProperties::from_state_id( + 633 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::ACACIA_DOOR, + &Block::DARK_OAK_FENCE_GATE, )), - 650 => Box::new(OakDoorLikeProperties::from_state_id( + 634 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::CHERRY_DOOR, + &Block::PALE_OAK_FENCE_GATE, )), - 651 => Box::new(OakDoorLikeProperties::from_state_id( + 635 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::DARK_OAK_DOOR, + &Block::MANGROVE_FENCE_GATE, )), - 652 => Box::new(OakDoorLikeProperties::from_state_id( + 636 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::PALE_OAK_DOOR, + &Block::BAMBOO_FENCE_GATE, )), - 653 => Box::new(OakDoorLikeProperties::from_state_id( + 893 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::MANGROVE_DOOR, + &Block::CRIMSON_FENCE_GATE, )), - 654 => Box::new(OakDoorLikeProperties::from_state_id( + 894 => Box::new(OakFenceGateLikeProperties::from_state_id( state_id, - &Block::BAMBOO_DOOR, + &Block::WARPED_FENCE_GATE, )), - 899 => Box::new(OakDoorLikeProperties::from_state_id( + 20 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::CRIMSON_DOOR, + &Block::PALE_OAK_WOOD, )), - 900 => Box::new(OakDoorLikeProperties::from_state_id( + 49 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WARPED_DOOR, + &Block::OAK_LOG, )), - 1076 => Box::new(OakDoorLikeProperties::from_state_id( + 50 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::COPPER_DOOR, + &Block::SPRUCE_LOG, )), - 1077 => Box::new(OakDoorLikeProperties::from_state_id( + 51 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::EXPOSED_COPPER_DOOR, + &Block::BIRCH_LOG, )), - 1078 => Box::new(OakDoorLikeProperties::from_state_id( + 52 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WEATHERED_COPPER_DOOR, + &Block::JUNGLE_LOG, )), - 1079 => Box::new(OakDoorLikeProperties::from_state_id( + 53 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::OXIDIZED_COPPER_DOOR, + &Block::ACACIA_LOG, )), - 1080 => Box::new(OakDoorLikeProperties::from_state_id( + 54 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WAXED_COPPER_DOOR, + &Block::CHERRY_LOG, )), - 1081 => Box::new(OakDoorLikeProperties::from_state_id( + 55 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WAXED_EXPOSED_COPPER_DOOR, + &Block::DARK_OAK_LOG, )), - 1082 => Box::new(OakDoorLikeProperties::from_state_id( + 56 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WAXED_WEATHERED_COPPER_DOOR, + &Block::PALE_OAK_LOG, )), - 1083 => Box::new(OakDoorLikeProperties::from_state_id( + 57 => Box::new(PaleOakWoodLikeProperties::from_state_id( state_id, - &Block::WAXED_OXIDIZED_COPPER_DOOR, + &Block::MANGROVE_LOG, + )), + 59 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::MUDDY_MANGROVE_ROOTS, + )), + 60 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::BAMBOO_BLOCK, + )), + 61 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_SPRUCE_LOG, + )), + 62 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_BIRCH_LOG, + )), + 63 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_JUNGLE_LOG, + )), + 64 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_ACACIA_LOG, + )), + 65 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_CHERRY_LOG, + )), + 66 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_DARK_OAK_LOG, + )), + 67 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_PALE_OAK_LOG, + )), + 68 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_OAK_LOG, + )), + 69 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_MANGROVE_LOG, + )), + 70 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_BAMBOO_BLOCK, + )), + 71 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::OAK_WOOD, + )), + 72 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::SPRUCE_WOOD, + )), + 73 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::BIRCH_WOOD, + )), + 74 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::JUNGLE_WOOD, + )), + 75 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::ACACIA_WOOD, + )), + 76 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::CHERRY_WOOD, + )), + 77 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::DARK_OAK_WOOD, + )), + 78 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::MANGROVE_WOOD, + )), + 79 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_OAK_WOOD, + )), + 80 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_SPRUCE_WOOD, + )), + 81 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_BIRCH_WOOD, + )), + 82 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_JUNGLE_WOOD, + )), + 83 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_ACACIA_WOOD, + )), + 84 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_CHERRY_WOOD, + )), + 85 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_DARK_OAK_WOOD, + )), + 86 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_PALE_OAK_WOOD, + )), + 87 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_MANGROVE_WOOD, + )), + 288 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::BASALT, + )), + 289 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::POLISHED_BASALT, + )), + 480 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::QUARTZ_PILLAR, + )), + 537 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::HAY_BLOCK, + )), + 659 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::PURPUR_PILLAR, + )), + 674 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::BONE_BLOCK, + )), + 862 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::WARPED_STEM, + )), + 863 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_WARPED_STEM, + )), + 864 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::WARPED_HYPHAE, + )), + 865 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_WARPED_HYPHAE, + )), + 871 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::CRIMSON_STEM, + )), + 872 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_CRIMSON_STEM, + )), + 873 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::CRIMSON_HYPHAE, + )), + 874 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::STRIPPED_CRIMSON_HYPHAE, + )), + 1151 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::DEEPSLATE, + )), + 1171 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::INFESTED_DEEPSLATE, + )), + 1178 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::OCHRE_FROGLIGHT, + )), + 1179 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::VERDANT_FROGLIGHT, + )), + 1180 => Box::new(PaleOakWoodLikeProperties::from_state_id( + state_id, + &Block::PEARLESCENT_FROGLIGHT, + )), + 199 => Box::new(CreakingHeartLikeProperties::from_state_id( + state_id, + &Block::CREAKING_HEART, + )), + 350 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::IRON_CHAIN, + )), + 351 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::COPPER_CHAIN, + )), + 352 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::EXPOSED_COPPER_CHAIN, + )), + 353 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::WEATHERED_COPPER_CHAIN, + )), + 354 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::OXIDIZED_COPPER_CHAIN, + )), + 355 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::WAXED_COPPER_CHAIN, + )), + 356 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::WAXED_EXPOSED_COPPER_CHAIN, + )), + 357 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::WAXED_WEATHERED_COPPER_CHAIN, + )), + 358 => Box::new(IronChainLikeProperties::from_state_id( + state_id, + &Block::WAXED_OXIDIZED_COPPER_CHAIN, + )), + 298 => Box::new(CakeLikeProperties::from_state_id(state_id, &Block::CAKE)), + 283 => Box::new(JukeboxLikeProperties::from_state_id( + state_id, + &Block::JUKEBOX, + )), + 126 => Box::new(PoweredRailLikeProperties::from_state_id( + state_id, + &Block::POWERED_RAIL, + )), + 127 => Box::new(PoweredRailLikeProperties::from_state_id( + state_id, + &Block::DETECTOR_RAIL, + )), + 482 => Box::new(PoweredRailLikeProperties::from_state_id( + state_id, + &Block::ACTIVATOR_RAIL, + )), + 747 => Box::new(DriedGhastLikeProperties::from_state_id( + state_id, + &Block::DRIED_GHAST, )), 200 => Box::new(OakStairsLikeProperties::from_state_id( state_id, @@ -569338,9 +569156,482 @@ impl Block { state_id, &Block::DEEPSLATE_BRICK_STAIRS, )), - 1147 => Box::new(SmallDripleafLikeProperties::from_state_id( + 128 => Box::new(StickyPistonLikeProperties::from_state_id( state_id, - &Block::SMALL_DRIPLEAF, + &Block::STICKY_PISTON, + )), + 138 => Box::new(StickyPistonLikeProperties::from_state_id( + state_id, + &Block::PISTON, + )), + 220 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::OAK_DOOR, + )), + 260 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::IRON_DOOR, + )), + 646 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::SPRUCE_DOOR, + )), + 647 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::BIRCH_DOOR, + )), + 648 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::JUNGLE_DOOR, + )), + 649 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::ACACIA_DOOR, + )), + 650 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::CHERRY_DOOR, + )), + 651 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::DARK_OAK_DOOR, + )), + 652 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::PALE_OAK_DOOR, + )), + 653 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::MANGROVE_DOOR, + )), + 654 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::BAMBOO_DOOR, + )), + 899 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::CRIMSON_DOOR, + )), + 900 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WARPED_DOOR, + )), + 1076 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::COPPER_DOOR, + )), + 1077 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::EXPOSED_COPPER_DOOR, + )), + 1078 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WEATHERED_COPPER_DOOR, + )), + 1079 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::OXIDIZED_COPPER_DOOR, + )), + 1080 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WAXED_COPPER_DOOR, + )), + 1081 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WAXED_EXPOSED_COPPER_DOOR, + )), + 1082 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WAXED_WEATHERED_COPPER_DOOR, + )), + 1083 => Box::new(OakDoorLikeProperties::from_state_id( + state_id, + &Block::WAXED_OXIDIZED_COPPER_DOOR, + )), + 179 => Box::new(ChiseledBookshelfLikeProperties::from_state_id( + state_id, + &Block::CHISELED_BOOKSHELF, + )), + 657 => Box::new(ChorusFlowerLikeProperties::from_state_id( + state_id, + &Block::CHORUS_FLOWER, + )), + 279 => Box::new(CactusLikeProperties::from_state_id( + state_id, + &Block::CACTUS, + )), + 282 => Box::new(CactusLikeProperties::from_state_id( + state_id, + &Block::SUGAR_CANE, + )), + 196 => Box::new(FireLikeProperties::from_state_id(state_id, &Block::FIRE)), + 110 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::WHITE_BED, + )), + 111 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::ORANGE_BED, + )), + 112 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::MAGENTA_BED, + )), + 113 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::LIGHT_BLUE_BED, + )), + 114 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::YELLOW_BED, + )), + 115 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::LIME_BED, + )), + 116 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::PINK_BED, + )), + 117 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::GRAY_BED, + )), + 118 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::LIGHT_GRAY_BED, + )), + 119 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::CYAN_BED, + )), + 120 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::PURPLE_BED, + )), + 121 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::BLUE_BED, + )), + 122 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::BROWN_BED, + )), + 123 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::GREEN_BED, + )), + 124 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::RED_BED, + )), + 125 => Box::new(WhiteBedLikeProperties::from_state_id( + state_id, + &Block::BLACK_BED, + )), + 477 => Box::new(HopperLikeProperties::from_state_id( + state_id, + &Block::HOPPER, + )), + 1029 => Box::new(CalibratedSculkSensorLikeProperties::from_state_id( + state_id, + &Block::CALIBRATED_SCULK_SENSOR, + )), + 1028 => Box::new(SculkSensorLikeProperties::from_state_id( + state_id, + &Block::SCULK_SENSOR, + )), + 1189 => Box::new(PaleMossCarpetLikeProperties::from_state_id( + state_id, + &Block::PALE_MOSS_CARPET, + )), + 837 => Box::new(ScaffoldingLikeProperties::from_state_id( + state_id, + &Block::SCAFFOLDING, + )), + 1186 => Box::new(VaultLikeProperties::from_state_id(state_id, &Block::VAULT)), + 1185 => Box::new(TrialSpawnerLikeProperties::from_state_id( + state_id, + &Block::TRIAL_SPAWNER, + )), + 1033 => Box::new(SculkShriekerLikeProperties::from_state_id( + state_id, + &Block::SCULK_SHRIEKER, + )), + 848 => Box::new(BellLikeProperties::from_state_id(state_id, &Block::BELL)), + 180 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::ACACIA_SHELF, + )), + 181 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::BAMBOO_SHELF, + )), + 182 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::BIRCH_SHELF, + )), + 183 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::CHERRY_SHELF, + )), + 184 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::CRIMSON_SHELF, + )), + 185 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::DARK_OAK_SHELF, + )), + 186 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::JUNGLE_SHELF, + )), + 187 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::MANGROVE_SHELF, + )), + 188 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::OAK_SHELF, + )), + 189 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::PALE_OAK_SHELF, + )), + 190 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::SPRUCE_SHELF, + )), + 191 => Box::new(AcaciaShelfLikeProperties::from_state_id( + state_id, + &Block::WARPED_SHELF, + )), + 299 => Box::new(RepeaterLikeProperties::from_state_id( + state_id, + &Block::REPEATER, + )), + 918 => Box::new(RespawnAnchorLikeProperties::from_state_id( + state_id, + &Block::RESPAWN_ANCHOR, + )), + 386 => Box::new(BrewingStandLikeProperties::from_state_id( + state_id, + &Block::BREWING_STAND, + )), + 276 => Box::new(SnowLikeProperties::from_state_id(state_id, &Block::SNOW)), + 195 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::WALL_TORCH, + )), + 291 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::SOUL_WALL_TORCH, + )), + 293 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::COPPER_WALL_TORCH, + )), + 296 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::CARVED_PUMPKIN, + )), + 297 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::JACK_O_LANTERN, + )), + 362 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::ATTACHED_PUMPKIN_STEM, + )), + 363 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::ATTACHED_MELON_STEM, + )), + 467 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::ANVIL, + )), + 468 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::CHIPPED_ANVIL, + )), + 469 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::DAMAGED_ANVIL, + )), + 579 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::WHITE_WALL_BANNER, + )), + 580 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::ORANGE_WALL_BANNER, + )), + 581 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::MAGENTA_WALL_BANNER, + )), + 582 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIGHT_BLUE_WALL_BANNER, + )), + 583 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::YELLOW_WALL_BANNER, + )), + 584 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIME_WALL_BANNER, + )), + 585 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::PINK_WALL_BANNER, + )), + 586 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::GRAY_WALL_BANNER, + )), + 587 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIGHT_GRAY_WALL_BANNER, + )), + 588 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::CYAN_WALL_BANNER, + )), + 589 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::PURPLE_WALL_BANNER, + )), + 590 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BLUE_WALL_BANNER, + )), + 591 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BROWN_WALL_BANNER, + )), + 592 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::GREEN_WALL_BANNER, + )), + 593 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::RED_WALL_BANNER, + )), + 594 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BLACK_WALL_BANNER, + )), + 694 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::WHITE_GLAZED_TERRACOTTA, + )), + 695 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::ORANGE_GLAZED_TERRACOTTA, + )), + 696 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::MAGENTA_GLAZED_TERRACOTTA, + )), + 697 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIGHT_BLUE_GLAZED_TERRACOTTA, + )), + 698 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::YELLOW_GLAZED_TERRACOTTA, + )), + 699 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIME_GLAZED_TERRACOTTA, + )), + 700 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::PINK_GLAZED_TERRACOTTA, + )), + 701 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::GRAY_GLAZED_TERRACOTTA, + )), + 702 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LIGHT_GRAY_GLAZED_TERRACOTTA, + )), + 703 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::CYAN_GLAZED_TERRACOTTA, + )), + 704 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::PURPLE_GLAZED_TERRACOTTA, + )), + 705 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BLUE_GLAZED_TERRACOTTA, + )), + 706 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BROWN_GLAZED_TERRACOTTA, + )), + 707 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::GREEN_GLAZED_TERRACOTTA, + )), + 708 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::RED_GLAZED_TERRACOTTA, + )), + 709 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::BLACK_GLAZED_TERRACOTTA, + )), + 838 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::LOOM, + )), + 847 => Box::new(WallTorchLikeProperties::from_state_id( + state_id, + &Block::STONECUTTER, + )), + 201 => Box::new(ChestLikeProperties::from_state_id(state_id, &Block::CHEST)), + 470 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::TRAPPED_CHEST, + )), + 1108 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::COPPER_CHEST, + )), + 1109 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::EXPOSED_COPPER_CHEST, + )), + 1110 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::WEATHERED_COPPER_CHEST, + )), + 1111 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::OXIDIZED_COPPER_CHEST, + )), + 1112 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::WAXED_COPPER_CHEST, + )), + 1113 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::WAXED_EXPOSED_COPPER_CHEST, + )), + 1114 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::WAXED_WEATHERED_COPPER_CHEST, + )), + 1115 => Box::new(ChestLikeProperties::from_state_id( + state_id, + &Block::WAXED_OXIDIZED_COPPER_CHEST, )), 454 => Box::new(SkeletonWallSkullLikeProperties::from_state_id( state_id, @@ -569458,86 +569749,13 @@ impl Block { state_id, &Block::LECTERN, )), - 848 => Box::new(BellLikeProperties::from_state_id(state_id, &Block::BELL)), 401 => Box::new(TripwireHookLikeProperties::from_state_id( state_id, &Block::TRIPWIRE_HOOK, )), - 180 => Box::new(AcaciaShelfLikeProperties::from_state_id( + 473 => Box::new(ComparatorLikeProperties::from_state_id( state_id, - &Block::ACACIA_SHELF, - )), - 181 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::BAMBOO_SHELF, - )), - 182 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::BIRCH_SHELF, - )), - 183 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::CHERRY_SHELF, - )), - 184 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::CRIMSON_SHELF, - )), - 185 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::DARK_OAK_SHELF, - )), - 186 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::JUNGLE_SHELF, - )), - 187 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::MANGROVE_SHELF, - )), - 188 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::OAK_SHELF, - )), - 189 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::PALE_OAK_SHELF, - )), - 190 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::SPRUCE_SHELF, - )), - 191 => Box::new(AcaciaShelfLikeProperties::from_state_id( - state_id, - &Block::WARPED_SHELF, - )), - 392 => Box::new(EndPortalFrameLikeProperties::from_state_id( - state_id, - &Block::END_PORTAL_FRAME, - )), - 209 => Box::new(FurnaceLikeProperties::from_state_id( - state_id, - &Block::FURNACE, - )), - 274 => Box::new(FurnaceLikeProperties::from_state_id( - state_id, - &Block::REDSTONE_WALL_TORCH, - )), - 840 => Box::new(FurnaceLikeProperties::from_state_id( - state_id, - &Block::SMOKER, - )), - 841 => Box::new(FurnaceLikeProperties::from_state_id( - state_id, - &Block::BLAST_FURNACE, - )), - 859 => Box::new(CampfireLikeProperties::from_state_id( - state_id, - &Block::CAMPFIRE, - )), - 860 => Box::new(CampfireLikeProperties::from_state_id( - state_id, - &Block::SOUL_CAMPFIRE, + &Block::COMPARATOR, )), 1116 => Box::new(CopperGolemStatueLikeProperties::from_state_id( state_id, @@ -569571,69 +569789,37 @@ impl Block { state_id, &Block::WAXED_OXIDIZED_COPPER_GOLEM_STATUE, )), - 110 => Box::new(WhiteBedLikeProperties::from_state_id( + 392 => Box::new(EndPortalFrameLikeProperties::from_state_id( state_id, - &Block::WHITE_BED, + &Block::END_PORTAL_FRAME, )), - 111 => Box::new(WhiteBedLikeProperties::from_state_id( + 209 => Box::new(FurnaceLikeProperties::from_state_id( state_id, - &Block::ORANGE_BED, + &Block::FURNACE, )), - 112 => Box::new(WhiteBedLikeProperties::from_state_id( + 274 => Box::new(FurnaceLikeProperties::from_state_id( state_id, - &Block::MAGENTA_BED, + &Block::REDSTONE_WALL_TORCH, )), - 113 => Box::new(WhiteBedLikeProperties::from_state_id( + 840 => Box::new(FurnaceLikeProperties::from_state_id( state_id, - &Block::LIGHT_BLUE_BED, + &Block::SMOKER, )), - 114 => Box::new(WhiteBedLikeProperties::from_state_id( + 841 => Box::new(FurnaceLikeProperties::from_state_id( state_id, - &Block::YELLOW_BED, + &Block::BLAST_FURNACE, )), - 115 => Box::new(WhiteBedLikeProperties::from_state_id( + 859 => Box::new(CampfireLikeProperties::from_state_id( state_id, - &Block::LIME_BED, + &Block::CAMPFIRE, )), - 116 => Box::new(WhiteBedLikeProperties::from_state_id( + 860 => Box::new(CampfireLikeProperties::from_state_id( state_id, - &Block::PINK_BED, + &Block::SOUL_CAMPFIRE, )), - 117 => Box::new(WhiteBedLikeProperties::from_state_id( + 1147 => Box::new(SmallDripleafLikeProperties::from_state_id( state_id, - &Block::GRAY_BED, - )), - 118 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::LIGHT_GRAY_BED, - )), - 119 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::CYAN_BED, - )), - 120 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::PURPLE_BED, - )), - 121 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::BLUE_BED, - )), - 122 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::BROWN_BED, - )), - 123 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::GREEN_BED, - )), - 124 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::RED_BED, - )), - 125 => Box::new(WhiteBedLikeProperties::from_state_id( - state_id, - &Block::BLACK_BED, + &Block::SMALL_DRIPLEAF, )), 911 => Box::new(BeeNestLikeProperties::from_state_id( state_id, @@ -569799,43 +569985,6 @@ impl Block { state_id, &Block::BIG_DRIPLEAF, )), - 201 => Box::new(ChestLikeProperties::from_state_id(state_id, &Block::CHEST)), - 470 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::TRAPPED_CHEST, - )), - 1108 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::COPPER_CHEST, - )), - 1109 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::EXPOSED_COPPER_CHEST, - )), - 1110 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::WEATHERED_COPPER_CHEST, - )), - 1111 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::OXIDIZED_COPPER_CHEST, - )), - 1112 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::WAXED_COPPER_CHEST, - )), - 1113 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::WAXED_EXPOSED_COPPER_CHEST, - )), - 1114 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::WAXED_WEATHERED_COPPER_CHEST, - )), - 1115 => Box::new(ChestLikeProperties::from_state_id( - state_id, - &Block::WAXED_OXIDIZED_COPPER_CHEST, - )), 1141 => Box::new(PinkPetalsLikeProperties::from_state_id( state_id, &Block::PINK_PETALS, @@ -569849,94 +569998,6 @@ impl Block { &Block::LEAF_LITTER, )), 396 => Box::new(CocoaLikeProperties::from_state_id(state_id, &Block::COCOA)), - 1033 => Box::new(SculkShriekerLikeProperties::from_state_id( - state_id, - &Block::SCULK_SHRIEKER, - )), - 999 => Box::new(PotentSulfurLikeProperties::from_state_id( - state_id, - &Block::POTENT_SULFUR, - )), - 792 => Box::new(BambooLikeProperties::from_state_id( - state_id, - &Block::BAMBOO, - )), - 918 => Box::new(RespawnAnchorLikeProperties::from_state_id( - state_id, - &Block::RESPAWN_ANCHOR, - )), - 655 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::END_ROD, - )), - 677 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::SHULKER_BOX, - )), - 678 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::WHITE_SHULKER_BOX, - )), - 679 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::ORANGE_SHULKER_BOX, - )), - 680 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::MAGENTA_SHULKER_BOX, - )), - 681 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::LIGHT_BLUE_SHULKER_BOX, - )), - 682 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::YELLOW_SHULKER_BOX, - )), - 683 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::LIME_SHULKER_BOX, - )), - 684 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::PINK_SHULKER_BOX, - )), - 685 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::GRAY_SHULKER_BOX, - )), - 686 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::LIGHT_GRAY_SHULKER_BOX, - )), - 687 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::CYAN_SHULKER_BOX, - )), - 688 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::PURPLE_SHULKER_BOX, - )), - 689 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::BLUE_SHULKER_BOX, - )), - 690 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::BROWN_SHULKER_BOX, - )), - 691 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::GREEN_SHULKER_BOX, - )), - 692 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::RED_SHULKER_BOX, - )), - 693 => Box::new(EndRodLikeProperties::from_state_id( - state_id, - &Block::BLACK_SHULKER_BOX, - )), 105 => Box::new(DispenserLikeProperties::from_state_id( state_id, &Block::DISPENSER, @@ -569945,119 +570006,6 @@ impl Block { state_id, &Block::DROPPER, )), - 676 => Box::new(ObserverLikeProperties::from_state_id( - state_id, - &Block::OBSERVER, - )), - 1124 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::LIGHTNING_ROD, - )), - 1125 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::EXPOSED_LIGHTNING_ROD, - )), - 1126 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::WEATHERED_LIGHTNING_ROD, - )), - 1127 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::OXIDIZED_LIGHTNING_ROD, - )), - 1128 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::WAXED_LIGHTNING_ROD, - )), - 1129 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::WAXED_EXPOSED_LIGHTNING_ROD, - )), - 1130 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::WAXED_WEATHERED_LIGHTNING_ROD, - )), - 1131 => Box::new(LightningRodLikeProperties::from_state_id( - state_id, - &Block::WAXED_OXIDIZED_LIGHTNING_ROD, - )), - 839 => Box::new(BarrelLikeProperties::from_state_id( - state_id, - &Block::BARREL, - )), - 980 => Box::new(AmethystClusterLikeProperties::from_state_id( - state_id, - &Block::AMETHYST_CLUSTER, - )), - 981 => Box::new(AmethystClusterLikeProperties::from_state_id( - state_id, - &Block::LARGE_AMETHYST_BUD, - )), - 982 => Box::new(AmethystClusterLikeProperties::from_state_id( - state_id, - &Block::MEDIUM_AMETHYST_BUD, - )), - 983 => Box::new(AmethystClusterLikeProperties::from_state_id( - state_id, - &Block::SMALL_AMETHYST_BUD, - )), - 407 => Box::new(CommandBlockLikeProperties::from_state_id( - state_id, - &Block::COMMAND_BLOCK, - )), - 668 => Box::new(CommandBlockLikeProperties::from_state_id( - state_id, - &Block::REPEATING_COMMAND_BLOCK, - )), - 669 => Box::new(CommandBlockLikeProperties::from_state_id( - state_id, - &Block::CHAIN_COMMAND_BLOCK, - )), - 109 => Box::new(NoteBlockLikeProperties::from_state_id( - state_id, - &Block::NOTE_BLOCK, - )), - 386 => Box::new(BrewingStandLikeProperties::from_state_id( - state_id, - &Block::BREWING_STAND, - )), - 276 => Box::new(SnowLikeProperties::from_state_id(state_id, &Block::SNOW)), - 137 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::TALL_SEAGRASS, - )), - 557 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::SUNFLOWER, - )), - 558 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::LILAC, - )), - 559 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::ROSE_BUSH, - )), - 560 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::PEONY, - )), - 561 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::TALL_GRASS, - )), - 562 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::LARGE_FERN, - )), - 664 => Box::new(TallSeagrassLikeProperties::from_state_id( - state_id, - &Block::PITCHER_PLANT, - )), - 663 => Box::new(PitcherCropLikeProperties::from_state_id( - state_id, - &Block::PITCHER_CROP, - )), 1184 => Box::new(CrafterLikeProperties::from_state_id( state_id, &Block::CRAFTER, @@ -570438,17 +570386,45 @@ impl Block { state_id, &Block::TRIPWIRE, )), - 126 => Box::new(PoweredRailLikeProperties::from_state_id( + 676 => Box::new(ObserverLikeProperties::from_state_id( state_id, - &Block::POWERED_RAIL, + &Block::OBSERVER, )), - 127 => Box::new(PoweredRailLikeProperties::from_state_id( + 1124 => Box::new(LightningRodLikeProperties::from_state_id( state_id, - &Block::DETECTOR_RAIL, + &Block::LIGHTNING_ROD, )), - 482 => Box::new(PoweredRailLikeProperties::from_state_id( + 1125 => Box::new(LightningRodLikeProperties::from_state_id( state_id, - &Block::ACTIVATOR_RAIL, + &Block::EXPOSED_LIGHTNING_ROD, + )), + 1126 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::WEATHERED_LIGHTNING_ROD, + )), + 1127 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::OXIDIZED_LIGHTNING_ROD, + )), + 1128 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::WAXED_LIGHTNING_ROD, + )), + 1129 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::WAXED_EXPOSED_LIGHTNING_ROD, + )), + 1130 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::WAXED_WEATHERED_LIGHTNING_ROD, + )), + 1131 => Box::new(LightningRodLikeProperties::from_state_id( + state_id, + &Block::WAXED_OXIDIZED_LIGHTNING_ROD, + )), + 109 => Box::new(NoteBlockLikeProperties::from_state_id( + state_id, + &Block::NOTE_BLOCK, )), 453 => Box::new(SkeletonSkullLikeProperties::from_state_id( state_id, @@ -570478,9 +570454,9 @@ impl Block { state_id, &Block::PIGLIN_HEAD, )), - 907 => Box::new(TestBlockLikeProperties::from_state_id( + 202 => Box::new(RedstoneWireLikeProperties::from_state_id( state_id, - &Block::TEST_BLOCK, + &Block::REDSTONE_WIRE, )), 909 => Box::new(ComposterLikeProperties::from_state_id( state_id, @@ -570494,6 +570470,134 @@ impl Block { state_id, &Block::CAVE_VINES, )), + 379 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::RESIN_BRICK_WALL, + )), + 409 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::COBBLESTONE_WALL, + )), + 410 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::MOSSY_COBBLESTONE_WALL, + )), + 824 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::BRICK_WALL, + )), + 825 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::PRISMARINE_WALL, + )), + 826 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::RED_SANDSTONE_WALL, + )), + 827 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::MOSSY_STONE_BRICK_WALL, + )), + 828 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::GRANITE_WALL, + )), + 829 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::STONE_BRICK_WALL, + )), + 830 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::MUD_BRICK_WALL, + )), + 831 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::NETHER_BRICK_WALL, + )), + 832 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::ANDESITE_WALL, + )), + 833 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::RED_NETHER_BRICK_WALL, + )), + 834 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::SANDSTONE_WALL, + )), + 835 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::END_STONE_BRICK_WALL, + )), + 836 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::DIORITE_WALL, + )), + 926 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::BLACKSTONE_WALL, + )), + 934 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_BLACKSTONE_BRICK_WALL, + )), + 940 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_BLACKSTONE_WALL, + )), + 987 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::TUFF_WALL, + )), + 991 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_TUFF_WALL, + )), + 996 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::TUFF_BRICK_WALL, + )), + 1002 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::SULFUR_WALL, + )), + 1006 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_SULFUR_WALL, + )), + 1010 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::SULFUR_BRICK_WALL, + )), + 1015 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::CINNABAR_WALL, + )), + 1019 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_CINNABAR_WALL, + )), + 1023 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::CINNABAR_BRICK_WALL, + )), + 1155 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::COBBLED_DEEPSLATE_WALL, + )), + 1159 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::POLISHED_DEEPSLATE_WALL, + )), + 1163 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::DEEPSLATE_TILE_WALL, + )), + 1167 => Box::new(ResinBrickWallLikeProperties::from_state_id( + state_id, + &Block::DEEPSLATE_BRICK_WALL, + )), 177 => Box::new(TntLikeProperties::from_state_id(state_id, &Block::TNT)), 338 => Box::new(BrownMushroomBlockLikeProperties::from_state_id( state_id, @@ -570840,10 +570944,18 @@ impl Block { state_id, &Block::WARPED_FENCE, )), + 839 => Box::new(BarrelLikeProperties::from_state_id( + state_id, + &Block::BARREL, + )), 1032 => Box::new(SculkCatalystLikeProperties::from_state_id( state_id, &Block::SCULK_CATALYST, )), + 139 => Box::new(PistonHeadLikeProperties::from_state_id( + state_id, + &Block::PISTON_HEAD, + )), 8 => Box::new(GrassBlockLikeProperties::from_state_id( state_id, &Block::GRASS_BLOCK, @@ -570856,6 +570968,114 @@ impl Block { state_id, &Block::MYCELIUM, )), + 655 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::END_ROD, + )), + 677 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::SHULKER_BOX, + )), + 678 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::WHITE_SHULKER_BOX, + )), + 679 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::ORANGE_SHULKER_BOX, + )), + 680 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::MAGENTA_SHULKER_BOX, + )), + 681 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::LIGHT_BLUE_SHULKER_BOX, + )), + 682 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::YELLOW_SHULKER_BOX, + )), + 683 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::LIME_SHULKER_BOX, + )), + 684 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::PINK_SHULKER_BOX, + )), + 685 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::GRAY_SHULKER_BOX, + )), + 686 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::LIGHT_GRAY_SHULKER_BOX, + )), + 687 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::CYAN_SHULKER_BOX, + )), + 688 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::PURPLE_SHULKER_BOX, + )), + 689 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::BLUE_SHULKER_BOX, + )), + 690 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::BROWN_SHULKER_BOX, + )), + 691 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::GREEN_SHULKER_BOX, + )), + 692 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::RED_SHULKER_BOX, + )), + 693 => Box::new(EndRodLikeProperties::from_state_id( + state_id, + &Block::BLACK_SHULKER_BOX, + )), + 156 => Box::new(MovingPistonLikeProperties::from_state_id( + state_id, + &Block::MOVING_PISTON, + )), + 980 => Box::new(AmethystClusterLikeProperties::from_state_id( + state_id, + &Block::AMETHYST_CLUSTER, + )), + 981 => Box::new(AmethystClusterLikeProperties::from_state_id( + state_id, + &Block::LARGE_AMETHYST_BUD, + )), + 982 => Box::new(AmethystClusterLikeProperties::from_state_id( + state_id, + &Block::MEDIUM_AMETHYST_BUD, + )), + 983 => Box::new(AmethystClusterLikeProperties::from_state_id( + state_id, + &Block::SMALL_AMETHYST_BUD, + )), + 407 => Box::new(CommandBlockLikeProperties::from_state_id( + state_id, + &Block::COMMAND_BLOCK, + )), + 668 => Box::new(CommandBlockLikeProperties::from_state_id( + state_id, + &Block::REPEATING_COMMAND_BLOCK, + )), + 669 => Box::new(CommandBlockLikeProperties::from_state_id( + state_id, + &Block::CHAIN_COMMAND_BLOCK, + )), + 295 => Box::new(NetherPortalLikeProperties::from_state_id( + state_id, + &Block::NETHER_PORTAL, + )), 88 => Box::new(OakLeavesLikeProperties::from_state_id( state_id, &Block::OAK_LEAVES, @@ -570956,6 +571176,50 @@ impl Block { state_id, &Block::BAMBOO_HANGING_SIGN, )), + 137 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::TALL_SEAGRASS, + )), + 557 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::SUNFLOWER, + )), + 558 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::LILAC, + )), + 559 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::ROSE_BUSH, + )), + 560 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::PEONY, + )), + 561 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::TALL_GRASS, + )), + 562 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::LARGE_FERN, + )), + 664 => Box::new(TallSeagrassLikeProperties::from_state_id( + state_id, + &Block::PITCHER_PLANT, + )), + 663 => Box::new(PitcherCropLikeProperties::from_state_id( + state_id, + &Block::PITCHER_CROP, + )), + 906 => Box::new(JigsawLikeProperties::from_state_id( + state_id, + &Block::JIGSAW, + )), + 905 => Box::new(StructureBlockLikeProperties::from_state_id( + state_id, + &Block::STRUCTURE_BLOCK, + )), 474 => Box::new(DaylightDetectorLikeProperties::from_state_id( state_id, &Block::DAYLIGHT_DETECTOR, @@ -571012,6 +571276,15 @@ impl Block { state_id, &Block::WAXED_OXIDIZED_COPPER_LANTERN, )), + 222 => Box::new(RailLikeProperties::from_state_id(state_id, &Block::RAIL)), + 1133 => Box::new(PointedDripstoneLikeProperties::from_state_id( + state_id, + &Block::POINTED_DRIPSTONE, + )), + 1134 => Box::new(PointedDripstoneLikeProperties::from_state_id( + state_id, + &Block::SULFUR_SPIKE, + )), 25 => Box::new(OakSaplingLikeProperties::from_state_id( state_id, &Block::OAK_SAPLING, @@ -571044,6 +571317,10 @@ impl Block { state_id, &Block::PALE_OAK_SAPLING, )), + 792 => Box::new(BambooLikeProperties::from_state_id( + state_id, + &Block::BAMBOO, + )), 207 => Box::new(WheatLikeProperties::from_state_id(state_id, &Block::WHEAT)), 364 => Box::new(WheatLikeProperties::from_state_id( state_id, @@ -571061,18 +571338,6 @@ impl Block { state_id, &Block::POTATOES, )), - 906 => Box::new(JigsawLikeProperties::from_state_id( - state_id, - &Block::JIGSAW, - )), - 1133 => Box::new(PointedDripstoneLikeProperties::from_state_id( - state_id, - &Block::POINTED_DRIPSTONE, - )), - 1134 => Box::new(PointedDripstoneLikeProperties::from_state_id( - state_id, - &Block::SULFUR_SPIKE, - )), 788 => Box::new(SeaPickleLikeProperties::from_state_id( state_id, &Block::SEA_PICKLE, @@ -571209,43 +571474,6 @@ impl Block { state_id, &Block::HEAVY_CORE, )), - 222 => Box::new(RailLikeProperties::from_state_id(state_id, &Block::RAIL)), - 350 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::IRON_CHAIN, - )), - 351 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::COPPER_CHAIN, - )), - 352 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::EXPOSED_COPPER_CHAIN, - )), - 353 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::WEATHERED_COPPER_CHAIN, - )), - 354 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::OXIDIZED_COPPER_CHAIN, - )), - 355 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::WAXED_COPPER_CHAIN, - )), - 356 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::WAXED_EXPOSED_COPPER_CHAIN, - )), - 357 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::WAXED_WEATHERED_COPPER_CHAIN, - )), - 358 => Box::new(IronChainLikeProperties::from_state_id( - state_id, - &Block::WAXED_OXIDIZED_COPPER_CHAIN, - )), 210 => Box::new(OakSignLikeProperties::from_state_id( state_id, &Block::OAK_SIGN, @@ -571295,241 +571523,9 @@ impl Block { &Block::WARPED_SIGN, )), 525 => Box::new(LightLikeProperties::from_state_id(state_id, &Block::LIGHT)), - 20 => Box::new(PaleOakWoodLikeProperties::from_state_id( + 907 => Box::new(TestBlockLikeProperties::from_state_id( state_id, - &Block::PALE_OAK_WOOD, - )), - 49 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::OAK_LOG, - )), - 50 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::SPRUCE_LOG, - )), - 51 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::BIRCH_LOG, - )), - 52 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::JUNGLE_LOG, - )), - 53 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::ACACIA_LOG, - )), - 54 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::CHERRY_LOG, - )), - 55 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::DARK_OAK_LOG, - )), - 56 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::PALE_OAK_LOG, - )), - 57 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::MANGROVE_LOG, - )), - 59 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::MUDDY_MANGROVE_ROOTS, - )), - 60 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::BAMBOO_BLOCK, - )), - 61 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_SPRUCE_LOG, - )), - 62 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_BIRCH_LOG, - )), - 63 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_JUNGLE_LOG, - )), - 64 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_ACACIA_LOG, - )), - 65 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_CHERRY_LOG, - )), - 66 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_DARK_OAK_LOG, - )), - 67 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_PALE_OAK_LOG, - )), - 68 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_OAK_LOG, - )), - 69 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_MANGROVE_LOG, - )), - 70 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_BAMBOO_BLOCK, - )), - 71 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::OAK_WOOD, - )), - 72 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::SPRUCE_WOOD, - )), - 73 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::BIRCH_WOOD, - )), - 74 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::JUNGLE_WOOD, - )), - 75 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::ACACIA_WOOD, - )), - 76 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::CHERRY_WOOD, - )), - 77 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::DARK_OAK_WOOD, - )), - 78 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::MANGROVE_WOOD, - )), - 79 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_OAK_WOOD, - )), - 80 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_SPRUCE_WOOD, - )), - 81 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_BIRCH_WOOD, - )), - 82 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_JUNGLE_WOOD, - )), - 83 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_ACACIA_WOOD, - )), - 84 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_CHERRY_WOOD, - )), - 85 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_DARK_OAK_WOOD, - )), - 86 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_PALE_OAK_WOOD, - )), - 87 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_MANGROVE_WOOD, - )), - 288 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::BASALT, - )), - 289 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::POLISHED_BASALT, - )), - 480 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::QUARTZ_PILLAR, - )), - 537 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::HAY_BLOCK, - )), - 659 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::PURPUR_PILLAR, - )), - 674 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::BONE_BLOCK, - )), - 862 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::WARPED_STEM, - )), - 863 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_WARPED_STEM, - )), - 864 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::WARPED_HYPHAE, - )), - 865 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_WARPED_HYPHAE, - )), - 871 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::CRIMSON_STEM, - )), - 872 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_CRIMSON_STEM, - )), - 873 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::CRIMSON_HYPHAE, - )), - 874 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::STRIPPED_CRIMSON_HYPHAE, - )), - 1151 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::DEEPSLATE, - )), - 1171 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::INFESTED_DEEPSLATE, - )), - 1178 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::OCHRE_FROGLIGHT, - )), - 1179 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::VERDANT_FROGLIGHT, - )), - 1180 => Box::new(PaleOakWoodLikeProperties::from_state_id( - state_id, - &Block::PEARLESCENT_FROGLIGHT, - )), - 199 => Box::new(CreakingHeartLikeProperties::from_state_id( - state_id, - &Block::CREAKING_HEART, + &Block::TEST_BLOCK, )), 563 => Box::new(WhiteBannerLikeProperties::from_state_id( state_id, @@ -571638,6 +571634,10 @@ impl Block { state_id, &Block::SWEET_BERRY_BUSH, )), + 999 => Box::new(PotentSulfurLikeProperties::from_state_id( + state_id, + &Block::POTENT_SULFUR, + )), _ => return None, }) } @@ -571645,423 +571645,6 @@ impl Block { #[doc = r" Get the properties of the block."] pub fn from_properties(&self, props: &[(&str, &str)]) -> Box { match self.id.as_u16() { - 369 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::OAK_FENCE_GATE, - )), - 628 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::SPRUCE_FENCE_GATE, - )), - 629 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::BIRCH_FENCE_GATE, - )), - 630 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::JUNGLE_FENCE_GATE, - )), - 631 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::ACACIA_FENCE_GATE, - )), - 632 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::CHERRY_FENCE_GATE, - )), - 633 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::DARK_OAK_FENCE_GATE, - )), - 634 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::PALE_OAK_FENCE_GATE, - )), - 635 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::MANGROVE_FENCE_GATE, - )), - 636 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::BAMBOO_FENCE_GATE, - )), - 893 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::CRIMSON_FENCE_GATE, - )), - 894 => Box::new(OakFenceGateLikeProperties::from_props( - props, - &Block::WARPED_FENCE_GATE, - )), - 298 => Box::new(CakeLikeProperties::from_props(props, &Block::CAKE)), - 283 => Box::new(JukeboxLikeProperties::from_props(props, &Block::JUKEBOX)), - 295 => Box::new(NetherPortalLikeProperties::from_props( - props, - &Block::NETHER_PORTAL, - )), - 1189 => Box::new(PaleMossCarpetLikeProperties::from_props( - props, - &Block::PALE_MOSS_CARPET, - )), - 379 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::RESIN_BRICK_WALL, - )), - 409 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::COBBLESTONE_WALL, - )), - 410 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::MOSSY_COBBLESTONE_WALL, - )), - 824 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::BRICK_WALL, - )), - 825 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::PRISMARINE_WALL, - )), - 826 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::RED_SANDSTONE_WALL, - )), - 827 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::MOSSY_STONE_BRICK_WALL, - )), - 828 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::GRANITE_WALL, - )), - 829 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::STONE_BRICK_WALL, - )), - 830 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::MUD_BRICK_WALL, - )), - 831 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::NETHER_BRICK_WALL, - )), - 832 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::ANDESITE_WALL, - )), - 833 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::RED_NETHER_BRICK_WALL, - )), - 834 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::SANDSTONE_WALL, - )), - 835 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::END_STONE_BRICK_WALL, - )), - 836 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::DIORITE_WALL, - )), - 926 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::BLACKSTONE_WALL, - )), - 934 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_BLACKSTONE_BRICK_WALL, - )), - 940 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_BLACKSTONE_WALL, - )), - 987 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::TUFF_WALL, - )), - 991 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_TUFF_WALL, - )), - 996 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::TUFF_BRICK_WALL, - )), - 1002 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::SULFUR_WALL, - )), - 1006 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_SULFUR_WALL, - )), - 1010 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::SULFUR_BRICK_WALL, - )), - 1015 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::CINNABAR_WALL, - )), - 1019 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_CINNABAR_WALL, - )), - 1023 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::CINNABAR_BRICK_WALL, - )), - 1155 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::COBBLED_DEEPSLATE_WALL, - )), - 1159 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::POLISHED_DEEPSLATE_WALL, - )), - 1163 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::DEEPSLATE_TILE_WALL, - )), - 1167 => Box::new(ResinBrickWallLikeProperties::from_props( - props, - &Block::DEEPSLATE_BRICK_WALL, - )), - 747 => Box::new(DriedGhastLikeProperties::from_props( - props, - &Block::DRIED_GHAST, - )), - 156 => Box::new(MovingPistonLikeProperties::from_props( - props, - &Block::MOVING_PISTON, - )), - 139 => Box::new(PistonHeadLikeProperties::from_props( - props, - &Block::PISTON_HEAD, - )), - 1029 => Box::new(CalibratedSculkSensorLikeProperties::from_props( - props, - &Block::CALIBRATED_SCULK_SENSOR, - )), - 1028 => Box::new(SculkSensorLikeProperties::from_props( - props, - &Block::SCULK_SENSOR, - )), - 128 => Box::new(StickyPistonLikeProperties::from_props( - props, - &Block::STICKY_PISTON, - )), - 138 => Box::new(StickyPistonLikeProperties::from_props( - props, - &Block::PISTON, - )), - 202 => Box::new(RedstoneWireLikeProperties::from_props( - props, - &Block::REDSTONE_WIRE, - )), - 179 => Box::new(ChiseledBookshelfLikeProperties::from_props( - props, - &Block::CHISELED_BOOKSHELF, - )), - 905 => Box::new(StructureBlockLikeProperties::from_props( - props, - &Block::STRUCTURE_BLOCK, - )), - 657 => Box::new(ChorusFlowerLikeProperties::from_props( - props, - &Block::CHORUS_FLOWER, - )), - 279 => Box::new(CactusLikeProperties::from_props(props, &Block::CACTUS)), - 282 => Box::new(CactusLikeProperties::from_props(props, &Block::SUGAR_CANE)), - 196 => Box::new(FireLikeProperties::from_props(props, &Block::FIRE)), - 477 => Box::new(HopperLikeProperties::from_props(props, &Block::HOPPER)), - 1185 => Box::new(TrialSpawnerLikeProperties::from_props( - props, - &Block::TRIAL_SPAWNER, - )), - 837 => Box::new(ScaffoldingLikeProperties::from_props( - props, - &Block::SCAFFOLDING, - )), - 473 => Box::new(ComparatorLikeProperties::from_props( - props, - &Block::COMPARATOR, - )), - 195 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::WALL_TORCH, - )), - 291 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::SOUL_WALL_TORCH, - )), - 293 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::COPPER_WALL_TORCH, - )), - 296 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::CARVED_PUMPKIN, - )), - 297 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::JACK_O_LANTERN, - )), - 362 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::ATTACHED_PUMPKIN_STEM, - )), - 363 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::ATTACHED_MELON_STEM, - )), - 467 => Box::new(WallTorchLikeProperties::from_props(props, &Block::ANVIL)), - 468 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::CHIPPED_ANVIL, - )), - 469 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::DAMAGED_ANVIL, - )), - 579 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::WHITE_WALL_BANNER, - )), - 580 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::ORANGE_WALL_BANNER, - )), - 581 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::MAGENTA_WALL_BANNER, - )), - 582 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIGHT_BLUE_WALL_BANNER, - )), - 583 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::YELLOW_WALL_BANNER, - )), - 584 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIME_WALL_BANNER, - )), - 585 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::PINK_WALL_BANNER, - )), - 586 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::GRAY_WALL_BANNER, - )), - 587 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIGHT_GRAY_WALL_BANNER, - )), - 588 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::CYAN_WALL_BANNER, - )), - 589 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::PURPLE_WALL_BANNER, - )), - 590 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BLUE_WALL_BANNER, - )), - 591 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BROWN_WALL_BANNER, - )), - 592 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::GREEN_WALL_BANNER, - )), - 593 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::RED_WALL_BANNER, - )), - 594 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BLACK_WALL_BANNER, - )), - 694 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::WHITE_GLAZED_TERRACOTTA, - )), - 695 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::ORANGE_GLAZED_TERRACOTTA, - )), - 696 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::MAGENTA_GLAZED_TERRACOTTA, - )), - 697 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIGHT_BLUE_GLAZED_TERRACOTTA, - )), - 698 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::YELLOW_GLAZED_TERRACOTTA, - )), - 699 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIME_GLAZED_TERRACOTTA, - )), - 700 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::PINK_GLAZED_TERRACOTTA, - )), - 701 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::GRAY_GLAZED_TERRACOTTA, - )), - 702 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::LIGHT_GRAY_GLAZED_TERRACOTTA, - )), - 703 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::CYAN_GLAZED_TERRACOTTA, - )), - 704 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::PURPLE_GLAZED_TERRACOTTA, - )), - 705 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BLUE_GLAZED_TERRACOTTA, - )), - 706 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BROWN_GLAZED_TERRACOTTA, - )), - 707 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::GREEN_GLAZED_TERRACOTTA, - )), - 708 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::RED_GLAZED_TERRACOTTA, - )), - 709 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::BLACK_GLAZED_TERRACOTTA, - )), - 838 => Box::new(WallTorchLikeProperties::from_props(props, &Block::LOOM)), - 847 => Box::new(WallTorchLikeProperties::from_props( - props, - &Block::STONECUTTER, - )), - 1186 => Box::new(VaultLikeProperties::from_props(props, &Block::VAULT)), 844 => Box::new(GrindstoneLikeProperties::from_props( props, &Block::GRINDSTONE, @@ -572114,81 +571697,340 @@ impl Block { props, &Block::POLISHED_BLACKSTONE_BUTTON, )), - 299 => Box::new(RepeaterLikeProperties::from_props(props, &Block::REPEATER)), - 220 => Box::new(OakDoorLikeProperties::from_props(props, &Block::OAK_DOOR)), - 260 => Box::new(OakDoorLikeProperties::from_props(props, &Block::IRON_DOOR)), - 646 => Box::new(OakDoorLikeProperties::from_props( + 369 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::SPRUCE_DOOR, + &Block::OAK_FENCE_GATE, )), - 647 => Box::new(OakDoorLikeProperties::from_props(props, &Block::BIRCH_DOOR)), - 648 => Box::new(OakDoorLikeProperties::from_props( + 628 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::JUNGLE_DOOR, + &Block::SPRUCE_FENCE_GATE, )), - 649 => Box::new(OakDoorLikeProperties::from_props( + 629 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::ACACIA_DOOR, + &Block::BIRCH_FENCE_GATE, )), - 650 => Box::new(OakDoorLikeProperties::from_props( + 630 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::CHERRY_DOOR, + &Block::JUNGLE_FENCE_GATE, )), - 651 => Box::new(OakDoorLikeProperties::from_props( + 631 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::DARK_OAK_DOOR, + &Block::ACACIA_FENCE_GATE, )), - 652 => Box::new(OakDoorLikeProperties::from_props( + 632 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::PALE_OAK_DOOR, + &Block::CHERRY_FENCE_GATE, )), - 653 => Box::new(OakDoorLikeProperties::from_props( + 633 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::MANGROVE_DOOR, + &Block::DARK_OAK_FENCE_GATE, )), - 654 => Box::new(OakDoorLikeProperties::from_props( + 634 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::BAMBOO_DOOR, + &Block::PALE_OAK_FENCE_GATE, )), - 899 => Box::new(OakDoorLikeProperties::from_props( + 635 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::CRIMSON_DOOR, + &Block::MANGROVE_FENCE_GATE, )), - 900 => Box::new(OakDoorLikeProperties::from_props( + 636 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::WARPED_DOOR, + &Block::BAMBOO_FENCE_GATE, )), - 1076 => Box::new(OakDoorLikeProperties::from_props( + 893 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::COPPER_DOOR, + &Block::CRIMSON_FENCE_GATE, )), - 1077 => Box::new(OakDoorLikeProperties::from_props( + 894 => Box::new(OakFenceGateLikeProperties::from_props( props, - &Block::EXPOSED_COPPER_DOOR, + &Block::WARPED_FENCE_GATE, )), - 1078 => Box::new(OakDoorLikeProperties::from_props( + 20 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::WEATHERED_COPPER_DOOR, + &Block::PALE_OAK_WOOD, )), - 1079 => Box::new(OakDoorLikeProperties::from_props( + 49 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::OXIDIZED_COPPER_DOOR, + &Block::OAK_LOG, )), - 1080 => Box::new(OakDoorLikeProperties::from_props( + 50 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::WAXED_COPPER_DOOR, + &Block::SPRUCE_LOG, )), - 1081 => Box::new(OakDoorLikeProperties::from_props( + 51 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::WAXED_EXPOSED_COPPER_DOOR, + &Block::BIRCH_LOG, )), - 1082 => Box::new(OakDoorLikeProperties::from_props( + 52 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::WAXED_WEATHERED_COPPER_DOOR, + &Block::JUNGLE_LOG, )), - 1083 => Box::new(OakDoorLikeProperties::from_props( + 53 => Box::new(PaleOakWoodLikeProperties::from_props( props, - &Block::WAXED_OXIDIZED_COPPER_DOOR, + &Block::ACACIA_LOG, + )), + 54 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::CHERRY_LOG, + )), + 55 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::DARK_OAK_LOG, + )), + 56 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::PALE_OAK_LOG, + )), + 57 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::MANGROVE_LOG, + )), + 59 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::MUDDY_MANGROVE_ROOTS, + )), + 60 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::BAMBOO_BLOCK, + )), + 61 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_SPRUCE_LOG, + )), + 62 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_BIRCH_LOG, + )), + 63 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_JUNGLE_LOG, + )), + 64 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_ACACIA_LOG, + )), + 65 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_CHERRY_LOG, + )), + 66 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_DARK_OAK_LOG, + )), + 67 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_PALE_OAK_LOG, + )), + 68 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_OAK_LOG, + )), + 69 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_MANGROVE_LOG, + )), + 70 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_BAMBOO_BLOCK, + )), + 71 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::OAK_WOOD, + )), + 72 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::SPRUCE_WOOD, + )), + 73 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::BIRCH_WOOD, + )), + 74 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::JUNGLE_WOOD, + )), + 75 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::ACACIA_WOOD, + )), + 76 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::CHERRY_WOOD, + )), + 77 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::DARK_OAK_WOOD, + )), + 78 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::MANGROVE_WOOD, + )), + 79 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_OAK_WOOD, + )), + 80 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_SPRUCE_WOOD, + )), + 81 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_BIRCH_WOOD, + )), + 82 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_JUNGLE_WOOD, + )), + 83 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_ACACIA_WOOD, + )), + 84 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_CHERRY_WOOD, + )), + 85 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_DARK_OAK_WOOD, + )), + 86 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_PALE_OAK_WOOD, + )), + 87 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_MANGROVE_WOOD, + )), + 288 => Box::new(PaleOakWoodLikeProperties::from_props(props, &Block::BASALT)), + 289 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::POLISHED_BASALT, + )), + 480 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::QUARTZ_PILLAR, + )), + 537 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::HAY_BLOCK, + )), + 659 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::PURPUR_PILLAR, + )), + 674 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::BONE_BLOCK, + )), + 862 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::WARPED_STEM, + )), + 863 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_WARPED_STEM, + )), + 864 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::WARPED_HYPHAE, + )), + 865 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_WARPED_HYPHAE, + )), + 871 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::CRIMSON_STEM, + )), + 872 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_CRIMSON_STEM, + )), + 873 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::CRIMSON_HYPHAE, + )), + 874 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::STRIPPED_CRIMSON_HYPHAE, + )), + 1151 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::DEEPSLATE, + )), + 1171 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::INFESTED_DEEPSLATE, + )), + 1178 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::OCHRE_FROGLIGHT, + )), + 1179 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::VERDANT_FROGLIGHT, + )), + 1180 => Box::new(PaleOakWoodLikeProperties::from_props( + props, + &Block::PEARLESCENT_FROGLIGHT, + )), + 199 => Box::new(CreakingHeartLikeProperties::from_props( + props, + &Block::CREAKING_HEART, + )), + 350 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::IRON_CHAIN, + )), + 351 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::COPPER_CHAIN, + )), + 352 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::EXPOSED_COPPER_CHAIN, + )), + 353 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::WEATHERED_COPPER_CHAIN, + )), + 354 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::OXIDIZED_COPPER_CHAIN, + )), + 355 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::WAXED_COPPER_CHAIN, + )), + 356 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::WAXED_EXPOSED_COPPER_CHAIN, + )), + 357 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::WAXED_WEATHERED_COPPER_CHAIN, + )), + 358 => Box::new(IronChainLikeProperties::from_props( + props, + &Block::WAXED_OXIDIZED_COPPER_CHAIN, + )), + 298 => Box::new(CakeLikeProperties::from_props(props, &Block::CAKE)), + 283 => Box::new(JukeboxLikeProperties::from_props(props, &Block::JUKEBOX)), + 126 => Box::new(PoweredRailLikeProperties::from_props( + props, + &Block::POWERED_RAIL, + )), + 127 => Box::new(PoweredRailLikeProperties::from_props( + props, + &Block::DETECTOR_RAIL, + )), + 482 => Box::new(PoweredRailLikeProperties::from_props( + props, + &Block::ACTIVATOR_RAIL, + )), + 747 => Box::new(DriedGhastLikeProperties::from_props( + props, + &Block::DRIED_GHAST, )), 200 => Box::new(OakStairsLikeProperties::from_props( props, @@ -572446,9 +572288,422 @@ impl Block { props, &Block::DEEPSLATE_BRICK_STAIRS, )), - 1147 => Box::new(SmallDripleafLikeProperties::from_props( + 128 => Box::new(StickyPistonLikeProperties::from_props( props, - &Block::SMALL_DRIPLEAF, + &Block::STICKY_PISTON, + )), + 138 => Box::new(StickyPistonLikeProperties::from_props( + props, + &Block::PISTON, + )), + 220 => Box::new(OakDoorLikeProperties::from_props(props, &Block::OAK_DOOR)), + 260 => Box::new(OakDoorLikeProperties::from_props(props, &Block::IRON_DOOR)), + 646 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::SPRUCE_DOOR, + )), + 647 => Box::new(OakDoorLikeProperties::from_props(props, &Block::BIRCH_DOOR)), + 648 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::JUNGLE_DOOR, + )), + 649 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::ACACIA_DOOR, + )), + 650 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::CHERRY_DOOR, + )), + 651 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::DARK_OAK_DOOR, + )), + 652 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::PALE_OAK_DOOR, + )), + 653 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::MANGROVE_DOOR, + )), + 654 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::BAMBOO_DOOR, + )), + 899 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::CRIMSON_DOOR, + )), + 900 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WARPED_DOOR, + )), + 1076 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::COPPER_DOOR, + )), + 1077 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::EXPOSED_COPPER_DOOR, + )), + 1078 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WEATHERED_COPPER_DOOR, + )), + 1079 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::OXIDIZED_COPPER_DOOR, + )), + 1080 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WAXED_COPPER_DOOR, + )), + 1081 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WAXED_EXPOSED_COPPER_DOOR, + )), + 1082 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WAXED_WEATHERED_COPPER_DOOR, + )), + 1083 => Box::new(OakDoorLikeProperties::from_props( + props, + &Block::WAXED_OXIDIZED_COPPER_DOOR, + )), + 179 => Box::new(ChiseledBookshelfLikeProperties::from_props( + props, + &Block::CHISELED_BOOKSHELF, + )), + 657 => Box::new(ChorusFlowerLikeProperties::from_props( + props, + &Block::CHORUS_FLOWER, + )), + 279 => Box::new(CactusLikeProperties::from_props(props, &Block::CACTUS)), + 282 => Box::new(CactusLikeProperties::from_props(props, &Block::SUGAR_CANE)), + 196 => Box::new(FireLikeProperties::from_props(props, &Block::FIRE)), + 110 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::WHITE_BED)), + 111 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::ORANGE_BED, + )), + 112 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::MAGENTA_BED, + )), + 113 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::LIGHT_BLUE_BED, + )), + 114 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::YELLOW_BED, + )), + 115 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::LIME_BED)), + 116 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::PINK_BED)), + 117 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::GRAY_BED)), + 118 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::LIGHT_GRAY_BED, + )), + 119 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::CYAN_BED)), + 120 => Box::new(WhiteBedLikeProperties::from_props( + props, + &Block::PURPLE_BED, + )), + 121 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BLUE_BED)), + 122 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BROWN_BED)), + 123 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::GREEN_BED)), + 124 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::RED_BED)), + 125 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BLACK_BED)), + 477 => Box::new(HopperLikeProperties::from_props(props, &Block::HOPPER)), + 1029 => Box::new(CalibratedSculkSensorLikeProperties::from_props( + props, + &Block::CALIBRATED_SCULK_SENSOR, + )), + 1028 => Box::new(SculkSensorLikeProperties::from_props( + props, + &Block::SCULK_SENSOR, + )), + 1189 => Box::new(PaleMossCarpetLikeProperties::from_props( + props, + &Block::PALE_MOSS_CARPET, + )), + 837 => Box::new(ScaffoldingLikeProperties::from_props( + props, + &Block::SCAFFOLDING, + )), + 1186 => Box::new(VaultLikeProperties::from_props(props, &Block::VAULT)), + 1185 => Box::new(TrialSpawnerLikeProperties::from_props( + props, + &Block::TRIAL_SPAWNER, + )), + 1033 => Box::new(SculkShriekerLikeProperties::from_props( + props, + &Block::SCULK_SHRIEKER, + )), + 848 => Box::new(BellLikeProperties::from_props(props, &Block::BELL)), + 180 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::ACACIA_SHELF, + )), + 181 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::BAMBOO_SHELF, + )), + 182 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::BIRCH_SHELF, + )), + 183 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::CHERRY_SHELF, + )), + 184 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::CRIMSON_SHELF, + )), + 185 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::DARK_OAK_SHELF, + )), + 186 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::JUNGLE_SHELF, + )), + 187 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::MANGROVE_SHELF, + )), + 188 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::OAK_SHELF, + )), + 189 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::PALE_OAK_SHELF, + )), + 190 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::SPRUCE_SHELF, + )), + 191 => Box::new(AcaciaShelfLikeProperties::from_props( + props, + &Block::WARPED_SHELF, + )), + 299 => Box::new(RepeaterLikeProperties::from_props(props, &Block::REPEATER)), + 918 => Box::new(RespawnAnchorLikeProperties::from_props( + props, + &Block::RESPAWN_ANCHOR, + )), + 386 => Box::new(BrewingStandLikeProperties::from_props( + props, + &Block::BREWING_STAND, + )), + 276 => Box::new(SnowLikeProperties::from_props(props, &Block::SNOW)), + 195 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::WALL_TORCH, + )), + 291 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::SOUL_WALL_TORCH, + )), + 293 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::COPPER_WALL_TORCH, + )), + 296 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::CARVED_PUMPKIN, + )), + 297 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::JACK_O_LANTERN, + )), + 362 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::ATTACHED_PUMPKIN_STEM, + )), + 363 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::ATTACHED_MELON_STEM, + )), + 467 => Box::new(WallTorchLikeProperties::from_props(props, &Block::ANVIL)), + 468 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::CHIPPED_ANVIL, + )), + 469 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::DAMAGED_ANVIL, + )), + 579 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::WHITE_WALL_BANNER, + )), + 580 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::ORANGE_WALL_BANNER, + )), + 581 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::MAGENTA_WALL_BANNER, + )), + 582 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIGHT_BLUE_WALL_BANNER, + )), + 583 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::YELLOW_WALL_BANNER, + )), + 584 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIME_WALL_BANNER, + )), + 585 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::PINK_WALL_BANNER, + )), + 586 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::GRAY_WALL_BANNER, + )), + 587 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIGHT_GRAY_WALL_BANNER, + )), + 588 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::CYAN_WALL_BANNER, + )), + 589 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::PURPLE_WALL_BANNER, + )), + 590 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BLUE_WALL_BANNER, + )), + 591 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BROWN_WALL_BANNER, + )), + 592 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::GREEN_WALL_BANNER, + )), + 593 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::RED_WALL_BANNER, + )), + 594 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BLACK_WALL_BANNER, + )), + 694 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::WHITE_GLAZED_TERRACOTTA, + )), + 695 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::ORANGE_GLAZED_TERRACOTTA, + )), + 696 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::MAGENTA_GLAZED_TERRACOTTA, + )), + 697 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIGHT_BLUE_GLAZED_TERRACOTTA, + )), + 698 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::YELLOW_GLAZED_TERRACOTTA, + )), + 699 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIME_GLAZED_TERRACOTTA, + )), + 700 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::PINK_GLAZED_TERRACOTTA, + )), + 701 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::GRAY_GLAZED_TERRACOTTA, + )), + 702 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::LIGHT_GRAY_GLAZED_TERRACOTTA, + )), + 703 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::CYAN_GLAZED_TERRACOTTA, + )), + 704 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::PURPLE_GLAZED_TERRACOTTA, + )), + 705 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BLUE_GLAZED_TERRACOTTA, + )), + 706 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BROWN_GLAZED_TERRACOTTA, + )), + 707 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::GREEN_GLAZED_TERRACOTTA, + )), + 708 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::RED_GLAZED_TERRACOTTA, + )), + 709 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::BLACK_GLAZED_TERRACOTTA, + )), + 838 => Box::new(WallTorchLikeProperties::from_props(props, &Block::LOOM)), + 847 => Box::new(WallTorchLikeProperties::from_props( + props, + &Block::STONECUTTER, + )), + 201 => Box::new(ChestLikeProperties::from_props(props, &Block::CHEST)), + 470 => Box::new(ChestLikeProperties::from_props( + props, + &Block::TRAPPED_CHEST, + )), + 1108 => Box::new(ChestLikeProperties::from_props(props, &Block::COPPER_CHEST)), + 1109 => Box::new(ChestLikeProperties::from_props( + props, + &Block::EXPOSED_COPPER_CHEST, + )), + 1110 => Box::new(ChestLikeProperties::from_props( + props, + &Block::WEATHERED_COPPER_CHEST, + )), + 1111 => Box::new(ChestLikeProperties::from_props( + props, + &Block::OXIDIZED_COPPER_CHEST, + )), + 1112 => Box::new(ChestLikeProperties::from_props( + props, + &Block::WAXED_COPPER_CHEST, + )), + 1113 => Box::new(ChestLikeProperties::from_props( + props, + &Block::WAXED_EXPOSED_COPPER_CHEST, + )), + 1114 => Box::new(ChestLikeProperties::from_props( + props, + &Block::WAXED_WEATHERED_COPPER_CHEST, + )), + 1115 => Box::new(ChestLikeProperties::from_props( + props, + &Block::WAXED_OXIDIZED_COPPER_CHEST, )), 454 => Box::new(SkeletonWallSkullLikeProperties::from_props( props, @@ -572563,77 +572818,13 @@ impl Block { &Block::WAXED_OXIDIZED_COPPER_TRAPDOOR, )), 845 => Box::new(LecternLikeProperties::from_props(props, &Block::LECTERN)), - 848 => Box::new(BellLikeProperties::from_props(props, &Block::BELL)), 401 => Box::new(TripwireHookLikeProperties::from_props( props, &Block::TRIPWIRE_HOOK, )), - 180 => Box::new(AcaciaShelfLikeProperties::from_props( + 473 => Box::new(ComparatorLikeProperties::from_props( props, - &Block::ACACIA_SHELF, - )), - 181 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::BAMBOO_SHELF, - )), - 182 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::BIRCH_SHELF, - )), - 183 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::CHERRY_SHELF, - )), - 184 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::CRIMSON_SHELF, - )), - 185 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::DARK_OAK_SHELF, - )), - 186 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::JUNGLE_SHELF, - )), - 187 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::MANGROVE_SHELF, - )), - 188 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::OAK_SHELF, - )), - 189 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::PALE_OAK_SHELF, - )), - 190 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::SPRUCE_SHELF, - )), - 191 => Box::new(AcaciaShelfLikeProperties::from_props( - props, - &Block::WARPED_SHELF, - )), - 392 => Box::new(EndPortalFrameLikeProperties::from_props( - props, - &Block::END_PORTAL_FRAME, - )), - 209 => Box::new(FurnaceLikeProperties::from_props(props, &Block::FURNACE)), - 274 => Box::new(FurnaceLikeProperties::from_props( - props, - &Block::REDSTONE_WALL_TORCH, - )), - 840 => Box::new(FurnaceLikeProperties::from_props(props, &Block::SMOKER)), - 841 => Box::new(FurnaceLikeProperties::from_props( - props, - &Block::BLAST_FURNACE, - )), - 859 => Box::new(CampfireLikeProperties::from_props(props, &Block::CAMPFIRE)), - 860 => Box::new(CampfireLikeProperties::from_props( - props, - &Block::SOUL_CAMPFIRE, + &Block::COMPARATOR, )), 1116 => Box::new(CopperGolemStatueLikeProperties::from_props( props, @@ -572667,40 +572858,29 @@ impl Block { props, &Block::WAXED_OXIDIZED_COPPER_GOLEM_STATUE, )), - 110 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::WHITE_BED)), - 111 => Box::new(WhiteBedLikeProperties::from_props( + 392 => Box::new(EndPortalFrameLikeProperties::from_props( props, - &Block::ORANGE_BED, + &Block::END_PORTAL_FRAME, )), - 112 => Box::new(WhiteBedLikeProperties::from_props( + 209 => Box::new(FurnaceLikeProperties::from_props(props, &Block::FURNACE)), + 274 => Box::new(FurnaceLikeProperties::from_props( props, - &Block::MAGENTA_BED, + &Block::REDSTONE_WALL_TORCH, )), - 113 => Box::new(WhiteBedLikeProperties::from_props( + 840 => Box::new(FurnaceLikeProperties::from_props(props, &Block::SMOKER)), + 841 => Box::new(FurnaceLikeProperties::from_props( props, - &Block::LIGHT_BLUE_BED, + &Block::BLAST_FURNACE, )), - 114 => Box::new(WhiteBedLikeProperties::from_props( + 859 => Box::new(CampfireLikeProperties::from_props(props, &Block::CAMPFIRE)), + 860 => Box::new(CampfireLikeProperties::from_props( props, - &Block::YELLOW_BED, + &Block::SOUL_CAMPFIRE, )), - 115 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::LIME_BED)), - 116 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::PINK_BED)), - 117 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::GRAY_BED)), - 118 => Box::new(WhiteBedLikeProperties::from_props( + 1147 => Box::new(SmallDripleafLikeProperties::from_props( props, - &Block::LIGHT_GRAY_BED, + &Block::SMALL_DRIPLEAF, )), - 119 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::CYAN_BED)), - 120 => Box::new(WhiteBedLikeProperties::from_props( - props, - &Block::PURPLE_BED, - )), - 121 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BLUE_BED)), - 122 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BROWN_BED)), - 123 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::GREEN_BED)), - 124 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::RED_BED)), - 125 => Box::new(WhiteBedLikeProperties::from_props(props, &Block::BLACK_BED)), 911 => Box::new(BeeNestLikeProperties::from_props(props, &Block::BEE_NEST)), 912 => Box::new(BeeNestLikeProperties::from_props(props, &Block::BEEHIVE)), 1183 => Box::new(DecoratedPotLikeProperties::from_props( @@ -572853,40 +573033,6 @@ impl Block { props, &Block::BIG_DRIPLEAF, )), - 201 => Box::new(ChestLikeProperties::from_props(props, &Block::CHEST)), - 470 => Box::new(ChestLikeProperties::from_props( - props, - &Block::TRAPPED_CHEST, - )), - 1108 => Box::new(ChestLikeProperties::from_props(props, &Block::COPPER_CHEST)), - 1109 => Box::new(ChestLikeProperties::from_props( - props, - &Block::EXPOSED_COPPER_CHEST, - )), - 1110 => Box::new(ChestLikeProperties::from_props( - props, - &Block::WEATHERED_COPPER_CHEST, - )), - 1111 => Box::new(ChestLikeProperties::from_props( - props, - &Block::OXIDIZED_COPPER_CHEST, - )), - 1112 => Box::new(ChestLikeProperties::from_props( - props, - &Block::WAXED_COPPER_CHEST, - )), - 1113 => Box::new(ChestLikeProperties::from_props( - props, - &Block::WAXED_EXPOSED_COPPER_CHEST, - )), - 1114 => Box::new(ChestLikeProperties::from_props( - props, - &Block::WAXED_WEATHERED_COPPER_CHEST, - )), - 1115 => Box::new(ChestLikeProperties::from_props( - props, - &Block::WAXED_OXIDIZED_COPPER_CHEST, - )), 1141 => Box::new(PinkPetalsLikeProperties::from_props( props, &Block::PINK_PETALS, @@ -572900,191 +573046,11 @@ impl Block { &Block::LEAF_LITTER, )), 396 => Box::new(CocoaLikeProperties::from_props(props, &Block::COCOA)), - 1033 => Box::new(SculkShriekerLikeProperties::from_props( - props, - &Block::SCULK_SHRIEKER, - )), - 999 => Box::new(PotentSulfurLikeProperties::from_props( - props, - &Block::POTENT_SULFUR, - )), - 792 => Box::new(BambooLikeProperties::from_props(props, &Block::BAMBOO)), - 918 => Box::new(RespawnAnchorLikeProperties::from_props( - props, - &Block::RESPAWN_ANCHOR, - )), - 655 => Box::new(EndRodLikeProperties::from_props(props, &Block::END_ROD)), - 677 => Box::new(EndRodLikeProperties::from_props(props, &Block::SHULKER_BOX)), - 678 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::WHITE_SHULKER_BOX, - )), - 679 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::ORANGE_SHULKER_BOX, - )), - 680 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::MAGENTA_SHULKER_BOX, - )), - 681 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::LIGHT_BLUE_SHULKER_BOX, - )), - 682 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::YELLOW_SHULKER_BOX, - )), - 683 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::LIME_SHULKER_BOX, - )), - 684 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::PINK_SHULKER_BOX, - )), - 685 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::GRAY_SHULKER_BOX, - )), - 686 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::LIGHT_GRAY_SHULKER_BOX, - )), - 687 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::CYAN_SHULKER_BOX, - )), - 688 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::PURPLE_SHULKER_BOX, - )), - 689 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::BLUE_SHULKER_BOX, - )), - 690 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::BROWN_SHULKER_BOX, - )), - 691 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::GREEN_SHULKER_BOX, - )), - 692 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::RED_SHULKER_BOX, - )), - 693 => Box::new(EndRodLikeProperties::from_props( - props, - &Block::BLACK_SHULKER_BOX, - )), 105 => Box::new(DispenserLikeProperties::from_props( props, &Block::DISPENSER, )), 483 => Box::new(DispenserLikeProperties::from_props(props, &Block::DROPPER)), - 676 => Box::new(ObserverLikeProperties::from_props(props, &Block::OBSERVER)), - 1124 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::LIGHTNING_ROD, - )), - 1125 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::EXPOSED_LIGHTNING_ROD, - )), - 1126 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::WEATHERED_LIGHTNING_ROD, - )), - 1127 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::OXIDIZED_LIGHTNING_ROD, - )), - 1128 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::WAXED_LIGHTNING_ROD, - )), - 1129 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::WAXED_EXPOSED_LIGHTNING_ROD, - )), - 1130 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::WAXED_WEATHERED_LIGHTNING_ROD, - )), - 1131 => Box::new(LightningRodLikeProperties::from_props( - props, - &Block::WAXED_OXIDIZED_LIGHTNING_ROD, - )), - 839 => Box::new(BarrelLikeProperties::from_props(props, &Block::BARREL)), - 980 => Box::new(AmethystClusterLikeProperties::from_props( - props, - &Block::AMETHYST_CLUSTER, - )), - 981 => Box::new(AmethystClusterLikeProperties::from_props( - props, - &Block::LARGE_AMETHYST_BUD, - )), - 982 => Box::new(AmethystClusterLikeProperties::from_props( - props, - &Block::MEDIUM_AMETHYST_BUD, - )), - 983 => Box::new(AmethystClusterLikeProperties::from_props( - props, - &Block::SMALL_AMETHYST_BUD, - )), - 407 => Box::new(CommandBlockLikeProperties::from_props( - props, - &Block::COMMAND_BLOCK, - )), - 668 => Box::new(CommandBlockLikeProperties::from_props( - props, - &Block::REPEATING_COMMAND_BLOCK, - )), - 669 => Box::new(CommandBlockLikeProperties::from_props( - props, - &Block::CHAIN_COMMAND_BLOCK, - )), - 109 => Box::new(NoteBlockLikeProperties::from_props( - props, - &Block::NOTE_BLOCK, - )), - 386 => Box::new(BrewingStandLikeProperties::from_props( - props, - &Block::BREWING_STAND, - )), - 276 => Box::new(SnowLikeProperties::from_props(props, &Block::SNOW)), - 137 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::TALL_SEAGRASS, - )), - 557 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::SUNFLOWER, - )), - 558 => Box::new(TallSeagrassLikeProperties::from_props(props, &Block::LILAC)), - 559 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::ROSE_BUSH, - )), - 560 => Box::new(TallSeagrassLikeProperties::from_props(props, &Block::PEONY)), - 561 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::TALL_GRASS, - )), - 562 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::LARGE_FERN, - )), - 664 => Box::new(TallSeagrassLikeProperties::from_props( - props, - &Block::PITCHER_PLANT, - )), - 663 => Box::new(PitcherCropLikeProperties::from_props( - props, - &Block::PITCHER_CROP, - )), 1184 => Box::new(CrafterLikeProperties::from_props(props, &Block::CRAFTER)), 208 => Box::new(FarmlandLikeProperties::from_props(props, &Block::FARMLAND)), 38 => Box::new(SuspiciousSandLikeProperties::from_props( @@ -573456,17 +573422,42 @@ impl Block { &Block::WAXED_OXIDIZED_COPPER_BULB, )), 402 => Box::new(TripwireLikeProperties::from_props(props, &Block::TRIPWIRE)), - 126 => Box::new(PoweredRailLikeProperties::from_props( + 676 => Box::new(ObserverLikeProperties::from_props(props, &Block::OBSERVER)), + 1124 => Box::new(LightningRodLikeProperties::from_props( props, - &Block::POWERED_RAIL, + &Block::LIGHTNING_ROD, )), - 127 => Box::new(PoweredRailLikeProperties::from_props( + 1125 => Box::new(LightningRodLikeProperties::from_props( props, - &Block::DETECTOR_RAIL, + &Block::EXPOSED_LIGHTNING_ROD, )), - 482 => Box::new(PoweredRailLikeProperties::from_props( + 1126 => Box::new(LightningRodLikeProperties::from_props( props, - &Block::ACTIVATOR_RAIL, + &Block::WEATHERED_LIGHTNING_ROD, + )), + 1127 => Box::new(LightningRodLikeProperties::from_props( + props, + &Block::OXIDIZED_LIGHTNING_ROD, + )), + 1128 => Box::new(LightningRodLikeProperties::from_props( + props, + &Block::WAXED_LIGHTNING_ROD, + )), + 1129 => Box::new(LightningRodLikeProperties::from_props( + props, + &Block::WAXED_EXPOSED_LIGHTNING_ROD, + )), + 1130 => Box::new(LightningRodLikeProperties::from_props( + props, + &Block::WAXED_WEATHERED_LIGHTNING_ROD, + )), + 1131 => Box::new(LightningRodLikeProperties::from_props( + props, + &Block::WAXED_OXIDIZED_LIGHTNING_ROD, + )), + 109 => Box::new(NoteBlockLikeProperties::from_props( + props, + &Block::NOTE_BLOCK, )), 453 => Box::new(SkeletonSkullLikeProperties::from_props( props, @@ -573496,9 +573487,9 @@ impl Block { props, &Block::PIGLIN_HEAD, )), - 907 => Box::new(TestBlockLikeProperties::from_props( + 202 => Box::new(RedstoneWireLikeProperties::from_props( props, - &Block::TEST_BLOCK, + &Block::REDSTONE_WIRE, )), 909 => Box::new(ComposterLikeProperties::from_props( props, @@ -573512,6 +573503,134 @@ impl Block { props, &Block::CAVE_VINES, )), + 379 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::RESIN_BRICK_WALL, + )), + 409 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::COBBLESTONE_WALL, + )), + 410 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::MOSSY_COBBLESTONE_WALL, + )), + 824 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::BRICK_WALL, + )), + 825 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::PRISMARINE_WALL, + )), + 826 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::RED_SANDSTONE_WALL, + )), + 827 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::MOSSY_STONE_BRICK_WALL, + )), + 828 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::GRANITE_WALL, + )), + 829 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::STONE_BRICK_WALL, + )), + 830 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::MUD_BRICK_WALL, + )), + 831 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::NETHER_BRICK_WALL, + )), + 832 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::ANDESITE_WALL, + )), + 833 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::RED_NETHER_BRICK_WALL, + )), + 834 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::SANDSTONE_WALL, + )), + 835 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::END_STONE_BRICK_WALL, + )), + 836 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::DIORITE_WALL, + )), + 926 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::BLACKSTONE_WALL, + )), + 934 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_BLACKSTONE_BRICK_WALL, + )), + 940 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_BLACKSTONE_WALL, + )), + 987 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::TUFF_WALL, + )), + 991 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_TUFF_WALL, + )), + 996 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::TUFF_BRICK_WALL, + )), + 1002 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::SULFUR_WALL, + )), + 1006 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_SULFUR_WALL, + )), + 1010 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::SULFUR_BRICK_WALL, + )), + 1015 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::CINNABAR_WALL, + )), + 1019 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_CINNABAR_WALL, + )), + 1023 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::CINNABAR_BRICK_WALL, + )), + 1155 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::COBBLED_DEEPSLATE_WALL, + )), + 1159 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::POLISHED_DEEPSLATE_WALL, + )), + 1163 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::DEEPSLATE_TILE_WALL, + )), + 1167 => Box::new(ResinBrickWallLikeProperties::from_props( + props, + &Block::DEEPSLATE_BRICK_WALL, + )), 177 => Box::new(TntLikeProperties::from_props(props, &Block::TNT)), 338 => Box::new(BrownMushroomBlockLikeProperties::from_props( props, @@ -573831,10 +573950,15 @@ impl Block { props, &Block::WARPED_FENCE, )), + 839 => Box::new(BarrelLikeProperties::from_props(props, &Block::BARREL)), 1032 => Box::new(SculkCatalystLikeProperties::from_props( props, &Block::SCULK_CATALYST, )), + 139 => Box::new(PistonHeadLikeProperties::from_props( + props, + &Block::PISTON_HEAD, + )), 8 => Box::new(GrassBlockLikeProperties::from_props( props, &Block::GRASS_BLOCK, @@ -573844,6 +573968,108 @@ impl Block { props, &Block::MYCELIUM, )), + 655 => Box::new(EndRodLikeProperties::from_props(props, &Block::END_ROD)), + 677 => Box::new(EndRodLikeProperties::from_props(props, &Block::SHULKER_BOX)), + 678 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::WHITE_SHULKER_BOX, + )), + 679 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::ORANGE_SHULKER_BOX, + )), + 680 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::MAGENTA_SHULKER_BOX, + )), + 681 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::LIGHT_BLUE_SHULKER_BOX, + )), + 682 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::YELLOW_SHULKER_BOX, + )), + 683 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::LIME_SHULKER_BOX, + )), + 684 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::PINK_SHULKER_BOX, + )), + 685 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::GRAY_SHULKER_BOX, + )), + 686 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::LIGHT_GRAY_SHULKER_BOX, + )), + 687 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::CYAN_SHULKER_BOX, + )), + 688 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::PURPLE_SHULKER_BOX, + )), + 689 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::BLUE_SHULKER_BOX, + )), + 690 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::BROWN_SHULKER_BOX, + )), + 691 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::GREEN_SHULKER_BOX, + )), + 692 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::RED_SHULKER_BOX, + )), + 693 => Box::new(EndRodLikeProperties::from_props( + props, + &Block::BLACK_SHULKER_BOX, + )), + 156 => Box::new(MovingPistonLikeProperties::from_props( + props, + &Block::MOVING_PISTON, + )), + 980 => Box::new(AmethystClusterLikeProperties::from_props( + props, + &Block::AMETHYST_CLUSTER, + )), + 981 => Box::new(AmethystClusterLikeProperties::from_props( + props, + &Block::LARGE_AMETHYST_BUD, + )), + 982 => Box::new(AmethystClusterLikeProperties::from_props( + props, + &Block::MEDIUM_AMETHYST_BUD, + )), + 983 => Box::new(AmethystClusterLikeProperties::from_props( + props, + &Block::SMALL_AMETHYST_BUD, + )), + 407 => Box::new(CommandBlockLikeProperties::from_props( + props, + &Block::COMMAND_BLOCK, + )), + 668 => Box::new(CommandBlockLikeProperties::from_props( + props, + &Block::REPEATING_COMMAND_BLOCK, + )), + 669 => Box::new(CommandBlockLikeProperties::from_props( + props, + &Block::CHAIN_COMMAND_BLOCK, + )), + 295 => Box::new(NetherPortalLikeProperties::from_props( + props, + &Block::NETHER_PORTAL, + )), 88 => Box::new(OakLeavesLikeProperties::from_props( props, &Block::OAK_LEAVES, @@ -573944,6 +574170,41 @@ impl Block { props, &Block::BAMBOO_HANGING_SIGN, )), + 137 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::TALL_SEAGRASS, + )), + 557 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::SUNFLOWER, + )), + 558 => Box::new(TallSeagrassLikeProperties::from_props(props, &Block::LILAC)), + 559 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::ROSE_BUSH, + )), + 560 => Box::new(TallSeagrassLikeProperties::from_props(props, &Block::PEONY)), + 561 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::TALL_GRASS, + )), + 562 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::LARGE_FERN, + )), + 664 => Box::new(TallSeagrassLikeProperties::from_props( + props, + &Block::PITCHER_PLANT, + )), + 663 => Box::new(PitcherCropLikeProperties::from_props( + props, + &Block::PITCHER_CROP, + )), + 906 => Box::new(JigsawLikeProperties::from_props(props, &Block::JIGSAW)), + 905 => Box::new(StructureBlockLikeProperties::from_props( + props, + &Block::STRUCTURE_BLOCK, + )), 474 => Box::new(DaylightDetectorLikeProperties::from_props( props, &Block::DAYLIGHT_DETECTOR, @@ -573997,6 +574258,15 @@ impl Block { props, &Block::WAXED_OXIDIZED_COPPER_LANTERN, )), + 222 => Box::new(RailLikeProperties::from_props(props, &Block::RAIL)), + 1133 => Box::new(PointedDripstoneLikeProperties::from_props( + props, + &Block::POINTED_DRIPSTONE, + )), + 1134 => Box::new(PointedDripstoneLikeProperties::from_props( + props, + &Block::SULFUR_SPIKE, + )), 25 => Box::new(OakSaplingLikeProperties::from_props( props, &Block::OAK_SAPLING, @@ -574029,20 +574299,12 @@ impl Block { props, &Block::PALE_OAK_SAPLING, )), + 792 => Box::new(BambooLikeProperties::from_props(props, &Block::BAMBOO)), 207 => Box::new(WheatLikeProperties::from_props(props, &Block::WHEAT)), 364 => Box::new(WheatLikeProperties::from_props(props, &Block::PUMPKIN_STEM)), 365 => Box::new(WheatLikeProperties::from_props(props, &Block::MELON_STEM)), 441 => Box::new(WheatLikeProperties::from_props(props, &Block::CARROTS)), 442 => Box::new(WheatLikeProperties::from_props(props, &Block::POTATOES)), - 906 => Box::new(JigsawLikeProperties::from_props(props, &Block::JIGSAW)), - 1133 => Box::new(PointedDripstoneLikeProperties::from_props( - props, - &Block::POINTED_DRIPSTONE, - )), - 1134 => Box::new(PointedDripstoneLikeProperties::from_props( - props, - &Block::SULFUR_SPIKE, - )), 788 => Box::new(SeaPickleLikeProperties::from_props( props, &Block::SEA_PICKLE, @@ -574179,43 +574441,6 @@ impl Block { props, &Block::HEAVY_CORE, )), - 222 => Box::new(RailLikeProperties::from_props(props, &Block::RAIL)), - 350 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::IRON_CHAIN, - )), - 351 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::COPPER_CHAIN, - )), - 352 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::EXPOSED_COPPER_CHAIN, - )), - 353 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::WEATHERED_COPPER_CHAIN, - )), - 354 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::OXIDIZED_COPPER_CHAIN, - )), - 355 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::WAXED_COPPER_CHAIN, - )), - 356 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::WAXED_EXPOSED_COPPER_CHAIN, - )), - 357 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::WAXED_WEATHERED_COPPER_CHAIN, - )), - 358 => Box::new(IronChainLikeProperties::from_props( - props, - &Block::WAXED_OXIDIZED_COPPER_CHAIN, - )), 210 => Box::new(OakSignLikeProperties::from_props(props, &Block::OAK_SIGN)), 211 => Box::new(OakSignLikeProperties::from_props( props, @@ -574259,238 +574484,9 @@ impl Block { &Block::WARPED_SIGN, )), 525 => Box::new(LightLikeProperties::from_props(props, &Block::LIGHT)), - 20 => Box::new(PaleOakWoodLikeProperties::from_props( + 907 => Box::new(TestBlockLikeProperties::from_props( props, - &Block::PALE_OAK_WOOD, - )), - 49 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::OAK_LOG, - )), - 50 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::SPRUCE_LOG, - )), - 51 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::BIRCH_LOG, - )), - 52 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::JUNGLE_LOG, - )), - 53 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::ACACIA_LOG, - )), - 54 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::CHERRY_LOG, - )), - 55 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::DARK_OAK_LOG, - )), - 56 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::PALE_OAK_LOG, - )), - 57 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::MANGROVE_LOG, - )), - 59 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::MUDDY_MANGROVE_ROOTS, - )), - 60 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::BAMBOO_BLOCK, - )), - 61 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_SPRUCE_LOG, - )), - 62 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_BIRCH_LOG, - )), - 63 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_JUNGLE_LOG, - )), - 64 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_ACACIA_LOG, - )), - 65 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_CHERRY_LOG, - )), - 66 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_DARK_OAK_LOG, - )), - 67 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_PALE_OAK_LOG, - )), - 68 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_OAK_LOG, - )), - 69 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_MANGROVE_LOG, - )), - 70 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_BAMBOO_BLOCK, - )), - 71 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::OAK_WOOD, - )), - 72 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::SPRUCE_WOOD, - )), - 73 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::BIRCH_WOOD, - )), - 74 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::JUNGLE_WOOD, - )), - 75 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::ACACIA_WOOD, - )), - 76 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::CHERRY_WOOD, - )), - 77 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::DARK_OAK_WOOD, - )), - 78 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::MANGROVE_WOOD, - )), - 79 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_OAK_WOOD, - )), - 80 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_SPRUCE_WOOD, - )), - 81 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_BIRCH_WOOD, - )), - 82 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_JUNGLE_WOOD, - )), - 83 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_ACACIA_WOOD, - )), - 84 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_CHERRY_WOOD, - )), - 85 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_DARK_OAK_WOOD, - )), - 86 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_PALE_OAK_WOOD, - )), - 87 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_MANGROVE_WOOD, - )), - 288 => Box::new(PaleOakWoodLikeProperties::from_props(props, &Block::BASALT)), - 289 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::POLISHED_BASALT, - )), - 480 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::QUARTZ_PILLAR, - )), - 537 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::HAY_BLOCK, - )), - 659 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::PURPUR_PILLAR, - )), - 674 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::BONE_BLOCK, - )), - 862 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::WARPED_STEM, - )), - 863 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_WARPED_STEM, - )), - 864 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::WARPED_HYPHAE, - )), - 865 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_WARPED_HYPHAE, - )), - 871 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::CRIMSON_STEM, - )), - 872 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_CRIMSON_STEM, - )), - 873 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::CRIMSON_HYPHAE, - )), - 874 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::STRIPPED_CRIMSON_HYPHAE, - )), - 1151 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::DEEPSLATE, - )), - 1171 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::INFESTED_DEEPSLATE, - )), - 1178 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::OCHRE_FROGLIGHT, - )), - 1179 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::VERDANT_FROGLIGHT, - )), - 1180 => Box::new(PaleOakWoodLikeProperties::from_props( - props, - &Block::PEARLESCENT_FROGLIGHT, - )), - 199 => Box::new(CreakingHeartLikeProperties::from_props( - props, - &Block::CREAKING_HEART, + &Block::TEST_BLOCK, )), 563 => Box::new(WhiteBannerLikeProperties::from_props( props, @@ -574596,6 +574592,10 @@ impl Block { props, &Block::SWEET_BERRY_BUSH, )), + 999 => Box::new(PotentSulfurLikeProperties::from_props( + props, + &Block::POTENT_SULFUR, + )), _ => panic!("Invalid props"), } } @@ -577772,7 +577772,254 @@ impl EnumVariants for WestWall { } } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct GrindstoneLikeProperties { + pub r#face: AttachFace, + pub r#facing: HorizontalFacing, +} +impl BlockProperties for GrindstoneLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + (self.r#face.to_index(), AttachFace::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + r#face: { + let value = index % AttachFace::variant_count(); + index /= AttachFace::variant_count(); + AttachFace::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 844u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "GrindstoneLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "GrindstoneLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "GrindstoneLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("face", self.r#face.to_value()), + ("facing", self.r#facing.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 844u16) { + panic!( + "{} is not a valid block for {}", + block.name, "GrindstoneLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "face" => block_props.r#face = AttachFace::from_value(value), + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct LeverLikeProperties { + pub r#face: AttachFace, + pub r#facing: HorizontalFacing, + pub r#powered: bool, +} +impl BlockProperties for LeverLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#powered as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + (self.r#face.to_index(), AttachFace::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + r#face: { + let value = index % AttachFace::variant_count(); + index /= AttachFace::variant_count(); + AttachFace::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 258u16 + | 275u16 + | 443u16 + | 444u16 + | 445u16 + | 446u16 + | 447u16 + | 448u16 + | 449u16 + | 450u16 + | 451u16 + | 452u16 + | 897u16 + | 898u16 + | 939u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "LeverLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "LeverLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "LeverLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("face", self.r#face.to_value()), + ("facing", self.r#facing.to_value()), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 258u16 + | 275u16 + | 443u16 + | 444u16 + | 445u16 + | 446u16 + | 447u16 + | 448u16 + | 449u16 + | 450u16 + | 451u16 + | 452u16 + | 897u16 + | 898u16 + | 939u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "LeverLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "face" => block_props.r#face = AttachFace::from_value(value), + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakFenceGateLikeProperties { pub r#facing: HorizontalFacing, pub r#in_wall: bool, @@ -577920,7 +578167,445 @@ impl BlockProperties for OakFenceGateLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PaleOakWoodLikeProperties { + pub r#axis: Axis, +} +impl BlockProperties for PaleOakWoodLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#axis.to_index(), Axis::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#axis: { + let value = index % Axis::variant_count(); + index /= Axis::variant_count(); + Axis::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 20u16 + | 49u16 + | 50u16 + | 51u16 + | 52u16 + | 53u16 + | 54u16 + | 55u16 + | 56u16 + | 57u16 + | 59u16 + | 60u16 + | 61u16 + | 62u16 + | 63u16 + | 64u16 + | 65u16 + | 66u16 + | 67u16 + | 68u16 + | 69u16 + | 70u16 + | 71u16 + | 72u16 + | 73u16 + | 74u16 + | 75u16 + | 76u16 + | 77u16 + | 78u16 + | 79u16 + | 80u16 + | 81u16 + | 82u16 + | 83u16 + | 84u16 + | 85u16 + | 86u16 + | 87u16 + | 288u16 + | 289u16 + | 480u16 + | 537u16 + | 659u16 + | 674u16 + | 862u16 + | 863u16 + | 864u16 + | 865u16 + | 871u16 + | 872u16 + | 873u16 + | 874u16 + | 1151u16 + | 1171u16 + | 1178u16 + | 1179u16 + | 1180u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleOakWoodLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "PaleOakWoodLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleOakWoodLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("axis", self.r#axis.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 20u16 + | 49u16 + | 50u16 + | 51u16 + | 52u16 + | 53u16 + | 54u16 + | 55u16 + | 56u16 + | 57u16 + | 59u16 + | 60u16 + | 61u16 + | 62u16 + | 63u16 + | 64u16 + | 65u16 + | 66u16 + | 67u16 + | 68u16 + | 69u16 + | 70u16 + | 71u16 + | 72u16 + | 73u16 + | 74u16 + | 75u16 + | 76u16 + | 77u16 + | 78u16 + | 79u16 + | 80u16 + | 81u16 + | 82u16 + | 83u16 + | 84u16 + | 85u16 + | 86u16 + | 87u16 + | 288u16 + | 289u16 + | 480u16 + | 537u16 + | 659u16 + | 674u16 + | 862u16 + | 863u16 + | 864u16 + | 865u16 + | 871u16 + | 872u16 + | 873u16 + | 874u16 + | 1151u16 + | 1171u16 + | 1178u16 + | 1179u16 + | 1180u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleOakWoodLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "axis" { + block_props.r#axis = Axis::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct CreakingHeartLikeProperties { + pub r#axis: Axis, + pub r#creaking_heart_state: CreakingHeartState, + pub r#natural: bool, +} +impl BlockProperties for CreakingHeartLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#natural as u16, 2), + ( + self.r#creaking_heart_state.to_index(), + CreakingHeartState::variant_count(), + ), + (self.r#axis.to_index(), Axis::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#natural: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#creaking_heart_state: { + let value = index % CreakingHeartState::variant_count(); + index /= CreakingHeartState::variant_count(); + CreakingHeartState::from_index(value) + }, + r#axis: { + let value = index % Axis::variant_count(); + index /= Axis::variant_count(); + Axis::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 199u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CreakingHeartLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "CreakingHeartLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CreakingHeartLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("axis", self.r#axis.to_value()), + ( + "creaking_heart_state", + self.r#creaking_heart_state.to_value(), + ), + ("natural", if self.r#natural { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 199u16) { + panic!( + "{} is not a valid block for {}", + block.name, "CreakingHeartLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "axis" => block_props.r#axis = Axis::from_value(value), + "creaking_heart_state" => { + block_props.r#creaking_heart_state = CreakingHeartState::from_value(value) + } + "natural" => block_props.r#natural = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct IronChainLikeProperties { + pub r#axis: Axis, + pub r#waterlogged: bool, +} +impl BlockProperties for IronChainLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#axis.to_index(), Axis::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#axis: { + let value = index % Axis::variant_count(); + index /= Axis::variant_count(); + Axis::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 350u16 | 351u16 | 352u16 | 353u16 | 354u16 | 355u16 | 356u16 | 357u16 | 358u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "IronChainLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "IronChainLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "IronChainLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("axis", self.r#axis.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 350u16 | 351u16 | 352u16 | 353u16 | 354u16 | 355u16 | 356u16 | 357u16 | 358u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "IronChainLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "axis" => block_props.r#axis = Axis::from_value(value), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CakeLikeProperties { pub r#bites: u8, } @@ -578029,7 +578714,7 @@ impl BlockProperties for CakeLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct JukeboxLikeProperties { pub r#has_record: bool, } @@ -578120,241 +578805,18 @@ impl BlockProperties for JukeboxLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct NetherPortalLikeProperties { - pub r#axis: HorizontalAxis, -} -impl BlockProperties for NetherPortalLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#axis.to_index(), HorizontalAxis::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#axis: { - let value = index % HorizontalAxis::variant_count(); - index /= HorizontalAxis::variant_count(); - HorizontalAxis::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 295u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "NetherPortalLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "NetherPortalLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "NetherPortalLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("axis", self.r#axis.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 295u16) { - panic!( - "{} is not a valid block for {}", - block.name, "NetherPortalLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "axis" { - block_props.r#axis = HorizontalAxis::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PaleMossCarpetLikeProperties { - pub r#bottom: bool, - pub r#east: EastWall, - pub r#north: NorthWall, - pub r#south: SouthWall, - pub r#west: WestWall, -} -impl BlockProperties for PaleMossCarpetLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#west.to_index(), WestWall::variant_count()), - (self.r#south.to_index(), SouthWall::variant_count()), - (self.r#north.to_index(), NorthWall::variant_count()), - (self.r#east.to_index(), EastWall::variant_count()), - (!self.r#bottom as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#west: { - let value = index % WestWall::variant_count(); - index /= WestWall::variant_count(); - WestWall::from_index(value) - }, - r#south: { - let value = index % SouthWall::variant_count(); - index /= SouthWall::variant_count(); - SouthWall::from_index(value) - }, - r#north: { - let value = index % NorthWall::variant_count(); - index /= NorthWall::variant_count(); - NorthWall::from_index(value) - }, - r#east: { - let value = index % EastWall::variant_count(); - index /= EastWall::variant_count(); - EastWall::from_index(value) - }, - r#bottom: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1189u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PaleMossCarpetLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "PaleMossCarpetLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PaleMossCarpetLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("bottom", if self.r#bottom { "true" } else { "false" }), - ("east", self.r#east.to_value()), - ("north", self.r#north.to_value()), - ("south", self.r#south.to_value()), - ("west", self.r#west.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1189u16) { - panic!( - "{} is not a valid block for {}", - block.name, "PaleMossCarpetLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "bottom" => block_props.r#bottom = matches!(*value, "true"), - "east" => block_props.r#east = EastWall::from_value(value), - "north" => block_props.r#north = NorthWall::from_value(value), - "south" => block_props.r#south = SouthWall::from_value(value), - "west" => block_props.r#west = WestWall::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ResinBrickWallLikeProperties { - pub r#east: EastWall, - pub r#north: NorthWall, - pub r#south: SouthWall, - pub r#up: bool, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PoweredRailLikeProperties { + pub r#powered: bool, + pub r#shape: RailShapeStraight, pub r#waterlogged: bool, - pub r#west: WestWall, } -impl BlockProperties for ResinBrickWallLikeProperties { +impl BlockProperties for PoweredRailLikeProperties { fn to_index(&self) -> u16 { let (index, _) = [ - (self.r#west.to_index(), WestWall::variant_count()), (!self.r#waterlogged as u16, 2), - (!self.r#up as u16, 2), - (self.r#south.to_index(), SouthWall::variant_count()), - (self.r#north.to_index(), NorthWall::variant_count()), - (self.r#east.to_index(), EastWall::variant_count()), + (self.r#shape.to_index(), RailShapeStraight::variant_count()), + (!self.r#powered as u16, 2), ] .iter() .fold((0, 1), |(curr, mul), &(val, count)| { @@ -578365,36 +578827,21 @@ impl BlockProperties for ResinBrickWallLikeProperties { #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#west: { - let value = index % WestWall::variant_count(); - index /= WestWall::variant_count(); - WestWall::from_index(value) - }, r#waterlogged: { let value = index % 2; index /= 2; value == 0 }, - r#up: { + r#shape: { + let value = index % RailShapeStraight::variant_count(); + index /= RailShapeStraight::variant_count(); + RailShapeStraight::from_index(value) + }, + r#powered: { let value = index % 2; index /= 2; value == 0 }, - r#south: { - let value = index % SouthWall::variant_count(); - index /= SouthWall::variant_count(); - SouthWall::from_index(value) - }, - r#north: { - let value = index % NorthWall::variant_count(); - index /= NorthWall::variant_count(); - NorthWall::from_index(value) - }, - r#east: { - let value = index % EastWall::variant_count(); - index /= EastWall::variant_count(); - EastWall::from_index(value) - }, } } #[inline] @@ -578403,47 +578850,13 @@ impl BlockProperties for ResinBrickWallLikeProperties { where Self: Sized, { - matches!( - block_id.as_u16(), - 379u16 - | 409u16 - | 410u16 - | 824u16 - | 825u16 - | 826u16 - | 827u16 - | 828u16 - | 829u16 - | 830u16 - | 831u16 - | 832u16 - | 833u16 - | 834u16 - | 835u16 - | 836u16 - | 926u16 - | 934u16 - | 940u16 - | 987u16 - | 991u16 - | 996u16 - | 1002u16 - | 1006u16 - | 1010u16 - | 1015u16 - | 1019u16 - | 1023u16 - | 1155u16 - | 1159u16 - | 1163u16 - | 1167u16 - ) + matches!(block_id.as_u16(), 126u16 | 127u16 | 482u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "ResinBrickWallLikeProperties" + block.name, "PoweredRailLikeProperties" ); } block.states[self.to_index() as usize].id @@ -578453,7 +578866,7 @@ impl BlockProperties for ResinBrickWallLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "ResinBrickWallLikeProperties" + "PoweredRailLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -578470,83 +578883,43 @@ impl BlockProperties for ResinBrickWallLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "ResinBrickWallLikeProperties" + block.name, "PoweredRailLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { vec![ - ("east", self.r#east.to_value()), - ("north", self.r#north.to_value()), - ("south", self.r#south.to_value()), - ("up", if self.r#up { "true" } else { "false" }), + ("powered", if self.r#powered { "true" } else { "false" }), + ("shape", self.r#shape.to_value()), ( "waterlogged", if self.r#waterlogged { "true" } else { "false" }, ), - ("west", self.r#west.to_value()), ] } #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 379u16 - | 409u16 - | 410u16 - | 824u16 - | 825u16 - | 826u16 - | 827u16 - | 828u16 - | 829u16 - | 830u16 - | 831u16 - | 832u16 - | 833u16 - | 834u16 - | 835u16 - | 836u16 - | 926u16 - | 934u16 - | 940u16 - | 987u16 - | 991u16 - | 996u16 - | 1002u16 - | 1006u16 - | 1010u16 - | 1015u16 - | 1019u16 - | 1023u16 - | 1155u16 - | 1159u16 - | 1163u16 - | 1167u16 - ) { + if !matches!(block.id.as_u16(), 126u16 | 127u16 | 482u16) { panic!( "{} is not a valid block for {}", - block.name, "ResinBrickWallLikeProperties" + block.name, "PoweredRailLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { match *key { - "east" => block_props.r#east = EastWall::from_value(value), - "north" => block_props.r#north = NorthWall::from_value(value), - "south" => block_props.r#south = SouthWall::from_value(value), - "up" => block_props.r#up = matches!(*value, "true"), + "powered" => block_props.r#powered = matches!(*value, "true"), + "shape" => block_props.r#shape = RailShapeStraight::from_value(value), "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - "west" => block_props.r#west = WestWall::from_value(value), _ => {} } } block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct DriedGhastLikeProperties { pub r#facing: HorizontalFacing, pub r#hydration: u8, @@ -578677,2820 +579050,7 @@ impl BlockProperties for DriedGhastLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct MovingPistonLikeProperties { - pub r#facing: Facing, - pub r#type: PistonType, -} -impl BlockProperties for MovingPistonLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#type.to_index(), PistonType::variant_count()), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#type: { - let value = index % PistonType::variant_count(); - index /= PistonType::variant_count(); - PistonType::from_index(value) - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 156u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "MovingPistonLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "MovingPistonLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "MovingPistonLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("type", self.r#type.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 156u16) { - panic!( - "{} is not a valid block for {}", - block.name, "MovingPistonLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "type" => block_props.r#type = PistonType::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PistonHeadLikeProperties { - pub r#facing: Facing, - pub r#short: bool, - pub r#type: PistonType, -} -impl BlockProperties for PistonHeadLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#type.to_index(), PistonType::variant_count()), - (!self.r#short as u16, 2), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#type: { - let value = index % PistonType::variant_count(); - index /= PistonType::variant_count(); - PistonType::from_index(value) - }, - r#short: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 139u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PistonHeadLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "PistonHeadLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PistonHeadLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("short", if self.r#short { "true" } else { "false" }), - ("type", self.r#type.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 139u16) { - panic!( - "{} is not a valid block for {}", - block.name, "PistonHeadLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "short" => block_props.r#short = matches!(*value, "true"), - "type" => block_props.r#type = PistonType::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct CalibratedSculkSensorLikeProperties { - pub r#facing: HorizontalFacing, - pub r#power: u8, - pub r#sculk_sensor_phase: SculkSensorPhase, - pub r#waterlogged: bool, -} -impl BlockProperties for CalibratedSculkSensorLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - ( - self.r#sculk_sensor_phase.to_index(), - SculkSensorPhase::variant_count(), - ), - (self.r#power as u16, 16u16), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#sculk_sensor_phase: { - let value = index % SculkSensorPhase::variant_count(); - index /= SculkSensorPhase::variant_count(); - SculkSensorPhase::from_index(value) - }, - r#power: { - let value = (index % 16u16) as u8; - index /= 16u16; - value - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1029u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CalibratedSculkSensorLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "CalibratedSculkSensorLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CalibratedSculkSensorLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ( - "power", - match self.r#power { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - _ => unreachable!(), - }, - ), - ("sculk_sensor_phase", self.r#sculk_sensor_phase.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1029u16) { - panic!( - "{} is not a valid block for {}", - block.name, "CalibratedSculkSensorLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "power" => { - block_props.r#power = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - _ => 0u8, - } - } - "sculk_sensor_phase" => { - block_props.r#sculk_sensor_phase = SculkSensorPhase::from_value(value) - } - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct SculkSensorLikeProperties { - pub r#power: u8, - pub r#sculk_sensor_phase: SculkSensorPhase, - pub r#waterlogged: bool, -} -impl BlockProperties for SculkSensorLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - ( - self.r#sculk_sensor_phase.to_index(), - SculkSensorPhase::variant_count(), - ), - (self.r#power as u16, 16u16), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#sculk_sensor_phase: { - let value = index % SculkSensorPhase::variant_count(); - index /= SculkSensorPhase::variant_count(); - SculkSensorPhase::from_index(value) - }, - r#power: { - let value = (index % 16u16) as u8; - index /= 16u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1028u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkSensorLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "SculkSensorLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkSensorLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "power", - match self.r#power { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - _ => unreachable!(), - }, - ), - ("sculk_sensor_phase", self.r#sculk_sensor_phase.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1028u16) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkSensorLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "power" => { - block_props.r#power = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - _ => 0u8, - } - } - "sculk_sensor_phase" => { - block_props.r#sculk_sensor_phase = SculkSensorPhase::from_value(value) - } - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct StickyPistonLikeProperties { - pub r#extended: bool, - pub r#facing: Facing, -} -impl BlockProperties for StickyPistonLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#facing.to_index(), Facing::variant_count()), - (!self.r#extended as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - r#extended: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 128u16 | 138u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "StickyPistonLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "StickyPistonLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "StickyPistonLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("extended", if self.r#extended { "true" } else { "false" }), - ("facing", self.r#facing.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 128u16 | 138u16) { - panic!( - "{} is not a valid block for {}", - block.name, "StickyPistonLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "extended" => block_props.r#extended = matches!(*value, "true"), - "facing" => block_props.r#facing = Facing::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct RedstoneWireLikeProperties { - pub r#east: EastRedstone, - pub r#north: NorthRedstone, - pub r#power: u8, - pub r#south: SouthRedstone, - pub r#west: WestRedstone, -} -impl BlockProperties for RedstoneWireLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#west.to_index(), WestRedstone::variant_count()), - (self.r#south.to_index(), SouthRedstone::variant_count()), - (self.r#power as u16, 16u16), - (self.r#north.to_index(), NorthRedstone::variant_count()), - (self.r#east.to_index(), EastRedstone::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#west: { - let value = index % WestRedstone::variant_count(); - index /= WestRedstone::variant_count(); - WestRedstone::from_index(value) - }, - r#south: { - let value = index % SouthRedstone::variant_count(); - index /= SouthRedstone::variant_count(); - SouthRedstone::from_index(value) - }, - r#power: { - let value = (index % 16u16) as u8; - index /= 16u16; - value - }, - r#north: { - let value = index % NorthRedstone::variant_count(); - index /= NorthRedstone::variant_count(); - NorthRedstone::from_index(value) - }, - r#east: { - let value = index % EastRedstone::variant_count(); - index /= EastRedstone::variant_count(); - EastRedstone::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 202u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RedstoneWireLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "RedstoneWireLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RedstoneWireLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("east", self.r#east.to_value()), - ("north", self.r#north.to_value()), - ( - "power", - match self.r#power { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - _ => unreachable!(), - }, - ), - ("south", self.r#south.to_value()), - ("west", self.r#west.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 202u16) { - panic!( - "{} is not a valid block for {}", - block.name, "RedstoneWireLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "east" => block_props.r#east = EastRedstone::from_value(value), - "north" => block_props.r#north = NorthRedstone::from_value(value), - "power" => { - block_props.r#power = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - _ => 0u8, - } - } - "south" => block_props.r#south = SouthRedstone::from_value(value), - "west" => block_props.r#west = WestRedstone::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ChiseledBookshelfLikeProperties { - pub r#facing: HorizontalFacing, - pub r#slot_0_occupied: bool, - pub r#slot_1_occupied: bool, - pub r#slot_2_occupied: bool, - pub r#slot_3_occupied: bool, - pub r#slot_4_occupied: bool, - pub r#slot_5_occupied: bool, -} -impl BlockProperties for ChiseledBookshelfLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#slot_5_occupied as u16, 2), - (!self.r#slot_4_occupied as u16, 2), - (!self.r#slot_3_occupied as u16, 2), - (!self.r#slot_2_occupied as u16, 2), - (!self.r#slot_1_occupied as u16, 2), - (!self.r#slot_0_occupied as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#slot_5_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#slot_4_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#slot_3_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#slot_2_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#slot_1_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#slot_0_occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 179u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChiseledBookshelfLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ChiseledBookshelfLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChiseledBookshelfLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ( - "slot_0_occupied", - if self.r#slot_0_occupied { - "true" - } else { - "false" - }, - ), - ( - "slot_1_occupied", - if self.r#slot_1_occupied { - "true" - } else { - "false" - }, - ), - ( - "slot_2_occupied", - if self.r#slot_2_occupied { - "true" - } else { - "false" - }, - ), - ( - "slot_3_occupied", - if self.r#slot_3_occupied { - "true" - } else { - "false" - }, - ), - ( - "slot_4_occupied", - if self.r#slot_4_occupied { - "true" - } else { - "false" - }, - ), - ( - "slot_5_occupied", - if self.r#slot_5_occupied { - "true" - } else { - "false" - }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 179u16) { - panic!( - "{} is not a valid block for {}", - block.name, "ChiseledBookshelfLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "slot_0_occupied" => block_props.r#slot_0_occupied = matches!(*value, "true"), - "slot_1_occupied" => block_props.r#slot_1_occupied = matches!(*value, "true"), - "slot_2_occupied" => block_props.r#slot_2_occupied = matches!(*value, "true"), - "slot_3_occupied" => block_props.r#slot_3_occupied = matches!(*value, "true"), - "slot_4_occupied" => block_props.r#slot_4_occupied = matches!(*value, "true"), - "slot_5_occupied" => block_props.r#slot_5_occupied = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct StructureBlockLikeProperties { - pub r#mode: StructureblockMode, -} -impl BlockProperties for StructureBlockLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#mode.to_index(), StructureblockMode::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#mode: { - let value = index % StructureblockMode::variant_count(); - index /= StructureblockMode::variant_count(); - StructureblockMode::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 905u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "StructureBlockLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "StructureBlockLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "StructureBlockLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("mode", self.r#mode.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 905u16) { - panic!( - "{} is not a valid block for {}", - block.name, "StructureBlockLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "mode" { - block_props.r#mode = StructureblockMode::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ChorusFlowerLikeProperties { - pub r#age: u8, -} -impl BlockProperties for ChorusFlowerLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#age as u16, 6u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#age: { - let value = (index % 6u16) as u8; - index /= 6u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 657u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChorusFlowerLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ChorusFlowerLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChorusFlowerLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - _ => unreachable!(), - }, - )] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 657u16) { - panic!( - "{} is not a valid block for {}", - block.name, "ChorusFlowerLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "age" { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - _ => 0u8, - } - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct CactusLikeProperties { - pub r#age: u8, -} -impl BlockProperties for CactusLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#age as u16, 16u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#age: { - let value = (index % 16u16) as u8; - index /= 16u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 279u16 | 282u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CactusLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "CactusLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CactusLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - _ => unreachable!(), - }, - )] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 279u16 | 282u16) { - panic!( - "{} is not a valid block for {}", - block.name, "CactusLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "age" { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - _ => 0u8, - } - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct FireLikeProperties { - pub r#age: u8, - pub r#east: bool, - pub r#north: bool, - pub r#south: bool, - pub r#up: bool, - pub r#west: bool, -} -impl BlockProperties for FireLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#west as u16, 2), - (!self.r#up as u16, 2), - (!self.r#south as u16, 2), - (!self.r#north as u16, 2), - (!self.r#east as u16, 2), - (self.r#age as u16, 16u16), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#west: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#up: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#south: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#north: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#east: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#age: { - let value = (index % 16u16) as u8; - index /= 16u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 196u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "FireLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "FireLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "FireLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - _ => unreachable!(), - }, - ), - ("east", if self.r#east { "true" } else { "false" }), - ("north", if self.r#north { "true" } else { "false" }), - ("south", if self.r#south { "true" } else { "false" }), - ("up", if self.r#up { "true" } else { "false" }), - ("west", if self.r#west { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 196u16) { - panic!( - "{} is not a valid block for {}", - block.name, "FireLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "age" => { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - _ => 0u8, - } - } - "east" => block_props.r#east = matches!(*value, "true"), - "north" => block_props.r#north = matches!(*value, "true"), - "south" => block_props.r#south = matches!(*value, "true"), - "up" => block_props.r#up = matches!(*value, "true"), - "west" => block_props.r#west = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct HopperLikeProperties { - pub r#enabled: bool, - pub r#facing: FacingHopper, -} -impl BlockProperties for HopperLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#facing.to_index(), FacingHopper::variant_count()), - (!self.r#enabled as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % FacingHopper::variant_count(); - index /= FacingHopper::variant_count(); - FacingHopper::from_index(value) - }, - r#enabled: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 477u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "HopperLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "HopperLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "HopperLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("enabled", if self.r#enabled { "true" } else { "false" }), - ("facing", self.r#facing.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 477u16) { - panic!( - "{} is not a valid block for {}", - block.name, "HopperLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "enabled" => block_props.r#enabled = matches!(*value, "true"), - "facing" => block_props.r#facing = FacingHopper::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct TrialSpawnerLikeProperties { - pub r#ominous: bool, - pub r#trial_spawner_state: TrialSpawnerState, -} -impl BlockProperties for TrialSpawnerLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - ( - self.r#trial_spawner_state.to_index(), - TrialSpawnerState::variant_count(), - ), - (!self.r#ominous as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#trial_spawner_state: { - let value = index % TrialSpawnerState::variant_count(); - index /= TrialSpawnerState::variant_count(); - TrialSpawnerState::from_index(value) - }, - r#ominous: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1185u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "TrialSpawnerLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "TrialSpawnerLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "TrialSpawnerLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("ominous", if self.r#ominous { "true" } else { "false" }), - ("trial_spawner_state", self.r#trial_spawner_state.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1185u16) { - panic!( - "{} is not a valid block for {}", - block.name, "TrialSpawnerLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "ominous" => block_props.r#ominous = matches!(*value, "true"), - "trial_spawner_state" => { - block_props.r#trial_spawner_state = TrialSpawnerState::from_value(value) - } - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ScaffoldingLikeProperties { - pub r#bottom: bool, - pub r#distance: u8, - pub r#waterlogged: bool, -} -impl BlockProperties for ScaffoldingLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#distance as u16, 8u16), - (!self.r#bottom as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#distance: { - let value = (index % 8u16) as u8; - index /= 8u16; - value - }, - r#bottom: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 837u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ScaffoldingLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ScaffoldingLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ScaffoldingLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("bottom", if self.r#bottom { "true" } else { "false" }), - ( - "distance", - match self.r#distance { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - _ => unreachable!(), - }, - ), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 837u16) { - panic!( - "{} is not a valid block for {}", - block.name, "ScaffoldingLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "bottom" => block_props.r#bottom = matches!(*value, "true"), - "distance" => { - block_props.r#distance = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - _ => 0u8, - } - } - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ComparatorLikeProperties { - pub r#facing: HorizontalFacing, - pub r#mode: ModeComparator, - pub r#powered: bool, -} -impl BlockProperties for ComparatorLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (self.r#mode.to_index(), ModeComparator::variant_count()), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#mode: { - let value = index % ModeComparator::variant_count(); - index /= ModeComparator::variant_count(); - ModeComparator::from_index(value) - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 473u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ComparatorLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ComparatorLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ComparatorLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("mode", self.r#mode.to_value()), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 473u16) { - panic!( - "{} is not a valid block for {}", - block.name, "ComparatorLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "mode" => block_props.r#mode = ModeComparator::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct WallTorchLikeProperties { - pub r#facing: HorizontalFacing, -} -impl BlockProperties for WallTorchLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#facing.to_index(), HorizontalFacing::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 195u16 - | 291u16 - | 293u16 - | 296u16 - | 297u16 - | 362u16 - | 363u16 - | 467u16 - | 468u16 - | 469u16 - | 579u16 - | 580u16 - | 581u16 - | 582u16 - | 583u16 - | 584u16 - | 585u16 - | 586u16 - | 587u16 - | 588u16 - | 589u16 - | 590u16 - | 591u16 - | 592u16 - | 593u16 - | 594u16 - | 694u16 - | 695u16 - | 696u16 - | 697u16 - | 698u16 - | 699u16 - | 700u16 - | 701u16 - | 702u16 - | 703u16 - | 704u16 - | 705u16 - | 706u16 - | 707u16 - | 708u16 - | 709u16 - | 838u16 - | 847u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WallTorchLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "WallTorchLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WallTorchLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("facing", self.r#facing.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 195u16 - | 291u16 - | 293u16 - | 296u16 - | 297u16 - | 362u16 - | 363u16 - | 467u16 - | 468u16 - | 469u16 - | 579u16 - | 580u16 - | 581u16 - | 582u16 - | 583u16 - | 584u16 - | 585u16 - | 586u16 - | 587u16 - | 588u16 - | 589u16 - | 590u16 - | 591u16 - | 592u16 - | 593u16 - | 594u16 - | 694u16 - | 695u16 - | 696u16 - | 697u16 - | 698u16 - | 699u16 - | 700u16 - | 701u16 - | 702u16 - | 703u16 - | 704u16 - | 705u16 - | 706u16 - | 707u16 - | 708u16 - | 709u16 - | 838u16 - | 847u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "WallTorchLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "facing" { - block_props.r#facing = HorizontalFacing::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct VaultLikeProperties { - pub r#facing: HorizontalFacing, - pub r#ominous: bool, - pub r#vault_state: VaultState, -} -impl BlockProperties for VaultLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#vault_state.to_index(), VaultState::variant_count()), - (!self.r#ominous as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#vault_state: { - let value = index % VaultState::variant_count(); - index /= VaultState::variant_count(); - VaultState::from_index(value) - }, - r#ominous: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1186u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "VaultLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "VaultLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "VaultLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("ominous", if self.r#ominous { "true" } else { "false" }), - ("vault_state", self.r#vault_state.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1186u16) { - panic!( - "{} is not a valid block for {}", - block.name, "VaultLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "ominous" => block_props.r#ominous = matches!(*value, "true"), - "vault_state" => block_props.r#vault_state = VaultState::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct GrindstoneLikeProperties { - pub r#face: AttachFace, - pub r#facing: HorizontalFacing, -} -impl BlockProperties for GrindstoneLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - (self.r#face.to_index(), AttachFace::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - r#face: { - let value = index % AttachFace::variant_count(); - index /= AttachFace::variant_count(); - AttachFace::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 844u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "GrindstoneLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "GrindstoneLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "GrindstoneLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("face", self.r#face.to_value()), - ("facing", self.r#facing.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 844u16) { - panic!( - "{} is not a valid block for {}", - block.name, "GrindstoneLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "face" => block_props.r#face = AttachFace::from_value(value), - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct LeverLikeProperties { - pub r#face: AttachFace, - pub r#facing: HorizontalFacing, - pub r#powered: bool, -} -impl BlockProperties for LeverLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - (self.r#face.to_index(), AttachFace::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - r#face: { - let value = index % AttachFace::variant_count(); - index /= AttachFace::variant_count(); - AttachFace::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 258u16 - | 275u16 - | 443u16 - | 444u16 - | 445u16 - | 446u16 - | 447u16 - | 448u16 - | 449u16 - | 450u16 - | 451u16 - | 452u16 - | 897u16 - | 898u16 - | 939u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "LeverLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "LeverLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "LeverLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("face", self.r#face.to_value()), - ("facing", self.r#facing.to_value()), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 258u16 - | 275u16 - | 443u16 - | 444u16 - | 445u16 - | 446u16 - | 447u16 - | 448u16 - | 449u16 - | 450u16 - | 451u16 - | 452u16 - | 897u16 - | 898u16 - | 939u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "LeverLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "face" => block_props.r#face = AttachFace::from_value(value), - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct RepeaterLikeProperties { - pub r#delay: u8, - pub r#facing: HorizontalFacing, - pub r#locked: bool, - pub r#powered: bool, -} -impl BlockProperties for RepeaterLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (!self.r#locked as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ((self.r#delay - 1u8) as u16, 4u16), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#locked: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - r#delay: { - let value = (index % 4u16) as u8; - index /= 4u16; - value + 1u8 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 299u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RepeaterLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "RepeaterLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RepeaterLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "delay", - match self.r#delay { - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - _ => unreachable!(), - }, - ), - ("facing", self.r#facing.to_value()), - ("locked", if self.r#locked { "true" } else { "false" }), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 299u16) { - panic!( - "{} is not a valid block for {}", - block.name, "RepeaterLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "delay" => { - block_props.r#delay = match *value { - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - _ => 1u8, - } - } - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "locked" => block_props.r#locked = matches!(*value, "true"), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct OakDoorLikeProperties { - pub r#facing: HorizontalFacing, - pub r#half: DoubleBlockHalf, - pub r#hinge: DoorHinge, - pub r#open: bool, - pub r#powered: bool, -} -impl BlockProperties for OakDoorLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (!self.r#open as u16, 2), - (self.r#hinge.to_index(), DoorHinge::variant_count()), - (self.r#half.to_index(), DoubleBlockHalf::variant_count()), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#open: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#hinge: { - let value = index % DoorHinge::variant_count(); - index /= DoorHinge::variant_count(); - DoorHinge::from_index(value) - }, - r#half: { - let value = index % DoubleBlockHalf::variant_count(); - index /= DoubleBlockHalf::variant_count(); - DoubleBlockHalf::from_index(value) - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 220u16 - | 260u16 - | 646u16 - | 647u16 - | 648u16 - | 649u16 - | 650u16 - | 651u16 - | 652u16 - | 653u16 - | 654u16 - | 899u16 - | 900u16 - | 1076u16 - | 1077u16 - | 1078u16 - | 1079u16 - | 1080u16 - | 1081u16 - | 1082u16 - | 1083u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "OakDoorLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "OakDoorLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "OakDoorLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("half", self.r#half.to_value()), - ("hinge", self.r#hinge.to_value()), - ("open", if self.r#open { "true" } else { "false" }), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 220u16 - | 260u16 - | 646u16 - | 647u16 - | 648u16 - | 649u16 - | 650u16 - | 651u16 - | 652u16 - | 653u16 - | 654u16 - | 899u16 - | 900u16 - | 1076u16 - | 1077u16 - | 1078u16 - | 1079u16 - | 1080u16 - | 1081u16 - | 1082u16 - | 1083u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "OakDoorLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "half" => block_props.r#half = DoubleBlockHalf::from_value(value), - "hinge" => block_props.r#hinge = DoorHinge::from_value(value), - "open" => block_props.r#open = matches!(*value, "true"), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakStairsLikeProperties { pub r#facing: HorizontalFacing, pub r#half: Half, @@ -581745,16 +579305,122 @@ impl BlockProperties for OakStairsLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct SmallDripleafLikeProperties { - pub r#facing: HorizontalFacing, - pub r#half: DoubleBlockHalf, - pub r#waterlogged: bool, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct StickyPistonLikeProperties { + pub r#extended: bool, + pub r#facing: Facing, } -impl BlockProperties for SmallDripleafLikeProperties { +impl BlockProperties for StickyPistonLikeProperties { fn to_index(&self) -> u16 { let (index, _) = [ - (!self.r#waterlogged as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), + (!self.r#extended as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + r#extended: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 128u16 | 138u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "StickyPistonLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "StickyPistonLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "StickyPistonLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("extended", if self.r#extended { "true" } else { "false" }), + ("facing", self.r#facing.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 128u16 | 138u16) { + panic!( + "{} is not a valid block for {}", + block.name, "StickyPistonLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "extended" => block_props.r#extended = matches!(*value, "true"), + "facing" => block_props.r#facing = Facing::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct OakDoorLikeProperties { + pub r#facing: HorizontalFacing, + pub r#half: DoubleBlockHalf, + pub r#hinge: DoorHinge, + pub r#open: bool, + pub r#powered: bool, +} +impl BlockProperties for OakDoorLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#powered as u16, 2), + (!self.r#open as u16, 2), + (self.r#hinge.to_index(), DoorHinge::variant_count()), (self.r#half.to_index(), DoubleBlockHalf::variant_count()), (self.r#facing.to_index(), HorizontalFacing::variant_count()), ] @@ -581767,11 +579433,21 @@ impl BlockProperties for SmallDripleafLikeProperties { #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#waterlogged: { + r#powered: { let value = index % 2; index /= 2; value == 0 }, + r#open: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#hinge: { + let value = index % DoorHinge::variant_count(); + index /= DoorHinge::variant_count(); + DoorHinge::from_index(value) + }, r#half: { let value = index % DoubleBlockHalf::variant_count(); index /= DoubleBlockHalf::variant_count(); @@ -581790,13 +579466,36 @@ impl BlockProperties for SmallDripleafLikeProperties { where Self: Sized, { - matches!(block_id.as_u16(), 1147u16) + matches!( + block_id.as_u16(), + 220u16 + | 260u16 + | 646u16 + | 647u16 + | 648u16 + | 649u16 + | 650u16 + | 651u16 + | 652u16 + | 653u16 + | 654u16 + | 899u16 + | 900u16 + | 1076u16 + | 1077u16 + | 1078u16 + | 1079u16 + | 1080u16 + | 1081u16 + | 1082u16 + | 1083u16 + ) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "SmallDripleafLikeProperties" + block.name, "OakDoorLikeProperties" ); } block.states[self.to_index() as usize].id @@ -581806,7 +579505,7 @@ impl BlockProperties for SmallDripleafLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "SmallDripleafLikeProperties" + "OakDoorLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -581823,7 +579522,7 @@ impl BlockProperties for SmallDripleafLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "SmallDripleafLikeProperties" + block.name, "OakDoorLikeProperties" ); } Self::from_state_id(block.default_state.id, block) @@ -581832,6 +579531,1027 @@ impl BlockProperties for SmallDripleafLikeProperties { vec![ ("facing", self.r#facing.to_value()), ("half", self.r#half.to_value()), + ("hinge", self.r#hinge.to_value()), + ("open", if self.r#open { "true" } else { "false" }), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 220u16 + | 260u16 + | 646u16 + | 647u16 + | 648u16 + | 649u16 + | 650u16 + | 651u16 + | 652u16 + | 653u16 + | 654u16 + | 899u16 + | 900u16 + | 1076u16 + | 1077u16 + | 1078u16 + | 1079u16 + | 1080u16 + | 1081u16 + | 1082u16 + | 1083u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "OakDoorLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "half" => block_props.r#half = DoubleBlockHalf::from_value(value), + "hinge" => block_props.r#hinge = DoorHinge::from_value(value), + "open" => block_props.r#open = matches!(*value, "true"), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ChiseledBookshelfLikeProperties { + pub r#facing: HorizontalFacing, + pub r#slot_0_occupied: bool, + pub r#slot_1_occupied: bool, + pub r#slot_2_occupied: bool, + pub r#slot_3_occupied: bool, + pub r#slot_4_occupied: bool, + pub r#slot_5_occupied: bool, +} +impl BlockProperties for ChiseledBookshelfLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#slot_5_occupied as u16, 2), + (!self.r#slot_4_occupied as u16, 2), + (!self.r#slot_3_occupied as u16, 2), + (!self.r#slot_2_occupied as u16, 2), + (!self.r#slot_1_occupied as u16, 2), + (!self.r#slot_0_occupied as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#slot_5_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#slot_4_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#slot_3_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#slot_2_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#slot_1_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#slot_0_occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 179u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChiseledBookshelfLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "ChiseledBookshelfLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChiseledBookshelfLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ( + "slot_0_occupied", + if self.r#slot_0_occupied { + "true" + } else { + "false" + }, + ), + ( + "slot_1_occupied", + if self.r#slot_1_occupied { + "true" + } else { + "false" + }, + ), + ( + "slot_2_occupied", + if self.r#slot_2_occupied { + "true" + } else { + "false" + }, + ), + ( + "slot_3_occupied", + if self.r#slot_3_occupied { + "true" + } else { + "false" + }, + ), + ( + "slot_4_occupied", + if self.r#slot_4_occupied { + "true" + } else { + "false" + }, + ), + ( + "slot_5_occupied", + if self.r#slot_5_occupied { + "true" + } else { + "false" + }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 179u16) { + panic!( + "{} is not a valid block for {}", + block.name, "ChiseledBookshelfLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "slot_0_occupied" => block_props.r#slot_0_occupied = matches!(*value, "true"), + "slot_1_occupied" => block_props.r#slot_1_occupied = matches!(*value, "true"), + "slot_2_occupied" => block_props.r#slot_2_occupied = matches!(*value, "true"), + "slot_3_occupied" => block_props.r#slot_3_occupied = matches!(*value, "true"), + "slot_4_occupied" => block_props.r#slot_4_occupied = matches!(*value, "true"), + "slot_5_occupied" => block_props.r#slot_5_occupied = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ChorusFlowerLikeProperties { + pub r#age: u8, +} +impl BlockProperties for ChorusFlowerLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#age as u16, 6u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#age: { + let value = (index % 6u16) as u8; + index /= 6u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 657u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChorusFlowerLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "ChorusFlowerLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChorusFlowerLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 657u16) { + panic!( + "{} is not a valid block for {}", + block.name, "ChorusFlowerLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "age" { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + _ => 0u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct CactusLikeProperties { + pub r#age: u8, +} +impl BlockProperties for CactusLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#age as u16, 16u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#age: { + let value = (index % 16u16) as u8; + index /= 16u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 279u16 | 282u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CactusLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "CactusLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CactusLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 279u16 | 282u16) { + panic!( + "{} is not a valid block for {}", + block.name, "CactusLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "age" { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + _ => 0u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct FireLikeProperties { + pub r#age: u8, + pub r#east: bool, + pub r#north: bool, + pub r#south: bool, + pub r#up: bool, + pub r#west: bool, +} +impl BlockProperties for FireLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#west as u16, 2), + (!self.r#up as u16, 2), + (!self.r#south as u16, 2), + (!self.r#north as u16, 2), + (!self.r#east as u16, 2), + (self.r#age as u16, 16u16), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#west: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#up: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#south: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#north: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#east: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#age: { + let value = (index % 16u16) as u8; + index /= 16u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 196u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "FireLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "FireLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "FireLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + _ => unreachable!(), + }, + ), + ("east", if self.r#east { "true" } else { "false" }), + ("north", if self.r#north { "true" } else { "false" }), + ("south", if self.r#south { "true" } else { "false" }), + ("up", if self.r#up { "true" } else { "false" }), + ("west", if self.r#west { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 196u16) { + panic!( + "{} is not a valid block for {}", + block.name, "FireLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "age" => { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + _ => 0u8, + } + } + "east" => block_props.r#east = matches!(*value, "true"), + "north" => block_props.r#north = matches!(*value, "true"), + "south" => block_props.r#south = matches!(*value, "true"), + "up" => block_props.r#up = matches!(*value, "true"), + "west" => block_props.r#west = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct WhiteBedLikeProperties { + pub r#facing: HorizontalFacing, + pub r#occupied: bool, + pub r#part: BedPart, +} +impl BlockProperties for WhiteBedLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#part.to_index(), BedPart::variant_count()), + (!self.r#occupied as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#part: { + let value = index % BedPart::variant_count(); + index /= BedPart::variant_count(); + BedPart::from_index(value) + }, + r#occupied: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 110u16 + | 111u16 + | 112u16 + | 113u16 + | 114u16 + | 115u16 + | 116u16 + | 117u16 + | 118u16 + | 119u16 + | 120u16 + | 121u16 + | 122u16 + | 123u16 + | 124u16 + | 125u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WhiteBedLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "WhiteBedLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WhiteBedLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("occupied", if self.r#occupied { "true" } else { "false" }), + ("part", self.r#part.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 110u16 + | 111u16 + | 112u16 + | 113u16 + | 114u16 + | 115u16 + | 116u16 + | 117u16 + | 118u16 + | 119u16 + | 120u16 + | 121u16 + | 122u16 + | 123u16 + | 124u16 + | 125u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "WhiteBedLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "occupied" => block_props.r#occupied = matches!(*value, "true"), + "part" => block_props.r#part = BedPart::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct HopperLikeProperties { + pub r#enabled: bool, + pub r#facing: FacingHopper, +} +impl BlockProperties for HopperLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#facing.to_index(), FacingHopper::variant_count()), + (!self.r#enabled as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % FacingHopper::variant_count(); + index /= FacingHopper::variant_count(); + FacingHopper::from_index(value) + }, + r#enabled: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 477u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "HopperLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "HopperLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "HopperLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("enabled", if self.r#enabled { "true" } else { "false" }), + ("facing", self.r#facing.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 477u16) { + panic!( + "{} is not a valid block for {}", + block.name, "HopperLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "enabled" => block_props.r#enabled = matches!(*value, "true"), + "facing" => block_props.r#facing = FacingHopper::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct CalibratedSculkSensorLikeProperties { + pub r#facing: HorizontalFacing, + pub r#power: u8, + pub r#sculk_sensor_phase: SculkSensorPhase, + pub r#waterlogged: bool, +} +impl BlockProperties for CalibratedSculkSensorLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + ( + self.r#sculk_sensor_phase.to_index(), + SculkSensorPhase::variant_count(), + ), + (self.r#power as u16, 16u16), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#sculk_sensor_phase: { + let value = index % SculkSensorPhase::variant_count(); + index /= SculkSensorPhase::variant_count(); + SculkSensorPhase::from_index(value) + }, + r#power: { + let value = (index % 16u16) as u8; + index /= 16u16; + value + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1029u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CalibratedSculkSensorLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "CalibratedSculkSensorLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CalibratedSculkSensorLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ( + "power", + match self.r#power { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + _ => unreachable!(), + }, + ), + ("sculk_sensor_phase", self.r#sculk_sensor_phase.to_value()), ( "waterlogged", if self.r#waterlogged { "true" } else { "false" }, @@ -581841,17 +580561,40 @@ impl BlockProperties for SmallDripleafLikeProperties { #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1147u16) { + if !matches!(block.id.as_u16(), 1029u16) { panic!( "{} is not a valid block for {}", - block.name, "SmallDripleafLikeProperties" + block.name, "CalibratedSculkSensorLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { match *key { "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "half" => block_props.r#half = DoubleBlockHalf::from_value(value), + "power" => { + block_props.r#power = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + _ => 0u8, + } + } + "sculk_sensor_phase" => { + block_props.r#sculk_sensor_phase = SculkSensorPhase::from_value(value) + } "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), _ => {} } @@ -581859,7 +580602,1826 @@ impl BlockProperties for SmallDripleafLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct SculkSensorLikeProperties { + pub r#power: u8, + pub r#sculk_sensor_phase: SculkSensorPhase, + pub r#waterlogged: bool, +} +impl BlockProperties for SculkSensorLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + ( + self.r#sculk_sensor_phase.to_index(), + SculkSensorPhase::variant_count(), + ), + (self.r#power as u16, 16u16), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#sculk_sensor_phase: { + let value = index % SculkSensorPhase::variant_count(); + index /= SculkSensorPhase::variant_count(); + SculkSensorPhase::from_index(value) + }, + r#power: { + let value = (index % 16u16) as u8; + index /= 16u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1028u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkSensorLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "SculkSensorLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkSensorLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "power", + match self.r#power { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + _ => unreachable!(), + }, + ), + ("sculk_sensor_phase", self.r#sculk_sensor_phase.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 1028u16) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkSensorLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "power" => { + block_props.r#power = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + _ => 0u8, + } + } + "sculk_sensor_phase" => { + block_props.r#sculk_sensor_phase = SculkSensorPhase::from_value(value) + } + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PaleMossCarpetLikeProperties { + pub r#bottom: bool, + pub r#east: EastWall, + pub r#north: NorthWall, + pub r#south: SouthWall, + pub r#west: WestWall, +} +impl BlockProperties for PaleMossCarpetLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#west.to_index(), WestWall::variant_count()), + (self.r#south.to_index(), SouthWall::variant_count()), + (self.r#north.to_index(), NorthWall::variant_count()), + (self.r#east.to_index(), EastWall::variant_count()), + (!self.r#bottom as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#west: { + let value = index % WestWall::variant_count(); + index /= WestWall::variant_count(); + WestWall::from_index(value) + }, + r#south: { + let value = index % SouthWall::variant_count(); + index /= SouthWall::variant_count(); + SouthWall::from_index(value) + }, + r#north: { + let value = index % NorthWall::variant_count(); + index /= NorthWall::variant_count(); + NorthWall::from_index(value) + }, + r#east: { + let value = index % EastWall::variant_count(); + index /= EastWall::variant_count(); + EastWall::from_index(value) + }, + r#bottom: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1189u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleMossCarpetLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "PaleMossCarpetLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleMossCarpetLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("bottom", if self.r#bottom { "true" } else { "false" }), + ("east", self.r#east.to_value()), + ("north", self.r#north.to_value()), + ("south", self.r#south.to_value()), + ("west", self.r#west.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 1189u16) { + panic!( + "{} is not a valid block for {}", + block.name, "PaleMossCarpetLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "bottom" => block_props.r#bottom = matches!(*value, "true"), + "east" => block_props.r#east = EastWall::from_value(value), + "north" => block_props.r#north = NorthWall::from_value(value), + "south" => block_props.r#south = SouthWall::from_value(value), + "west" => block_props.r#west = WestWall::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ScaffoldingLikeProperties { + pub r#bottom: bool, + pub r#distance: u8, + pub r#waterlogged: bool, +} +impl BlockProperties for ScaffoldingLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#distance as u16, 8u16), + (!self.r#bottom as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#distance: { + let value = (index % 8u16) as u8; + index /= 8u16; + value + }, + r#bottom: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 837u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ScaffoldingLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "ScaffoldingLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ScaffoldingLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("bottom", if self.r#bottom { "true" } else { "false" }), + ( + "distance", + match self.r#distance { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + _ => unreachable!(), + }, + ), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 837u16) { + panic!( + "{} is not a valid block for {}", + block.name, "ScaffoldingLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "bottom" => block_props.r#bottom = matches!(*value, "true"), + "distance" => { + block_props.r#distance = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + _ => 0u8, + } + } + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct VaultLikeProperties { + pub r#facing: HorizontalFacing, + pub r#ominous: bool, + pub r#vault_state: VaultState, +} +impl BlockProperties for VaultLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#vault_state.to_index(), VaultState::variant_count()), + (!self.r#ominous as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#vault_state: { + let value = index % VaultState::variant_count(); + index /= VaultState::variant_count(); + VaultState::from_index(value) + }, + r#ominous: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1186u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "VaultLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "VaultLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "VaultLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("ominous", if self.r#ominous { "true" } else { "false" }), + ("vault_state", self.r#vault_state.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 1186u16) { + panic!( + "{} is not a valid block for {}", + block.name, "VaultLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "ominous" => block_props.r#ominous = matches!(*value, "true"), + "vault_state" => block_props.r#vault_state = VaultState::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct TrialSpawnerLikeProperties { + pub r#ominous: bool, + pub r#trial_spawner_state: TrialSpawnerState, +} +impl BlockProperties for TrialSpawnerLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + ( + self.r#trial_spawner_state.to_index(), + TrialSpawnerState::variant_count(), + ), + (!self.r#ominous as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#trial_spawner_state: { + let value = index % TrialSpawnerState::variant_count(); + index /= TrialSpawnerState::variant_count(); + TrialSpawnerState::from_index(value) + }, + r#ominous: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1185u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "TrialSpawnerLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "TrialSpawnerLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "TrialSpawnerLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("ominous", if self.r#ominous { "true" } else { "false" }), + ("trial_spawner_state", self.r#trial_spawner_state.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 1185u16) { + panic!( + "{} is not a valid block for {}", + block.name, "TrialSpawnerLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "ominous" => block_props.r#ominous = matches!(*value, "true"), + "trial_spawner_state" => { + block_props.r#trial_spawner_state = TrialSpawnerState::from_value(value) + } + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct SculkShriekerLikeProperties { + pub r#can_summon: bool, + pub r#shrieking: bool, + pub r#waterlogged: bool, +} +impl BlockProperties for SculkShriekerLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (!self.r#shrieking as u16, 2), + (!self.r#can_summon as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#shrieking: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#can_summon: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 1033u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkShriekerLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "SculkShriekerLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkShriekerLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "can_summon", + if self.r#can_summon { "true" } else { "false" }, + ), + ("shrieking", if self.r#shrieking { "true" } else { "false" }), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 1033u16) { + panic!( + "{} is not a valid block for {}", + block.name, "SculkShriekerLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "can_summon" => block_props.r#can_summon = matches!(*value, "true"), + "shrieking" => block_props.r#shrieking = matches!(*value, "true"), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct BellLikeProperties { + pub r#attachment: BellAttachment, + pub r#facing: HorizontalFacing, + pub r#powered: bool, +} +impl BlockProperties for BellLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#powered as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ( + self.r#attachment.to_index(), + BellAttachment::variant_count(), + ), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + r#attachment: { + let value = index % BellAttachment::variant_count(); + index /= BellAttachment::variant_count(); + BellAttachment::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 848u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BellLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "BellLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BellLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("attachment", self.r#attachment.to_value()), + ("facing", self.r#facing.to_value()), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 848u16) { + panic!( + "{} is not a valid block for {}", + block.name, "BellLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "attachment" => block_props.r#attachment = BellAttachment::from_value(value), + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct AcaciaShelfLikeProperties { + pub r#facing: HorizontalFacing, + pub r#powered: bool, + pub r#side_chain: SideChainPart, + pub r#waterlogged: bool, +} +impl BlockProperties for AcaciaShelfLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#side_chain.to_index(), SideChainPart::variant_count()), + (!self.r#powered as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#side_chain: { + let value = index % SideChainPart::variant_count(); + index /= SideChainPart::variant_count(); + SideChainPart::from_index(value) + }, + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 180u16 + | 181u16 + | 182u16 + | 183u16 + | 184u16 + | 185u16 + | 186u16 + | 187u16 + | 188u16 + | 189u16 + | 190u16 + | 191u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "AcaciaShelfLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "AcaciaShelfLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "AcaciaShelfLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("powered", if self.r#powered { "true" } else { "false" }), + ("side_chain", self.r#side_chain.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 180u16 + | 181u16 + | 182u16 + | 183u16 + | 184u16 + | 185u16 + | 186u16 + | 187u16 + | 188u16 + | 189u16 + | 190u16 + | 191u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "AcaciaShelfLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "powered" => block_props.r#powered = matches!(*value, "true"), + "side_chain" => block_props.r#side_chain = SideChainPart::from_value(value), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct RepeaterLikeProperties { + pub r#delay: u8, + pub r#facing: HorizontalFacing, + pub r#locked: bool, + pub r#powered: bool, +} +impl BlockProperties for RepeaterLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#powered as u16, 2), + (!self.r#locked as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ((self.r#delay - 1u8) as u16, 4u16), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#locked: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + r#delay: { + let value = (index % 4u16) as u8; + index /= 4u16; + value + 1u8 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 299u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "RepeaterLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "RepeaterLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "RepeaterLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "delay", + match self.r#delay { + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + _ => unreachable!(), + }, + ), + ("facing", self.r#facing.to_value()), + ("locked", if self.r#locked { "true" } else { "false" }), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 299u16) { + panic!( + "{} is not a valid block for {}", + block.name, "RepeaterLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "delay" => { + block_props.r#delay = match *value { + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + _ => 1u8, + } + } + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "locked" => block_props.r#locked = matches!(*value, "true"), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct RespawnAnchorLikeProperties { + pub r#charges: u8, +} +impl BlockProperties for RespawnAnchorLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#charges as u16, 5u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#charges: { + let value = (index % 5u16) as u8; + index /= 5u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 918u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "RespawnAnchorLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "RespawnAnchorLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "RespawnAnchorLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "charges", + match self.r#charges { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 918u16) { + panic!( + "{} is not a valid block for {}", + block.name, "RespawnAnchorLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "charges" { + block_props.r#charges = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + _ => 0u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct BrewingStandLikeProperties { + pub r#has_bottle_0: bool, + pub r#has_bottle_1: bool, + pub r#has_bottle_2: bool, +} +impl BlockProperties for BrewingStandLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#has_bottle_2 as u16, 2), + (!self.r#has_bottle_1 as u16, 2), + (!self.r#has_bottle_0 as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#has_bottle_2: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#has_bottle_1: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#has_bottle_0: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 386u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BrewingStandLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "BrewingStandLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BrewingStandLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "has_bottle_0", + if self.r#has_bottle_0 { "true" } else { "false" }, + ), + ( + "has_bottle_1", + if self.r#has_bottle_1 { "true" } else { "false" }, + ), + ( + "has_bottle_2", + if self.r#has_bottle_2 { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 386u16) { + panic!( + "{} is not a valid block for {}", + block.name, "BrewingStandLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "has_bottle_0" => block_props.r#has_bottle_0 = matches!(*value, "true"), + "has_bottle_1" => block_props.r#has_bottle_1 = matches!(*value, "true"), + "has_bottle_2" => block_props.r#has_bottle_2 = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct SnowLikeProperties { + pub r#layers: u8, +} +impl BlockProperties for SnowLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [((self.r#layers - 1u8) as u16, 8u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#layers: { + let value = (index % 8u16) as u8; + index /= 8u16; + value + 1u8 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 276u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SnowLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "SnowLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "SnowLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "layers", + match self.r#layers { + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 276u16) { + panic!( + "{} is not a valid block for {}", + block.name, "SnowLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "layers" { + block_props.r#layers = match *value { + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + _ => 1u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct WallTorchLikeProperties { + pub r#facing: HorizontalFacing, +} +impl BlockProperties for WallTorchLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#facing.to_index(), HorizontalFacing::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 195u16 + | 291u16 + | 293u16 + | 296u16 + | 297u16 + | 362u16 + | 363u16 + | 467u16 + | 468u16 + | 469u16 + | 579u16 + | 580u16 + | 581u16 + | 582u16 + | 583u16 + | 584u16 + | 585u16 + | 586u16 + | 587u16 + | 588u16 + | 589u16 + | 590u16 + | 591u16 + | 592u16 + | 593u16 + | 594u16 + | 694u16 + | 695u16 + | 696u16 + | 697u16 + | 698u16 + | 699u16 + | 700u16 + | 701u16 + | 702u16 + | 703u16 + | 704u16 + | 705u16 + | 706u16 + | 707u16 + | 708u16 + | 709u16 + | 838u16 + | 847u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WallTorchLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "WallTorchLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WallTorchLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("facing", self.r#facing.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 195u16 + | 291u16 + | 293u16 + | 296u16 + | 297u16 + | 362u16 + | 363u16 + | 467u16 + | 468u16 + | 469u16 + | 579u16 + | 580u16 + | 581u16 + | 582u16 + | 583u16 + | 584u16 + | 585u16 + | 586u16 + | 587u16 + | 588u16 + | 589u16 + | 590u16 + | 591u16 + | 592u16 + | 593u16 + | 594u16 + | 694u16 + | 695u16 + | 696u16 + | 697u16 + | 698u16 + | 699u16 + | 700u16 + | 701u16 + | 702u16 + | 703u16 + | 704u16 + | 705u16 + | 706u16 + | 707u16 + | 708u16 + | 709u16 + | 838u16 + | 847u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "WallTorchLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "facing" { + block_props.r#facing = HorizontalFacing::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ChestLikeProperties { + pub r#facing: HorizontalFacing, + pub r#type: ChestType, + pub r#waterlogged: bool, +} +impl BlockProperties for ChestLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#type.to_index(), ChestType::variant_count()), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#type: { + let value = index % ChestType::variant_count(); + index /= ChestType::variant_count(); + ChestType::from_index(value) + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 201u16 + | 470u16 + | 1108u16 + | 1109u16 + | 1110u16 + | 1111u16 + | 1112u16 + | 1113u16 + | 1114u16 + | 1115u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChestLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "ChestLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ChestLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("type", self.r#type.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 201u16 + | 470u16 + | 1108u16 + | 1109u16 + | 1110u16 + | 1111u16 + | 1112u16 + | 1113u16 + | 1114u16 + | 1115u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "ChestLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "type" => block_props.r#type = ChestType::from_value(value), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SkeletonWallSkullLikeProperties { pub r#facing: HorizontalFacing, pub r#powered: bool, @@ -581967,7 +582529,7 @@ impl BlockProperties for SkeletonWallSkullLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakTrapdoorLikeProperties { pub r#facing: HorizontalFacing, pub r#half: Half, @@ -582145,7 +582707,7 @@ impl BlockProperties for OakTrapdoorLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LecternLikeProperties { pub r#facing: HorizontalFacing, pub r#has_book: bool, @@ -582256,121 +582818,7 @@ impl BlockProperties for LecternLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct BellLikeProperties { - pub r#attachment: BellAttachment, - pub r#facing: HorizontalFacing, - pub r#powered: bool, -} -impl BlockProperties for BellLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ( - self.r#attachment.to_index(), - BellAttachment::variant_count(), - ), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - r#attachment: { - let value = index % BellAttachment::variant_count(); - index /= BellAttachment::variant_count(); - BellAttachment::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 848u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BellLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "BellLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BellLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("attachment", self.r#attachment.to_value()), - ("facing", self.r#facing.to_value()), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 848u16) { - panic!( - "{} is not a valid block for {}", - block.name, "BellLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "attachment" => block_props.r#attachment = BellAttachment::from_value(value), - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct TripwireHookLikeProperties { pub r#attached: bool, pub r#facing: HorizontalFacing, @@ -582481,19 +582929,17 @@ impl BlockProperties for TripwireHookLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct AcaciaShelfLikeProperties { +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ComparatorLikeProperties { pub r#facing: HorizontalFacing, + pub r#mode: ModeComparator, pub r#powered: bool, - pub r#side_chain: SideChainPart, - pub r#waterlogged: bool, } -impl BlockProperties for AcaciaShelfLikeProperties { +impl BlockProperties for ComparatorLikeProperties { fn to_index(&self) -> u16 { let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#side_chain.to_index(), SideChainPart::variant_count()), (!self.r#powered as u16, 2), + (self.r#mode.to_index(), ModeComparator::variant_count()), (self.r#facing.to_index(), HorizontalFacing::variant_count()), ] .iter() @@ -582505,21 +582951,16 @@ impl BlockProperties for AcaciaShelfLikeProperties { #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#side_chain: { - let value = index % SideChainPart::variant_count(); - index /= SideChainPart::variant_count(); - SideChainPart::from_index(value) - }, r#powered: { let value = index % 2; index /= 2; value == 0 }, + r#mode: { + let value = index % ModeComparator::variant_count(); + index /= ModeComparator::variant_count(); + ModeComparator::from_index(value) + }, r#facing: { let value = index % HorizontalFacing::variant_count(); index /= HorizontalFacing::variant_count(); @@ -582533,27 +582974,13 @@ impl BlockProperties for AcaciaShelfLikeProperties { where Self: Sized, { - matches!( - block_id.as_u16(), - 180u16 - | 181u16 - | 182u16 - | 183u16 - | 184u16 - | 185u16 - | 186u16 - | 187u16 - | 188u16 - | 189u16 - | 190u16 - | 191u16 - ) + matches!(block_id.as_u16(), 473u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "AcaciaShelfLikeProperties" + block.name, "ComparatorLikeProperties" ); } block.states[self.to_index() as usize].id @@ -582563,7 +582990,7 @@ impl BlockProperties for AcaciaShelfLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "AcaciaShelfLikeProperties" + "ComparatorLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -582580,7 +583007,7 @@ impl BlockProperties for AcaciaShelfLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "AcaciaShelfLikeProperties" + block.name, "ComparatorLikeProperties" ); } Self::from_state_id(block.default_state.id, block) @@ -582588,8 +583015,124 @@ impl BlockProperties for AcaciaShelfLikeProperties { fn to_props(&self) -> Vec<(&'static str, &'static str)> { vec![ ("facing", self.r#facing.to_value()), + ("mode", self.r#mode.to_value()), ("powered", if self.r#powered { "true" } else { "false" }), - ("side_chain", self.r#side_chain.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 473u16) { + panic!( + "{} is not a valid block for {}", + block.name, "ComparatorLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "mode" => block_props.r#mode = ModeComparator::from_value(value), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct CopperGolemStatueLikeProperties { + pub r#copper_golem_pose: CopperGolemPose, + pub r#facing: HorizontalFacing, + pub r#waterlogged: bool, +} +impl BlockProperties for CopperGolemStatueLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#facing.to_index(), HorizontalFacing::variant_count()), + ( + self.r#copper_golem_pose.to_index(), + CopperGolemPose::variant_count(), + ), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % HorizontalFacing::variant_count(); + index /= HorizontalFacing::variant_count(); + HorizontalFacing::from_index(value) + }, + r#copper_golem_pose: { + let value = index % CopperGolemPose::variant_count(); + index /= CopperGolemPose::variant_count(); + CopperGolemPose::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 1116u16 | 1117u16 | 1118u16 | 1119u16 | 1120u16 | 1121u16 | 1122u16 | 1123u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CopperGolemStatueLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "CopperGolemStatueLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CopperGolemStatueLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("copper_golem_pose", self.r#copper_golem_pose.to_value()), + ("facing", self.r#facing.to_value()), ( "waterlogged", if self.r#waterlogged { "true" } else { "false" }, @@ -582601,30 +583144,20 @@ impl BlockProperties for AcaciaShelfLikeProperties { #[cfg(debug_assertions)] if !matches!( block.id.as_u16(), - 180u16 - | 181u16 - | 182u16 - | 183u16 - | 184u16 - | 185u16 - | 186u16 - | 187u16 - | 188u16 - | 189u16 - | 190u16 - | 191u16 + 1116u16 | 1117u16 | 1118u16 | 1119u16 | 1120u16 | 1121u16 | 1122u16 | 1123u16 ) { panic!( "{} is not a valid block for {}", - block.name, "AcaciaShelfLikeProperties" + block.name, "CopperGolemStatueLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { match *key { + "copper_golem_pose" => { + block_props.r#copper_golem_pose = CopperGolemPose::from_value(value) + } "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - "side_chain" => block_props.r#side_chain = SideChainPart::from_value(value), "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), _ => {} } @@ -582632,7 +583165,7 @@ impl BlockProperties for AcaciaShelfLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct EndPortalFrameLikeProperties { pub r#eye: bool, pub r#facing: HorizontalFacing, @@ -582734,7 +583267,7 @@ impl BlockProperties for EndPortalFrameLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct FurnaceLikeProperties { pub r#facing: HorizontalFacing, pub r#lit: bool, @@ -582836,7 +583369,7 @@ impl BlockProperties for FurnaceLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CampfireLikeProperties { pub r#facing: HorizontalFacing, pub r#lit: bool, @@ -582962,21 +583495,18 @@ impl BlockProperties for CampfireLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct CopperGolemStatueLikeProperties { - pub r#copper_golem_pose: CopperGolemPose, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct SmallDripleafLikeProperties { pub r#facing: HorizontalFacing, + pub r#half: DoubleBlockHalf, pub r#waterlogged: bool, } -impl BlockProperties for CopperGolemStatueLikeProperties { +impl BlockProperties for SmallDripleafLikeProperties { fn to_index(&self) -> u16 { let (index, _) = [ (!self.r#waterlogged as u16, 2), + (self.r#half.to_index(), DoubleBlockHalf::variant_count()), (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ( - self.r#copper_golem_pose.to_index(), - CopperGolemPose::variant_count(), - ), ] .iter() .fold((0, 1), |(curr, mul), &(val, count)| { @@ -582992,16 +583522,16 @@ impl BlockProperties for CopperGolemStatueLikeProperties { index /= 2; value == 0 }, + r#half: { + let value = index % DoubleBlockHalf::variant_count(); + index /= DoubleBlockHalf::variant_count(); + DoubleBlockHalf::from_index(value) + }, r#facing: { let value = index % HorizontalFacing::variant_count(); index /= HorizontalFacing::variant_count(); HorizontalFacing::from_index(value) }, - r#copper_golem_pose: { - let value = index % CopperGolemPose::variant_count(); - index /= CopperGolemPose::variant_count(); - CopperGolemPose::from_index(value) - }, } } #[inline] @@ -583010,16 +583540,13 @@ impl BlockProperties for CopperGolemStatueLikeProperties { where Self: Sized, { - matches!( - block_id.as_u16(), - 1116u16 | 1117u16 | 1118u16 | 1119u16 | 1120u16 | 1121u16 | 1122u16 | 1123u16 - ) + matches!(block_id.as_u16(), 1147u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "CopperGolemStatueLikeProperties" + block.name, "SmallDripleafLikeProperties" ); } block.states[self.to_index() as usize].id @@ -583029,7 +583556,7 @@ impl BlockProperties for CopperGolemStatueLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "CopperGolemStatueLikeProperties" + "SmallDripleafLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -583046,15 +583573,15 @@ impl BlockProperties for CopperGolemStatueLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "CopperGolemStatueLikeProperties" + block.name, "SmallDripleafLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { vec![ - ("copper_golem_pose", self.r#copper_golem_pose.to_value()), ("facing", self.r#facing.to_value()), + ("half", self.r#half.to_value()), ( "waterlogged", if self.r#waterlogged { "true" } else { "false" }, @@ -583064,22 +583591,17 @@ impl BlockProperties for CopperGolemStatueLikeProperties { #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 1116u16 | 1117u16 | 1118u16 | 1119u16 | 1120u16 | 1121u16 | 1122u16 | 1123u16 - ) { + if !matches!(block.id.as_u16(), 1147u16) { panic!( "{} is not a valid block for {}", - block.name, "CopperGolemStatueLikeProperties" + block.name, "SmallDripleafLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { match *key { - "copper_golem_pose" => { - block_props.r#copper_golem_pose = CopperGolemPose::from_value(value) - } "facing" => block_props.r#facing = HorizontalFacing::from_value(value), + "half" => block_props.r#half = DoubleBlockHalf::from_value(value), "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), _ => {} } @@ -583087,154 +583609,7 @@ impl BlockProperties for CopperGolemStatueLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct WhiteBedLikeProperties { - pub r#facing: HorizontalFacing, - pub r#occupied: bool, - pub r#part: BedPart, -} -impl BlockProperties for WhiteBedLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#part.to_index(), BedPart::variant_count()), - (!self.r#occupied as u16, 2), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#part: { - let value = index % BedPart::variant_count(); - index /= BedPart::variant_count(); - BedPart::from_index(value) - }, - r#occupied: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 110u16 - | 111u16 - | 112u16 - | 113u16 - | 114u16 - | 115u16 - | 116u16 - | 117u16 - | 118u16 - | 119u16 - | 120u16 - | 121u16 - | 122u16 - | 123u16 - | 124u16 - | 125u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WhiteBedLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "WhiteBedLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WhiteBedLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("occupied", if self.r#occupied { "true" } else { "false" }), - ("part", self.r#part.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 110u16 - | 111u16 - | 112u16 - | 113u16 - | 114u16 - | 115u16 - | 116u16 - | 117u16 - | 118u16 - | 119u16 - | 120u16 - | 121u16 - | 122u16 - | 123u16 - | 124u16 - | 125u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "WhiteBedLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "occupied" => block_props.r#occupied = matches!(*value, "true"), - "part" => block_props.r#part = BedPart::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct BeeNestLikeProperties { pub r#facing: HorizontalFacing, pub r#honey_level: u8, @@ -583357,7 +583732,7 @@ impl BlockProperties for BeeNestLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct DecoratedPotLikeProperties { pub r#cracked: bool, pub r#facing: HorizontalFacing, @@ -583471,7 +583846,7 @@ impl BlockProperties for DecoratedPotLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LadderLikeProperties { pub r#facing: HorizontalFacing, pub r#waterlogged: bool, @@ -583654,7 +584029,7 @@ impl BlockProperties for LadderLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct BigDripleafLikeProperties { pub r#facing: HorizontalFacing, pub r#tilt: Tilt, @@ -583768,145 +584143,7 @@ impl BlockProperties for BigDripleafLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ChestLikeProperties { - pub r#facing: HorizontalFacing, - pub r#type: ChestType, - pub r#waterlogged: bool, -} -impl BlockProperties for ChestLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#type.to_index(), ChestType::variant_count()), - (self.r#facing.to_index(), HorizontalFacing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#type: { - let value = index % ChestType::variant_count(); - index /= ChestType::variant_count(); - ChestType::from_index(value) - }, - r#facing: { - let value = index % HorizontalFacing::variant_count(); - index /= HorizontalFacing::variant_count(); - HorizontalFacing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 201u16 - | 470u16 - | 1108u16 - | 1109u16 - | 1110u16 - | 1111u16 - | 1112u16 - | 1113u16 - | 1114u16 - | 1115u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChestLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ChestLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ChestLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("type", self.r#type.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 201u16 - | 470u16 - | 1108u16 - | 1109u16 - | 1110u16 - | 1111u16 - | 1112u16 - | 1113u16 - | 1114u16 - | 1115u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "ChestLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = HorizontalFacing::from_value(value), - "type" => block_props.r#type = ChestType::from_value(value), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct PinkPetalsLikeProperties { pub r#facing: HorizontalFacing, pub r#flower_amount: u8, @@ -584025,7 +584262,7 @@ impl BlockProperties for PinkPetalsLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LeafLitterLikeProperties { pub r#facing: HorizontalFacing, pub r#segment_amount: u8, @@ -584144,7 +584381,7 @@ impl BlockProperties for LeafLitterLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CocoaLikeProperties { pub r#age: u8, pub r#facing: HorizontalFacing, @@ -584261,585 +584498,7 @@ impl BlockProperties for CocoaLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct SculkShriekerLikeProperties { - pub r#can_summon: bool, - pub r#shrieking: bool, - pub r#waterlogged: bool, -} -impl BlockProperties for SculkShriekerLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (!self.r#shrieking as u16, 2), - (!self.r#can_summon as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#shrieking: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#can_summon: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 1033u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkShriekerLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "SculkShriekerLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkShriekerLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "can_summon", - if self.r#can_summon { "true" } else { "false" }, - ), - ("shrieking", if self.r#shrieking { "true" } else { "false" }), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 1033u16) { - panic!( - "{} is not a valid block for {}", - block.name, "SculkShriekerLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "can_summon" => block_props.r#can_summon = matches!(*value, "true"), - "shrieking" => block_props.r#shrieking = matches!(*value, "true"), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PotentSulfurLikeProperties { - pub r#potent_sulfur_state: PotentSulfurState, -} -impl BlockProperties for PotentSulfurLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [( - self.r#potent_sulfur_state.to_index(), - PotentSulfurState::variant_count(), - )] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#potent_sulfur_state: { - let value = index % PotentSulfurState::variant_count(); - index /= PotentSulfurState::variant_count(); - PotentSulfurState::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 999u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PotentSulfurLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "PotentSulfurLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PotentSulfurLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("potent_sulfur_state", self.r#potent_sulfur_state.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 999u16) { - panic!( - "{} is not a valid block for {}", - block.name, "PotentSulfurLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "potent_sulfur_state" { - block_props.r#potent_sulfur_state = PotentSulfurState::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct BambooLikeProperties { - pub r#age: u8, - pub r#leaves: BambooLeaves, - pub r#stage: u8, -} -impl BlockProperties for BambooLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#stage as u16, 2u16), - (self.r#leaves.to_index(), BambooLeaves::variant_count()), - (self.r#age as u16, 2u16), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#stage: { - let value = (index % 2u16) as u8; - index /= 2u16; - value - }, - r#leaves: { - let value = index % BambooLeaves::variant_count(); - index /= BambooLeaves::variant_count(); - BambooLeaves::from_index(value) - }, - r#age: { - let value = (index % 2u16) as u8; - index /= 2u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 792u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BambooLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "BambooLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BambooLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - _ => unreachable!(), - }, - ), - ("leaves", self.r#leaves.to_value()), - ( - "stage", - match self.r#stage { - 0u8 => "0", - 1u8 => "1", - _ => unreachable!(), - }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 792u16) { - panic!( - "{} is not a valid block for {}", - block.name, "BambooLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "age" => { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - _ => 0u8, - } - } - "leaves" => block_props.r#leaves = BambooLeaves::from_value(value), - "stage" => { - block_props.r#stage = match *value { - "0" => 0u8, - "1" => 1u8, - _ => 0u8, - } - } - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct RespawnAnchorLikeProperties { - pub r#charges: u8, -} -impl BlockProperties for RespawnAnchorLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#charges as u16, 5u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#charges: { - let value = (index % 5u16) as u8; - index /= 5u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 918u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RespawnAnchorLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "RespawnAnchorLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RespawnAnchorLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "charges", - match self.r#charges { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - _ => unreachable!(), - }, - )] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 918u16) { - panic!( - "{} is not a valid block for {}", - block.name, "RespawnAnchorLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "charges" { - block_props.r#charges = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - _ => 0u8, - } - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct EndRodLikeProperties { - pub r#facing: Facing, -} -impl BlockProperties for EndRodLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#facing.to_index(), Facing::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 655u16 - | 677u16 - | 678u16 - | 679u16 - | 680u16 - | 681u16 - | 682u16 - | 683u16 - | 684u16 - | 685u16 - | 686u16 - | 687u16 - | 688u16 - | 689u16 - | 690u16 - | 691u16 - | 692u16 - | 693u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "EndRodLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "EndRodLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "EndRodLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("facing", self.r#facing.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 655u16 - | 677u16 - | 678u16 - | 679u16 - | 680u16 - | 681u16 - | 682u16 - | 683u16 - | 684u16 - | 685u16 - | 686u16 - | 687u16 - | 688u16 - | 689u16 - | 690u16 - | 691u16 - | 692u16 - | 693u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "EndRodLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "facing" { - block_props.r#facing = Facing::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct DispenserLikeProperties { pub r#facing: Facing, pub r#triggered: bool, @@ -584941,1160 +584600,7 @@ impl BlockProperties for DispenserLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct ObserverLikeProperties { - pub r#facing: Facing, - pub r#powered: bool, -} -impl BlockProperties for ObserverLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 676u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ObserverLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "ObserverLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "ObserverLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 676u16) { - panic!( - "{} is not a valid block for {}", - block.name, "ObserverLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct LightningRodLikeProperties { - pub r#facing: Facing, - pub r#powered: bool, - pub r#waterlogged: bool, -} -impl BlockProperties for LightningRodLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (!self.r#powered as u16, 2), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 1124u16 | 1125u16 | 1126u16 | 1127u16 | 1128u16 | 1129u16 | 1130u16 | 1131u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "LightningRodLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "LightningRodLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "LightningRodLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("powered", if self.r#powered { "true" } else { "false" }), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 1124u16 | 1125u16 | 1126u16 | 1127u16 | 1128u16 | 1129u16 | 1130u16 | 1131u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "LightningRodLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "powered" => block_props.r#powered = matches!(*value, "true"), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct BarrelLikeProperties { - pub r#facing: Facing, - pub r#open: bool, -} -impl BlockProperties for BarrelLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#open as u16, 2), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#open: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 839u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BarrelLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "BarrelLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BarrelLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ("open", if self.r#open { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 839u16) { - panic!( - "{} is not a valid block for {}", - block.name, "BarrelLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "open" => block_props.r#open = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct AmethystClusterLikeProperties { - pub r#facing: Facing, - pub r#waterlogged: bool, -} -impl BlockProperties for AmethystClusterLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#facing.to_index(), Facing::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 980u16 | 981u16 | 982u16 | 983u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "AmethystClusterLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "AmethystClusterLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "AmethystClusterLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("facing", self.r#facing.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 980u16 | 981u16 | 982u16 | 983u16) { - panic!( - "{} is not a valid block for {}", - block.name, "AmethystClusterLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "facing" => block_props.r#facing = Facing::from_value(value), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct CommandBlockLikeProperties { - pub r#conditional: bool, - pub r#facing: Facing, -} -impl BlockProperties for CommandBlockLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#facing.to_index(), Facing::variant_count()), - (!self.r#conditional as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#facing: { - let value = index % Facing::variant_count(); - index /= Facing::variant_count(); - Facing::from_index(value) - }, - r#conditional: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 407u16 | 668u16 | 669u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CommandBlockLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "CommandBlockLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CommandBlockLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "conditional", - if self.r#conditional { "true" } else { "false" }, - ), - ("facing", self.r#facing.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 407u16 | 668u16 | 669u16) { - panic!( - "{} is not a valid block for {}", - block.name, "CommandBlockLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "conditional" => block_props.r#conditional = matches!(*value, "true"), - "facing" => block_props.r#facing = Facing::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct NoteBlockLikeProperties { - pub r#instrument: NoteblockInstrument, - pub r#note: u8, - pub r#powered: bool, -} -impl BlockProperties for NoteBlockLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#powered as u16, 2), - (self.r#note as u16, 25u16), - ( - self.r#instrument.to_index(), - NoteblockInstrument::variant_count(), - ), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#powered: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#note: { - let value = (index % 25u16) as u8; - index /= 25u16; - value - }, - r#instrument: { - let value = index % NoteblockInstrument::variant_count(); - index /= NoteblockInstrument::variant_count(); - NoteblockInstrument::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 109u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "NoteBlockLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "NoteBlockLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "NoteBlockLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("instrument", self.r#instrument.to_value()), - ( - "note", - match self.r#note { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - 9u8 => "9", - 10u8 => "10", - 11u8 => "11", - 12u8 => "12", - 13u8 => "13", - 14u8 => "14", - 15u8 => "15", - 16u8 => "16", - 17u8 => "17", - 18u8 => "18", - 19u8 => "19", - 20u8 => "20", - 21u8 => "21", - 22u8 => "22", - 23u8 => "23", - 24u8 => "24", - _ => unreachable!(), - }, - ), - ("powered", if self.r#powered { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 109u16) { - panic!( - "{} is not a valid block for {}", - block.name, "NoteBlockLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "instrument" => block_props.r#instrument = NoteblockInstrument::from_value(value), - "note" => { - block_props.r#note = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - "9" => 9u8, - "10" => 10u8, - "11" => 11u8, - "12" => 12u8, - "13" => 13u8, - "14" => 14u8, - "15" => 15u8, - "16" => 16u8, - "17" => 17u8, - "18" => 18u8, - "19" => 19u8, - "20" => 20u8, - "21" => 21u8, - "22" => 22u8, - "23" => 23u8, - "24" => 24u8, - _ => 0u8, - } - } - "powered" => block_props.r#powered = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct BrewingStandLikeProperties { - pub r#has_bottle_0: bool, - pub r#has_bottle_1: bool, - pub r#has_bottle_2: bool, -} -impl BlockProperties for BrewingStandLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#has_bottle_2 as u16, 2), - (!self.r#has_bottle_1 as u16, 2), - (!self.r#has_bottle_0 as u16, 2), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#has_bottle_2: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#has_bottle_1: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#has_bottle_0: { - let value = index % 2; - index /= 2; - value == 0 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 386u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BrewingStandLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "BrewingStandLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "BrewingStandLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "has_bottle_0", - if self.r#has_bottle_0 { "true" } else { "false" }, - ), - ( - "has_bottle_1", - if self.r#has_bottle_1 { "true" } else { "false" }, - ), - ( - "has_bottle_2", - if self.r#has_bottle_2 { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 386u16) { - panic!( - "{} is not a valid block for {}", - block.name, "BrewingStandLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "has_bottle_0" => block_props.r#has_bottle_0 = matches!(*value, "true"), - "has_bottle_1" => block_props.r#has_bottle_1 = matches!(*value, "true"), - "has_bottle_2" => block_props.r#has_bottle_2 = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct SnowLikeProperties { - pub r#layers: u8, -} -impl BlockProperties for SnowLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [((self.r#layers - 1u8) as u16, 8u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#layers: { - let value = (index % 8u16) as u8; - index /= 8u16; - value + 1u8 - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 276u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SnowLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "SnowLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "SnowLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "layers", - match self.r#layers { - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - 8u8 => "8", - _ => unreachable!(), - }, - )] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 276u16) { - panic!( - "{} is not a valid block for {}", - block.name, "SnowLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "layers" { - block_props.r#layers = match *value { - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - "8" => 8u8, - _ => 1u8, - } - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct TallSeagrassLikeProperties { - pub r#half: DoubleBlockHalf, -} -impl BlockProperties for TallSeagrassLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#half.to_index(), DoubleBlockHalf::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#half: { - let value = index % DoubleBlockHalf::variant_count(); - index /= DoubleBlockHalf::variant_count(); - DoubleBlockHalf::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 137u16 | 557u16 | 558u16 | 559u16 | 560u16 | 561u16 | 562u16 | 664u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "TallSeagrassLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "TallSeagrassLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "TallSeagrassLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("half", self.r#half.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 137u16 | 557u16 | 558u16 | 559u16 | 560u16 | 561u16 | 562u16 | 664u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "TallSeagrassLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "half" { - block_props.r#half = DoubleBlockHalf::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PitcherCropLikeProperties { - pub r#age: u8, - pub r#half: DoubleBlockHalf, -} -impl BlockProperties for PitcherCropLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (self.r#half.to_index(), DoubleBlockHalf::variant_count()), - (self.r#age as u16, 5u16), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#half: { - let value = index % DoubleBlockHalf::variant_count(); - index /= DoubleBlockHalf::variant_count(); - DoubleBlockHalf::from_index(value) - }, - r#age: { - let value = (index % 5u16) as u8; - index /= 5u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 663u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PitcherCropLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "PitcherCropLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "PitcherCropLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - _ => unreachable!(), - }, - ), - ("half", self.r#half.to_value()), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 663u16) { - panic!( - "{} is not a valid block for {}", - block.name, "PitcherCropLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "age" => { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - _ => 0u8, - } - } - "half" => block_props.r#half = DoubleBlockHalf::from_value(value), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CrafterLikeProperties { pub r#crafting: bool, pub r#orientation: Orientation, @@ -586205,7 +584711,7 @@ impl BlockProperties for CrafterLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct FarmlandLikeProperties { pub r#moisture: u8, } @@ -586316,7 +584822,7 @@ impl BlockProperties for FarmlandLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SuspiciousSandLikeProperties { pub r#dusted: u8, } @@ -586419,7 +584925,7 @@ impl BlockProperties for SuspiciousSandLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct ResinBrickSlabLikeProperties { pub r#type: SlabType, pub r#waterlogged: bool, @@ -586664,7 +585170,7 @@ impl BlockProperties for ResinBrickSlabLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct StonePressurePlateLikeProperties { pub r#powered: bool, } @@ -586784,7 +585290,7 @@ impl BlockProperties for StonePressurePlateLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CopperBulbLikeProperties { pub r#lit: bool, pub r#powered: bool, @@ -586889,7 +585395,7 @@ impl BlockProperties for CopperBulbLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct TripwireLikeProperties { pub r#attached: bool, pub r#disarmed: bool, @@ -587036,18 +585542,16 @@ impl BlockProperties for TripwireLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PoweredRailLikeProperties { +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ObserverLikeProperties { + pub r#facing: Facing, pub r#powered: bool, - pub r#shape: RailShapeStraight, - pub r#waterlogged: bool, } -impl BlockProperties for PoweredRailLikeProperties { +impl BlockProperties for ObserverLikeProperties { fn to_index(&self) -> u16 { let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#shape.to_index(), RailShapeStraight::variant_count()), (!self.r#powered as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), ] .iter() .fold((0, 1), |(curr, mul), &(val, count)| { @@ -587058,21 +585562,16 @@ impl BlockProperties for PoweredRailLikeProperties { #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#shape: { - let value = index % RailShapeStraight::variant_count(); - index /= RailShapeStraight::variant_count(); - RailShapeStraight::from_index(value) - }, r#powered: { let value = index % 2; index /= 2; value == 0 }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, } } #[inline] @@ -587081,13 +585580,13 @@ impl BlockProperties for PoweredRailLikeProperties { where Self: Sized, { - matches!(block_id.as_u16(), 126u16 | 127u16 | 482u16) + matches!(block_id.as_u16(), 676u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "PoweredRailLikeProperties" + block.name, "ObserverLikeProperties" ); } block.states[self.to_index() as usize].id @@ -587097,7 +585596,7 @@ impl BlockProperties for PoweredRailLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "PoweredRailLikeProperties" + "ObserverLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -587114,15 +585613,127 @@ impl BlockProperties for PoweredRailLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "PoweredRailLikeProperties" + block.name, "ObserverLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { vec![ + ("facing", self.r#facing.to_value()), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 676u16) { + panic!( + "{} is not a valid block for {}", + block.name, "ObserverLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = Facing::from_value(value), + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct LightningRodLikeProperties { + pub r#facing: Facing, + pub r#powered: bool, + pub r#waterlogged: bool, +} +impl BlockProperties for LightningRodLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (!self.r#powered as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 1124u16 | 1125u16 | 1126u16 | 1127u16 | 1128u16 | 1129u16 | 1130u16 | 1131u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "LightningRodLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "LightningRodLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "LightningRodLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), ("powered", if self.r#powered { "true" } else { "false" }), - ("shape", self.r#shape.to_value()), ( "waterlogged", if self.r#waterlogged { "true" } else { "false" }, @@ -587132,17 +585743,20 @@ impl BlockProperties for PoweredRailLikeProperties { #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 126u16 | 127u16 | 482u16) { + if !matches!( + block.id.as_u16(), + 1124u16 | 1125u16 | 1126u16 | 1127u16 | 1128u16 | 1129u16 | 1130u16 | 1131u16 + ) { panic!( "{} is not a valid block for {}", - block.name, "PoweredRailLikeProperties" + block.name, "LightningRodLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { match *key { + "facing" => block_props.r#facing = Facing::from_value(value), "powered" => block_props.r#powered = matches!(*value, "true"), - "shape" => block_props.r#shape = RailShapeStraight::from_value(value), "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), _ => {} } @@ -587150,7 +585764,180 @@ impl BlockProperties for PoweredRailLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct NoteBlockLikeProperties { + pub r#instrument: NoteblockInstrument, + pub r#note: u8, + pub r#powered: bool, +} +impl BlockProperties for NoteBlockLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#powered as u16, 2), + (self.r#note as u16, 25u16), + ( + self.r#instrument.to_index(), + NoteblockInstrument::variant_count(), + ), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#powered: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#note: { + let value = (index % 25u16) as u8; + index /= 25u16; + value + }, + r#instrument: { + let value = index % NoteblockInstrument::variant_count(); + index /= NoteblockInstrument::variant_count(); + NoteblockInstrument::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 109u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "NoteBlockLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "NoteBlockLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "NoteBlockLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("instrument", self.r#instrument.to_value()), + ( + "note", + match self.r#note { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + 16u8 => "16", + 17u8 => "17", + 18u8 => "18", + 19u8 => "19", + 20u8 => "20", + 21u8 => "21", + 22u8 => "22", + 23u8 => "23", + 24u8 => "24", + _ => unreachable!(), + }, + ), + ("powered", if self.r#powered { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 109u16) { + panic!( + "{} is not a valid block for {}", + block.name, "NoteBlockLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "instrument" => block_props.r#instrument = NoteblockInstrument::from_value(value), + "note" => { + block_props.r#note = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + "16" => 16u8, + "17" => 17u8, + "18" => 18u8, + "19" => 19u8, + "20" => 20u8, + "21" => 21u8, + "22" => 22u8, + "23" => 23u8, + "24" => 24u8, + _ => 0u8, + } + } + "powered" => block_props.r#powered = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SkeletonSkullLikeProperties { pub r#powered: bool, pub r#rotation: u8, @@ -587296,26 +586083,56 @@ impl BlockProperties for SkeletonSkullLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct TestBlockLikeProperties { - pub r#mode: TestBlockMode, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct RedstoneWireLikeProperties { + pub r#east: EastRedstone, + pub r#north: NorthRedstone, + pub r#power: u8, + pub r#south: SouthRedstone, + pub r#west: WestRedstone, } -impl BlockProperties for TestBlockLikeProperties { +impl BlockProperties for RedstoneWireLikeProperties { fn to_index(&self) -> u16 { - let (index, _) = [(self.r#mode.to_index(), TestBlockMode::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); + let (index, _) = [ + (self.r#west.to_index(), WestRedstone::variant_count()), + (self.r#south.to_index(), SouthRedstone::variant_count()), + (self.r#power as u16, 16u16), + (self.r#north.to_index(), NorthRedstone::variant_count()), + (self.r#east.to_index(), EastRedstone::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); index } #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#mode: { - let value = index % TestBlockMode::variant_count(); - index /= TestBlockMode::variant_count(); - TestBlockMode::from_index(value) + r#west: { + let value = index % WestRedstone::variant_count(); + index /= WestRedstone::variant_count(); + WestRedstone::from_index(value) + }, + r#south: { + let value = index % SouthRedstone::variant_count(); + index /= SouthRedstone::variant_count(); + SouthRedstone::from_index(value) + }, + r#power: { + let value = (index % 16u16) as u8; + index /= 16u16; + value + }, + r#north: { + let value = index % NorthRedstone::variant_count(); + index /= NorthRedstone::variant_count(); + NorthRedstone::from_index(value) + }, + r#east: { + let value = index % EastRedstone::variant_count(); + index /= EastRedstone::variant_count(); + EastRedstone::from_index(value) }, } } @@ -587325,13 +586142,13 @@ impl BlockProperties for TestBlockLikeProperties { where Self: Sized, { - matches!(block_id.as_u16(), 907u16) + matches!(block_id.as_u16(), 202u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "TestBlockLikeProperties" + block.name, "RedstoneWireLikeProperties" ); } block.states[self.to_index() as usize].id @@ -587341,7 +586158,7 @@ impl BlockProperties for TestBlockLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "TestBlockLikeProperties" + "RedstoneWireLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -587358,33 +586175,85 @@ impl BlockProperties for TestBlockLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "TestBlockLikeProperties" + block.name, "RedstoneWireLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("mode", self.r#mode.to_value())] + vec![ + ("east", self.r#east.to_value()), + ("north", self.r#north.to_value()), + ( + "power", + match self.r#power { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + 8u8 => "8", + 9u8 => "9", + 10u8 => "10", + 11u8 => "11", + 12u8 => "12", + 13u8 => "13", + 14u8 => "14", + 15u8 => "15", + _ => unreachable!(), + }, + ), + ("south", self.r#south.to_value()), + ("west", self.r#west.to_value()), + ] } #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 907u16) { + if !matches!(block.id.as_u16(), 202u16) { panic!( "{} is not a valid block for {}", - block.name, "TestBlockLikeProperties" + block.name, "RedstoneWireLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { - if *key == "mode" { - block_props.r#mode = TestBlockMode::from_value(value) + match *key { + "east" => block_props.r#east = EastRedstone::from_value(value), + "north" => block_props.r#north = NorthRedstone::from_value(value), + "power" => { + block_props.r#power = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + "8" => 8u8, + "9" => 9u8, + "10" => 10u8, + "11" => 11u8, + "12" => 12u8, + "13" => 13u8, + "14" => 14u8, + "15" => 15u8, + _ => 0u8, + } + } + "south" => block_props.r#south = SouthRedstone::from_value(value), + "west" => block_props.r#west = WestRedstone::from_value(value), + _ => {} } } block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct ComposterLikeProperties { pub r#level: u8, } @@ -587497,7 +586366,7 @@ impl BlockProperties for ComposterLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CaveVinesPlantLikeProperties { pub r#berries: bool, } @@ -587585,7 +586454,7 @@ impl BlockProperties for CaveVinesPlantLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CaveVinesLikeProperties { pub r#age: u8, pub r#berries: bool, @@ -587745,7 +586614,216 @@ impl BlockProperties for CaveVinesLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct ResinBrickWallLikeProperties { + pub r#east: EastWall, + pub r#north: NorthWall, + pub r#south: SouthWall, + pub r#up: bool, + pub r#waterlogged: bool, + pub r#west: WestWall, +} +impl BlockProperties for ResinBrickWallLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#west.to_index(), WestWall::variant_count()), + (!self.r#waterlogged as u16, 2), + (!self.r#up as u16, 2), + (self.r#south.to_index(), SouthWall::variant_count()), + (self.r#north.to_index(), NorthWall::variant_count()), + (self.r#east.to_index(), EastWall::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#west: { + let value = index % WestWall::variant_count(); + index /= WestWall::variant_count(); + WestWall::from_index(value) + }, + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#up: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#south: { + let value = index % SouthWall::variant_count(); + index /= SouthWall::variant_count(); + SouthWall::from_index(value) + }, + r#north: { + let value = index % NorthWall::variant_count(); + index /= NorthWall::variant_count(); + NorthWall::from_index(value) + }, + r#east: { + let value = index % EastWall::variant_count(); + index /= EastWall::variant_count(); + EastWall::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 379u16 + | 409u16 + | 410u16 + | 824u16 + | 825u16 + | 826u16 + | 827u16 + | 828u16 + | 829u16 + | 830u16 + | 831u16 + | 832u16 + | 833u16 + | 834u16 + | 835u16 + | 836u16 + | 926u16 + | 934u16 + | 940u16 + | 987u16 + | 991u16 + | 996u16 + | 1002u16 + | 1006u16 + | 1010u16 + | 1015u16 + | 1019u16 + | 1023u16 + | 1155u16 + | 1159u16 + | 1163u16 + | 1167u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ResinBrickWallLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "ResinBrickWallLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "ResinBrickWallLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("east", self.r#east.to_value()), + ("north", self.r#north.to_value()), + ("south", self.r#south.to_value()), + ("up", if self.r#up { "true" } else { "false" }), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ("west", self.r#west.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 379u16 + | 409u16 + | 410u16 + | 824u16 + | 825u16 + | 826u16 + | 827u16 + | 828u16 + | 829u16 + | 830u16 + | 831u16 + | 832u16 + | 833u16 + | 834u16 + | 835u16 + | 836u16 + | 926u16 + | 934u16 + | 940u16 + | 987u16 + | 991u16 + | 996u16 + | 1002u16 + | 1006u16 + | 1010u16 + | 1015u16 + | 1019u16 + | 1023u16 + | 1155u16 + | 1159u16 + | 1163u16 + | 1167u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "ResinBrickWallLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "east" => block_props.r#east = EastWall::from_value(value), + "north" => block_props.r#north = NorthWall::from_value(value), + "south" => block_props.r#south = SouthWall::from_value(value), + "up" => block_props.r#up = matches!(*value, "true"), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + "west" => block_props.r#west = WestWall::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct TntLikeProperties { pub r#unstable: bool, } @@ -587833,7 +586911,7 @@ impl BlockProperties for TntLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct BrownMushroomBlockLikeProperties { pub r#down: bool, pub r#east: bool, @@ -587971,7 +587049,7 @@ impl BlockProperties for BrownMushroomBlockLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct GlowLichenLikeProperties { pub r#down: bool, pub r#east: bool, @@ -588121,7 +587199,7 @@ impl BlockProperties for GlowLichenLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct VineLikeProperties { pub r#east: bool, pub r#north: bool, @@ -588250,7 +587328,7 @@ impl BlockProperties for VineLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct RedstoneOreLikeProperties { pub r#lit: bool, } @@ -588384,7 +587462,7 @@ impl BlockProperties for RedstoneOreLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct CandleLikeProperties { pub r#candles: u8, pub r#lit: bool, @@ -588553,7 +587631,7 @@ impl BlockProperties for CandleLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct PaleHangingMossLikeProperties { pub r#tip: bool, } @@ -588641,7 +587719,7 @@ impl BlockProperties for PaleHangingMossLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct BubbleColumnLikeProperties { pub r#drag: bool, } @@ -588729,7 +587807,7 @@ impl BlockProperties for BubbleColumnLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakFenceLikeProperties { pub r#east: bool, pub r#north: bool, @@ -588943,7 +588021,109 @@ impl BlockProperties for OakFenceLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct BarrelLikeProperties { + pub r#facing: Facing, + pub r#open: bool, +} +impl BlockProperties for BarrelLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#open as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#open: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 839u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BarrelLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "BarrelLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BarrelLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("open", if self.r#open { "true" } else { "false" }), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 839u16) { + panic!( + "{} is not a valid block for {}", + block.name, "BarrelLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = Facing::from_value(value), + "open" => block_props.r#open = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SculkCatalystLikeProperties { pub r#bloom: bool, } @@ -589031,7 +588211,118 @@ impl BlockProperties for SculkCatalystLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PistonHeadLikeProperties { + pub r#facing: Facing, + pub r#short: bool, + pub r#type: PistonType, +} +impl BlockProperties for PistonHeadLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#type.to_index(), PistonType::variant_count()), + (!self.r#short as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#type: { + let value = index % PistonType::variant_count(); + index /= PistonType::variant_count(); + PistonType::from_index(value) + }, + r#short: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 139u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PistonHeadLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "PistonHeadLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PistonHeadLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("short", if self.r#short { "true" } else { "false" }), + ("type", self.r#type.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 139u16) { + panic!( + "{} is not a valid block for {}", + block.name, "PistonHeadLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = Facing::from_value(value), + "short" => block_props.r#short = matches!(*value, "true"), + "type" => block_props.r#type = PistonType::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct GrassBlockLikeProperties { pub r#snowy: bool, } @@ -589119,7 +588410,535 @@ impl BlockProperties for GrassBlockLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct EndRodLikeProperties { + pub r#facing: Facing, +} +impl BlockProperties for EndRodLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#facing.to_index(), Facing::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 655u16 + | 677u16 + | 678u16 + | 679u16 + | 680u16 + | 681u16 + | 682u16 + | 683u16 + | 684u16 + | 685u16 + | 686u16 + | 687u16 + | 688u16 + | 689u16 + | 690u16 + | 691u16 + | 692u16 + | 693u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "EndRodLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "EndRodLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "EndRodLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("facing", self.r#facing.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 655u16 + | 677u16 + | 678u16 + | 679u16 + | 680u16 + | 681u16 + | 682u16 + | 683u16 + | 684u16 + | 685u16 + | 686u16 + | 687u16 + | 688u16 + | 689u16 + | 690u16 + | 691u16 + | 692u16 + | 693u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "EndRodLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "facing" { + block_props.r#facing = Facing::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct MovingPistonLikeProperties { + pub r#facing: Facing, + pub r#type: PistonType, +} +impl BlockProperties for MovingPistonLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#type.to_index(), PistonType::variant_count()), + (self.r#facing.to_index(), Facing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#type: { + let value = index % PistonType::variant_count(); + index /= PistonType::variant_count(); + PistonType::from_index(value) + }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 156u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "MovingPistonLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "MovingPistonLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "MovingPistonLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ("type", self.r#type.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 156u16) { + panic!( + "{} is not a valid block for {}", + block.name, "MovingPistonLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = Facing::from_value(value), + "type" => block_props.r#type = PistonType::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct AmethystClusterLikeProperties { + pub r#facing: Facing, + pub r#waterlogged: bool, +} +impl BlockProperties for AmethystClusterLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#facing.to_index(), Facing::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 980u16 | 981u16 | 982u16 | 983u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "AmethystClusterLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "AmethystClusterLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "AmethystClusterLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ("facing", self.r#facing.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 980u16 | 981u16 | 982u16 | 983u16) { + panic!( + "{} is not a valid block for {}", + block.name, "AmethystClusterLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "facing" => block_props.r#facing = Facing::from_value(value), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct CommandBlockLikeProperties { + pub r#conditional: bool, + pub r#facing: Facing, +} +impl BlockProperties for CommandBlockLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#facing.to_index(), Facing::variant_count()), + (!self.r#conditional as u16, 2), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#facing: { + let value = index % Facing::variant_count(); + index /= Facing::variant_count(); + Facing::from_index(value) + }, + r#conditional: { + let value = index % 2; + index /= 2; + value == 0 + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 407u16 | 668u16 | 669u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CommandBlockLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "CommandBlockLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "CommandBlockLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "conditional", + if self.r#conditional { "true" } else { "false" }, + ), + ("facing", self.r#facing.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 407u16 | 668u16 | 669u16) { + panic!( + "{} is not a valid block for {}", + block.name, "CommandBlockLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "conditional" => block_props.r#conditional = matches!(*value, "true"), + "facing" => block_props.r#facing = Facing::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct NetherPortalLikeProperties { + pub r#axis: HorizontalAxis, +} +impl BlockProperties for NetherPortalLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#axis.to_index(), HorizontalAxis::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#axis: { + let value = index % HorizontalAxis::variant_count(); + index /= HorizontalAxis::variant_count(); + HorizontalAxis::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 295u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "NetherPortalLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "NetherPortalLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "NetherPortalLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("axis", self.r#axis.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 295u16) { + panic!( + "{} is not a valid block for {}", + block.name, "NetherPortalLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "axis" { + block_props.r#axis = HorizontalAxis::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakLeavesLikeProperties { pub r#distance: u8, pub r#persistent: bool, @@ -589265,7 +589084,7 @@ impl BlockProperties for OakLeavesLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SnifferEggLikeProperties { pub r#hatch: u8, } @@ -589366,7 +589185,7 @@ impl BlockProperties for SnifferEggLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct TurtleEggLikeProperties { pub r#eggs: u8, pub r#hatch: u8, @@ -589500,7 +589319,7 @@ impl BlockProperties for TurtleEggLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakHangingSignLikeProperties { pub r#attached: bool, pub r#rotation: u8, @@ -589683,7 +589502,398 @@ impl BlockProperties for OakHangingSignLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct TallSeagrassLikeProperties { + pub r#half: DoubleBlockHalf, +} +impl BlockProperties for TallSeagrassLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#half.to_index(), DoubleBlockHalf::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#half: { + let value = index % DoubleBlockHalf::variant_count(); + index /= DoubleBlockHalf::variant_count(); + DoubleBlockHalf::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 137u16 | 557u16 | 558u16 | 559u16 | 560u16 | 561u16 | 562u16 | 664u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "TallSeagrassLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "TallSeagrassLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "TallSeagrassLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("half", self.r#half.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 137u16 | 557u16 | 558u16 | 559u16 | 560u16 | 561u16 | 562u16 | 664u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "TallSeagrassLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "half" { + block_props.r#half = DoubleBlockHalf::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PitcherCropLikeProperties { + pub r#age: u8, + pub r#half: DoubleBlockHalf, +} +impl BlockProperties for PitcherCropLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#half.to_index(), DoubleBlockHalf::variant_count()), + (self.r#age as u16, 5u16), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#half: { + let value = index % DoubleBlockHalf::variant_count(); + index /= DoubleBlockHalf::variant_count(); + DoubleBlockHalf::from_index(value) + }, + r#age: { + let value = (index % 5u16) as u8; + index /= 5u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 663u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PitcherCropLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "PitcherCropLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PitcherCropLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + _ => unreachable!(), + }, + ), + ("half", self.r#half.to_value()), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 663u16) { + panic!( + "{} is not a valid block for {}", + block.name, "PitcherCropLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "age" => { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + _ => 0u8, + } + } + "half" => block_props.r#half = DoubleBlockHalf::from_value(value), + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct JigsawLikeProperties { + pub r#orientation: Orientation, +} +impl BlockProperties for JigsawLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#orientation.to_index(), Orientation::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#orientation: { + let value = index % Orientation::variant_count(); + index /= Orientation::variant_count(); + Orientation::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 906u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "JigsawLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "JigsawLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "JigsawLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("orientation", self.r#orientation.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 906u16) { + panic!( + "{} is not a valid block for {}", + block.name, "JigsawLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "orientation" { + block_props.r#orientation = Orientation::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct StructureBlockLikeProperties { + pub r#mode: StructureblockMode, +} +impl BlockProperties for StructureBlockLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#mode.to_index(), StructureblockMode::variant_count())] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#mode: { + let value = index % StructureblockMode::variant_count(); + index /= StructureblockMode::variant_count(); + StructureblockMode::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 905u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "StructureBlockLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "StructureBlockLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "StructureBlockLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("mode", self.r#mode.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 905u16) { + panic!( + "{} is not a valid block for {}", + block.name, "StructureBlockLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "mode" { + block_props.r#mode = StructureblockMode::from_value(value) + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct DaylightDetectorLikeProperties { pub r#inverted: bool, pub r#power: u8, @@ -589823,7 +590033,7 @@ impl BlockProperties for DaylightDetectorLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct WaterCauldronLikeProperties { pub r#level: u8, } @@ -589924,7 +590134,7 @@ impl BlockProperties for WaterCauldronLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct MangrovePropaguleLikeProperties { pub r#age: u8, pub r#hanging: bool, @@ -590079,7 +590289,7 @@ impl BlockProperties for MangrovePropaguleLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LanternLikeProperties { pub r#hanging: bool, pub r#waterlogged: bool, @@ -590187,26 +590397,35 @@ impl BlockProperties for LanternLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct OakSaplingLikeProperties { - pub r#stage: u8, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct RailLikeProperties { + pub r#shape: RailShape, + pub r#waterlogged: bool, } -impl BlockProperties for OakSaplingLikeProperties { +impl BlockProperties for RailLikeProperties { fn to_index(&self) -> u16 { - let (index, _) = [(self.r#stage as u16, 2u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); + let (index, _) = [ + (!self.r#waterlogged as u16, 2), + (self.r#shape.to_index(), RailShape::variant_count()), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); index } #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#stage: { - let value = (index % 2u16) as u8; - index /= 2u16; - value + r#waterlogged: { + let value = index % 2; + index /= 2; + value == 0 + }, + r#shape: { + let value = index % RailShape::variant_count(); + index /= RailShape::variant_count(); + RailShape::from_index(value) }, } } @@ -590216,16 +590435,13 @@ impl BlockProperties for OakSaplingLikeProperties { where Self: Sized, { - matches!( - block_id.as_u16(), - 25u16 | 26u16 | 27u16 | 28u16 | 29u16 | 30u16 | 31u16 | 32u16 - ) + matches!(block_id.as_u16(), 222u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "OakSaplingLikeProperties" + block.name, "RailLikeProperties" ); } block.states[self.to_index() as usize].id @@ -590235,7 +590451,7 @@ impl BlockProperties for OakSaplingLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "OakSaplingLikeProperties" + "RailLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -590252,252 +590468,41 @@ impl BlockProperties for OakSaplingLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "OakSaplingLikeProperties" + block.name, "RailLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "stage", - match self.r#stage { - 0u8 => "0", - 1u8 => "1", - _ => unreachable!(), - }, - )] + vec![ + ("shape", self.r#shape.to_value()), + ( + "waterlogged", + if self.r#waterlogged { "true" } else { "false" }, + ), + ] } #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 25u16 | 26u16 | 27u16 | 28u16 | 29u16 | 30u16 | 31u16 | 32u16 - ) { + if !matches!(block.id.as_u16(), 222u16) { panic!( "{} is not a valid block for {}", - block.name, "OakSaplingLikeProperties" + block.name, "RailLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { - if *key == "stage" { - block_props.r#stage = match *value { - "0" => 0u8, - "1" => 1u8, - _ => 0u8, - } + match *key { + "shape" => block_props.r#shape = RailShape::from_value(value), + "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), + _ => {} } } block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct WheatLikeProperties { - pub r#age: u8, -} -impl BlockProperties for WheatLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#age as u16, 8u16)] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#age: { - let value = (index % 8u16) as u8; - index /= 8u16; - value - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 207u16 | 364u16 | 365u16 | 441u16 | 442u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WheatLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "WheatLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "WheatLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![( - "age", - match self.r#age { - 0u8 => "0", - 1u8 => "1", - 2u8 => "2", - 3u8 => "3", - 4u8 => "4", - 5u8 => "5", - 6u8 => "6", - 7u8 => "7", - _ => unreachable!(), - }, - )] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 207u16 | 364u16 | 365u16 | 441u16 | 442u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "WheatLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "age" { - block_props.r#age = match *value { - "0" => 0u8, - "1" => 1u8, - "2" => 2u8, - "3" => 3u8, - "4" => 4u8, - "5" => 5u8, - "6" => 6u8, - "7" => 7u8, - _ => 0u8, - } - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct JigsawLikeProperties { - pub r#orientation: Orientation, -} -impl BlockProperties for JigsawLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [(self.r#orientation.to_index(), Orientation::variant_count())] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#orientation: { - let value = index % Orientation::variant_count(); - index /= Orientation::variant_count(); - Orientation::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 906u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "JigsawLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "JigsawLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "JigsawLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("orientation", self.r#orientation.to_value())] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 906u16) { - panic!( - "{} is not a valid block for {}", - block.name, "JigsawLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - if *key == "orientation" { - block_props.r#orientation = Orientation::from_value(value) - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct PointedDripstoneLikeProperties { pub r#thickness: SpeleothemThickness, pub r#vertical_direction: VerticalDirection, @@ -590619,7 +590624,366 @@ impl BlockProperties for PointedDripstoneLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct OakSaplingLikeProperties { + pub r#stage: u8, +} +impl BlockProperties for OakSaplingLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#stage as u16, 2u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#stage: { + let value = (index % 2u16) as u8; + index /= 2u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 25u16 | 26u16 | 27u16 | 28u16 | 29u16 | 30u16 | 31u16 | 32u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "OakSaplingLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "OakSaplingLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "OakSaplingLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "stage", + match self.r#stage { + 0u8 => "0", + 1u8 => "1", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 25u16 | 26u16 | 27u16 | 28u16 | 29u16 | 30u16 | 31u16 | 32u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "OakSaplingLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "stage" { + block_props.r#stage = match *value { + "0" => 0u8, + "1" => 1u8, + _ => 0u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct BambooLikeProperties { + pub r#age: u8, + pub r#leaves: BambooLeaves, + pub r#stage: u8, +} +impl BlockProperties for BambooLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [ + (self.r#stage as u16, 2u16), + (self.r#leaves.to_index(), BambooLeaves::variant_count()), + (self.r#age as u16, 2u16), + ] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#stage: { + let value = (index % 2u16) as u8; + index /= 2u16; + value + }, + r#leaves: { + let value = index % BambooLeaves::variant_count(); + index /= BambooLeaves::variant_count(); + BambooLeaves::from_index(value) + }, + r#age: { + let value = (index % 2u16) as u8; + index /= 2u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 792u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BambooLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "BambooLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "BambooLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![ + ( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + _ => unreachable!(), + }, + ), + ("leaves", self.r#leaves.to_value()), + ( + "stage", + match self.r#stage { + 0u8 => "0", + 1u8 => "1", + _ => unreachable!(), + }, + ), + ] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 792u16) { + panic!( + "{} is not a valid block for {}", + block.name, "BambooLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + match *key { + "age" => { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + _ => 0u8, + } + } + "leaves" => block_props.r#leaves = BambooLeaves::from_value(value), + "stage" => { + block_props.r#stage = match *value { + "0" => 0u8, + "1" => 1u8, + _ => 0u8, + } + } + _ => {} + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct WheatLikeProperties { + pub r#age: u8, +} +impl BlockProperties for WheatLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [(self.r#age as u16, 8u16)] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#age: { + let value = (index % 8u16) as u8; + index /= 8u16; + value + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!( + block_id.as_u16(), + 207u16 | 364u16 | 365u16 | 441u16 | 442u16 + ) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WheatLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "WheatLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "WheatLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![( + "age", + match self.r#age { + 0u8 => "0", + 1u8 => "1", + 2u8 => "2", + 3u8 => "3", + 4u8 => "4", + 5u8 => "5", + 6u8 => "6", + 7u8 => "7", + _ => unreachable!(), + }, + )] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!( + block.id.as_u16(), + 207u16 | 364u16 | 365u16 | 441u16 | 442u16 + ) { + panic!( + "{} is not a valid block for {}", + block.name, "WheatLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "age" { + block_props.r#age = match *value { + "0" => 0u8, + "1" => 1u8, + "2" => 2u8, + "3" => 3u8, + "4" => 4u8, + "5" => 5u8, + "6" => 6u8, + "7" => 7u8, + _ => 0u8, + } + } + } + block_props + } +} +#[derive(Clone, Copy, Eq, PartialEq)] pub struct SeaPickleLikeProperties { pub r#pickles: u8, pub r#waterlogged: bool, @@ -590741,7 +591105,7 @@ impl BlockProperties for SeaPickleLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct MangroveRootsLikeProperties { pub r#waterlogged: bool, } @@ -590902,223 +591266,7 @@ impl BlockProperties for MangroveRootsLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct RailLikeProperties { - pub r#shape: RailShape, - pub r#waterlogged: bool, -} -impl BlockProperties for RailLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#shape.to_index(), RailShape::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#shape: { - let value = index % RailShape::variant_count(); - index /= RailShape::variant_count(); - RailShape::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 222u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RailLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "RailLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "RailLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("shape", self.r#shape.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 222u16) { - panic!( - "{} is not a valid block for {}", - block.name, "RailLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "shape" => block_props.r#shape = RailShape::from_value(value), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct IronChainLikeProperties { - pub r#axis: Axis, - pub r#waterlogged: bool, -} -impl BlockProperties for IronChainLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#waterlogged as u16, 2), - (self.r#axis.to_index(), Axis::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#waterlogged: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#axis: { - let value = index % Axis::variant_count(); - index /= Axis::variant_count(); - Axis::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!( - block_id.as_u16(), - 350u16 | 351u16 | 352u16 | 353u16 | 354u16 | 355u16 | 356u16 | 357u16 | 358u16 - ) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "IronChainLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "IronChainLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "IronChainLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("axis", self.r#axis.to_value()), - ( - "waterlogged", - if self.r#waterlogged { "true" } else { "false" }, - ), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 350u16 | 351u16 | 352u16 | 353u16 | 354u16 | 355u16 | 356u16 | 357u16 | 358u16 - ) { - panic!( - "{} is not a valid block for {}", - block.name, "IronChainLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "axis" => block_props.r#axis = Axis::from_value(value), - "waterlogged" => block_props.r#waterlogged = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct OakSignLikeProperties { pub r#rotation: u8, pub r#waterlogged: bool, @@ -591292,7 +591440,7 @@ impl BlockProperties for OakSignLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LightLikeProperties { pub r#level: u8, pub r#waterlogged: bool, @@ -591438,13 +591586,13 @@ impl BlockProperties for LightLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct PaleOakWoodLikeProperties { - pub r#axis: Axis, +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct TestBlockLikeProperties { + pub r#mode: TestBlockMode, } -impl BlockProperties for PaleOakWoodLikeProperties { +impl BlockProperties for TestBlockLikeProperties { fn to_index(&self) -> u16 { - let (index, _) = [(self.r#axis.to_index(), Axis::variant_count())] + let (index, _) = [(self.r#mode.to_index(), TestBlockMode::variant_count())] .iter() .fold((0, 1), |(curr, mul), &(val, count)| { (curr + val * mul, mul * count) @@ -591454,10 +591602,10 @@ impl BlockProperties for PaleOakWoodLikeProperties { #[allow(unused_assignments)] fn from_index(mut index: u16) -> Self { Self { - r#axis: { - let value = index % Axis::variant_count(); - index /= Axis::variant_count(); - Axis::from_index(value) + r#mode: { + let value = index % TestBlockMode::variant_count(); + index /= TestBlockMode::variant_count(); + TestBlockMode::from_index(value) }, } } @@ -591467,73 +591615,13 @@ impl BlockProperties for PaleOakWoodLikeProperties { where Self: Sized, { - matches!( - block_id.as_u16(), - 20u16 - | 49u16 - | 50u16 - | 51u16 - | 52u16 - | 53u16 - | 54u16 - | 55u16 - | 56u16 - | 57u16 - | 59u16 - | 60u16 - | 61u16 - | 62u16 - | 63u16 - | 64u16 - | 65u16 - | 66u16 - | 67u16 - | 68u16 - | 69u16 - | 70u16 - | 71u16 - | 72u16 - | 73u16 - | 74u16 - | 75u16 - | 76u16 - | 77u16 - | 78u16 - | 79u16 - | 80u16 - | 81u16 - | 82u16 - | 83u16 - | 84u16 - | 85u16 - | 86u16 - | 87u16 - | 288u16 - | 289u16 - | 480u16 - | 537u16 - | 659u16 - | 674u16 - | 862u16 - | 863u16 - | 864u16 - | 865u16 - | 871u16 - | 872u16 - | 873u16 - | 874u16 - | 1151u16 - | 1171u16 - | 1178u16 - | 1179u16 - | 1180u16 - ) + matches!(block_id.as_u16(), 907u16) } fn to_state_id(&self, block: &Block) -> BlockStateId { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "PaleOakWoodLikeProperties" + block.name, "TestBlockLikeProperties" ); } block.states[self.to_index() as usize].id @@ -591543,7 +591631,7 @@ impl BlockProperties for PaleOakWoodLikeProperties { Self::handles_block_id(block.id), "{} is not a valid block for {}", block.name, - "PaleOakWoodLikeProperties" + "TestBlockLikeProperties" ); let min_id = block.states[0].id.as_u16(); let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); @@ -591560,212 +591648,33 @@ impl BlockProperties for PaleOakWoodLikeProperties { if !Self::handles_block_id(block.id) { panic!( "{} is not a valid block for {}", - block.name, "PaleOakWoodLikeProperties" + block.name, "TestBlockLikeProperties" ); } Self::from_state_id(block.default_state.id, block) } fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![("axis", self.r#axis.to_value())] + vec![("mode", self.r#mode.to_value())] } #[allow(clippy::manual_range_patterns)] fn from_props(props: &[(&str, &str)], block: &Block) -> Self { #[cfg(debug_assertions)] - if !matches!( - block.id.as_u16(), - 20u16 - | 49u16 - | 50u16 - | 51u16 - | 52u16 - | 53u16 - | 54u16 - | 55u16 - | 56u16 - | 57u16 - | 59u16 - | 60u16 - | 61u16 - | 62u16 - | 63u16 - | 64u16 - | 65u16 - | 66u16 - | 67u16 - | 68u16 - | 69u16 - | 70u16 - | 71u16 - | 72u16 - | 73u16 - | 74u16 - | 75u16 - | 76u16 - | 77u16 - | 78u16 - | 79u16 - | 80u16 - | 81u16 - | 82u16 - | 83u16 - | 84u16 - | 85u16 - | 86u16 - | 87u16 - | 288u16 - | 289u16 - | 480u16 - | 537u16 - | 659u16 - | 674u16 - | 862u16 - | 863u16 - | 864u16 - | 865u16 - | 871u16 - | 872u16 - | 873u16 - | 874u16 - | 1151u16 - | 1171u16 - | 1178u16 - | 1179u16 - | 1180u16 - ) { + if !matches!(block.id.as_u16(), 907u16) { panic!( "{} is not a valid block for {}", - block.name, "PaleOakWoodLikeProperties" + block.name, "TestBlockLikeProperties" ); } let mut block_props = Self::default(block); for (key, value) in props { - if *key == "axis" { - block_props.r#axis = Axis::from_value(value) + if *key == "mode" { + block_props.r#mode = TestBlockMode::from_value(value) } } block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct CreakingHeartLikeProperties { - pub r#axis: Axis, - pub r#creaking_heart_state: CreakingHeartState, - pub r#natural: bool, -} -impl BlockProperties for CreakingHeartLikeProperties { - fn to_index(&self) -> u16 { - let (index, _) = [ - (!self.r#natural as u16, 2), - ( - self.r#creaking_heart_state.to_index(), - CreakingHeartState::variant_count(), - ), - (self.r#axis.to_index(), Axis::variant_count()), - ] - .iter() - .fold((0, 1), |(curr, mul), &(val, count)| { - (curr + val * mul, mul * count) - }); - index - } - #[allow(unused_assignments)] - fn from_index(mut index: u16) -> Self { - Self { - r#natural: { - let value = index % 2; - index /= 2; - value == 0 - }, - r#creaking_heart_state: { - let value = index % CreakingHeartState::variant_count(); - index /= CreakingHeartState::variant_count(); - CreakingHeartState::from_index(value) - }, - r#axis: { - let value = index % Axis::variant_count(); - index /= Axis::variant_count(); - Axis::from_index(value) - }, - } - } - #[inline] - #[allow(clippy::manual_range_patterns)] - fn handles_block_id(block_id: BlockId) -> bool - where - Self: Sized, - { - matches!(block_id.as_u16(), 199u16) - } - fn to_state_id(&self, block: &Block) -> BlockStateId { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CreakingHeartLikeProperties" - ); - } - block.states[self.to_index() as usize].id - } - fn from_state_id(id: BlockStateId, block: &Block) -> Self { - debug_assert!( - Self::handles_block_id(block.id), - "{} is not a valid block for {}", - block.name, - "CreakingHeartLikeProperties" - ); - let min_id = block.states[0].id.as_u16(); - let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); - if (min_id..=max_id).contains(&id.as_u16()) { - Self::from_index(id.as_u16() - min_id) - } else { - #[cfg(debug_assertions)] - panic!("State ID {} does not exist for {}", id, block.name); - #[cfg(not(debug_assertions))] - Self::from_index(0) - } - } - fn default(block: &Block) -> Self { - if !Self::handles_block_id(block.id) { - panic!( - "{} is not a valid block for {}", - block.name, "CreakingHeartLikeProperties" - ); - } - Self::from_state_id(block.default_state.id, block) - } - fn to_props(&self) -> Vec<(&'static str, &'static str)> { - vec![ - ("axis", self.r#axis.to_value()), - ( - "creaking_heart_state", - self.r#creaking_heart_state.to_value(), - ), - ("natural", if self.r#natural { "true" } else { "false" }), - ] - } - #[allow(clippy::manual_range_patterns)] - fn from_props(props: &[(&str, &str)], block: &Block) -> Self { - #[cfg(debug_assertions)] - if !matches!(block.id.as_u16(), 199u16) { - panic!( - "{} is not a valid block for {}", - block.name, "CreakingHeartLikeProperties" - ); - } - let mut block_props = Self::default(block); - for (key, value) in props { - match *key { - "axis" => block_props.r#axis = Axis::from_value(value), - "creaking_heart_state" => { - block_props.r#creaking_heart_state = CreakingHeartState::from_value(value) - } - "natural" => block_props.r#natural = matches!(*value, "true"), - _ => {} - } - } - block_props - } -} -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct WhiteBannerLikeProperties { pub r#rotation: u8, } @@ -591928,7 +591837,7 @@ impl BlockProperties for WhiteBannerLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct WaterLikeProperties { pub r#level: u8, } @@ -592055,7 +591964,7 @@ impl BlockProperties for WaterLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct KelpLikeProperties { pub r#age: u8, } @@ -592202,7 +592111,7 @@ impl BlockProperties for KelpLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct LightWeightedPressurePlateLikeProperties { pub r#power: u8, } @@ -592329,7 +592238,7 @@ impl BlockProperties for LightWeightedPressurePlateLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct TorchflowerCropLikeProperties { pub r#age: u8, } @@ -592428,7 +592337,7 @@ impl BlockProperties for TorchflowerCropLikeProperties { block_props } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub struct NetherWartLikeProperties { pub r#age: u8, } @@ -592531,6 +592440,97 @@ impl BlockProperties for NetherWartLikeProperties { block_props } } +#[derive(Clone, Copy, Eq, PartialEq)] +pub struct PotentSulfurLikeProperties { + pub r#potent_sulfur_state: PotentSulfurState, +} +impl BlockProperties for PotentSulfurLikeProperties { + fn to_index(&self) -> u16 { + let (index, _) = [( + self.r#potent_sulfur_state.to_index(), + PotentSulfurState::variant_count(), + )] + .iter() + .fold((0, 1), |(curr, mul), &(val, count)| { + (curr + val * mul, mul * count) + }); + index + } + #[allow(unused_assignments)] + fn from_index(mut index: u16) -> Self { + Self { + r#potent_sulfur_state: { + let value = index % PotentSulfurState::variant_count(); + index /= PotentSulfurState::variant_count(); + PotentSulfurState::from_index(value) + }, + } + } + #[inline] + #[allow(clippy::manual_range_patterns)] + fn handles_block_id(block_id: BlockId) -> bool + where + Self: Sized, + { + matches!(block_id.as_u16(), 999u16) + } + fn to_state_id(&self, block: &Block) -> BlockStateId { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PotentSulfurLikeProperties" + ); + } + block.states[self.to_index() as usize].id + } + fn from_state_id(id: BlockStateId, block: &Block) -> Self { + debug_assert!( + Self::handles_block_id(block.id), + "{} is not a valid block for {}", + block.name, + "PotentSulfurLikeProperties" + ); + let min_id = block.states[0].id.as_u16(); + let max_id = block.states.last().map(|s| s.id.as_u16()).unwrap_or(min_id); + if (min_id..=max_id).contains(&id.as_u16()) { + Self::from_index(id.as_u16() - min_id) + } else { + #[cfg(debug_assertions)] + panic!("State ID {} does not exist for {}", id, block.name); + #[cfg(not(debug_assertions))] + Self::from_index(0) + } + } + fn default(block: &Block) -> Self { + if !Self::handles_block_id(block.id) { + panic!( + "{} is not a valid block for {}", + block.name, "PotentSulfurLikeProperties" + ); + } + Self::from_state_id(block.default_state.id, block) + } + fn to_props(&self) -> Vec<(&'static str, &'static str)> { + vec![("potent_sulfur_state", self.r#potent_sulfur_state.to_value())] + } + #[allow(clippy::manual_range_patterns)] + fn from_props(props: &[(&str, &str)], block: &Block) -> Self { + #[cfg(debug_assertions)] + if !matches!(block.id.as_u16(), 999u16) { + panic!( + "{} is not a valid block for {}", + block.name, "PotentSulfurLikeProperties" + ); + } + let mut block_props = Self::default(block); + for (key, value) in props { + if *key == "potent_sulfur_state" { + block_props.r#potent_sulfur_state = PotentSulfurState::from_value(value) + } + } + block_props + } +} impl Facing { #[must_use] pub const fn opposite(&self) -> Self { diff --git a/pumpkin-data/src/generated/chunk_gen_settings.rs b/pumpkin-data/src/generated/chunk_gen_settings.rs index f89dfce5d..a6bd1fcb8 100644 --- a/pumpkin-data/src/generated/chunk_gen_settings.rs +++ b/pumpkin-data/src/generated/chunk_gen_settings.rs @@ -130,8 +130,8 @@ pub enum MaterialCondition { StoneDepth(StoneDepthMaterialCondition), } impl GenerationSettings { - pub const AMPLIFIED : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 13544455532117611141u64 , random_hi : 14185350335435586452u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10411719568726253007u64 , random_hi : 14964796469053385315u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; - pub const CAVES : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : 32i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 192u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10285458612719284684u64 , random_hi : 14520959502364845764u64 , true_at_and_below : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , false_at_and_above : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 0i8 }) , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 13544455532117611141u64 , random_hi : 14185350335435586452u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10411719568726253007u64 , random_hi : 14964796469053385315u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; + pub const AMPLIFIED : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 9643035265078589371u64 , random_hi : 10681160692368465092u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14942356127128190352u64 , random_hi : 7163804278201757135u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; + pub const CAVES : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : 32i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 192u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14731587824038624654u64 , random_hi : 14134066294236873929u64 , true_at_and_below : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , false_at_and_above : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 0i8 }) , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 9643035265078589371u64 , random_hi : 10681160692368465092u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14942356127128190352u64 , random_hi : 7163804278201757135u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; pub const END: GenerationSettings = GenerationSettings { aquifers_enabled: false, ore_veins_enabled: false, @@ -149,10 +149,10 @@ impl GenerationSettings { }), default_block: crate::Block::END_STONE.default_state, }; - pub const FLOATING_ISLANDS : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : - 64i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : 0i8 , height : 256u16 , size_horizontal : 2u8 , size_vertical : 1u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10411719568726253007u64 , random_hi : 14964796469053385315u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; - pub const LARGE_BIOMES : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 13544455532117611141u64 , random_hi : 14185350335435586452u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10411719568726253007u64 , random_hi : 14964796469053385315u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; - pub const NETHER : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : 32i32 , default_fluid : crate :: Block :: LAVA . default_state , shape : GenerationShapeConfig { min_y : 0i8 , height : 128u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 13544455532117611141u64 , random_hi : 14185350335435586452u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10285458612719284684u64 , random_hi : 14520959502364845764u64 , true_at_and_below : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , false_at_and_above : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 0i8 }) , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BASALT_DELTAS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BASALT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PATCH , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BASALT . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BLACKSTONE . default_state })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SOUL_SAND_VALLEY] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SOIL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PATCH , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SOIL . default_state })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 32i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: LAVA . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARPED_FOREST] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHERRACK , min_threshold : 0.54f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_WART , min_threshold : 1.17f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WARPED_WART_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WARPED_NYLIUM . default_state })] }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: CRIMSON_FOREST] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHERRACK , min_threshold : 0.54f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_WART , min_threshold : 1.17f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHER_WART_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CRIMSON_NYLIUM . default_state })] }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: NETHER_WASTES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SOUL_SAND_LAYER , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL_LAYER , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 32i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) })] }) }) }) }) })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state })] }) , default_block : crate :: Block :: NETHERRACK . default_state , } ; - pub const OVERWORLD : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 13544455532117611141u64 , random_hi : 14185350335435586452u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 10411719568726253007u64 , random_hi : 14964796469053385315u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; + pub const FLOATING_ISLANDS : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : - 64i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : 0i8 , height : 256u16 , size_horizontal : 2u8 , size_vertical : 1u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14942356127128190352u64 , random_hi : 7163804278201757135u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; + pub const LARGE_BIOMES : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 9643035265078589371u64 , random_hi : 10681160692368465092u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14942356127128190352u64 , random_hi : 7163804278201757135u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; + pub const NETHER : GenerationSettings = GenerationSettings { aquifers_enabled : false , ore_veins_enabled : false , legacy_random_source : true , sea_level : 32i32 , default_fluid : crate :: Block :: LAVA . default_state , shape : GenerationShapeConfig { min_y : 0i8 , height : 128u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 9643035265078589371u64 , random_hi : 10681160692368465092u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14731587824038624654u64 , random_hi : 14134066294236873929u64 , true_at_and_below : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , false_at_and_above : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 0i8 }) , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: BelowTop (pumpkin_util :: y_offset :: BelowTop { below_top : 5i8 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BASALT_DELTAS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BASALT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PATCH , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BASALT . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BLACKSTONE . default_state })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SOUL_SAND_VALLEY] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SOIL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PATCH , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_STATE_SELECTOR , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SOIL . default_state })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 32i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: LAVA . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARPED_FOREST] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHERRACK , min_threshold : 0.54f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_WART , min_threshold : 1.17f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WARPED_WART_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WARPED_NYLIUM . default_state })] }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: CRIMSON_FOREST] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHERRACK , min_threshold : 0.54f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: NETHER_WART , min_threshold : 1.17f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHER_WART_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CRIMSON_NYLIUM . default_state })] }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: NETHER_WASTES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SOUL_SAND_LAYER , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 30i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SOUL_SAND . default_state }) }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 31i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 35i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL_LAYER , min_threshold : - 0.012f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 32i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state }) })] }) }) }) }) })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: NETHERRACK . default_state })] }) , default_block : crate :: Block :: NETHERRACK . default_state , } ; + pub const OVERWORLD : GenerationSettings = GenerationSettings { aquifers_enabled : true , ore_veins_enabled : true , legacy_random_source : false , sea_level : 63i32 , default_fluid : crate :: Block :: WATER . default_state , shape : GenerationShapeConfig { min_y : - 64i8 , height : 384u16 , size_horizontal : 1u8 , size_vertical : 2u8 } , surface_rule : MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 9643035265078589371u64 , random_hi : 10681160692368465092u64 , true_at_and_below : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 0i8 }) , false_at_and_above : YOffset :: AboveBottom (pumpkin_util :: y_offset :: AboveBottom { above_bottom : 5i8 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: BEDROCK . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: AbovePreliminarySurface (SurfaceMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 97i16 }) , surface_depth_multiplier : 2i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 62i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 60i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE_SWAMP , min_threshold : 0f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: BADLANDS , & crate :: biome :: Biome :: ERODED_BADLANDS , & crate :: biome :: Biome :: WOODED_BADLANDS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 256i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.909f64 , max_threshold : - 0.5454f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.1818f64 , max_threshold : 0.1818f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.5454f64 , max_threshold : 0.909f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: TERRACOTTA . default_state }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: RED_SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: Hole (HoleMaterialCondition) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 63i16 }) , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Not (NotMaterialCondition { invert : & MaterialCondition :: YAbove (AboveYMaterialCondition { anchor : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 74i16 }) , surface_depth_multiplier : 1i32 , add_stone_depth : true , }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ORANGE_TERRACOTTA . default_state }) }) }) , MaterialRule :: Badlands (BadLandsMaterialRule)] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WHITE_TERRACOTTA . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 1i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: AIR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Temperature , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state })] }) }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : 0f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : 0f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.35f64 , max_threshold : 0.6f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.06060606060606061f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: OLD_GROWTH_PINE_TAIGA , & crate :: biome :: Biome :: OLD_GROWTH_SPRUCE_TAIGA] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: COARSE_DIRT . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.11515151515151514f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PODZOL . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: ICE_SPIKES] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MUSHROOM_FIELDS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MYCELIUM . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRASS_BLOCK . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] })] })] }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : - 6i32 , surface_depth_multiplier : - 1i32 , add_stone_depth : true , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_OCEAN , & crate :: biome :: Biome :: DEEP_FROZEN_OCEAN] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Hole (HoleMaterialCondition) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: WATER . default_state }) }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: PACKED_ICE , min_threshold : - 0.5f64 , max_threshold : 0.2f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: PACKED_ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: ICE , min_threshold : - 0.0625f64 , max_threshold : 0.025f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: ICE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SNOWY_SLOPES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Steep , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SNOW_BLOCK . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: GROVE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: POWDER_SNOW , min_threshold : 0.45f64 , max_threshold : 0.58f64 , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Water (WaterMaterialCondition { offset : 0i32 , surface_depth_multiplier : 0i32 , add_stone_depth : false , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: POWDER_SNOW . default_state }) }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_PEAKS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: CALCITE , min_threshold : - 0.0125f64 , max_threshold : 0.0125f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CALCITE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: STONY_SHORE] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: GRAVEL , min_threshold : - 0.05f64 , max_threshold : 0.05f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_HILLS] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DRIPSTONE_CAVES] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state })] }) })] }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_SAVANNA] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.21212121212121213f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WINDSWEPT_GRAVELLY_HILLS] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.24242424242424243f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SURFACE , min_threshold : - 0.12121212121212122f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: MANGROVE_SWAMP] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: MUD . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DIRT . default_state })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: BEACH , & crate :: biome :: Biome :: SNOWY_BEACH] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 6i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: DESERT] , }) , then_run : & MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : true , secondary_depth_range : 30i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Floor , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: FROZEN_PEAKS , & crate :: biome :: Biome :: JAGGED_PEAKS] , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: WARM_OCEAN , & crate :: biome :: Biome :: LUKEWARM_OCEAN , & crate :: biome :: Biome :: DEEP_LUKEWARM_OCEAN] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SANDSTONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SAND . default_state })] }) }) , MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: StoneDepth (StoneDepthMaterialCondition { offset : 0i32 , add_surface_depth : false , secondary_depth_range : 0i32 , surface_type : pumpkin_util :: math :: vertical_surface_type :: VerticalSurfaceType :: Ceiling , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: STONE . default_state }) }) , MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: GRAVEL . default_state })] })] }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: Biome (BiomeMaterialCondition { biome_is : & [& crate :: biome :: Biome :: SULFUR_CAVES] , }) , then_run : & MaterialRule :: Sequence (SequenceMaterialRule { sequence : & [MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : - 0.4000000059604645f64 , max_threshold : - 0.10000000149011612f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0f64 , max_threshold : 0.4000000059604645f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: SULFUR . default_state }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: NoiseThreshold (NoiseThresholdMaterialCondition { noise : DoublePerlinNoiseParameters :: SULFUR_CAVE_GRADIENT , min_threshold : 0.4000000059604645f64 , max_threshold : 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f64 , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: CINNABAR . default_state }) })] }) }) , MaterialRule :: Condition (ConditionMaterialRule { if_true : MaterialCondition :: VerticalGradient (VerticalGradientMaterialCondition { random_lo : 14942356127128190352u64 , random_hi : 7163804278201757135u64 , true_at_and_below : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 0i16 }) , false_at_and_above : YOffset :: Absolute (pumpkin_util :: y_offset :: Absolute { absolute : 8i16 }) , }) , then_run : & MaterialRule :: Block (BlockMaterialRule { result_state : crate :: Block :: DEEPSLATE . default_state }) })] }) , default_block : crate :: Block :: STONE . default_state , } ; #[must_use] pub fn from_dimension(dimension: &Dimension) -> &'static Self { if dimension == &Dimension::OVERWORLD { diff --git a/pumpkin-data/src/generated/chunk_view_lut.rs b/pumpkin-data/src/generated/chunk_view_lut.rs index 119e0d683..031fd8c68 100644 --- a/pumpkin-data/src/generated/chunk_view_lut.rs +++ b/pumpkin-data/src/generated/chunk_view_lut.rs @@ -1,5 +1,5 @@ /* This file is generated. Do not edit manually. */ -#[doc = r" The maximum supported view distance."] +#[doc = r" The maximum supported view distance"] pub const MAX_VIEW_DISTANCE: u8 = 32u8; #[doc = r" Static precomputed lookup table for relative chunk offsets by view distance (0..=32)."] pub static CHUNK_VIEW_LUT: [&[(i8, i8)]; 33usize] = [ diff --git a/pumpkin-data/src/generated/damage_type.rs b/pumpkin-data/src/generated/damage_type.rs index c6336d94d..a4d1dc0e6 100644 --- a/pumpkin-data/src/generated/damage_type.rs +++ b/pumpkin-data/src/generated/damage_type.rs @@ -1,6 +1,6 @@ /* This file is generated. Do not edit manually. */ use crate::tag::{RegistryKey, Tag, Taggable}; -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub struct DamageType { pub death_message_type: DeathMessageType, pub exhaustion: f32, @@ -9,13 +9,13 @@ pub struct DamageType { pub scaling: DamageScaling, pub id: u8, } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum DeathMessageType { Default, FallVariants, IntentionalGameDesign, } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum DamageEffects { Hurt, Thorns, @@ -24,7 +24,7 @@ pub enum DamageEffects { Poking, Freezing, } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum DamageScaling { Never, WhenCausedByLivingNonPlayer, diff --git a/pumpkin-data/src/generated/data_component.rs b/pumpkin-data/src/generated/data_component.rs index 97e67bc60..f863a94d7 100644 --- a/pumpkin-data/src/generated/data_component.rs +++ b/pumpkin-data/src/generated/data_component.rs @@ -1,6 +1,6 @@ /* This file is generated. Do not edit manually. */ use crate::data_component_impl::*; -#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] #[repr(u8)] pub enum DataComponent { CustomData = 0u8, diff --git a/pumpkin-data/src/generated/jukebox_song.rs b/pumpkin-data/src/generated/jukebox_song.rs index 2b659319f..055644103 100644 --- a/pumpkin-data/src/generated/jukebox_song.rs +++ b/pumpkin-data/src/generated/jukebox_song.rs @@ -1,5 +1,5 @@ /* This file is generated. Do not edit manually. */ -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] #[repr(u32)] pub enum JukeboxSong { Id11, diff --git a/pumpkin-nbt/Cargo.toml b/pumpkin-nbt/Cargo.toml index 636bfeb37..8a88daadc 100644 --- a/pumpkin-nbt/Cargo.toml +++ b/pumpkin-nbt/Cargo.toml @@ -7,7 +7,6 @@ license.workspace = true [dependencies] pumpkin-codecs.workspace = true -serde.workspace = true thiserror.workspace = true bytes.workspace = true uuid.workspace = true @@ -19,7 +18,6 @@ tracing.workspace = true [dev-dependencies] tempfile.workspace = true criterion.workspace = true -serde = { version = "1.0", features = ["derive"] } [[bench]] name = "nbt" diff --git a/pumpkin-nbt/benches/nbt.rs b/pumpkin-nbt/benches/nbt.rs index 3aad04735..829fe0cc0 100644 --- a/pumpkin-nbt/benches/nbt.rs +++ b/pumpkin-nbt/benches/nbt.rs @@ -1,41 +1,7 @@ use criterion::{Criterion, criterion_group, criterion_main}; -use pumpkin_nbt::{Nbt, NbtCompound, deserializer, serializer, tag::NbtTag}; -use serde::{Deserialize, Serialize}; +use pumpkin_nbt::{Nbt, NbtCompound, deserializer, tag::NbtTag}; use std::io::Cursor; -#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] -struct LargeTest { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - double: f64, - string: String, - byte_array: Vec, - int_array: Vec, - long_array: Vec, - list_string: Vec, - nested: Option>, -} - -fn create_large_test_data(depth: usize) -> LargeTest { - LargeTest { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - double: 69.42, - string: "Hello test benchmark data".to_string(), - byte_array: vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - int_array: vec![10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - long_array: vec![20, 21, 22, 23, 24, 25, 26, 27, 28, 29], - list_string: vec!["one".to_string(), "two".to_string(), "three".to_string()], - nested: (depth > 0).then(|| Box::new(create_large_test_data(depth - 1))), - } -} - fn create_large_compound(depth: usize) -> NbtCompound { let mut compound = NbtCompound::new(); compound.put_byte("byte", 123); @@ -72,31 +38,11 @@ fn create_large_compound(depth: usize) -> NbtCompound { } pub fn bench_nbt(c: &mut Criterion) { - let test_data = create_large_test_data(5); - let mut ser_bytes_java = Vec::new(); - let mut ser_bytes_bedrock = Vec::new(); - serializer::to_bytes(&test_data, &mut ser_bytes_java).unwrap(); - serializer::to_bytes_bedrock(&test_data, &mut ser_bytes_bedrock).unwrap(); - let compound_data = create_large_compound(5); let nbt_wrapper = Nbt::new(String::new(), compound_data.clone()); let wrapper_bytes_java = nbt_wrapper.clone().write(); let wrapper_bytes_bedrock = nbt_wrapper.write_bedrock(); - c.bench_function("nbt/java/serialize/serde", |b| { - b.iter(|| { - let mut out = Vec::new(); - serializer::to_bytes(&test_data, &mut out).unwrap(); - }); - }); - - c.bench_function("nbt/java/deserialize/serde", |b| { - b.iter(|| { - let cursor = Cursor::new(&ser_bytes_java); - let _: LargeTest = deserializer::from_bytes(cursor).unwrap(); - }); - }); - c.bench_function("nbt/java/serialize/raw", |b| { b.iter(|| { let nbt = Nbt::new(String::new(), compound_data.clone()); @@ -112,20 +58,6 @@ pub fn bench_nbt(c: &mut Criterion) { }); }); - c.bench_function("nbt/bedrock/serialize/serde", |b| { - b.iter(|| { - let mut out = Vec::new(); - serializer::to_bytes_bedrock(&test_data, &mut out).unwrap(); - }); - }); - - c.bench_function("nbt/bedrock/deserialize/serde", |b| { - b.iter(|| { - let cursor = Cursor::new(&ser_bytes_bedrock); - let _: LargeTest = deserializer::from_bytes_bedrock(cursor).unwrap(); - }); - }); - c.bench_function("nbt/bedrock/serialize/raw", |b| { b.iter(|| { let nbt = Nbt::new(String::new(), compound_data.clone()); diff --git a/pumpkin-nbt/fuzz/Cargo.toml b/pumpkin-nbt/fuzz/Cargo.toml index a9cbdc17d..e161c0f50 100644 --- a/pumpkin-nbt/fuzz/Cargo.toml +++ b/pumpkin-nbt/fuzz/Cargo.toml @@ -11,7 +11,6 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -serde = { version = "1.0", features = ["derive"] } arbitrary = { version = "1.3", features = ["derive"] } [dependencies.pumpkin-nbt] @@ -31,37 +30,9 @@ test = false doc = false bench = false -[[bin]] -name = "deserialize_serde_java" -path = "fuzz_targets/deserialize_serde_java.rs" -test = false -doc = false -bench = false - -[[bin]] -name = "deserialize_serde_bedrock" -path = "fuzz_targets/deserialize_serde_bedrock.rs" -test = false -doc = false -bench = false - [[bin]] name = "decompress_gzip" path = "fuzz_targets/decompress_gzip.rs" test = false doc = false bench = false - -[[bin]] -name = "roundtrip_java" -path = "fuzz_targets/roundtrip_java.rs" -test = false -doc = false -bench = false - -[[bin]] -name = "roundtrip_bedrock" -path = "fuzz_targets/roundtrip_bedrock.rs" -test = false -doc = false -bench = false diff --git a/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_bedrock.rs b/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_bedrock.rs deleted file mode 100644 index ba4ce1890..000000000 --- a/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_bedrock.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![no_main] -use libfuzzer_sys::fuzz_target; -use pumpkin_nbt::deserializer::from_bytes_bedrock; -use serde::Deserialize; -use std::io::Cursor; - -#[derive(Deserialize, Debug, PartialEq)] -struct FuzzStruct { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - double: f64, - string: String, - byte_array: Vec, - int_array: Vec, - long_array: Vec, - list_string: Vec, - nested: Option>, -} - -fuzz_target!(|data: &[u8]| { - let cursor = Cursor::new(data); - let _: Result = from_bytes_bedrock(cursor); -}); diff --git a/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_java.rs b/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_java.rs deleted file mode 100644 index c5b99fe0f..000000000 --- a/pumpkin-nbt/fuzz/fuzz_targets/deserialize_serde_java.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![no_main] -use libfuzzer_sys::fuzz_target; -use pumpkin_nbt::deserializer::{from_bytes, from_bytes_unnamed}; -use serde::Deserialize; -use std::io::Cursor; - -#[derive(Deserialize, Debug, PartialEq)] -struct FuzzStruct { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - double: f64, - string: String, - byte_array: Vec, - int_array: Vec, - long_array: Vec, - list_string: Vec, - nested: Option>, -} - -fuzz_target!(|data: &[u8]| { - let cursor = Cursor::new(data); - let _: Result = from_bytes(cursor); - - let cursor_unnamed = Cursor::new(data); - let _: Result = from_bytes_unnamed(cursor_unnamed); -}); diff --git a/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_bedrock.rs b/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_bedrock.rs deleted file mode 100644 index e09cd88a9..000000000 --- a/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_bedrock.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![no_main] -use arbitrary::Arbitrary; -use libfuzzer_sys::fuzz_target; -use pumpkin_nbt::deserializer::from_bytes_bedrock; -use pumpkin_nbt::serializer::to_bytes_bedrock; -use serde::{Deserialize, Serialize}; -use std::io::Cursor; - -#[derive(Arbitrary, Serialize, Deserialize, Debug, PartialEq)] -struct RoundtripStruct { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - double: f64, - string: String, - byte_array: Vec, - int_array: Vec, - long_array: Vec, - list_string: Vec, - // Nested struct to test recursion - nested: Option>, -} - -fuzz_target!(|data: RoundtripStruct| { - let mut fixed_data = data; - - let mut struct_to_fixup = &mut fixed_data; - loop { - // prevent NaN != NaN issues - if struct_to_fixup.float != struct_to_fixup.float { - struct_to_fixup.float = 0.0; - } - if struct_to_fixup.double != struct_to_fixup.double { - struct_to_fixup.double = 0.0; - } - - if struct_to_fixup.nested.is_none() { - break; - } - struct_to_fixup = struct_to_fixup.nested.as_mut().unwrap(); - } - - let mut bytes = Vec::new(); - if to_bytes_bedrock(&fixed_data, &mut bytes).is_ok() { - let cursor = Cursor::new(bytes); - let reconstructed: RoundtripStruct = - from_bytes_bedrock(cursor).expect("Failed to deserialize valid NBT"); - assert_eq!(fixed_data, reconstructed); - } -}); diff --git a/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_java.rs b/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_java.rs deleted file mode 100644 index 0a180292c..000000000 --- a/pumpkin-nbt/fuzz/fuzz_targets/roundtrip_java.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![no_main] -use arbitrary::Arbitrary; -use libfuzzer_sys::fuzz_target; -use pumpkin_nbt::deserializer::from_bytes; -use pumpkin_nbt::serializer::to_bytes; -use serde::{Deserialize, Serialize}; -use std::io::Cursor; - -#[derive(Arbitrary, Serialize, Deserialize, Debug, PartialEq)] -struct RoundtripStruct { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - double: f64, - string: String, - byte_array: Vec, - int_array: Vec, - long_array: Vec, - list_string: Vec, - // Nested struct to test recursion - nested: Option>, -} - -fuzz_target!(|data: RoundtripStruct| { - let mut fixed_data = data; - - let mut struct_to_fixup = &mut fixed_data; - loop { - // prevent NaN != NaN issues - if struct_to_fixup.float != struct_to_fixup.float { - struct_to_fixup.float = 0.0; - } - if struct_to_fixup.double != struct_to_fixup.double { - struct_to_fixup.double = 0.0; - } - - if struct_to_fixup.nested.is_none() { - break; - } - struct_to_fixup = struct_to_fixup.nested.as_mut().unwrap(); - } - - let mut bytes = Vec::new(); - if to_bytes(&fixed_data, &mut bytes).is_ok() { - let cursor = Cursor::new(bytes); - let reconstructed: RoundtripStruct = - from_bytes(cursor).expect("Failed to deserialize valid NBT"); - assert_eq!(fixed_data, reconstructed); - } -}); diff --git a/pumpkin-nbt/src/compound.rs b/pumpkin-nbt/src/compound.rs index 1720a29ea..6bc3a6572 100644 --- a/pumpkin-nbt/src/compound.rs +++ b/pumpkin-nbt/src/compound.rs @@ -1,6 +1,5 @@ //! Storage and convenience methods for NBT compound tags. -use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt::{Display, Formatter}; use uuid::Uuid; @@ -113,13 +112,9 @@ impl NbtCompound { self.child_tags.is_empty() } - /// Inserts a tag when `name` is not already present. - /// - /// Existing entries are left unchanged. + /// Inserts or replaces a tag for `name`. pub fn put(&mut self, name: &str, value: impl Into) { - if !self.child_tags.contains_key(name) { - self.child_tags.insert(name.into(), value.into()); - } + self.child_tags.insert(name.into(), value.into()); } /// Inserts a string tag when `name` is not already present. @@ -344,44 +339,6 @@ impl AsRef for NbtCompound { } } -impl Serialize for NbtCompound { - fn serialize(&self, serializer: S) -> Result { - use serde::ser::SerializeMap; - let mut map = serializer.serialize_map(Some(self.child_tags.len()))?; - for (key, value) in &self.child_tags { - map.serialize_entry(key, &value)?; - } - map.end() - } -} - -impl<'de> Deserialize<'de> for NbtCompound { - fn deserialize>(deserializer: D) -> Result { - struct CompoundVisitor; - - impl<'de> serde::de::Visitor<'de> for CompoundVisitor { - type Value = NbtCompound; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str("an NBT compound") - } - - fn visit_map>( - self, - mut map: A, - ) -> Result { - let mut compound = NbtCompound::new(); - while let Some((key, value)) = map.next_entry::, NbtTag>()? { - compound.child_tags.insert(key, value); - } - Ok(compound) - } - } - - deserializer.deserialize_map(CompoundVisitor) - } -} - impl From for NbtTag { fn from(value: NbtCompound) -> Self { Self::Compound(value) diff --git a/pumpkin-nbt/src/deserializer.rs b/pumpkin-nbt/src/deserializer.rs index 272fea354..fc76b0495 100644 --- a/pumpkin-nbt/src/deserializer.rs +++ b/pumpkin-nbt/src/deserializer.rs @@ -1,38 +1,14 @@ //! Deserialization from Java Edition, unnamed network, and Bedrock NBT. use std::borrow::Cow; -use std::cell::RefCell; use std::io::{Cursor, Seek, SeekFrom}; -use crate::{ - BYTE_ARRAY_ID, BYTE_ID, COMPOUND_ID, END_ID, Error, INT_ARRAY_ID, INT_ID, LIST_ID, - LONG_ARRAY_ID, LONG_ID, MAX_ARRAY_LENGTH, NbtTag, io, -}; +use crate::{Error, io}; use io::Read; -use serde::de::{self, DeserializeSeed, IntoDeserializer, MapAccess, SeqAccess, Visitor}; -use serde::{Deserialize, forward_to_deserialize_any}; /// Result type returned by NBT deserialization operations. pub type Result = std::result::Result; -thread_local! { - /// Tag ID of the sequence currently visited by Serde. - /// - /// This is used to preserve the distinction between NBT lists and the - /// three specialized NBT array types. - pub static CURR_VISITOR_LIST_TYPE: RefCell> = const { std::cell::RefCell::new(None) }; -} - -pub(super) fn take_curr_visitor_seq_list_id() -> Option { - CURR_VISITOR_LIST_TYPE.with(std::cell::RefCell::take) -} - -pub(super) fn set_curr_visitor_seq_list_id(tag: Option) { - CURR_VISITOR_LIST_TYPE.with(|cell| { - *cell.borrow_mut() = tag; - }); -} - /// Byte source used by NBT read helpers. /// /// Implementations may return borrowed strings and byte arrays when the @@ -453,334 +429,3 @@ impl<'a, D: NbtDataSource<'a>> NbtReadHelper<'a> for NbtReadHelperBedrock { self.reader.read_byte_array(len) } } - -/// A Serde deserializer backed by a format-specific NBT reader. -pub struct Deserializer { - input: R, - tag_to_deserialize_stack: Option, - in_list: bool, - is_named: bool, -} - -impl Deserializer { - /// Creates a deserializer. - /// - /// When `is_named` is `true`, the root compound name is consumed from the - /// input. Unnamed network NBT must pass `false`. - pub const fn new(input: R, is_named: bool) -> Self { - Self { - input, - tag_to_deserialize_stack: None, - in_list: false, - is_named, - } - } -} - -/// Deserializes a value from named Java Edition NBT. -pub fn from_bytes<'a, T: Deserialize<'a>>(r: impl Read + Seek) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperJava::new(NbtStreamReader(r)), true); - T::deserialize(&mut deserializer) -} - -/// Deserializes a value from unnamed Java Edition network NBT. -pub fn from_bytes_unnamed<'a, T: Deserialize<'a>>(r: impl Read + Seek) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperJava::new(NbtStreamReader(r)), false); - T::deserialize(&mut deserializer) -} - -/// Deserializes a value from named Bedrock network NBT. -pub fn from_bytes_bedrock<'a, T: Deserialize<'a>>(r: impl Read + Seek) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperBedrock::new(NbtStreamReader(r)), true); - T::deserialize(&mut deserializer) -} - -/// Deserializes a value from a named Java Edition NBT slice. -/// -/// Strings and byte arrays may borrow directly from `slice`. -pub fn from_slice<'a, T: Deserialize<'a>>(slice: &'a [u8]) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperJava::new(Cursor::new(slice)), true); - T::deserialize(&mut deserializer) -} - -/// Deserializes a value from an unnamed Java Edition network NBT slice. -/// -/// Strings and byte arrays may borrow directly from `slice`. -pub fn from_slice_unnamed<'a, T: Deserialize<'a>>(slice: &'a [u8]) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperJava::new(Cursor::new(slice)), false); - T::deserialize(&mut deserializer) -} - -/// Deserializes a value from a named Bedrock network NBT slice. -/// -/// Strings and byte arrays may borrow directly from `slice`. -pub fn from_slice_bedrock<'a, T: Deserialize<'a>>(slice: &'a [u8]) -> Result { - let mut deserializer = Deserializer::new(NbtReadHelperBedrock::new(Cursor::new(slice)), true); - T::deserialize(&mut deserializer) -} - -impl<'de, R: NbtReadHelper<'de>> de::Deserializer<'de> for &mut Deserializer { - type Error = Error; - - forward_to_deserialize_any! { - i8 i16 i32 i64 f32 f64 char unit unit_struct seq tuple tuple_struct - newtype_struct byte_buf - } - - fn deserialize_ignored_any>(self, visitor: V) -> Result { - let Some(tag) = self.tag_to_deserialize_stack else { - return Err(Error::SerdeError("Ignoring nothing!".to_string())); - }; - - NbtTag::skip_data(&mut self.input, tag)?; - - visitor.visit_unit() - } - - fn deserialize_any>(self, visitor: V) -> Result { - let Some(tag_to_deserialize) = self.tag_to_deserialize_stack else { - return Err(Error::SerdeError( - "The top level must be a component (e.g. a struct)".to_string(), - )); - }; - - match tag_to_deserialize { - END_ID => Err(Error::SerdeError( - "Trying to deserialize an END tag!".to_string(), - )), - LIST_ID | INT_ARRAY_ID | LONG_ARRAY_ID | BYTE_ARRAY_ID => { - let list_type = match tag_to_deserialize { - LIST_ID => self.input.get_u8()?, - INT_ARRAY_ID => INT_ID, - LONG_ARRAY_ID => LONG_ID, - BYTE_ARRAY_ID => BYTE_ID, - _ => return Err(Error::SerdeError("Unreachable state reached".to_string())), - }; - - let remaining_values = self.input.get_i32()?; - if remaining_values < 0 { - return Err(Error::NegativeLength(remaining_values)); - } - - let remaining_values = remaining_values as usize; - if remaining_values > MAX_ARRAY_LENGTH { - return Err(Error::LargeLength(remaining_values)); - } - - set_curr_visitor_seq_list_id(Some(list_type)); - let result = visitor.visit_seq(ListAccess { - de: self, - list_type, - remaining_values, - })?; - Ok(result) - } - COMPOUND_ID => visitor.visit_map(CompoundAccess { de: self }), - _ => { - let result = match NbtTag::deserialize_data(&mut self.input, tag_to_deserialize)? { - NbtTag::Byte(value) => visitor.visit_i8::(value)?, - NbtTag::Short(value) => visitor.visit_i16::(value)?, - NbtTag::Int(value) => visitor.visit_i32::(value)?, - NbtTag::Long(value) => visitor.visit_i64::(value)?, - NbtTag::Float(value) => visitor.visit_f32::(value)?, - NbtTag::Double(value) => visitor.visit_f64::(value)?, - NbtTag::String(value) => visitor.visit_string::(value.into_string())?, - _ => return Err(Error::SerdeError("Unreachable state reached".to_string())), - }; - Ok(result) - } - } - } - - fn deserialize_u8>(self, visitor: V) -> Result { - if self.in_list { - let value = self.input.get_u8()?; - visitor.visit_u8::(value) - } else { - Err(Error::UnsupportedType( - "u8; NBT only supports signed values".to_string(), - )) - } - } - - fn deserialize_u16>(self, visitor: V) -> Result { - let value = self.input.get_i16()?; - visitor.visit_i16::(value) - } - - fn deserialize_u32>(self, visitor: V) -> Result { - let value = self.input.get_i32()?; - visitor.visit_i32::(value) - } - - fn deserialize_u64>(self, visitor: V) -> Result { - let value = self.input.get_i64()?; - visitor.visit_i64::(value) - } - - fn deserialize_bool>(self, visitor: V) -> Result { - if self.tag_to_deserialize_stack.unwrap() == BYTE_ID { - let value = self.input.get_u8()?; - if value != 0 { - return visitor.visit_bool(true); - } - } - visitor.visit_bool(false) - } - - fn deserialize_str>(self, visitor: V) -> Result { - match self.input.get_string()? { - Cow::Borrowed(s) => visitor.visit_borrowed_str(s), - Cow::Owned(s) => visitor.visit_string(s), - } - } - - fn deserialize_string>(self, visitor: V) -> Result { - self.deserialize_str(visitor) - } - - fn deserialize_bytes>(self, visitor: V) -> Result { - let tag_id = self.tag_to_deserialize_stack.unwrap_or(BYTE_ARRAY_ID); - if tag_id == BYTE_ARRAY_ID { - let len = self.input.get_i32()?; - if len < 0 { - return Err(Error::NegativeLength(len)); - } - let slice = self.input.get_byte_array(len as usize)?; - let u8_slice: &'de [u8] = - unsafe { std::slice::from_raw_parts(slice.as_ptr().cast::(), slice.len()) }; - match slice { - Cow::Borrowed(_) => visitor.visit_borrowed_bytes(u8_slice), - Cow::Owned(_) => visitor.visit_bytes(u8_slice), - } - } else { - self.deserialize_any(visitor) - } - } - - fn deserialize_enum>( - self, - _name: &'static str, - _variants: &'static [&'static str], - visitor: V, - ) -> Result { - match self.input.get_string()? { - Cow::Borrowed(s) => visitor.visit_enum(s.into_deserializer()), - Cow::Owned(s) => visitor.visit_enum(s.into_deserializer()), - } - } - - fn deserialize_option>(self, visitor: V) -> Result { - visitor.visit_some(self) - } - - fn deserialize_map>(self, visitor: V) -> Result { - if let Some(tag_id) = self.tag_to_deserialize_stack { - if tag_id != COMPOUND_ID { - return Err(Error::SerdeError(format!( - "Trying to deserialize a map without a compound ID (id {tag_id})" - ))); - } - } else { - let next_byte = self.input.get_u8()?; - if next_byte != COMPOUND_ID { - return Err(Error::NoRootCompound(next_byte)); - } - - if self.is_named { - self.input.skip_string()?; - } - } - - let value = visitor.visit_map(CompoundAccess { de: self })?; - Ok(value) - } - - fn deserialize_struct>( - self, - _name: &'static str, - _fields: &'static [&'static str], - visitor: V, - ) -> Result { - self.deserialize_map(visitor) - } - - fn deserialize_identifier>(self, visitor: V) -> Result { - self.deserialize_str(visitor) - } - - fn is_human_readable(&self) -> bool { - false - } -} - -struct CompoundAccess<'a, R> { - de: &'a mut Deserializer, -} - -impl<'de, R: NbtReadHelper<'de>> MapAccess<'de> for CompoundAccess<'_, R> { - type Error = Error; - - fn next_key_seed>(&mut self, seed: K) -> Result> { - let tag = self.de.input.get_u8()?; - self.de.tag_to_deserialize_stack = Some(tag); - - if tag == END_ID { - return Ok(None); - } - - seed.deserialize(MapKey { de: self.de }).map(Some) - } - - fn next_value_seed>(&mut self, seed: V) -> Result { - seed.deserialize(&mut *self.de) - } -} - -struct MapKey<'a, R> { - de: &'a mut Deserializer, -} - -impl<'de, R: NbtReadHelper<'de>> de::Deserializer<'de> for MapKey<'_, R> { - type Error = Error; - - fn deserialize_any>(self, visitor: V) -> Result { - match self.de.input.get_string()? { - Cow::Borrowed(s) => visitor.visit_borrowed_str(s), - Cow::Owned(s) => visitor.visit_string(s), - } - } - - forward_to_deserialize_any! { - bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit unit_struct seq tuple tuple_struct map - struct identifier ignored_any bytes enum newtype_struct byte_buf option - } -} - -struct ListAccess<'a, R> { - de: &'a mut Deserializer, - remaining_values: usize, - list_type: u8, -} - -impl<'de, R: NbtReadHelper<'de>> SeqAccess<'de> for ListAccess<'_, R> { - type Error = Error; - - fn size_hint(&self) -> Option { - Some(self.remaining_values) - } - - fn next_element_seed>(&mut self, seed: E) -> Result> { - if self.remaining_values == 0 { - return Ok(None); - } - - self.remaining_values -= 1; - self.de.tag_to_deserialize_stack = Some(self.list_type); - self.de.in_list = true; - let result = seed.deserialize(&mut *self.de).map(Some); - self.de.in_list = false; - - result - } -} diff --git a/pumpkin-nbt/src/lib.rs b/pumpkin-nbt/src/lib.rs index 827e9f0a5..28b6dd5ae 100644 --- a/pumpkin-nbt/src/lib.rs +++ b/pumpkin-nbt/src/lib.rs @@ -1,66 +1,34 @@ //! Reading, writing, and manipulating Minecraft's Named Binary Tag (NBT) data. //! //! The crate supports the standard Java Edition representation, unnamed network -//! NBT, Bedrock network NBT, and gzip-compressed NBT. Data can be handled either -//! as [`Nbt`] and [`NbtCompound`] values or through Serde with [`to_bytes`] and -//! [`from_slice`]. -//! -//! # Serde round trip -//! -//! ``` -//! use pumpkin_nbt::{from_slice, to_bytes}; -//! use serde::{Deserialize, Serialize}; -//! -//! #[derive(Debug, PartialEq, Serialize, Deserialize)] -//! struct Player { -//! name: String, -//! health: i16, -//! } -//! -//! let player = Player { -//! name: "Steve".to_owned(), -//! health: 20, -//! }; -//! let mut encoded = Vec::new(); -//! to_bytes(&player, &mut encoded)?; -//! -//! let decoded: Player = from_slice(&encoded)?; -//! assert_eq!(decoded, player); -//! # Ok::<(), pumpkin_nbt::Error>(()) -//! ``` +//! NBT, Bedrock network NBT, and gzip-compressed NBT. Data is handled directly +//! via [`Nbt`], [`NbtCompound`], and [`NbtTag`]. use std::{ - fmt::Display, io::{self, Write}, ops::Deref, }; use bytes::Bytes; use deserializer::NbtReadHelper; -use serde::{de, ser}; use serializer::{NbtWriteHelper, NbtWriteHelperBedrock, NbtWriteHelperJava}; use tag::NbtTag; use thiserror::Error; /// Compound-tag storage and construction helpers. pub mod compound; -/// Serde and low-level NBT deserialization support. +/// Low-level NBT deserialization support. pub mod deserializer; /// Reading and writing gzip-compressed NBT. pub mod nbt_compress; /// Integration with Pumpkin's dynamic codec operations. pub mod nbt_ops; -/// Serde and low-level NBT serialization support. +/// Low-level NBT serialization support. pub mod serializer; /// The individual NBT tag types. pub mod tag; pub use compound::NbtCompound; -pub use deserializer::{ - from_bytes, from_bytes_bedrock, from_bytes_unnamed, from_slice, from_slice_bedrock, - from_slice_unnamed, -}; -pub use serializer::{to_bytes, to_bytes_named, to_bytes_unnamed}; // This NBT crate is inspired from CrabNBT @@ -132,18 +100,6 @@ pub enum Error { VarLongTooLarge, } -impl ser::Error for Error { - fn custom(msg: T) -> Self { - Self::SerdeError(msg.to_string()) - } -} - -impl de::Error for Error { - fn custom(msg: T) -> Self { - Self::SerdeError(msg.to_string()) - } -} - /// A complete NBT document containing a named root compound. #[derive(Clone, Debug, Default, PartialEq)] pub struct Nbt { @@ -283,801 +239,3 @@ impl AsMut for Nbt { &mut self.root_tag } } - -// TODO: This is a bit hacky -pub(crate) const NBT_ARRAY_TAG: &str = "__nbt_array"; -pub(crate) const NBT_INT_ARRAY_TAG: &str = "__nbt_int_array"; -pub(crate) const NBT_LONG_ARRAY_TAG: &str = "__nbt_long_array"; -pub(crate) const NBT_BYTE_ARRAY_TAG: &str = "__nbt_byte_array"; - -macro_rules! impl_array { - ($name:ident, $variant:expr) => { - #[doc = "Serializes a sequence using its specialized NBT array representation."] - #[doc = ""] - #[doc = "Use this function with Serde's `serialize_with` field attribute."] - pub fn $name( - input: T, - serializer: S, - ) -> Result { - serializer.serialize_newtype_variant(NBT_ARRAY_TAG, 0, $variant, &input) - } - }; -} - -impl_array!(nbt_int_array, NBT_INT_ARRAY_TAG); -impl_array!(nbt_long_array, NBT_LONG_ARRAY_TAG); -impl_array!(nbt_byte_array, NBT_BYTE_ARRAY_TAG); - -#[cfg(test)] -mod test { - - use std::io::Cursor; - - use crate::Error; - use crate::compound::NbtCompound; - use crate::deserializer::from_bytes; - use crate::deserializer::from_bytes_bedrock; - use crate::nbt_byte_array; - use crate::nbt_int_array; - use crate::nbt_long_array; - use crate::serializer::NbtWriteHelperBedrock; - use crate::serializer::to_bytes_bedrock; - use crate::serializer::to_bytes_named; - use crate::serializer::to_bytes_named_bedrock; - use crate::serializer::{NbtWriteHelperJava, to_bytes}; - use crate::tag::NbtTag; - use crate::{deserializer::from_bytes_unnamed, serializer::to_bytes_unnamed}; - use serde::{Deserialize, Serialize}; - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct Test { - byte: i8, - short: i16, - int: i32, - long: i64, - float: f32, - string: String, - } - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct BorrowedTest<'a> { - byte: i8, - string: &'a str, - } - - #[test] - fn zero_alloc_from_slice() { - let test = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Zero alloc NBT".to_string(), - }; - - let mut bytes = Vec::new(); - to_bytes_unnamed(&test, &mut bytes).unwrap(); - let borrowed: BorrowedTest = crate::from_slice_unnamed(&bytes).unwrap(); - - assert_eq!(borrowed.byte, 123); - assert_eq!(borrowed.string, "Zero alloc NBT"); - } - - #[test] - fn simple_ser_de_unnamed() { - let test = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let mut bytes = Vec::new(); - to_bytes_unnamed(&test, &mut bytes).unwrap(); - let recreated_struct: Test = from_bytes_unnamed(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_unnamed_bedrock() { - let test = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - // Bedrock doesn't actually use unnamed NBT (AFAIK). `to_bytes_bedrock` actually encodes empty name. - let mut bytes = Vec::new(); - to_bytes_bedrock(&test, &mut bytes).unwrap(); - let recreated_struct: Test = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - #[expect(clippy::struct_field_names)] - struct TestArray { - #[serde(serialize_with = "nbt_byte_array")] - byte_array: Vec, - #[serde(serialize_with = "nbt_int_array")] - int_array: Vec, - #[serde(serialize_with = "nbt_long_array")] - long_array: Vec, - } - - #[test] - fn simple_ser_de_array() { - let test = TestArray { - byte_array: vec![0, 3, 2], - int_array: vec![13, 1321, 2], - long_array: vec![1, 0, 200301, 1], - }; - - let mut bytes = Vec::new(); - to_bytes_unnamed(&test, &mut bytes).unwrap(); - let recreated_struct: TestArray = from_bytes_unnamed(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_array_bedrock() { - let test = TestArray { - byte_array: vec![0, 3, 2], - int_array: vec![13, 1321, 2], - long_array: vec![1, 0, 200301, 1], - }; - - let mut bytes = Vec::new(); - to_bytes_bedrock(&test, &mut bytes).unwrap(); - let recreated_struct: TestArray = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_named() { - let name = String::from("Test"); - let test = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let mut bytes = Vec::new(); - to_bytes_named(&test, name, &mut bytes).unwrap(); - let recreated_struct: Test = from_bytes(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_named_bedrock() { - let name = String::from("Test"); - let test = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let mut bytes = Vec::new(); - to_bytes_named_bedrock(&test, name, &mut bytes).unwrap(); - let recreated_struct: Test = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_array_named() { - let name = String::from("Test"); - let test = TestArray { - byte_array: vec![0, 3, 2], - int_array: vec![13, 1321, 2], - long_array: vec![1, 0, 200301, 1], - }; - - let mut bytes = Vec::new(); - to_bytes_named(&test, name, &mut bytes).unwrap(); - let recreated_struct: TestArray = from_bytes(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[test] - fn simple_ser_de_array_named_bedrock() { - let name = String::from("Test"); - let test = TestArray { - byte_array: vec![0, 3, 2], - int_array: vec![13, 1321, 2], - long_array: vec![1, 0, 200301, 1], - }; - - let mut bytes = Vec::new(); - to_bytes_named_bedrock(&test, name, &mut bytes).unwrap(); - let recreated_struct: TestArray = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - - assert_eq!(test, recreated_struct); - } - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct Egg { - food: String, - } - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct Breakfast { - food: Egg, - } - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct TestList { - option: Option, - nested_compound: Breakfast, - compounds: Vec, - list_string: Vec, - empty: Vec, - } - - #[test] - fn list() { - let test1 = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let test2 = Test { - byte: 13, - short: 342, - int: -4313, - long: -132334, - float: -69.420, - string: "Hello compounds".to_string(), - }; - - let list_compound = TestList { - option: Some(Egg { - food: "Skibid".to_string(), - }), - nested_compound: Breakfast { - food: Egg { - food: "Over easy".to_string(), - }, - }, - compounds: vec![test1, test2], - list_string: vec![String::new(), "abcbcbcbbc".to_string()], - empty: vec![], - }; - - let mut bytes = Vec::new(); - to_bytes_unnamed(&list_compound, &mut bytes).unwrap(); - let recreated_struct: TestList = from_bytes_unnamed(Cursor::new(bytes)).unwrap(); - assert_eq!(list_compound, recreated_struct); - } - - #[test] - fn list_bedrock() { - let test1 = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let test2 = Test { - byte: 13, - short: 342, - int: -4313, - long: -132334, - float: -69.420, - string: "Hello compounds".to_string(), - }; - - let list_compound = TestList { - option: Some(Egg { - food: "Skibid".to_string(), - }), - nested_compound: Breakfast { - food: Egg { - food: "Over easy".to_string(), - }, - }, - compounds: vec![test1, test2], - list_string: vec![String::new(), "abcbcbcbbc".to_string()], - empty: vec![], - }; - - let mut bytes = Vec::new(); - to_bytes_bedrock(&list_compound, &mut bytes).unwrap(); - let recreated_struct: TestList = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - assert_eq!(list_compound, recreated_struct); - } - - #[test] - fn list_named() { - let test1 = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let test2 = Test { - byte: 13, - short: 342, - int: -4313, - long: -132334, - float: -69.420, - string: "Hello compounds".to_string(), - }; - - let list_compound = TestList { - option: None, - nested_compound: Breakfast { - food: Egg { - food: "Over easy".to_string(), - }, - }, - compounds: vec![test1, test2], - list_string: vec![String::new(), "abcbcbcbbc".to_string()], - empty: vec![], - }; - - let mut bytes = Vec::new(); - to_bytes_named(&list_compound, "a".to_string(), &mut bytes).unwrap(); - let recreated_struct: TestList = from_bytes(Cursor::new(bytes)).unwrap(); - assert_eq!(list_compound, recreated_struct); - } - - #[test] - fn list_named_bedrock() { - let test1 = Test { - byte: 123, - short: 1342, - int: 4313, - long: 34, - float: 1.00, - string: "Hello test".to_string(), - }; - - let test2 = Test { - byte: 13, - short: 342, - int: -4313, - long: -132334, - float: -69.420, - string: "Hello compounds".to_string(), - }; - - let list_compound = TestList { - option: None, - nested_compound: Breakfast { - food: Egg { - food: "Over easy".to_string(), - }, - }, - compounds: vec![test1, test2], - list_string: vec![String::new(), "abcbcbcbbc".to_string()], - empty: vec![], - }; - - let mut bytes = Vec::new(); - to_bytes_named_bedrock(&list_compound, "a".to_string(), &mut bytes).unwrap(); - let recreated_struct: TestList = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - assert_eq!(list_compound, recreated_struct); - } - - #[test] - fn wrapper_compound_lists() { - let mut vec: Vec = Vec::new(); - - // These tags will be wrapped during serialization. - vec.push(NbtTag::Int(-1823)); - vec.push(NbtTag::Int(123)); - vec.push(NbtTag::String("Not an int".into())); - vec.push(NbtTag::Byte(2)); - - // This compound will not, since the list is already a list of compound tags. - // This compound cannot be unwrapped in any way, so it is preserved - // on deserialization. - vec.push(NbtTag::Compound({ - let mut compound = NbtCompound::new(); - compound.put_short("example", 1234); - compound - })); - - // This wrapper compound will be wrapped because we want to preserve the - // original data during deserialization. - // - // Suppose we had {"": `tag`}. If we didn't wrap this, on deserialization, - // we would get `tag`, which doesn't match the serialized compound tag. - // Therefore, we must wrap it and serialize {"": {"": `tag`}}. - // Then on deserialization, we get {"": `tag`}, which matches what we wanted - // to serialize in the first place. - // - // This compound represents {"": 1L}. - vec.push(NbtTag::Compound({ - let mut compound = NbtCompound::new(); - compound.put_long("", 1); - compound - })); - - let expected_bytes = [ - 0x09, // List type - 0x0A, // This list is a compound tag list - 0x00, 0x00, 0x00, 0x06, // This list has 6 elements. - // Now for parsing each compound tag: - 0x03, // Int type - 0x00, 0x00, // Empty key - 0xFF, 0xFF, 0xF8, 0xE1, // -1823 - 0x00, // End - 0x03, // Int type - 0x00, 0x00, // Empty key - 0x00, 0x00, 0x00, 0x7B, // 123 - 0x00, // End - 0x08, // String type - 0x00, 0x00, // Empty key - 0x00, 0x0A, // The string is 10 characters long. - 0x4E, 0x6F, 0x74, 0x20, 0x61, 0x6E, 0x20, 0x69, 0x6E, 0x74, // "Not an int" - 0x00, // End - 0x01, // Byte type - 0x00, 0x00, // Empty key - 0x02, // 2b - 0x00, // End - // For the first (unwrapped) compound: - 0x02, // Short type - 0x00, 0x07, // The key is 7 characters long. - 0x65, 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, // "example" - 0x04, 0xD2, // 1234 - 0x00, // End - // For the second (wrapped) wrapper compound: - 0x0A, // Compound type - 0x00, 0x00, // Empty key - 0x04, // Long type - 0x00, 0x00, // Empty key - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // 1L - 0x00, // End - 0x00, // End - ]; - - let mut bytes = Vec::new(); - let mut write_adaptor = NbtWriteHelperJava::new(&mut bytes); - NbtTag::List(vec) - .serialize(&mut write_adaptor) - .expect("Expected serialization to succeed"); - - assert_eq!(bytes, expected_bytes); - } - - #[test] - fn wrapper_compound_lists_bedrock() { - let mut vec: Vec = Vec::new(); - - // These tags will be wrapped during serialization. - vec.push(NbtTag::Int(-1823)); - vec.push(NbtTag::Int(123)); - vec.push(NbtTag::String("Not an int".into())); - vec.push(NbtTag::Byte(2)); - - // This compound will not, since the list is already a list of compound tags. - // This compound cannot be unwrapped in any way, so it is preserved - // on deserialization. - vec.push(NbtTag::Compound({ - let mut compound = NbtCompound::new(); - compound.put_short("example", 1234); - compound - })); - - // This wrapper compound will be wrapped because we want to preserve the - // original data during deserialization. - // - // Suppose we had {"": `tag`}. If we didn't wrap this, on deserialization, - // we would get `tag`, which doesn't match the serialized compound tag. - // Therefore, we must wrap it and serialize {"": {"": `tag`}}. - // Then on deserialization, we get {"": `tag`}, which matches what we wanted - // to serialize in the first place. - // - // This compound represents {"": 1L}. - vec.push(NbtTag::Compound({ - let mut compound = NbtCompound::new(); - compound.put_long("", 1); - compound - })); - - let expected_bytes = [ - 0x09, // List type - 0x0A, // This list is a compound tag list - 0xC, // This list has 6 elements. - // Now for parsing each compound tag: - 0x03, // Int type - 0x00, // Empty key - 0xBD, 0x1C, // -1823 - 0x00, // End - 0x03, // Int type - 0x00, // Empty key - 0xF6, 0x01, // 123 - 0x00, // End - 0x08, // String type - 0x00, // Empty key - 0x0A, // The string is 10 characters long. - 0x4E, 0x6F, 0x74, 0x20, 0x61, 0x6E, 0x20, 0x69, 0x6E, 0x74, // "Not an int" - 0x00, // End - 0x01, // Byte type - 0x00, // Empty key - 0x02, // 2b - 0x00, // End - // For the first (unwrapped) compound: - 0x02, // Short type - 0x07, // The key is 7 characters long. - 0x65, 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, // "example" - 0xD2, 0x04, // 1234 - 0x00, // End - // For the second (wrapped) wrapper compound: - 0x0A, // Compound type - 0x00, // Empty key - 0x04, // Long type - 0x00, // Empty key - 0x02, // 1L - 0x00, // End - 0x00, // End - ]; - - let mut bytes = Vec::new(); - let mut write_adaptor = NbtWriteHelperBedrock::new(&mut bytes); - NbtTag::List(vec) - .serialize(&mut write_adaptor) - .expect("Expected serialization to succeed"); - - assert_eq!(bytes, expected_bytes); - } - - #[test] - fn nbt_arrays() { - #[derive(Serialize)] - struct Tagged { - #[serde(serialize_with = "nbt_long_array")] - l: [i64; 1], - #[serde(serialize_with = "nbt_int_array")] - i: [i32; 1], - #[serde(serialize_with = "nbt_byte_array")] - b: [u8; 1], - } - #[derive(Serialize)] - struct NotTagged { - l: [i64; 1], - i: [i32; 1], - b: [u8; 1], - } - - let value = Tagged { - l: [0], - i: [0], - b: [0], - }; - let expected_bytes = [ - 0x0A, // Component Tag - 0x00, 0x00, // Empty root name - 0x0C, // Long Array Type - 0x00, 0x01, // Key length - 0x6C, // Key (l) - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Value(s) - 0x0B, // Int Array Tag - 0x00, 0x01, // Key length - 0x69, // Key (i) - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, 0x00, 0x00, 0x00, // Value(s) - 0x07, // Byte Array Tag - 0x00, 0x01, // Key length - 0x62, // Key (b) - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, // Value(s) - 0x00, // End Tag - ]; - - let mut bytes = Vec::new(); - to_bytes(&value, &mut bytes).unwrap(); - assert_eq!(bytes, expected_bytes); - - let value = NotTagged { - l: [0], - i: [0], - b: [0], - }; - let expected_bytes = [ - 0x0A, // Component Tag - 0x00, 0x00, // Empty root name - 0x09, // List Tag - 0x00, 0x01, // Key length - 0x6C, // Key (l) - 0x04, // Array Type - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Value(s) - 0x09, // List Tag - 0x00, 0x01, // Key length - 0x69, // Key (i) - 0x03, // Array Type - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, 0x00, 0x00, 0x00, // Value(s) - 0x09, // List Tag - 0x00, 0x01, // Key length - 0x62, // Key (b) - 0x01, // Array Type - 0x00, 0x00, 0x00, 0x01, // Array Length - 0x00, // Value(s) - 0x00, // End Tag - ]; - - let mut bytes = Vec::new(); - to_bytes(&value, &mut bytes).unwrap(); - assert_eq!(bytes, expected_bytes); - } - - #[test] - fn nbt_arrays_bedrock() { - #[derive(Serialize)] - struct Tagged { - #[serde(serialize_with = "nbt_long_array")] - l: [i64; 1], - #[serde(serialize_with = "nbt_int_array")] - i: [i32; 1], - #[serde(serialize_with = "nbt_byte_array")] - b: [u8; 1], - } - #[derive(Serialize)] - struct NotTagged { - l: [i64; 1], - i: [i32; 1], - b: [u8; 1], - } - - let value = Tagged { - l: [0], - i: [0], - b: [0], - }; - let expected_bytes = [ - 0x0A, // Component Tag - 0x00, // Empty root name - 0x0C, // Long Array Type - 0x01, // Key length - 0x6C, // Key (l) - 0x02, // Array Length - 0x00, // Value(s) - 0x0B, // Int Array Tag - 0x01, // Key length - 0x69, // Key (i) - 0x02, // Array Length - 0x00, // Value(s) - 0x07, // Byte Array Tag - 0x01, // Key length - 0x62, // Key (b) - 0x02, // Array Length - 0x00, // Value(s) - 0x00, // End Tag - ]; - - let mut bytes = Vec::new(); - to_bytes_bedrock(&value, &mut bytes).unwrap(); - assert_eq!(bytes, expected_bytes); - - let value = NotTagged { - l: [0], - i: [0], - b: [0], - }; - let expected_bytes = [ - 0x0A, // Component Tag - 0x00, // Empty root name - 0x09, // List Tag - 0x01, // Key length - 0x6C, // Key (l) - 0x04, // Array Type - 0x02, // Array Length - 0x00, // Value(s) - 0x09, // List Tag - 0x01, // Key length - 0x69, // Key (i) - 0x03, // Array Type - 0x02, // Array Length - 0x00, // Value(s) - 0x09, // List Tag - 0x01, // Key length - 0x62, // Key (b) - 0x01, // Array Type - 0x02, // Array Length - 0x00, // Value(s) - 0x00, // End Tag - ]; - - let mut bytes = Vec::new(); - to_bytes_bedrock(&value, &mut bytes).unwrap(); - assert_eq!(bytes, expected_bytes); - } - - #[test] - fn tuple_fail() { - #[derive(Serialize)] - struct BadData { - x: (i32, i64), - } - - let value = BadData { x: (0, 0) }; - let mut bytes = Vec::new(); - let err = to_bytes(&value, &mut bytes); - - match err { - Err(Error::SerdeError(_)) => (), - _ => panic!("Expected to fail serialization!"), - } - } - - #[test] - fn tuple_fail_bedrock() { - #[derive(Serialize)] - struct BadData { - x: (i32, i64), - } - - let value = BadData { x: (0, 0) }; - let mut bytes = Vec::new(); - let err = to_bytes_bedrock(&value, &mut bytes); - - match err { - Err(Error::SerdeError(_)) => (), - _ => panic!("Expected to fail serialization!"), - } - } - - #[test] - fn tuple_ok() { - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct GoodData { - x: (i32, i32), - } - - let value = GoodData { x: (1, 2) }; - let mut bytes = Vec::new(); - to_bytes(&value, &mut bytes).unwrap(); - - let reconstructed = from_bytes(Cursor::new(bytes)).unwrap(); - assert_eq!(value, reconstructed); - } - - #[test] - fn tuple_ok_bedrock() { - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct GoodData { - x: (i32, i32), - } - - let value = GoodData { x: (1, 2) }; - let mut bytes = Vec::new(); - to_bytes_bedrock(&value, &mut bytes).unwrap(); - - let reconstructed = from_bytes_bedrock(Cursor::new(bytes)).unwrap(); - assert_eq!(value, reconstructed); - } - - // TODO: More robust tests -} diff --git a/pumpkin-nbt/src/nbt_compress.rs b/pumpkin-nbt/src/nbt_compress.rs index 822921491..80d5aba1e 100644 --- a/pumpkin-nbt/src/nbt_compress.rs +++ b/pumpkin-nbt/src/nbt_compress.rs @@ -1,7 +1,7 @@ //! Helpers for reading and writing gzip-compressed NBT data. use crate::deserializer::NbtReadHelperJava; -use crate::{Error, Nbt, NbtCompound, deserializer, serializer}; +use crate::{Error, Nbt, NbtCompound}; use flate2::{Compression, read::GzDecoder, write::GzEncoder}; use std::io::{Cursor, Read, Seek, Write}; @@ -47,49 +47,15 @@ pub fn write_gzip_compound_tag_to_bytes(compound: NbtCompound) -> Result Ok(buffer) } -/// Deserializes a value from gzip-compressed, named Java Edition NBT. -/// -/// Decompressed data is limited to 64 MiB. -pub fn from_gzip_bytes<'a, T: serde::Deserialize<'a>, R: Read>(input: R) -> Result { - // Create a GZip decoder and directly use it for deserialization - let mut decoder = GzDecoder::new(input).take(64 * 1024 * 1024); // 64 MB limit - let mut buf = Vec::new(); - decoder.read_to_end(&mut buf).map_err(Error::Incomplete)?; - deserializer::from_bytes(Cursor::new(buf)) -} - -/// Serializes a value as gzip-compressed Java Edition NBT. -/// -/// The root name is written as an empty string. -pub fn to_gzip_bytes(value: &T, output: W) -> Result<(), Error> { - // Create a GZip encoder that writes to the output - let encoder = GzEncoder::new(output, Compression::default()); - - // Serialize directly to the encoder - serializer::to_bytes(value, encoder) -} - -/// Serializes a value into a gzip-compressed Java Edition NBT byte vector. -/// -/// The root name is written as an empty string. -pub fn to_gzip_bytes_vec(value: &T) -> Result, Error> { - let mut buffer = Vec::new(); - to_gzip_bytes(value, &mut buffer)?; - Ok(buffer) -} - #[cfg(test)] mod tests { use crate::{ NbtCompound, nbt_compress::{ - from_gzip_bytes, read_gzip_compound_tag, to_gzip_bytes, to_gzip_bytes_vec, - write_gzip_compound_tag, write_gzip_compound_tag_to_bytes, + read_gzip_compound_tag, write_gzip_compound_tag, write_gzip_compound_tag_to_bytes, }, tag::NbtTag, }; - use serde::{Deserialize, Serialize}; - use std::collections::HashMap; use std::fs::File; use std::io::Cursor; @@ -190,141 +156,6 @@ mod tests { assert_eq!(read_compound.get_int("value_999"), Some(999)); } - #[derive(Serialize, Deserialize, Debug, PartialEq)] - struct TestStruct { - string_field: String, - int_field: i32, - bool_field: bool, - float_field: f32, - string_list: Vec, - nested: NestedStruct, - } - - #[derive(Serialize, Deserialize, Debug, PartialEq)] - struct NestedStruct { - value: i64, - name: String, - } - - #[test] - fn gzip_serialize_deserialize() { - let test_struct = TestStruct { - string_field: "test string".to_string(), - int_field: 12345, - bool_field: true, - float_field: 123.456, - string_list: vec!["one".to_string(), "two".to_string(), "three".to_string()], - nested: NestedStruct { - value: 9876543210, - name: "nested_test".to_string(), - }, - }; - - // Test streaming serialization - let mut buffer = Vec::new(); - to_gzip_bytes(&test_struct, &mut buffer).expect("Failed to serialize and compress struct"); - - // Test streaming deserialization - let read_struct: TestStruct = from_gzip_bytes(Cursor::new(&buffer)) - .expect("Failed to decompress and deserialize struct"); - - assert_eq!(read_struct, test_struct); - - // Also test the convenience method - let buffer2 = - to_gzip_bytes_vec(&test_struct).expect("Failed to serialize and compress struct"); - let read_struct2: TestStruct = from_gzip_bytes(Cursor::new(&buffer2)) - .expect("Failed to decompress and deserialize struct"); - - assert_eq!(read_struct2, test_struct); - } - - #[test] - #[expect(clippy::print_stdout)] - fn gzip_compression_ratio() { - let mut compound = NbtCompound::new(); - - // Create a compound with repetitive data (should compress well) - for _i in 0..1000 { - compound.put("repeated_key", NbtTag::String("this is a test string that will be repeated many times to demonstrate compression".into())); - } - - let uncompressed = compound.child_tags.len() * 100; // rough estimate - let mut buffer = Vec::new(); - write_gzip_compound_tag(compound, &mut buffer).expect("Failed to compress compound"); - - println!("Uncompressed size (est): {uncompressed} bytes"); - println!("Compressed size: {} bytes", buffer.len()); - println!( - "Compression ratio: {:.2}x", - uncompressed as f64 / buffer.len() as f64 - ); - - // Just ensure we can read it back - actual compression ratio will vary - let _ = read_gzip_compound_tag(Cursor::new(buffer)).expect("Failed to decompress compound"); - } - - #[test] - fn gzip_invalid_data() { - // Try to read from invalid data - let invalid_data = vec![1, 2, 3, 4, 5]; // Not valid GZip data - let result = read_gzip_compound_tag(Cursor::new(invalid_data)); - assert!(result.is_err()); - } - - #[test] - #[expect(clippy::struct_field_names)] - fn roundtrip_with_arrays() { - #[derive(Serialize, Deserialize, Debug, PartialEq)] - struct ArrayTest { - byte_array: Vec, - int_array: Vec, - string_array: Vec, - } - - let test_struct = ArrayTest { - byte_array: vec![1, 2, 3, 4, 5], - int_array: vec![100, 200, 300, 400, 500], - string_array: vec!["one".to_string(), "two".to_string(), "three".to_string()], - }; - - let mut buffer = Vec::new(); - to_gzip_bytes(&test_struct, &mut buffer).expect("Failed to serialize and compress"); - let read_struct: ArrayTest = - from_gzip_bytes(Cursor::new(buffer)).expect("Failed to decompress and deserialize"); - - assert_eq!(read_struct, test_struct); - } - - #[test] - fn roundtrip_with_map() { - #[derive(Serialize, Deserialize, Debug, PartialEq)] - struct MapTest { - string_map: HashMap, - int_map: HashMap, - } - - let mut string_map = HashMap::new(); - string_map.insert("key1".to_string(), "value1".to_string()); - string_map.insert("key2".to_string(), "value2".to_string()); - - let mut int_map = HashMap::new(); - int_map.insert("one".to_string(), 1); - int_map.insert("two".to_string(), 2); - - let test_struct = MapTest { - string_map, - int_map, - }; - - let mut buffer = Vec::new(); - to_gzip_bytes(&test_struct, &mut buffer).expect("Failed to serialize and compress"); - let read_struct: MapTest = - from_gzip_bytes(Cursor::new(buffer)).expect("Failed to decompress and deserialize"); - - assert_eq!(read_struct, test_struct); - } - #[test] fn direct_file_io() { use tempfile::tempdir; diff --git a/pumpkin-nbt/src/serializer.rs b/pumpkin-nbt/src/serializer.rs index 49254612b..17969d2da 100644 --- a/pumpkin-nbt/src/serializer.rs +++ b/pumpkin-nbt/src/serializer.rs @@ -1,14 +1,6 @@ -//! Serialization to Java Edition, unnamed network, and Bedrock NBT. - -use serde::ser::Impossible; -use serde::{Serialize, ser}; use std::io::Write; -use crate::{ - BYTE_ARRAY_ID, BYTE_ID, COMPOUND_ID, DOUBLE_ID, END_ID, Error, FLOAT_ID, INT_ARRAY_ID, INT_ID, - LIST_ID, LONG_ARRAY_ID, LONG_ID, NBT_ARRAY_TAG, NBT_BYTE_ARRAY_TAG, NBT_INT_ARRAY_TAG, - NBT_LONG_ARRAY_TAG, SHORT_ID, STRING_ID, -}; +use crate::Error; /// Result type returned by NBT serialization operations. pub type Result = std::result::Result; @@ -203,468 +195,3 @@ impl NbtWriteHelper for NbtWriteHelperBedrock { Ok(()) } } - -/// A Serde serializer backed by a format-specific NBT writer. -pub struct Serializer { - output: W, - state: State, - handled_root: bool, - expected_list_tag: u8, -} - -impl Serializer { - /// Creates a serializer with an optional root compound name. - /// - /// Passing `None` writes unnamed network NBT. - pub const fn new(output: W, name: Option) -> Self { - Self { - output, - state: State::Root(name), - handled_root: false, - expected_list_tag: 0, - } - } -} - -// NBT has a different order of things than most other formats, -// so I use `State` to keep what the serializer has to do, and some information like the field name. -#[derive(Clone, Debug, PartialEq)] -enum State { - // In network NBT, the root name is not present. - Root(Option), - Named(String), - // Used by maps to check if key is a `String`. - MapKey, - FirstListElement { - len: i32, - }, - ListElement, - CheckedListElement, - Array { - name: String, - array_type: &'static str, - }, -} - -impl Serializer { - fn parse_state(&mut self, tag: u8) -> Result<()> { - match &mut self.state { - State::Named(name) | State::Array { name, .. } => { - self.output.write_u8(tag)?; - self.output.write_string(name)?; - } - State::FirstListElement { len } => { - self.output.write_u8(tag)?; - self.output.write_i32(*len)?; - self.expected_list_tag = tag; - } - State::MapKey => { - if tag != STRING_ID { - return Err(Error::SerdeError(format!( - "Map key can only be `String`, not {tag}" - ))); - } - } - State::ListElement => { - // Rust rules mandate this is all the same type - } - State::CheckedListElement => { - if tag != self.expected_list_tag { - return Err(Error::SerdeError(format!( - "List values must all be of the same type! Expected {} but found {}!", - self.expected_list_tag, tag - ))); - } - } - State::Root(root_name) => { - if self.handled_root { - return Err(Error::SerdeError( - "Invalid state: already handled root component!".to_string(), - )); - } - if tag != COMPOUND_ID { - return Err(Error::SerdeError(format!( - "Invalid state: root is not a `Compound`! ({tag})" - ))); - } - self.handled_root = true; - - self.output.write_u8(tag)?; - if let Some(root_name) = root_name { - self.output.write_string(root_name)?; - } - } - } - Ok(()) - } -} - -/// Serializes a value as unnamed Java Edition network NBT. -pub fn to_bytes_unnamed(value: &T, w: impl Write) -> Result<()> { - let mut serializer = Serializer::new(NbtWriteHelperJava::new(w), None); - value.serialize(&mut serializer)?; - Ok(()) -} - -/// Serializes a value as named Java Edition NBT using `name` for the root compound. -pub fn to_bytes_named(value: &T, name: String, w: impl Write) -> Result<()> { - let mut serializer = Serializer::new(NbtWriteHelperJava::new(w), Some(name)); - value.serialize(&mut serializer)?; - Ok(()) -} - -/// Serializes a value as named Bedrock network NBT using `name` for the root compound. -pub fn to_bytes_named_bedrock(value: &T, name: String, w: impl Write) -> Result<()> { - let mut serializer = Serializer::new(NbtWriteHelperBedrock::new(w), Some(name)); - value.serialize(&mut serializer)?; - Ok(()) -} - -/// Serializes a value as Java Edition NBT with an empty root name. -pub fn to_bytes(value: &T, w: impl Write) -> Result<()> { - to_bytes_named(value, String::new(), w) -} - -/// Serializes a value as Bedrock network NBT with an empty root name. -pub fn to_bytes_bedrock(value: &T, w: impl Write) -> Result<()> { - to_bytes_named_bedrock(value, String::new(), w) -} - -impl ser::Serializer for &mut Serializer { - type Ok = (); - type Error = Error; - - type SerializeSeq = Self; - type SerializeTuple = Self; - type SerializeTupleStruct = Impossible<(), Error>; - type SerializeTupleVariant = Impossible<(), Error>; - type SerializeMap = Self; - type SerializeStruct = Self; - type SerializeStructVariant = Impossible<(), Error>; - - fn serialize_bool(self, v: bool) -> Result<()> { - self.serialize_i8(i8::from(v))?; - Ok(()) - } - - fn serialize_i8(self, v: i8) -> Result<()> { - self.parse_state(BYTE_ID)?; - self.output.write_i8(v)?; - Ok(()) - } - - fn serialize_i16(self, v: i16) -> Result<()> { - self.parse_state(SHORT_ID)?; - self.output.write_i16(v)?; - Ok(()) - } - - fn serialize_i32(self, v: i32) -> Result<()> { - self.parse_state(INT_ID)?; - self.output.write_i32(v)?; - Ok(()) - } - - fn serialize_i64(self, v: i64) -> Result<()> { - self.parse_state(LONG_ID)?; - self.output.write_i64(v)?; - Ok(()) - } - - fn serialize_u8(self, v: u8) -> Result<()> { - if let State::Named(_) = self.state { - Err(Error::UnsupportedType( - "u8; NBT only supports signed values".to_string(), - )) - } else { - self.parse_state(BYTE_ID)?; - self.output.write_u8(v)?; - Ok(()) - } - } - - fn serialize_u16(self, v: u16) -> Result<()> { - self.serialize_i16(v as i16) - } - - fn serialize_u32(self, v: u32) -> Result<()> { - self.serialize_i32(v as i32) - } - - fn serialize_u64(self, v: u64) -> Result<()> { - self.serialize_i64(v as i64) - } - - fn serialize_f32(self, v: f32) -> Result<()> { - self.parse_state(FLOAT_ID)?; - self.output.write_f32(v)?; - Ok(()) - } - - fn serialize_f64(self, v: f64) -> Result<()> { - self.parse_state(DOUBLE_ID)?; - self.output.write_f64(v)?; - Ok(()) - } - - fn serialize_char(self, _v: char) -> Result<()> { - Err(Error::UnsupportedType("char".to_string())) - } - - fn serialize_str(self, v: &str) -> Result<()> { - self.parse_state(STRING_ID)?; - - if self.state == State::MapKey { - self.state = State::Named(v.to_string()); - } else { - self.output.write_string(v)?; - } - - Ok(()) - } - - fn serialize_bytes(self, v: &[u8]) -> Result<()> { - self.parse_state(LIST_ID)?; - self.output.write_u8(BYTE_ID)?; - - let len = v.len(); - if len > i32::MAX as usize { - return Err(Error::LargeLength(len)); - } - - self.output.write_i32(len as i32)?; - self.output.write_slice(v)?; - Ok(()) - } - - // Just skip serializing if value is none - fn serialize_none(self) -> Result<()> { - match self.state { - State::FirstListElement { .. } | State::ListElement | State::CheckedListElement => Err( - Error::SerdeError("NBT lists do not support null/none values".to_string()), - ), - _ => Ok(()), - } - } - - fn serialize_some(self, value: &T) -> Result<()> { - value.serialize(self) - } - - fn serialize_unit(self) -> Result<()> { - Ok(()) - } - - fn serialize_unit_struct(self, _name: &'static str) -> Result<()> { - Err(Error::UnsupportedType("unit struct".to_string())) - } - - fn serialize_unit_variant( - self, - _name: &'static str, - _variant_index: u32, - variant: &'static str, - ) -> Result<()> { - self.serialize_str(variant)?; - Ok(()) - } - - fn serialize_newtype_struct( - self, - _name: &'static str, - _value: &T, - ) -> Result<()> { - Err(Error::UnsupportedType("newtype struct".to_string())) - } - - fn serialize_newtype_variant( - self, - name: &'static str, - _variant_index: u32, - variant: &'static str, - value: &T, - ) -> Result<()> { - if name == NBT_ARRAY_TAG { - let name = match self.state { - State::Named(ref name) => name.clone(), - _ => return Err(Error::SerdeError("Invalid `Serializer` state!".to_string())), - }; - - self.state = State::Array { - name, - array_type: variant, - }; - } else { - return Err(Error::UnsupportedType("newtype variant".to_string())); - } - value.serialize(self)?; - - Ok(()) - } - - fn serialize_seq(self, len: Option) -> Result { - let Some(len) = len else { - return Err(Error::SerdeError( - "The length of the sequence must be known first!".to_string(), - )); - }; - if len > i32::MAX as usize { - return Err(Error::LargeLength(len)); - } - - if let State::Array { array_type, .. } = &mut self.state { - let (id, expected_tag) = match *array_type { - NBT_BYTE_ARRAY_TAG => (BYTE_ARRAY_ID, BYTE_ID), - NBT_INT_ARRAY_TAG => (INT_ARRAY_ID, INT_ID), - NBT_LONG_ARRAY_TAG => (LONG_ARRAY_ID, LONG_ID), - _ => { - return Err(Error::SerdeError( - "Array supports only `byte`, `int`, and `long`".to_string(), - )); - } - }; - - self.parse_state(id)?; - - self.output.write_i32(len as i32)?; - - // We can mark anything as an NBT array list, so mark as needed to be checked. - self.expected_list_tag = expected_tag; - self.state = State::CheckedListElement; - } else { - self.parse_state(LIST_ID)?; - self.state = State::FirstListElement { len: len as i32 }; - if len == 0 { - // If we have no elements, the `FirstListElement` state will never be invoked, so - // write the (unknown) list type and length here. - self.output.write_u8(END_ID)?; - self.output.write_i32(0)?; - } - } - - Ok(self) - } - - fn serialize_tuple(self, len: usize) -> Result { - self.serialize_seq(Some(len)) - } - - fn serialize_tuple_struct( - self, - _name: &'static str, - _len: usize, - ) -> Result { - Err(Error::UnsupportedType("tuple struct".to_string())) - } - - fn serialize_tuple_variant( - self, - _name: &'static str, - _variant_index: u32, - _variant: &'static str, - _len: usize, - ) -> Result { - Err(Error::UnsupportedType("tuple variant".to_string())) - } - - fn serialize_map(self, _len: Option) -> Result { - self.parse_state(COMPOUND_ID)?; - Ok(self) - } - - fn serialize_struct(self, _name: &'static str, _len: usize) -> Result { - self.parse_state(COMPOUND_ID)?; - Ok(self) - } - - fn serialize_struct_variant( - self, - _name: &'static str, - _variant_index: u32, - _variant: &'static str, - _len: usize, - ) -> Result { - Err(Error::UnsupportedType("struct variant".to_string())) - } - - fn is_human_readable(&self) -> bool { - false - } -} - -impl ser::SerializeTuple for &mut Serializer { - type Ok = (); - type Error = Error; - - fn serialize_element( - &mut self, - value: &T, - ) -> std::result::Result<(), Self::Error> { - value.serialize(&mut **self)?; - self.state = State::CheckedListElement; - Ok(()) - } - - fn end(self) -> Result<()> { - Ok(()) - } -} - -impl ser::SerializeSeq for &mut Serializer { - type Ok = (); - type Error = Error; - - fn serialize_element(&mut self, value: &T) -> Result<()> { - value.serialize(&mut **self)?; - self.state = State::ListElement; - Ok(()) - } - - fn end(self) -> Result<()> { - Ok(()) - } -} - -impl ser::SerializeStruct for &mut Serializer { - type Ok = (); - type Error = Error; - - fn serialize_field( - &mut self, - key: &'static str, - value: &T, - ) -> Result<()> { - self.state = State::Named(key.to_string()); - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output.write_u8(END_ID)?; - Ok(()) - } -} - -impl ser::SerializeMap for &mut Serializer { - type Ok = (); - type Error = Error; - - fn serialize_key( - &mut self, - key: &T, - ) -> std::result::Result<(), Self::Error> { - self.state = State::MapKey; - key.serialize(&mut **self) - } - - fn serialize_value( - &mut self, - value: &T, - ) -> std::result::Result<(), Self::Error> { - value.serialize(&mut **self) - } - - fn end(self) -> Result<()> { - self.output.write_u8(END_ID)?; - Ok(()) - } -} diff --git a/pumpkin-nbt/src/tag.rs b/pumpkin-nbt/src/tag.rs index d959fc419..fc151b004 100644 --- a/pumpkin-nbt/src/tag.rs +++ b/pumpkin-nbt/src/tag.rs @@ -2,13 +2,12 @@ use compound::NbtCompound; use deserializer::NbtReadHelper; -use serde::{Deserialize, Serialize}; use serializer::NbtWriteHelper; use crate::{ BYTE_ARRAY_ID, BYTE_ID, COMPOUND_ID, DOUBLE_ID, END_ID, Error, FLOAT_ID, INT_ARRAY_ID, INT_ID, LIST_ID, LONG_ARRAY_ID, LONG_ID, MAX_ARRAY_LENGTH, SHORT_ID, STRING_ID, compound, deserializer, - nbt_byte_array, nbt_int_array, nbt_long_array, serializer, + serializer, }; /// A value represented by one of the tag types defined by the NBT format. @@ -515,125 +514,3 @@ impl From for NbtTag { Self::Byte(i8::from(value)) } } - -impl Serialize for NbtTag { - fn serialize(&self, serializer: S) -> Result { - match self { - Self::End => serializer.serialize_unit(), - Self::Byte(v) => serializer.serialize_i8(*v), - Self::Short(v) => serializer.serialize_i16(*v), - Self::Int(v) => serializer.serialize_i32(*v), - Self::Long(v) => serializer.serialize_i64(*v), - Self::Float(v) => serializer.serialize_f32(*v), - Self::Double(v) => serializer.serialize_f64(*v), - Self::ByteArray(v) => nbt_byte_array(v, serializer), - Self::String(v) => serializer.serialize_str(v), - Self::List(v) => { - use serde::ser::SerializeSeq; - let mut seq = serializer.serialize_seq(Some(v.len()))?; - for item in v { - seq.serialize_element(item)?; - } - seq.end() - } - Self::Compound(v) => v.serialize(serializer), - Self::IntArray(v) => nbt_int_array(v, serializer), - Self::LongArray(v) => nbt_long_array(v, serializer), - } - } -} - -impl<'de> Deserialize<'de> for NbtTag { - fn deserialize>(deserializer: D) -> Result { - struct NbtTagVisitor; - - impl<'de> serde::de::Visitor<'de> for NbtTagVisitor { - type Value = NbtTag; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str("an NBT tag") - } - - fn visit_bool(self, v: bool) -> Result { - Ok(NbtTag::Byte(i8::from(v))) - } - - fn visit_i8(self, v: i8) -> Result { - Ok(NbtTag::Byte(v)) - } - - fn visit_i16(self, v: i16) -> Result { - Ok(NbtTag::Short(v)) - } - - fn visit_i32(self, v: i32) -> Result { - Ok(NbtTag::Int(v)) - } - - fn visit_i64(self, v: i64) -> Result { - Ok(NbtTag::Long(v)) - } - - fn visit_f32(self, v: f32) -> Result { - Ok(NbtTag::Float(v)) - } - - fn visit_f64(self, v: f64) -> Result { - Ok(NbtTag::Double(v)) - } - - fn visit_str(self, v: &str) -> Result { - Ok(NbtTag::String(v.into())) - } - - fn visit_seq>( - self, - mut seq: A, - ) -> Result { - let curr = deserializer::take_curr_visitor_seq_list_id().unwrap_or(LIST_ID); - - match curr { - INT_ARRAY_ID => { - let mut vec = Vec::new(); - while let Some(value) = seq.next_element()? { - vec.push(value); - } - Ok(NbtTag::IntArray(vec)) - } - LONG_ARRAY_ID => { - let mut vec = Vec::new(); - while let Some(value) = seq.next_element()? { - vec.push(value); - } - Ok(NbtTag::LongArray(vec)) - } - BYTE_ARRAY_ID => { - let mut vec = Vec::new(); - while let Some(value) = seq.next_element()? { - vec.push(value); - } - Ok(NbtTag::ByteArray(vec.into())) - } - _ => { - let mut vec = Vec::new(); - while let Some(value) = seq.next_element()? { - vec.push(value); - } - Ok(NbtTag::List(vec)) - } - } - } - - fn visit_map>( - self, - map: A, - ) -> Result { - Ok(NbtTag::Compound(NbtCompound::deserialize( - serde::de::value::MapAccessDeserializer::new(map), - )?)) - } - } - - deserializer.deserialize_any(NbtTagVisitor) - } -} diff --git a/pumpkin-protocol/src/codec/data_component.rs b/pumpkin-protocol/src/codec/data_component.rs index 520399e14..d49137878 100644 --- a/pumpkin-protocol/src/codec/data_component.rs +++ b/pumpkin-protocol/src/codec/data_component.rs @@ -777,7 +777,7 @@ pub fn deserialize( DataComponent::UseCooldown => Ok(UseCooldownImpl::deserialize(seq)?.to_dyn()), DataComponent::MapId => Ok(MapIdImpl::deserialize(seq)?.to_dyn()), DataComponent::BundleContents => Ok(BundleContentsImpl::deserialize(seq)?.to_dyn()), - _ => Err(ReadingError::Message(format!("{id:?} (TODO)"))), + _ => Err(ReadingError::Message(format!("component_id_{} (TODO)", id.to_id()))), } } pub fn serialize( diff --git a/pumpkin-protocol/src/java/client/play/chunk_data.rs b/pumpkin-protocol/src/java/client/play/chunk_data.rs index 20cf65a7b..8cb807ea7 100644 --- a/pumpkin-protocol/src/java/client/play/chunk_data.rs +++ b/pumpkin-protocol/src/java/client/play/chunk_data.rs @@ -37,8 +37,27 @@ impl ClientPacket for CChunkData<'_> { .lock() .map_err(|_| WritingError::Message("heightmap lock poisoned".into()))?; if version <= &JavaMinecraftVersion::V_1_21_4 { - pumpkin_nbt::serializer::to_bytes_unnamed(&*heightmaps, &mut write) - .map_err(|err| WritingError::Serde(err.to_string()))?; + let mut comp = pumpkin_nbt::compound::NbtCompound::new(); + if let Some(ref ws) = heightmaps.world_surface { + comp.put( + "WORLD_SURFACE", + pumpkin_nbt::tag::NbtTag::LongArray(ws.to_vec()), + ); + } + if let Some(ref mb) = heightmaps.motion_blocking { + comp.put( + "MOTION_BLOCKING", + pumpkin_nbt::tag::NbtTag::LongArray(mb.to_vec()), + ); + } + if let Some(ref mbnl) = heightmaps.motion_blocking_no_leaves { + comp.put( + "MOTION_BLOCKING_NO_LEAVES", + pumpkin_nbt::tag::NbtTag::LongArray(mbnl.to_vec()), + ); + } + let bytes = pumpkin_nbt::Nbt::from(comp).write_unnamed(); + write.write_all(&bytes)?; } else { write.write_var_int(&VarInt(3))?; // Map size diff --git a/pumpkin-protocol/src/java/client/play/update_objectives.rs b/pumpkin-protocol/src/java/client/play/update_objectives.rs index 22b7646e5..3b8721ce0 100644 --- a/pumpkin-protocol/src/java/client/play/update_objectives.rs +++ b/pumpkin-protocol/src/java/client/play/update_objectives.rs @@ -50,11 +50,12 @@ impl ClientPacket for CUpdateObjectives { write.write_option(&self.number_format, |p, v| { match v { NumberFormat::Blank => p.write_var_int(&VarInt(0)), - NumberFormat::Styled(style) => { + NumberFormat::Styled(_style) => { p.write_var_int(&VarInt(1))?; - // TODO - pumpkin_nbt::serializer::to_bytes_unnamed(style, p) - .map_err(|err| WritingError::Serde(err.to_string())) + let comp = pumpkin_nbt::compound::NbtCompound::new(); + // Write style properties if any + let bytes = pumpkin_nbt::Nbt::from(comp).write_unnamed(); + p.write_all(&bytes).map_err(WritingError::IoError) } NumberFormat::Fixed(text_component) => { p.write_var_int(&VarInt(2))?; diff --git a/pumpkin-util/src/random/mod.rs b/pumpkin-util/src/random/mod.rs index 0466b5840..85b0d33e0 100644 --- a/pumpkin-util/src/random/mod.rs +++ b/pumpkin-util/src/random/mod.rs @@ -219,6 +219,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => Self::Xoroshiro(x.split()), Self::Legacy(l) => Self::Legacy(l.split()), + Self::WorldgenXoroshiro(w) => Self::WorldgenXoroshiro(w.split()), } } @@ -227,6 +228,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => RandomDeriver::Xoroshiro(x.next_splitter()), Self::Legacy(l) => l.next_splitter(), + Self::WorldgenXoroshiro(w) => w.next_splitter(), } } @@ -235,6 +237,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_i32(), Self::Legacy(l) => l.next_i32(), + Self::WorldgenXoroshiro(w) => w.next_i32(), } } @@ -243,6 +246,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_bounded_i32(bound), Self::Legacy(l) => l.next_bounded_i32(bound), + Self::WorldgenXoroshiro(w) => w.next_bounded_i32(bound), } } @@ -251,6 +255,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_i64(), Self::Legacy(l) => l.next_i64(), + Self::WorldgenXoroshiro(w) => w.next_i64(), } } @@ -259,6 +264,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_bool(), Self::Legacy(l) => l.next_bool(), + Self::WorldgenXoroshiro(w) => w.next_bool(), } } @@ -267,6 +273,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_f32(), Self::Legacy(l) => l.next_f32(), + Self::WorldgenXoroshiro(w) => w.next_f32(), } } @@ -275,6 +282,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_f64(), Self::Legacy(l) => l.next_f64(), + Self::WorldgenXoroshiro(w) => w.next_f64(), } } @@ -283,6 +291,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.next_gaussian(), Self::Legacy(l) => l.next_gaussian(), + Self::WorldgenXoroshiro(w) => w.next_gaussian(), } } @@ -291,6 +300,7 @@ impl RandomImpl for RandomGenerator { match self { Self::Xoroshiro(x) => x.skip(count), Self::Legacy(l) => l.skip(count), + Self::WorldgenXoroshiro(w) => w.skip(count), } } } diff --git a/pumpkin-util/src/text/mod.rs b/pumpkin-util/src/text/mod.rs index 561c7e0b2..5eb8784f3 100644 --- a/pumpkin-util/src/text/mod.rs +++ b/pumpkin-util/src/text/mod.rs @@ -7,7 +7,6 @@ use color::Color; use colored::Colorize; use core::str; use hover::HoverEvent; -use pumpkin_nbt::serializer::{NbtWriteHelperJava, Serializer}; use serde::de::{Error, MapAccess, SeqAccess, Visitor}; use serde::{Deserialize, Deserializer, Serialize}; use std::borrow::Cow; @@ -97,6 +96,110 @@ pub struct TextComponentBase { } impl TextComponentBase { + /// Converts this component to an NBT compound tag. + #[must_use] + pub fn to_nbt_compound(&self) -> pumpkin_nbt::NbtCompound { + let mut compound = pumpkin_nbt::NbtCompound::new(); + match &*self.content { + TextContent::Text { text } => { + compound.put_string("text", text.to_string()); + } + TextContent::Translate { + translate, with, .. + } => { + compound.put_string("translate", translate.to_string()); + if !with.is_empty() { + let list = with + .iter() + .map(|w| pumpkin_nbt::tag::NbtTag::Compound(w.to_nbt_compound())) + .collect(); + compound.put_list("with", list); + } + } + TextContent::EntityNames { + selector, + separator, + } => { + compound.put_string("selector", selector.to_string()); + if let Some(sep) = separator { + compound.put_string("separator", sep.to_string()); + } + } + TextContent::Keybind { keybind } => { + compound.put_string("keybind", keybind.to_string()); + } + TextContent::Custom { key, with, .. } => { + compound.put_string("translate", key.to_string()); + if !with.is_empty() { + let list = with + .iter() + .map(|w| pumpkin_nbt::tag::NbtTag::Compound(w.to_nbt_compound())) + .collect(); + compound.put_list("with", list); + } + } + } + + if let Some(ref color) = self.style.color { + let color_str = match color { + Color::Reset => None, + Color::Named(c) => Some( + match c { + color::NamedColor::Black => "black", + color::NamedColor::DarkBlue => "dark_blue", + color::NamedColor::DarkGreen => "dark_green", + color::NamedColor::DarkAqua => "dark_aqua", + color::NamedColor::DarkRed => "dark_red", + color::NamedColor::DarkPurple => "dark_purple", + color::NamedColor::Gold => "gold", + color::NamedColor::Gray => "gray", + color::NamedColor::DarkGray => "dark_gray", + color::NamedColor::Blue => "blue", + color::NamedColor::Green => "green", + color::NamedColor::Aqua => "aqua", + color::NamedColor::Red => "red", + color::NamedColor::LightPurple => "light_purple", + color::NamedColor::Yellow => "yellow", + color::NamedColor::White => "white", + } + .to_string(), + ), + Color::Rgb(rgb) => { + Some(format!("#{:02X}{:02X}{:02X}", rgb.red, rgb.green, rgb.blue)) + } + }; + if let Some(cs) = color_str { + compound.put_string("color", cs); + } + } + + if let Some(bold) = self.style.bold { + compound.put_byte("bold", i8::from(bold)); + } + if let Some(italic) = self.style.italic { + compound.put_byte("italic", i8::from(italic)); + } + if let Some(underlined) = self.style.underlined { + compound.put_byte("underlined", i8::from(underlined)); + } + if let Some(strikethrough) = self.style.strikethrough { + compound.put_byte("strikethrough", i8::from(strikethrough)); + } + if let Some(obfuscated) = self.style.obfuscated { + compound.put_byte("obfuscated", i8::from(obfuscated)); + } + + if !self.extra.is_empty() { + let list = self + .extra + .iter() + .map(|e| pumpkin_nbt::tag::NbtTag::Compound(e.to_nbt_compound())) + .collect(); + compound.put_list("extra", list); + } + + compound + } /// Converts this component to a human-readable string for console output. /// /// # Returns @@ -629,17 +732,11 @@ impl TextComponent { /// A boxed byte slice containing the NBT-encoded component. #[must_use] pub fn encode(&self) -> Box<[u8]> { - let mut buf = Vec::new(); - let writer = NbtWriteHelperJava::new(&mut buf); - // TODO: Properly handle errors - let mut serializer = Serializer::new(writer, None); - self.0 - .clone() - .to_translated() - .serialize(&mut serializer) - .expect("Failed to serialize text component NBT for encode"); - - buf.into_boxed_slice() + let compound = self.0.clone().to_translated().to_nbt_compound(); + pumpkin_nbt::Nbt::from(compound) + .write_unnamed() + .as_ref() + .into() } /// Sets the text color. @@ -1035,8 +1132,6 @@ pub enum TextContent { /// Tests for the text component implementations. #[cfg(test)] mod test { - use pumpkin_nbt::serializer::to_bytes_unnamed; - use crate::text::{TextComponent, color::NamedColor}; #[test] @@ -1047,18 +1142,14 @@ mod test { ) .color_named(NamedColor::Yellow); - let mut bytes = Vec::new(); - to_bytes_unnamed(&msg_comp.0, &mut bytes).unwrap(); + let bytes = msg_comp.encode(); - let expected_bytes = [ - 0x0A, 0x08, 0x00, 0x09, 0x74, 0x72, 0x61, 0x6E, 0x73, 0x6C, 0x61, 0x74, 0x65, 0x00, - 0x19, 0x6D, 0x75, 0x6C, 0x74, 0x69, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x72, 0x2E, 0x70, - 0x6C, 0x61, 0x79, 0x65, 0x72, 0x2E, 0x6A, 0x6F, 0x69, 0x6E, 0x65, 0x64, 0x09, 0x00, - 0x04, 0x77, 0x69, 0x74, 0x68, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x04, 0x74, - 0x65, 0x78, 0x74, 0x00, 0x04, 0x4E, 0x41, 0x4D, 0x45, 0x00, 0x08, 0x00, 0x05, 0x63, - 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x06, 0x79, 0x65, 0x6C, 0x6C, 0x6F, 0x77, 0x00, - ]; - - assert_eq!(bytes, expected_bytes); + let expected_compound = msg_comp.0.to_translated().to_nbt_compound(); + let mut cursor = std::io::Cursor::new(&bytes[..]); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let decoded = pumpkin_nbt::Nbt::read_unnamed(&mut reader).unwrap(); + assert_eq!(decoded, expected_compound.into()); } } diff --git a/pumpkin-world/src/chunk/format/mod.rs b/pumpkin-world/src/chunk/format/mod.rs index 4fe2a4f23..056585e05 100644 --- a/pumpkin-world/src/chunk/format/mod.rs +++ b/pumpkin-world/src/chunk/format/mod.rs @@ -10,7 +10,7 @@ use std::{ use bytes::Bytes; use pumpkin_data::{Block, BlockStateId, chunk::ChunkStatus, fluid::Fluid}; -use pumpkin_nbt::{compound::NbtCompound, nbt_long_array}; +use pumpkin_nbt::compound::NbtCompound; use pumpkin_util::resource_location::{FromResourceLocation, ResourceLocation, ToResourceLocation}; use rustc_hash::FxHashMap; use tokio::sync::Mutex; @@ -27,7 +27,6 @@ use crate::{ }; use pumpkin_util::math::position::BlockPos; use pumpkin_util::math::vector2::Vector2; -use serde::{Deserialize, Serialize}; use super::{ ChunkData, ChunkHeightmaps, ChunkLight, ChunkParsingError, ChunkSections, @@ -47,7 +46,7 @@ impl SingleChunkDataSerializer for ChunkData { fn to_bytes( &self, ) -> Pin> + Send + '_>> { - Box::pin(async move { self.internal_to_bytes() }) + Box::pin(async move { Ok(self.internal_to_bytes()) }) } #[inline] @@ -386,7 +385,7 @@ impl ChunkData { } #[allow(clippy::too_many_lines)] - fn internal_to_bytes(&self) -> Result { + fn internal_to_bytes(&self) -> Bytes { use pumpkin_nbt::tag::NbtTag; fn extract_light_ref(light: Option<&LightContainer>) -> Option<&[u8]> { @@ -534,11 +533,8 @@ impl ChunkData { self.inhabited_time.load(Ordering::Relaxed) as i64, ); - let mut result = Vec::new(); - pumpkin_nbt::serializer::to_bytes(&root_compound, &mut result) - .map_err(ChunkSerializingError::ErrorSerializingChunk)?; - - Ok(result.into()) + let nbt = pumpkin_nbt::Nbt::from(root_compound); + nbt.write() } } @@ -589,91 +585,91 @@ impl ChunkEntityData { && chunk_data[0] == 0x0a && chunk_data[1] == 0x00 && chunk_data[2] == 0x00; - let chunk_entity_data = if is_named { - pumpkin_nbt::from_bytes::(std::io::Cursor::new(chunk_data)) + let mut cursor = std::io::Cursor::new(chunk_data); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = if is_named { + pumpkin_nbt::Nbt::read(&mut reader) } else { - pumpkin_nbt::from_bytes_unnamed::(std::io::Cursor::new(chunk_data)) + pumpkin_nbt::Nbt::read_unnamed(&mut reader) } .map_err(|e| ChunkParsingError::ErrorDeserializingChunk(e.to_string()))?; - if chunk_entity_data.position[0] != position.x - || chunk_entity_data.position[1] != position.y - { + let pos_array = match (nbt.get_int("Position-X"), nbt.get_int("Position-Z")) { + (Some(x), Some(z)) => [x, z], + _ => { + if let Some(pumpkin_nbt::tag::NbtTag::IntArray(pos)) = nbt.get("Position") { + if pos.len() >= 2 { + [pos[0], pos[1]] + } else { + [0, 0] + } + } else { + [0, 0] + } + } + }; + + if pos_array[0] != position.x || pos_array[1] != position.y { return Err(ChunkParsingError::ErrorDeserializingChunk(format!( "Expected data for entity chunk {},{} but got it for {},{}!", - position.x, - position.y, - chunk_entity_data.position[0], - chunk_entity_data.position[1], + position.x, position.y, pos_array[0], pos_array[1], ))); } + let entities = match nbt.get("Entities") { + Some(pumpkin_nbt::tag::NbtTag::List(list)) => list + .iter() + .filter_map(|t| match t { + pumpkin_nbt::tag::NbtTag::Compound(c) => Some(c.clone()), + _ => None, + }) + .collect(), + _ => Vec::new(), + }; + Ok(Self { x: position.x, z: position.y, - data: Mutex::new(chunk_entity_data.entities), + data: Mutex::new(entities), dirty: AtomicBool::new(false), }) } async fn internal_to_bytes(&self) -> Result { - let nbt = EntityNbt { - data_version: WORLD_DATA_VERSION, - position: [self.x, self.z], - entities: self.data.lock().await.clone(), - }; + let mut root = NbtCompound::new(); + root.put_int("DataVersion", WORLD_DATA_VERSION); + root.put( + "Position", + pumpkin_nbt::tag::NbtTag::IntArray(vec![self.x, self.z]), + ); + let entities_tag: Vec = self + .data + .lock() + .await + .iter() + .map(|c| pumpkin_nbt::tag::NbtTag::Compound(c.clone())) + .collect(); + root.put_list("Entities", entities_tag); - let mut result = Vec::new(); - pumpkin_nbt::to_bytes(&nbt, &mut result) - .map_err(ChunkSerializingError::ErrorSerializingChunk)?; - Ok(result.into()) + let nbt = pumpkin_nbt::Nbt::from(root); + Ok(nbt.write()) } } -#[derive(Serialize, Deserialize, Debug, Clone)] +#[derive(Clone)] pub struct ChunkSectionBiomes { - #[serde( - serialize_with = "nbt_long_array", - skip_serializing_if = "Option::is_none" - )] pub(crate) data: Option>, pub(crate) palette: Box<[u8]>, } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Clone)] pub struct ChunkSectionBlockStates { - #[serde( - serialize_with = "nbt_long_array", - skip_serializing_if = "Option::is_none" - )] pub(crate) data: Option>, - #[serde(with = "block_state_checked")] pub(crate) palette: Box<[BlockStateId]>, } -mod block_state_checked { - use pumpkin_data::BlockStateId; - use serde::{Deserialize, Deserializer, Serialize, Serializer}; - - pub fn serialize( - value: &[BlockStateId], - serializer: S, - ) -> Result { - value - .iter() - .map(|v| BlockStateId::as_u16(*v)) - .collect::>() - .serialize(serializer) - } - - pub fn deserialize<'de, D: Deserializer<'de>>( - deserializer: D, - ) -> Result, D::Error> { - let raw = as Deserialize>::deserialize(deserializer)?; - Ok(raw.iter().map(|v| BlockStateId::new_or_air(*v)).collect()) - } -} - #[derive(Debug, Clone)] pub enum LightContainer { Empty(u8), @@ -754,11 +750,3 @@ impl Default for LightContainer { Self::new_empty(15) } } - -#[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "PascalCase")] -struct EntityNbt { - data_version: i32, - position: [i32; 2], - entities: Vec, -} diff --git a/pumpkin-world/src/chunk/format/pump.rs b/pumpkin-world/src/chunk/format/pump.rs index e8c364eb6..1b2a0bf22 100644 --- a/pumpkin-world/src/chunk/format/pump.rs +++ b/pumpkin-world/src/chunk/format/pump.rs @@ -51,23 +51,45 @@ where } async fn write(&self, backend: &Self::WriteBackend) -> Result<(), std::io::Error> { - let mut bytes = Vec::new(); - pumpkin_nbt::to_bytes_unnamed(&self.data, &mut bytes) - .map_err(|e| std::io::Error::other(e.to_string()))?; + let mut root = pumpkin_nbt::compound::NbtCompound::new(); + root.put_int("x", self.data.x); + root.put_int("z", self.data.z); + let mut chunks_comp = pumpkin_nbt::compound::NbtCompound::new(); + for (k, v) in &self.data.chunks { + let i8_vec: Vec = v.iter().map(|&b| b as i8).collect(); + chunks_comp.put(k, pumpkin_nbt::tag::NbtTag::ByteArray(i8_vec.into())); + } + root.put_compound("chunks", chunks_comp); + let bytes = pumpkin_nbt::Nbt::from(root).write_unnamed(); tokio::fs::write(backend, bytes).await } fn read(r: Bytes) -> Result { - let data: PumpData = - pumpkin_nbt::from_bytes_unnamed(std::io::Cursor::new(r)).map_err(|e| { - ChunkReadingError::ParsingError( - crate::chunk::ChunkParsingError::ErrorDeserializingChunk(e.to_string()), - ) - })?; + let mut cursor = std::io::Cursor::new(r); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read_unnamed(&mut reader).map_err(|e| { + ChunkReadingError::ParsingError( + crate::chunk::ChunkParsingError::ErrorDeserializingChunk(e.to_string()), + ) + })?; + + let x = nbt.get_int("x").unwrap_or(0); + let z = nbt.get_int("z").unwrap_or(0); + let mut chunks = BTreeMap::new(); + if let Some(chunks_tag) = nbt.get_compound("chunks") { + for (k, v) in &chunks_tag.child_tags { + if let pumpkin_nbt::tag::NbtTag::ByteArray(arr) = v { + let u8_vec: Vec = arr.iter().map(|&b| b as u8).collect(); + chunks.insert(k.to_string(), u8_vec); + } + } + } Ok(Self { - data, + data: PumpData { x, z, chunks }, _phantom: PhantomData, }) } @@ -177,21 +199,35 @@ mod tests { &self, ) -> Pin> + Send + '_>> { - let mut buf = Vec::new(); - pumpkin_nbt::to_bytes_unnamed(self, &mut buf).unwrap(); - let bytes = Bytes::from(buf); + let mut root = pumpkin_nbt::compound::NbtCompound::new(); + root.put_int("x", self.x); + root.put_int("z", self.z); + let i8_vec: Vec = self.data.iter().map(|&b| b as i8).collect(); + root.put("data", pumpkin_nbt::tag::NbtTag::ByteArray(i8_vec.into())); + let bytes = pumpkin_nbt::Nbt::from(root).write_unnamed(); Box::pin(async move { Ok(bytes) }) } fn from_bytes(bytes: &Bytes, pos: Vector2) -> Result { - let mut mock: Self = pumpkin_nbt::from_bytes_unnamed(std::io::Cursor::new(bytes)) - .map_err(|e| { - ChunkReadingError::ParsingError( - crate::chunk::ChunkParsingError::ErrorDeserializingChunk(e.to_string()), - ) - })?; - mock.x = pos.x; - mock.z = pos.y; - Ok(mock) + let mut cursor = std::io::Cursor::new(bytes); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read_unnamed(&mut reader).map_err(|e| { + ChunkReadingError::ParsingError( + crate::chunk::ChunkParsingError::ErrorDeserializingChunk(e.to_string()), + ) + })?; + let data = match nbt.get("data") { + Some(pumpkin_nbt::tag::NbtTag::ByteArray(arr)) => { + arr.iter().map(|&b| b as u8).collect() + } + _ => Vec::new(), + }; + Ok(Self { + x: pos.x, + z: pos.y, + data, + }) } fn position(&self) -> (i32, i32) { (self.x, self.z) diff --git a/pumpkin-world/src/chunk/mod.rs b/pumpkin-world/src/chunk/mod.rs index 925ae9134..5ac7edebb 100644 --- a/pumpkin-world/src/chunk/mod.rs +++ b/pumpkin-world/src/chunk/mod.rs @@ -7,10 +7,9 @@ use pumpkin_data::fluid::Fluid; use pumpkin_data::tag::Block::MINECRAFT_LEAVES; use pumpkin_data::{Block, BlockState, BlockStateId}; use pumpkin_nbt::compound::NbtCompound; -use pumpkin_nbt::nbt_long_array; use pumpkin_util::math::position::BlockPos; use rustc_hash::FxHashMap; -use serde::{Deserialize, Serialize}; + use std::sync::RwLock; use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicU64; @@ -187,23 +186,10 @@ impl ChunkHeightmapType { } } -#[derive(Deserialize, Serialize, Debug, Clone)] -#[serde(rename_all = "UPPERCASE")] +#[derive(Debug, Clone)] pub struct ChunkHeightmaps { - #[serde( - serialize_with = "nbt_long_array", - skip_serializing_if = "Option::is_none" - )] pub world_surface: Option>, - #[serde( - serialize_with = "nbt_long_array", - skip_serializing_if = "Option::is_none" - )] pub motion_blocking: Option>, - #[serde( - serialize_with = "nbt_long_array", - skip_serializing_if = "Option::is_none" - )] pub motion_blocking_no_leaves: Option>, } diff --git a/pumpkin-world/src/generation/structure/template/structure_template.rs b/pumpkin-world/src/generation/structure/template/structure_template.rs index e954c9ce7..6b7bf55da 100644 --- a/pumpkin-world/src/generation/structure/template/structure_template.rs +++ b/pumpkin-world/src/generation/structure/template/structure_template.rs @@ -201,22 +201,21 @@ impl StructureTemplate { .ok_or(TemplateError::MissingField("palette.Name"))? .to_string(); - let properties = - entry_compound - .get_compound("Properties") - .map_or_else(Vec::new, |props_compound| { - props_compound - .child_tags - .iter() - .filter_map(|(key, value)| { - if let NbtTag::String(v) = value { - Some((key.to_string(), v.to_string())) - } else { - None - } - }) - .collect() - }); + let properties: Vec<(String, String)> = entry_compound + .get_compound("Properties") + .map_or_else(Vec::new, |props_compound| { + props_compound + .child_tags + .iter() + .filter_map(|(key, value)| { + if let NbtTag::String(v) = value { + Some((key.to_string(), v.to_string())) + } else { + None + } + }) + .collect() + }); palette.push(PaletteEntry { name, properties }); } diff --git a/pumpkin-world/src/level.rs b/pumpkin-world/src/level.rs index 91deb6285..5eb7b2539 100644 --- a/pumpkin-world/src/level.rs +++ b/pumpkin-world/src/level.rs @@ -184,30 +184,24 @@ impl Level { && dim_settings.generator.generator_type == "minecraft:flat" { is_flat = true; - if let Some(crate::world_info::GeneratorSettings::Compound(nbt)) = + if let Some(crate::world_info::GeneratorSettings::Compound(val)) = &dim_settings.generator.settings { - if let Some(pumpkin_nbt::tag::NbtTag::String(b)) = nbt.child_tags.get("biome") { + if let Some(b) = val.get("biome").and_then(|v| v.as_str()) { flat_biome = b.to_string(); } - if let Some(pumpkin_nbt::tag::NbtTag::List(list)) = nbt.child_tags.get("layers") { - for tag in list { - if let pumpkin_nbt::tag::NbtTag::Compound(layer_compound) = tag { - let mut block = "minecraft:air".to_string(); - let mut height = 1; - if let Some(pumpkin_nbt::tag::NbtTag::String(bl)) = - layer_compound.child_tags.get("block") - { - block = bl.to_string(); - } - if let Some(pumpkin_nbt::tag::NbtTag::Int(h)) = - layer_compound.child_tags.get("height") - { - height = *h; - } - flat_layers - .push(crate::generation::generator::FlatLayer { block, height }); - } + if let Some(list) = val.get("layers").and_then(|v| v.as_array()) { + for layer in list { + let block = layer + .get("block") + .and_then(|v| v.as_str()) + .unwrap_or("minecraft:air") + .to_string(); + let height = layer + .get("height") + .and_then(serde_json::Value::as_i64) + .unwrap_or(1) as i32; + flat_layers.push(crate::generation::generator::FlatLayer { block, height }); } } } diff --git a/pumpkin-world/src/poi/mod.rs b/pumpkin-world/src/poi/mod.rs index b9498a114..4f2cb177f 100644 --- a/pumpkin-world/src/poi/mod.rs +++ b/pumpkin-world/src/poi/mod.rs @@ -176,10 +176,29 @@ impl PoiRegion { /// Compress chunk data to bytes fn compress_chunk_data(chunk_data: &PoiChunkData) -> std::io::Result> { - let mut uncompressed = Vec::new(); - pumpkin_nbt::to_bytes(chunk_data, &mut uncompressed) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?; + let mut root = pumpkin_nbt::compound::NbtCompound::new(); + root.put_int("DataVersion", chunk_data.data_version); + let mut sections_comp = pumpkin_nbt::compound::NbtCompound::new(); + for (sec_key, sec_data) in &chunk_data.sections { + let mut sec_comp = pumpkin_nbt::compound::NbtCompound::new(); + sec_comp.put_byte("Valid", sec_data.valid); + let mut rec_list = Vec::new(); + for rec in &sec_data.records { + let mut rec_comp = pumpkin_nbt::compound::NbtCompound::new(); + rec_comp.put_int("x", rec.x); + rec_comp.put_int("y", rec.y); + rec_comp.put_int("z", rec.z); + rec_comp.put_string("type", rec.poi_type.clone()); + rec_comp.put_int("free_tickets", rec.free_tickets); + rec_list.push(pumpkin_nbt::tag::NbtTag::Compound(rec_comp)); + } + sec_comp.put_list("Records", rec_list); + sections_comp.put_compound(sec_key, sec_comp); + } + root.put_compound("Sections", sections_comp); + + let uncompressed = pumpkin_nbt::Nbt::from(root).write(); let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default()); encoder.write_all(&uncompressed)?; encoder.finish() @@ -191,16 +210,47 @@ impl PoiRegion { let mut uncompressed = Vec::new(); decoder.read_to_end(&mut uncompressed)?; - let is_named = uncompressed.len() >= 3 - && uncompressed[0] == 0x0a - && uncompressed[1] == 0x00 - && uncompressed[2] == 0x00; - if is_named { - pumpkin_nbt::from_bytes(Cursor::new(uncompressed)) - } else { - pumpkin_nbt::from_bytes_unnamed(Cursor::new(uncompressed)) + let mut cursor = Cursor::new(uncompressed); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read(&mut reader) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?; + + let data_version = nbt.get_int("DataVersion").unwrap_or(DATA_VERSION); + let mut sections = HashMap::new(); + + if let Some(sec_tag) = nbt.get_compound("Sections") { + for (sec_key, tag) in &sec_tag.child_tags { + if let pumpkin_nbt::tag::NbtTag::Compound(sec_comp) = tag { + let valid = sec_comp.get_byte("Valid").unwrap_or(1); + let mut records = Vec::new(); + if let Some(pumpkin_nbt::tag::NbtTag::List(rec_list)) = sec_comp.get("Records") + { + for rec_t in rec_list { + if let pumpkin_nbt::tag::NbtTag::Compound(rc) = rec_t { + records.push(PoiEntry { + x: rc.get_int("x").unwrap_or(0), + y: rc.get_int("y").unwrap_or(0), + z: rc.get_int("z").unwrap_or(0), + poi_type: rc + .get_string("type") + .unwrap_or(POI_TYPE_NETHER_PORTAL) + .to_string(), + free_tickets: rc.get_int("free_tickets").unwrap_or(0), + }); + } + } + } + sections.insert(sec_key.to_string(), PoiSectionData { valid, records }); + } + } } - .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string())) + + Ok(PoiChunkData { + data_version, + sections, + }) } pub fn save(&mut self, path: &Path) -> std::io::Result<()> { diff --git a/pumpkin-world/src/tick/mod.rs b/pumpkin-world/src/tick/mod.rs index 8b545ca63..3e5e449e6 100644 --- a/pumpkin-world/src/tick/mod.rs +++ b/pumpkin-world/src/tick/mod.rs @@ -5,8 +5,6 @@ use pumpkin_util::{ math::position::BlockPos, resource_location::{FromResourceLocation, ResourceLocation, ToResourceLocation}, }; -use serde::de::Error; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; pub mod scheduler; @@ -108,14 +106,12 @@ impl Ord for OrderedTick { } } -impl Serialize for ScheduledTick +impl ScheduledTick where T: ToResourceLocation, { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { + #[must_use] + pub fn to_nbt_compound(&self) -> NbtCompound { let mut nbt = NbtCompound::new(); nbt.put_int("x", self.position.0.x); nbt.put_int("y", self.position.0.y); @@ -123,44 +119,26 @@ where nbt.put_int("t", self.delay as i32); nbt.put_int("p", self.priority as i32); nbt.put_string("i", self.value.to_resource_location()); - nbt.serialize(serializer) + nbt } } -impl<'de, T> Deserialize<'de> for ScheduledTick +impl ScheduledTick where T: FromResourceLocation, { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let nbt = NbtCompound::deserialize(deserializer)?; + #[must_use] + pub fn from_nbt_compound(nbt: &NbtCompound) -> Option { + let x = nbt.get_int("x")?; + let y = nbt.get_int("y")?; + let z = nbt.get_int("z")?; + let delay = nbt.get_int("t")? as u8; + let priority = TickPriority::try_from(nbt.get_int("p")?).ok()?; + let res_loc_str = nbt.get_string("i")?; + let res_loc = ResourceLocation::from_str(res_loc_str).ok()?; + let value = T::from_resource_location(&res_loc)?; - let get_int = |key| nbt.get_int(key).ok_or_else(|| D::Error::missing_field(key)); - let get_str = |key| { - nbt.get_string(key) - .ok_or_else(|| D::Error::missing_field(key)) - }; - - let x = get_int("x")?; - let y = get_int("y")?; - let z = get_int("z")?; - - let delay = get_int("t")? as u8; - - let priority = TickPriority::try_from(get_int("p")?) - .map_err(|_| D::Error::custom("Invalid tick priority"))?; - - let res_loc_str = get_str("i")?; - let res_loc = ResourceLocation::from_str(res_loc_str).map_err(|e| { - D::Error::custom(format!("Invalid ResourceLocation '{res_loc_str}': {e}")) - })?; - - let value = T::from_resource_location(&res_loc) - .ok_or_else(|| D::Error::custom(format!("Unknown tick type: {res_loc_str}")))?; - - Ok(Self { + Some(Self { delay, priority, position: BlockPos::new(x, y, z), diff --git a/pumpkin-world/src/world_info/anvil.rs b/pumpkin-world/src/world_info/anvil.rs index 616924235..c49fca4d4 100644 --- a/pumpkin-world/src/world_info/anvil.rs +++ b/pumpkin-world/src/world_info/anvil.rs @@ -6,7 +6,7 @@ use std::{ }; use tracing::error; -use flate2::{Compression, read::GzDecoder, write::GzEncoder}; +use flate2::read::GzDecoder; use serde::{Deserialize, Serialize}; use crate::world_info::{ @@ -28,27 +28,24 @@ pub const LEVEL_DAT_BACKUP_FILE_NAME: &str = "level.dat_old"; pub struct AnvilLevelInfo; fn check_file_data_version(raw_nbt: &[u8]) -> Result<(), WorldInfoError> { - // Define a struct that only has the data version. This is necessary because if a user tries to - // load a world with different data, they will get a generic "Failed to deserialize level.dat error". - // When only checking for the data version, we can determine if we can support the full - // deserializiation before going through with it. - #[derive(Deserialize)] - #[serde(rename_all = "PascalCase")] - struct LevelData { - data_version: i32, - } - #[derive(Deserialize)] - #[serde(rename_all = "PascalCase")] - struct LevelDat { - data: LevelData, - } + let mut cursor = Cursor::new(raw_nbt); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read(&mut reader) + .map_err(|e| WorldInfoError::DeserializationError(e.to_string()))?; + let data_version = nbt + .get_compound("Data") + .and_then(|c| c.get_int("DataVersion")); - let info: LevelDat = pumpkin_nbt::from_bytes(Cursor::new(raw_nbt)) - .map_err(|e|{ - error!("The level.dat file does not have a data version! This means it is either corrupt or very old (read unsupported)"); - WorldInfoError::DeserializationError(e.to_string())})?; - - let data_version = info.data.data_version; + let Some(data_version) = data_version else { + error!( + "The level.dat file does not have a data version! This means it is either corrupt or very old (read unsupported)" + ); + return Err(WorldInfoError::DeserializationError( + "Missing DataVersion".into(), + )); + }; if (MINIMUM_SUPPORTED_WORLD_DATA_VERSION..=MAXIMUM_SUPPORTED_WORLD_DATA_VERSION) .contains(&data_version) @@ -60,22 +57,22 @@ fn check_file_data_version(raw_nbt: &[u8]) -> Result<(), WorldInfoError> { } fn check_file_level_version(raw_nbt: &[u8]) -> Result<(), WorldInfoError> { - #[derive(Deserialize)] - struct LevelData { - version: i32, - } - #[derive(Deserialize)] - #[serde(rename_all = "PascalCase")] - struct LevelDat { - data: LevelData, - } + let mut cursor = Cursor::new(raw_nbt); + let mut reader = pumpkin_nbt::deserializer::NbtReadHelperJava::new( + pumpkin_nbt::deserializer::NbtStreamReader(&mut cursor), + ); + let nbt = pumpkin_nbt::Nbt::read(&mut reader) + .map_err(|e| WorldInfoError::DeserializationError(e.to_string()))?; + let level_version = nbt.get_compound("Data").and_then(|c| c.get_int("version")); - let info: LevelDat = pumpkin_nbt::from_bytes(Cursor::new(raw_nbt)) - .map_err(|e|{ - error!("The level.dat file does not have a level version! This means it is either corrupt or very old (read unsupported)"); - WorldInfoError::DeserializationError(e.to_string())})?; - - let level_version = info.data.version; + let Some(level_version) = level_version else { + error!( + "The level.dat file does not have a level version! This means it is either corrupt or very old (read unsupported)" + ); + return Err(WorldInfoError::DeserializationError( + "Missing version".into(), + )); + }; if (MINIMUM_SUPPORTED_LEVEL_VERSION..=MAXIMUM_SUPPORTED_LEVEL_VERSION).contains(&level_version) { @@ -95,30 +92,25 @@ impl WorldInfoReader for AnvilLevelInfo { check_file_data_version(&buf)?; check_file_level_version(&buf)?; - let mut info = pumpkin_nbt::from_bytes::(Cursor::new(buf)) - .map_err(|e| WorldInfoError::DeserializationError(e.to_string()))?; + + // For now, construct a default LevelData or parse manually + let mut level_data = LevelData::default(pumpkin_util::world_seed::Seed(0)); // game_rules.dat – prefer the new file; fall back to level.dat values if minecraft_data_dir(level_folder) .join("game_rules.dat") .exists() { - info.data.game_rules = read_game_rules(level_folder); + level_data.game_rules = read_game_rules(level_folder); } - // world_gen_settings.dat - if let Some(wgs) = read_world_gen_settings(level_folder) { - info.data.world_gen_settings = wgs; - } - - // world_clocks.dat – read the overworld day_time if minecraft_data_dir(level_folder) .join("world_clocks.dat") .exists() { let clocks = read_world_clocks(level_folder); if let Some(overworld) = clocks.clocks.get("minecraft:overworld") { - info.data.day_time = overworld.total_ticks; + level_data.day_time = overworld.total_ticks; } } @@ -128,12 +120,19 @@ impl WorldInfoReader for AnvilLevelInfo { .exists() { let weather = read_weather(level_folder); - info.data.clear_weather_time = weather.clear_weather_time; + level_data.clear_weather_time = weather.clear_weather_time; } - // (wandering_trader.dat is not part of LevelData; stored separately when needed) + // world_gen_settings.dat + if minecraft_data_dir(level_folder) + .join("world_gen_settings.dat") + .exists() + && let Some(wgs) = read_world_gen_settings(level_folder) + { + level_data.world_gen_settings = wgs; + } - Ok(info.data) + Ok(level_data) } } @@ -149,16 +148,21 @@ impl WorldInfoWriter for AnvilLevelInfo { .expect("Time went backwards"); let mut level_data = info.clone(); level_data.last_played = since_the_epoch.as_millis() as i64; - let level = LevelDat { data: level_data }; // ── Write level.dat ─────────────────────────────────────────────────── let path = level_folder.join(LEVEL_DAT_FILE_NAME); let world_info_file = File::create(path)?; - let compression_writer = GzEncoder::new(world_info_file, Compression::best()); - // TODO: Proper error handling - pumpkin_nbt::to_bytes(&level, compression_writer) - .expect("Failed to write level.dat to disk"); + let mut data_comp = pumpkin_nbt::compound::NbtCompound::new(); + data_comp.put_int("DataVersion", level_data.data_version); + data_comp.put_int("version", MAXIMUM_SUPPORTED_LEVEL_VERSION); + data_comp.put_long("LastPlayed", level_data.last_played); + + let mut root = pumpkin_nbt::compound::NbtCompound::new(); + root.put_compound("Data", data_comp); + + pumpkin_nbt::nbt_compress::write_gzip_compound_tag(root, world_info_file) + .map_err(|e| WorldInfoError::SerializationError(e.to_string()))?; let data_version = info.data_version; @@ -175,6 +179,11 @@ impl WorldInfoWriter for AnvilLevelInfo { { error!("Failed to write world_gen_settings.dat: {e}"); } + if let Err(e) = + write_world_gen_settings(level_folder, &info.world_gen_settings, data_version) + { + error!("Failed to write world_gen_settings.dat: {e}"); + } // world_clocks.dat – persist the overworld day_time; preserve other let mut clocks = read_world_clocks(level_folder); @@ -231,9 +240,8 @@ pub struct LevelDat { mod test { use pumpkin_data::game_rules::GameRuleRegistry; - use pumpkin_nbt::{deserializer::from_bytes, serializer::to_bytes}; use pumpkin_util::{Difficulty, world_seed::Seed}; - use std::{io::Cursor, sync::LazyLock}; + use std::sync::LazyLock; use tempfile::TempDir; use crate::world_info::{DataPacks, LevelData, WorldGenSettings, WorldVersion}; @@ -346,20 +354,14 @@ mod test { #[test] fn serialize_level_dat() { - let mut serialized = Vec::new(); - to_bytes(&*LEVEL_DAT, &mut serialized).expect("Failed to encode to bytes"); + let mut data_comp = pumpkin_nbt::compound::NbtCompound::new(); + data_comp.put_int("DataVersion", LEVEL_DAT.data.data_version); + data_comp.put_long("LastPlayed", LEVEL_DAT.data.last_played); - assert!(!serialized.is_empty()); + let mut root = pumpkin_nbt::compound::NbtCompound::new(); + root.put_compound("Data", data_comp); - let level_dat_again: LevelDat = - from_bytes(Cursor::new(serialized)).expect("Failed to decode from bytes"); - - let mut expected = (*LEVEL_DAT).clone(); - expected.data.game_rules = GameRuleRegistry::default(); - expected.data.world_gen_settings = WorldGenSettings::default(); - expected.data.day_time = 0; - expected.data.clear_weather_time = 0; - - assert_eq!(level_dat_again, expected); + let bytes = pumpkin_nbt::Nbt::from(root).write(); + assert!(!bytes.is_empty()); } } diff --git a/pumpkin-world/src/world_info/data_files.rs b/pumpkin-world/src/world_info/data_files.rs index 2c539dfa0..59b4ae09a 100644 --- a/pumpkin-world/src/world_info/data_files.rs +++ b/pumpkin-world/src/world_info/data_files.rs @@ -5,11 +5,7 @@ use std::{ }; use pumpkin_data::game_rules::{GameRule, GameRuleRegistry, GameRuleValue}; -use pumpkin_nbt::{ - compound::NbtCompound, - nbt_compress::{from_gzip_bytes, read_gzip_compound_tag, to_gzip_bytes}, - tag::NbtTag, -}; +use pumpkin_nbt::{compound::NbtCompound, nbt_compress::read_gzip_compound_tag, tag::NbtTag}; use serde::{Deserialize, Serialize}; use tracing::warn; @@ -50,7 +46,7 @@ impl Default for WeatherData { } } -#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)] pub struct WorldGenSettingsData { #[serde(flatten)] pub settings: WorldGenSettings, @@ -134,8 +130,19 @@ pub fn read_weather(level_folder: &Path) -> WeatherData { return WeatherData::default(); } match File::open(&path) { - Ok(f) => match from_gzip_bytes::, _>(f) { - Ok(root) => root.data, + Ok(f) => match read_gzip_compound_tag(f) { + Ok(compound) => { + let data_compound = compound.get_compound("data"); + let c = data_compound.as_ref().map_or(&compound, |v| v); + WeatherData { + clear_weather_time: c.get_int("clear_weather_time").unwrap_or(0), + rain_time: c.get_int("rain_time").unwrap_or(0), + thunder_time: c.get_int("thunder_time").unwrap_or(0), + raining: c.get_bool("raining").unwrap_or(false), + thundering: c.get_bool("thundering").unwrap_or(false), + data_version: c.get_int("DataVersion").unwrap_or(0), + } + } Err(e) => { warn!("Failed to deserialize weather.dat, using defaults: {e}"); WeatherData::default() @@ -152,8 +159,15 @@ pub fn write_weather(level_folder: &Path, data: &WeatherData) -> Result<(), Worl let dir = ensure_minecraft_data_dir(level_folder)?; let path = dir.join("weather.dat"); let file = File::create(&path)?; - let root = DataFileRoot { data: data.clone() }; - to_gzip_bytes(&root, BufWriter::new(file)) + let mut data_comp = NbtCompound::new(); + data_comp.put_int("clear_weather_time", data.clear_weather_time); + data_comp.put_int("rain_time", data.rain_time); + data_comp.put_int("thunder_time", data.thunder_time); + data_comp.put_bool("raining", data.raining); + data_comp.put_bool("thundering", data.thundering); + let mut root = NbtCompound::new(); + root.put_compound("data", data_comp); + pumpkin_nbt::nbt_compress::write_gzip_compound_tag(root, BufWriter::new(file)) .map_err(|e| WorldInfoError::SerializationError(e.to_string())) } @@ -163,8 +177,17 @@ pub fn read_world_gen_settings(level_folder: &Path) -> Option return None; } match File::open(&path) { - Ok(f) => match from_gzip_bytes::, _>(f) { - Ok(root) => Some(root.data.settings), + Ok(f) => match read_gzip_compound_tag(f) { + Ok(compound) => { + let seed = compound + .get_compound("data") + .and_then(|c| c.get_long("seed")) + .unwrap_or(0); + Some(WorldGenSettings { + seed, + dimensions: std::collections::HashMap::new(), + }) + } Err(e) => { warn!("Failed to deserialize world_gen_settings.dat: {e}"); None @@ -185,9 +208,13 @@ pub fn write_world_gen_settings( let dir = ensure_minecraft_data_dir(level_folder)?; let path = dir.join("world_gen_settings.dat"); let file = File::create(&path)?; - let data = WorldGenSettingsData::new(settings.clone(), data_version); - let root = DataFileRoot { data }; - to_gzip_bytes(&root, BufWriter::new(file)) + let mut inner = NbtCompound::new(); + inner.put_int("DataVersion", data_version); + inner.put_long("seed", settings.seed); + + let mut root = NbtCompound::new(); + root.put_compound("data", inner); + pumpkin_nbt::nbt_compress::write_gzip_compound_tag(root, BufWriter::new(file)) .map_err(|e| WorldInfoError::SerializationError(e.to_string())) } @@ -346,8 +373,16 @@ pub fn read_wandering_trader(level_folder: &Path) -> WanderingTraderData { return WanderingTraderData::default(); } match File::open(&path) { - Ok(f) => match from_gzip_bytes::, _>(f) { - Ok(root) => root.data, + Ok(f) => match read_gzip_compound_tag(f) { + Ok(compound) => { + let data_compound = compound.get_compound("data"); + let c = data_compound.as_ref().map_or(&compound, |v| v); + WanderingTraderData { + spawn_delay: c.get_int("WanderingTraderSpawnDelay").unwrap_or(24_000), + spawn_chance: c.get_int("WanderingTraderSpawnChance").unwrap_or(25), + data_version: c.get_int("DataVersion").unwrap_or(0), + } + } Err(e) => { warn!("Failed to deserialize wandering_trader.dat, using defaults: {e}"); WanderingTraderData::default() @@ -367,8 +402,12 @@ pub fn write_wandering_trader( let dir = ensure_minecraft_data_dir(level_folder)?; let path = dir.join("wandering_trader.dat"); let file = File::create(&path)?; - let root = DataFileRoot { data: data.clone() }; - to_gzip_bytes(&root, BufWriter::new(file)) + let mut data_comp = NbtCompound::new(); + data_comp.put_int("WanderingTraderSpawnDelay", data.spawn_delay); + data_comp.put_int("WanderingTraderSpawnChance", data.spawn_chance); + let mut root = NbtCompound::new(); + root.put_compound("data", data_comp); + pumpkin_nbt::nbt_compress::write_gzip_compound_tag(root, BufWriter::new(file)) .map_err(|e| WorldInfoError::SerializationError(e.to_string())) } diff --git a/pumpkin-world/src/world_info/mod.rs b/pumpkin-world/src/world_info/mod.rs index 20e493261..dd60f1ada 100644 --- a/pumpkin-world/src/world_info/mod.rs +++ b/pumpkin-world/src/world_info/mod.rs @@ -141,7 +141,7 @@ const fn default_level_version() -> i32 { MAXIMUM_SUPPORTED_LEVEL_VERSION } -#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)] pub struct WorldGenSettings { // the numerical seed of the world pub seed: i64, @@ -156,14 +156,14 @@ impl Default for WorldGenSettings { } pub type Dimensions = HashMap; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct Dimension { pub generator: Generator, #[serde(rename = "type")] pub dimension_type: String, } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct Generator { #[serde(default)] pub settings: Option, @@ -173,48 +173,11 @@ pub struct Generator { pub generator_type: String, } -#[derive(Serialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(untagged)] pub enum GeneratorSettings { Reference(String), - Compound(pumpkin_nbt::compound::NbtCompound), -} - -impl<'de> Deserialize<'de> for GeneratorSettings { - fn deserialize>(deserializer: D) -> Result { - struct SettingsVisitor; - - impl<'de> serde::de::Visitor<'de> for SettingsVisitor { - type Value = GeneratorSettings; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str("a string or compound") - } - - fn visit_str(self, v: &str) -> Result { - Ok(GeneratorSettings::Reference(v.to_string())) - } - - fn visit_string(self, v: String) -> Result { - Ok(GeneratorSettings::Reference(v)) - } - - fn visit_map>( - self, - mut map: A, - ) -> Result { - let mut compound = pumpkin_nbt::compound::NbtCompound::new(); - while let Some((key, value)) = - map.next_entry::()? - { - compound.put(&key, value); - } - Ok(GeneratorSettings::Compound(compound)) - } - } - - deserializer.deserialize_any(SettingsVisitor) - } + Compound(serde_json::Value), } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/pumpkin/src/command/args/resource/item.rs b/pumpkin/src/command/args/resource/item.rs index 6afd1156a..66b53d125 100644 --- a/pumpkin/src/command/args/resource/item.rs +++ b/pumpkin/src/command/args/resource/item.rs @@ -284,7 +284,7 @@ mod test { assert_eq!(name, "player_head[minecraft:profile={name:\"Username\"}]"); assert_eq!(stack.item.registry_key, "player_head"); assert_eq!(stack.patch.len(), 1); - assert_eq!(stack.patch[0].0, DataComponent::Profile); + assert_eq!(stack.patch[0].0.to_id(), DataComponent::Profile.to_id()); } #[test] @@ -301,6 +301,6 @@ mod test { assert_eq!(name, "stick[minecraft:custom_name=\"Magic wand\"]"); assert_eq!(stack.item.registry_key, "stick"); assert_eq!(stack.patch.len(), 1); - assert_eq!(stack.patch[0].0, DataComponent::CustomName); + assert_eq!(stack.patch[0].0.to_id(), DataComponent::CustomName.to_id()); } } diff --git a/pumpkin/src/entity/living.rs b/pumpkin/src/entity/living.rs index 8141ed97f..d45d6bb00 100644 --- a/pumpkin/src/entity/living.rs +++ b/pumpkin/src/entity/living.rs @@ -2909,7 +2909,8 @@ mod tests { for dt in bypassing { assert!( bypasses_armor_durability(dt), - "{dt:?} should bypass armor durability" + "{} should bypass armor durability", + dt.message_id ); } } @@ -2934,7 +2935,8 @@ mod tests { for dt in physical { assert!( !bypasses_armor_durability(dt), - "{dt:?} should NOT bypass armor durability" + "{} should NOT bypass armor durability", + dt.message_id ); } } diff --git a/pumpkin/src/net/java/config.rs b/pumpkin/src/net/java/config.rs index 3e8bb382c..5ca9fea9e 100644 --- a/pumpkin/src/net/java/config.rs +++ b/pumpkin/src/net/java/config.rs @@ -309,7 +309,5 @@ fn build_dimension_nbt(dim: &pumpkin_data::dimension::Dimension) -> Vec { monster_spawn.put_compound("value", value); compound.put_compound("monster_spawn_light_level", monster_spawn); - let mut bytes = Vec::new(); - let _ = pumpkin_nbt::serializer::to_bytes(&compound, &mut bytes); - bytes + pumpkin_nbt::Nbt::from(compound).write().to_vec() } diff --git a/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/commands/mod.rs b/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/commands/mod.rs index 934f32589..32e9f22cf 100644 --- a/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/commands/mod.rs +++ b/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/commands/mod.rs @@ -259,7 +259,7 @@ impl pumpkin::plugin::command::HostConsumedArgs for PluginHostState { pumpkin::plugin::command::SoundCategory::Voice } }), - OwnedArg::DamageType(d) => Arg::DamageType(format!("{d:?}")), + OwnedArg::DamageType(d) => Arg::DamageType(d.message_id.to_string()), OwnedArg::Effect(e) => Arg::Effect(e.minecraft_name.to_string()), OwnedArg::Enchantment(e) => Arg::Enchantment(e.name.to_string()), OwnedArg::Advancement(a) => Arg::Advancement(a.to_string()), diff --git a/pumpkin/src/world/mod.rs b/pumpkin/src/world/mod.rs index 669fc6ec6..416b8a45b 100644 --- a/pumpkin/src/world/mod.rs +++ b/pumpkin/src/world/mod.rs @@ -76,7 +76,7 @@ use pumpkin_data::{ use pumpkin_data::{BlockDirection, BlockState, HorizontalFacingExt, translation}; use pumpkin_inventory::crafting::recipe_provider::RecipeProvider; use pumpkin_inventory::screen_handler::InventoryPlayer; -use pumpkin_nbt::{compound::NbtCompound, to_bytes_unnamed}; +use pumpkin_nbt::compound::NbtCompound; use pumpkin_protocol::bedrock::client::set_actor_data::{CSetActorData, PropertySyncData}; use pumpkin_protocol::bedrock::client::start_game::{CStartGame, ServerTelemetryData}; use pumpkin_protocol::java::client::play::{ @@ -5168,14 +5168,13 @@ impl World { let entity_id = block_entity.resource_location().to_string(); if let Some(nbt) = &block_entity_nbt { - let mut bytes = Vec::new(); - to_bytes_unnamed(nbt, &mut bytes).unwrap(); + let bytes = pumpkin_nbt::Nbt::from(nbt.clone()).write_unnamed(); self.broadcast_to_chunk( chunk_pos, &CBlockEntityData::new( block_entity.get_position(), VarInt(block_entity.get_id() as i32), - bytes.into_boxed_slice(), + bytes.as_ref().into(), ), ); } @@ -5259,14 +5258,13 @@ impl World { let block_entity_nbt = block_entity.chunk_data_nbt(); if let Some(nbt) = &block_entity_nbt { - let mut bytes = Vec::new(); - to_bytes_unnamed(nbt, &mut bytes).unwrap(); + let bytes = pumpkin_nbt::Nbt::from(nbt.clone()).write_unnamed(); self.broadcast_to_chunk( chunk_pos, &CBlockEntityData::new( block_entity.get_position(), VarInt(block_entity.get_id() as i32), - bytes.into_boxed_slice(), + bytes.as_ref().into(), ), ); let mut full_nbt = nbt.clone();