diff --git a/.gitignore b/.gitignore index d0a8c67d2..f5ca81c30 100644 --- a/.gitignore +++ b/.gitignore @@ -6,12 +6,11 @@ # Cargo build configuration .cargo -world/ +/worlds/ +/generated/ +/worldgen/ /config.toml -plugins/ - -# Python cache files (libcraft) -**/__pycache__/ +/plugins.toml # macOS desktop files **/.DS_STORE diff --git a/.rustfmt.toml b/.rustfmt.toml index f8129fbf8..2c44a0723 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,4 +1,5 @@ # We use rustfmt, and formatting is checked in CI. # Please run `cargo fmt` before committing -# Empty config: default settings! +unstable_features = true +format_generated_files = true diff --git a/Cargo.lock b/Cargo.lock index 0b4381092..15a2ad85f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli 0.26.1", -] - [[package]] name = "adler" version = "1.0.2" @@ -23,7 +14,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", "opaque-debug", @@ -44,7 +35,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom", "once_cell", "version_check", ] @@ -60,18 +51,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" - -[[package]] -name = "approx" -version = "0.3.2" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" [[package]] name = "approx" @@ -83,34 +65,14 @@ dependencies = [ ] [[package]] -name = "argh" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb41d85d92dfab96cb95ab023c265c5e4261bb956c0fb49ca06d90c570f1958" -dependencies = [ - "argh_derive", - "argh_shared", -] - -[[package]] -name = "argh_derive" -version = "0.1.7" +name = "approx" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be69f70ef5497dd6ab331a50bd95c6ac6b8f7f17a7967838332743fbd58dc3b5" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ - "argh_shared", - "heck 0.3.3", - "proc-macro2", - "quote", - "syn", + "num-traits", ] -[[package]] -name = "argh_shared" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f8c380fa28aa1b36107cd97f0196474bb7241bb95a453c5c01a15ac74b2eac" - [[package]] name = "arrayvec" version = "0.5.2" @@ -139,36 +101,18 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "backtrace" -version = "0.3.63" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "autocfg 1.1.0", ] [[package]] -name = "base-x" -version = "0.2.8" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -178,17 +122,26 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.3.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874f8444adcb4952a8bc51305c8be95c8ec8237bb0d2e78d2e039f771f8828a0" +checksum = "e6b4d9b1225d28d360ec6a231d65af1fd99a2a095154c8040689617290569c5c" [[package]] name = "bincode" -version = "1.3.3" +version = "2.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "f609ceb2c41b0d0277314a789ef0e7eb14593d5485f7c67320bed3924ebb1b33" dependencies = [ - "serde", + "bincode_derive", +] + +[[package]] +name = "bincode_derive" +version = "2.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913287a8f3e00db4c7ae1b87e9b9b8cebd6b89217eaadfc281fa5c897da35dc3" +dependencies = [ + "virtue", ] [[package]] @@ -199,9 +152,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.21.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470fbd40e959c961f16841fbf96edbbdcff766ead89a1ae2b53d22852be20998" +checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" dependencies = [ "funty", "radium", @@ -209,56 +162,21 @@ dependencies = [ "wyz", ] -[[package]] -name = "block-access" -version = "0.1.0" -dependencies = [ - "quill", -] - [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array", ] -[[package]] -name = "block-place" -version = "0.1.0" -dependencies = [ - "quill", -] - [[package]] name = "bumpalo" version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" -[[package]] -name = "bytecheck" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" -dependencies = [ - "bytecheck_derive", - "ptr_meta", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "bytecount" version = "0.6.2" @@ -267,18 +185,18 @@ checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" dependencies = [ "proc-macro2", "quote", @@ -291,12 +209,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.1.0" @@ -325,44 +237,14 @@ dependencies = [ ] [[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-quill" -version = "0.1.0" -dependencies = [ - "anyhow", - "argh", - "cargo_metadata", - "heck 0.3.3", - "quill-plugin-format", -] - -[[package]] -name = "cargo_metadata" -version = "0.12.3" +name = "cc" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ - "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", - "serde", - "serde_json", + "jobserver", ] -[[package]] -name = "cc" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - [[package]] name = "cesu8" version = "1.1.0" @@ -378,12 +260,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -396,6 +272,33 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "cipher" version = "0.3.0" @@ -407,16 +310,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.10" +version = "3.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a30c3bf9ff12dfe5dae53f0a96e0febcd18420d1c0e7fad77796d9d5c4b5375" +checksum = "7c167e37342afc5f33fd87bbc870cedd020d2a6dffa05d45ccd9241fbdd146db" dependencies = [ "atty", "bitflags", "clap_derive", + "clap_lex", "indexmap", "lazy_static", - "os_str_bytes", "strsim", "termcolor", "textwrap", @@ -424,17 +327,26 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.0.6" +version = "3.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517358c28fcef6607bf6f76108e02afad7e82297d132a6b846dcc1fc3efcd153" +checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro-error", "proc-macro2", "quote", "syn", ] +[[package]] +name = "clap_lex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189ddd3b5d32a70b35e7686054371742a937b0d99128e76dde6340210e966669" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "cmake" version = "0.1.48" @@ -477,143 +389,69 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" dependencies = [ - "getrandom 0.2.4", + "getrandom", "lazy_static", "proc-macro-hack", "tiny-keccak", ] [[package]] -name = "const_fn" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "cpufeatures" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-bforest" -version = "0.76.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e6bea67967505247f54fa2c85cf4f6e0e31c4e5692c9b70e4ae58e339067333" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.76.0" +name = "const_format" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48194035d2752bdd5bdae429e3ab88676e95f52a2b1355a5d4e809f9e39b1d74" +checksum = "22bc6cd49b0ec407b680c3e380182b6ac63b73991cb7602de350352fc309b614" dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.25.0", - "log", - "regalloc", - "smallvec", - "target-lexicon 0.12.2", + "const_format_proc_macros", ] [[package]] -name = "cranelift-codegen-meta" -version = "0.76.0" +name = "const_format_proc_macros" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976efb22fcab4f2cd6bd4e9913764616a54d895c1a23530128d04e03633c555f" +checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" dependencies = [ - "cranelift-codegen-shared", - "cranelift-entity", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] -name = "cranelift-codegen-shared" -version = "0.76.0" +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dabb5fe66e04d4652e434195b45ae65b5c8172d520247b8f66d8df42b2b45dc" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] -name = "cranelift-entity" -version = "0.76.0" +name = "convert_case" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3329733e4d4b8e91c809efcaa4faee80bf66f20164e3dd16d707346bd3494799" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" [[package]] -name = "cranelift-frontend" -version = "0.76.0" +name = "cpufeatures" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279afcc0d3e651b773f94837c3d581177b348c8d69e928104b2e9fccb226f921" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon 0.12.2", + "libc", ] [[package]] name = "crc32fast" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.6" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", + "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] @@ -630,15 +468,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "crypto-common" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctrlc" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865" +dependencies = [ + "nix", + "winapi", +] + [[package]] name = "darling" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ "darling_core", "darling_macro", @@ -646,9 +504,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", @@ -660,9 +518,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", @@ -685,7 +543,7 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", @@ -702,10 +560,14 @@ dependencies = [ ] [[package]] -name = "discard" -version = "1.0.4" +name = "digest" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", +] [[package]] name = "either" @@ -713,33 +575,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "enumset" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6216d2c19a6fb5f29d1ada1dc7bc4367a8cbf0fa4af5cf12e07b5bbdde6b5b2c" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fastrand" version = "1.7.0" @@ -750,96 +585,29 @@ dependencies = [ ] [[package]] -name = "feather-base" +name = "feather-common" version = "0.1.0" dependencies = [ - "ahash 0.4.7", + "ahash 0.7.6", "anyhow", - "arrayvec 0.7.2", - "bitflags", - "bitvec", - "bytemuck", - "byteorder", - "feather-blocks", - "hematite-nbt", - "libcraft-blocks", - "libcraft-core", - "libcraft-inventory", - "libcraft-items", - "libcraft-particles", - "libcraft-text", - "nom", - "nom_locate", - "num-derive", - "num-traits", + "derive_more", + "feather-utils", + "feather-worldgen", + "flume", + "itertools", + "libcraft", + "log", + "num_cpus", "parking_lot", - "quill-common", - "rand 0.8.4", - "rand_pcg", + "quill", + "rand", "serde", - "serde_json", - "serde_test", - "serde_with", - "smallvec", - "thiserror", - "uuid", - "vek", -] - -[[package]] -name = "feather-blocks" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "libcraft-blocks", - "num-traits", - "once_cell", - "serde", - "thiserror", - "vek", -] - -[[package]] -name = "feather-blocks-generator" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "heck 0.3.3", - "indexmap", - "maplit", - "once_cell", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", -] - -[[package]] -name = "feather-common" -version = "0.1.0" -dependencies = [ - "ahash 0.7.6", - "anyhow", - "feather-base", - "feather-blocks", - "feather-ecs", - "feather-utils", - "feather-worldgen", - "flume", - "itertools", - "libcraft-core", - "libcraft-inventory", - "libcraft-items", - "log", - "parking_lot", - "quill-common", - "rand 0.8.4", - "rayon", "smartstring", + "tokio", + "toml", "uuid", + "vane", + "vek 0.14.1", ] [[package]] @@ -857,54 +625,6 @@ dependencies = [ "zip", ] -[[package]] -name = "feather-ecs" -version = "0.1.0" -dependencies = [ - "ahash 0.7.6", - "anyhow", - "feather-utils", - "hecs", - "log", - "thiserror", -] - -[[package]] -name = "feather-plugin-host" -version = "0.1.0" -dependencies = [ - "ahash 0.7.6", - "anyhow", - "bincode", - "bumpalo", - "bytemuck", - "feather-base", - "feather-common", - "feather-ecs", - "feather-plugin-host-macros", - "libloading", - "log", - "paste 1.0.6", - "quill-common", - "quill-plugin-format", - "serde", - "serde_json", - "tempfile", - "vec-arena", - "wasmer", - "wasmer-wasi", -] - -[[package]] -name = "feather-plugin-host-macros" -version = "0.1.0" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "feather-protocol" version = "0.1.0" @@ -913,17 +633,15 @@ dependencies = [ "anyhow", "bytemuck", "byteorder", - "bytes 0.5.6", + "bytes", "cfb8", - "feather-base", - "feather-blocks", + "either", "flate2", "hematite-nbt", - "libcraft-core", - "libcraft-items", + "libcraft", "num-traits", "parking_lot", - "quill-common", + "quill", "serde", "thiserror", "uuid", @@ -938,41 +656,45 @@ dependencies = [ "base64", "base64ct", "colored", + "const_format", "crossbeam-utils", - "feather-base", + "ctrlc", + "either", "feather-common", - "feather-ecs", - "feather-plugin-host", "feather-protocol", "feather-utils", - "feather-worldgen", + "feather-world-format-plugin", "fern", "flate2", "flume", "futures-lite", "hematite-nbt", - "libcraft-core", - "libcraft-items", + "humantime-serde", + "indexmap", + "itertools", + "konst", + "libcraft", "log", "md-5", "num-bigint", "num-traits", "once_cell", "parking_lot", - "quill-common", - "rand 0.8.4", + "quill", + "rand", "ring", "rsa", "rsa-der", "serde", "serde_json", "sha-1", - "slab", - "time 0.3.6", + "slotmap", + "time", "tokio", "toml", "ureq", "uuid", + "vane", ] [[package]] @@ -980,50 +702,62 @@ name = "feather-utils" version = "0.1.0" [[package]] -name = "feather-worldgen" -version = "0.6.0" +name = "feather-world-format" +version = "0.1.0" dependencies = [ - "approx 0.3.2", + "anyhow", "bitvec", - "feather-base", + "byteorder", + "ciborium", + "libcraft", "log", - "num-traits", - "once_cell", - "rand 0.7.3", - "rand_xorshift", - "simdnoise", - "smallvec", - "strum", + "serde", + "tempfile", + "zstd", ] [[package]] -name = "fern" +name = "feather-world-format-plugin" +version = "0.1.0" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "feather-world-format", + "flume", + "log", + "num_cpus", + "parking_lot", + "quill", + "serde", + "toml", +] + +[[package]] +name = "feather-worldgen" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9a4820f0ccc8a7afd67c39a0f1a0f4b07ca1725164271a64939d7aeb9af065" dependencies = [ + "libcraft", "log", + "quill", + "rand", ] [[package]] -name = "filetime" -version = "0.2.15" +name = "fern" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" +checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "winapi", + "log", ] [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", "libz-sys", @@ -1032,15 +766,15 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.10" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d04dafd11240188e146b6f6476a898004cace3be31d4ec5e08e216bf4947ac0" +checksum = "843c03199d0c0ca54bc1ea90ac0d507274c28abcc4f691ae8b4eaa375087c76a" dependencies = [ "futures-core", "futures-sink", "nanorand", "pin-project", - "spin 0.9.2", + "spin 0.9.3", ] [[package]] @@ -1060,22 +794,28 @@ dependencies = [ ] [[package]] -name = "funty" +name = "fs_extra" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-lite" @@ -1094,18 +834,9 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" - -[[package]] -name = "generational-arena" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d3b771574f62d0548cee0ad9057857e9fc25d7a3335f140c84f6acd0bf601" -dependencies = [ - "cfg-if 0.1.10", -] +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "generic-array" @@ -1119,71 +850,28 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] -name = "gimli" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.26.1" +name = "half" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" - -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash 0.4.7", -] +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -1191,14 +879,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" -[[package]] -name = "hecs" -version = "0.3.2" -source = "git+https://github.com/feather-rs/feather-hecs#824712c4e4ab658e75fabf2a91a54f9d1c0b1790" -dependencies = [ - "hashbrown 0.9.1", -] - [[package]] name = "hematite-nbt" version = "0.5.2" @@ -1219,6 +899,22 @@ dependencies = [ "libc", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1238,48 +934,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ - "autocfg 1.0.1", - "hashbrown 0.11.2", + "autocfg 1.1.0", + "hashbrown", "serde", ] -[[package]] -name = "inkwell" -version = "0.1.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2223d0eba0ae6d40a3e4680c6a3209143471e1f38b41746ea309aa36dde9f90b" -dependencies = [ - "either", - "inkwell_internals", - "libc", - "llvm-sys", - "once_cell", - "parking_lot", - "regex", -] - -[[package]] -name = "inkwell_internals" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7090af3d300424caa81976b8c97bca41cd70e861272c072e188ae082fb49f9" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1297,15 +967,46 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "konst" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf39e1fb26bc66fe74331504ed87b533d48c00da9bd04aafd58bbb12dc063a0" +dependencies = [ + "konst_macro_rules", + "konst_proc_macros", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e329ff8b9745c0bc70fdb0a3721d8ac954e8bbc905e8e63a9450ab0acf08f3" + +[[package]] +name = "konst_proc_macros" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "984e109462d46ad18314f10e392c286c3d47bce203088a09012de1015b45b737" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1315,12 +1016,6 @@ dependencies = [ "spin 0.5.2", ] -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "lexical-core" version = "0.7.6" @@ -1329,16 +1024,58 @@ checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec 0.5.2", "bitflags", - "cfg-if 1.0.0", + "cfg-if", "ryu", "static_assertions", ] [[package]] name = "libc" -version = "0.2.113" +version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" +checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" + +[[package]] +name = "libcraft" +version = "0.1.0" +dependencies = [ + "bincode", + "bitflags", + "derive_more", + "flate2", + "hematite-nbt", + "libcraft-anvil", + "libcraft-blocks", + "libcraft-chunk", + "libcraft-core", + "libcraft-inventory", + "libcraft-items", + "libcraft-particles", + "libcraft-text", + "serde", + "uuid", +] + +[[package]] +name = "libcraft-anvil" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayvec 0.7.2", + "bitvec", + "bytemuck", + "byteorder", + "flate2", + "hematite-nbt", + "libcraft-blocks", + "libcraft-chunk", + "libcraft-core", + "libcraft-inventory", + "libcraft-items", + "serde", + "thiserror", + "uuid", +] [[package]] name = "libcraft-blocks" @@ -1355,20 +1092,38 @@ dependencies = [ "num-traits", "once_cell", "serde", + "smartstring", "thiserror", ] +[[package]] +name = "libcraft-chunk" +version = "0.1.0" +dependencies = [ + "bincode", + "derive_more", + "flate2", + "itertools", + "libcraft-blocks", + "libcraft-core", + "once_cell", + "serde", +] + [[package]] name = "libcraft-core" version = "0.1.0" dependencies = [ + "bincode", "bytemuck", + "derive_more", "num-derive", "num-traits", "serde", "strum", "strum_macros", - "vek", + "thiserror", + "vek 0.15.7", ] [[package]] @@ -1377,10 +1132,22 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", + "convert_case 0.5.0", "flate2", + "fs_extra", + "indexmap", + "libcraft", "libcraft-blocks", + "libcraft-chunk", + "libcraft-core", + "log", + "once_cell", + "proc-macro2", + "quote", + "regex", "serde", "serde_json", + "ureq", ] [[package]] @@ -1388,7 +1155,6 @@ name = "libcraft-inventory" version = "0.1.0" dependencies = [ "libcraft-items", - "parking_lot", ] [[package]] @@ -1434,101 +1200,43 @@ dependencies = [ "uuid", ] -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - [[package]] name = "libm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" - -[[package]] -name = "libz-sys" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" -dependencies = [ - "cc", - "cmake", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "llvm-sys" -version = "120.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4897352ffc39e1b2b3f7078b632222939044b76d3a99d36666c1c47203c104cc" -dependencies = [ - "cc", - "lazy_static", - "libc", - "regex", - "semver 0.11.0", -] - -[[package]] -name = "lock_api" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "libz-sys" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "6f35facd4a5673cb5a48822be2be1d4236c1c99cb4113cab7061ac720d5bf859" dependencies = [ - "quote", - "syn", + "cc", + "cmake", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "mach" -version = "0.3.2" +name = "lock_api" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ - "libc", + "autocfg 1.1.0", + "scopeguard", ] [[package]] -name = "maplit" -version = "1.0.2" +name = "log" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +dependencies = [ + "cfg-if", +] [[package]] name = "matches" @@ -1538,13 +1246,11 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "md-5" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" dependencies = [ - "block-buffer", - "digest", - "opaque-debug", + "digest 0.10.3", ] [[package]] @@ -1553,44 +1259,26 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "memmap2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg 1.0.1", -] - [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg 1.0.1", ] [[package]] name = "mio" -version = "0.7.14" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi", ] @@ -1604,18 +1292,23 @@ dependencies = [ ] [[package]] -name = "more-asserts" -version = "0.2.2" +name = "nanorand" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] [[package]] -name = "nanorand" -version = "0.6.1" +name = "nix" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" +checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" dependencies = [ - "getrandom 0.2.4", + "bitflags", + "cfg-if", + "libc", ] [[package]] @@ -1642,9 +1335,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -1655,7 +1348,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -1666,14 +1359,14 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4547ee5541c18742396ae2c895d0717d0f886d8823b8399cdaf7b07d63ad0480" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "byteorder", "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.8.4", + "rand", "smallvec", "zeroize", ] @@ -1695,7 +1388,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-traits", ] @@ -1705,7 +1398,7 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -1716,7 +1409,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "libm", ] @@ -1732,36 +1425,18 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a1eb3a36534514077c1e079ada2fb170ef30c47d203aa6916138cf882ecd52" +checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" -dependencies = [ - "crc32fast", - "indexmap", - "memchr", -] - -[[package]] -name = "observe-creativemode-flight-event" -version = "0.1.0" -dependencies = [ - "quill", -] - [[package]] name = "once_cell" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -1786,9 +1461,6 @@ name = "os_str_bytes" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" -dependencies = [ - "memchr", -] [[package]] name = "parking" @@ -1798,66 +1470,32 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" dependencies = [ - "cfg-if 1.0.0", - "instant", + "cfg-if", "libc", "redox_syscall", "smallvec", - "winapi", -] - -[[package]] -name = "particle-example" -version = "0.1.0" -dependencies = [ - "quill", -] - -[[package]] -name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - -[[package]] -name = "paste" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" - -[[package]] -name = "paste-impl" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", + "windows-sys", ] [[package]] name = "pem-rfc7468" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f22eb0e3c593294a99e9ff4b24cf6b752d43f193aa4415fe5077c159996d497" +checksum = "84e93a3b1cc0510b03020f33f21e62acdde3dcaef432edc95bea377fbd4c2cd4" dependencies = [ "base64ct", ] @@ -1868,15 +1506,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - [[package]] name = "pin-project" version = "1.0.10" @@ -1929,24 +1558,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" - -[[package]] -name = "plugin-macro" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "plugin-message" -version = "0.1.0" -dependencies = [ - "quill", -] +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "ppv-lite86" @@ -1975,310 +1589,132 @@ dependencies = [ [[package]] name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "proxy" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "colored", - "feather-protocol", - "fern", - "log", - "pretty-hex", - "time 0.3.6", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "query-entities" -version = "0.1.0" -dependencies = [ - "quill", - "rand 0.8.4", -] - -[[package]] -name = "quickcheck" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" -dependencies = [ - "rand 0.8.4", -] - -[[package]] -name = "quill" -version = "0.1.0" -dependencies = [ - "bincode", - "bytemuck", - "itertools", - "libcraft-blocks", - "libcraft-core", - "libcraft-particles", - "libcraft-text", - "plugin-macro", - "quill-common", - "quill-sys", - "serde_json", - "thiserror", - "uuid", -] - -[[package]] -name = "quill-common" -version = "0.1.0" -dependencies = [ - "bincode", - "bytemuck", - "derive_more", - "libcraft-core", - "libcraft-particles", - "libcraft-text", - "quill", - "serde", - "smartstring", - "uuid", -] - -[[package]] -name = "quill-plugin-format" -version = "0.1.0" -dependencies = [ - "anyhow", - "flate2", - "serde", - "serde_json", - "serde_with", - "tar", - "target-lexicon 0.11.2", -] - -[[package]] -name = "quill-sys" -version = "0.1.0" -dependencies = [ - "quill-common", - "quill-sys-macros", -] - -[[package]] -name = "quill-sys-macros" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "proc-macro2", + "quote", + "version_check", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "proc-macro-hack" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", -] +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] -name = "rand_core" -version = "0.5.1" +name = "proc-macro2" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ - "getrandom 0.1.16", + "unicode-xid", ] [[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +name = "proxy" +version = "0.1.0" dependencies = [ - "getrandom 0.2.4", + "anyhow", + "clap", + "colored", + "feather-protocol", + "fern", + "log", + "pretty-hex", + "time", ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "quickcheck" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" dependencies = [ - "rand_core 0.5.1", + "rand", ] [[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +name = "quill" +version = "0.1.0" dependencies = [ - "rand_core 0.6.3", + "ahash 0.7.6", + "anyhow", + "derive_more", + "flume", + "libcraft", + "log", + "parking_lot", + "serde", + "smartstring", + "thiserror", + "tokio", + "toml", + "uuid", + "vane", ] [[package]] -name = "rand_pcg" -version = "0.3.1" +name = "quote" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ - "rand_core 0.6.3", + "proc-macro2", ] [[package]] -name = "rand_xorshift" -version = "0.2.0" +name = "radium" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" -dependencies = [ - "rand_core 0.5.1", -] +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "rayon" -version = "1.5.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "autocfg 1.0.1", - "crossbeam-deque", - "either", - "rayon-core", + "libc", + "rand_chacha", + "rand_core", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ppv-lite86", + "rand_core", ] [[package]] -name = "redox_syscall" -version = "0.2.10" +name = "rand_core" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "bitflags", + "getrandom", ] [[package]] -name = "regalloc" -version = "0.0.31" +name = "redox_syscall" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "bitflags", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -2291,18 +1727,6 @@ version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remove_dir_all" version = "0.5.3" @@ -2312,15 +1736,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rend" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" -dependencies = [ - "bytecheck", -] - [[package]] name = "ring" version = "0.16.20" @@ -2336,31 +1751,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rkyv" -version = "0.7.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a37de5dfc60bae2d94961dacd03c7b80e426b66a99fa1b17799570dbdd8f96" -dependencies = [ - "bytecheck", - "hashbrown 0.11.2", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719d447dd0e84b23cee6cb5b32d97e21efb112a3e3c636c8da36647b938475a1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "rsa" version = "0.5.0" @@ -2368,7 +1758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" dependencies = [ "byteorder", - "digest", + "digest 0.9.0", "lazy_static", "num-bigint-dig", "num-integer", @@ -2376,7 +1766,7 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8", - "rand 0.8.4", + "rand", "subtle", "zeroize", ] @@ -2390,18 +1780,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc_version" version = "0.2.3" @@ -2417,14 +1795,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.4", + "semver 1.0.7", ] [[package]] name = "rustls" -version = "0.20.2" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" dependencies = [ "log", "ring", @@ -2460,36 +1838,20 @@ dependencies = [ "untrusted", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", - "serde", + "semver-parser", ] [[package]] name = "semver" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" [[package]] name = "semver-parser" @@ -2497,38 +1859,20 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" -version = "1.0.134" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b3c34c1690edf8174f5b289a336ab03f568a4460d8c6df75f2f3a692b3bc6a" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" -version = "1.0.134" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784ed1fbfa13fe191077537b0d70ec8ad1e903cfe04831da608aa36457cb653d" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -2537,29 +1881,20 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "651bca88044a8a5166bd0fd984a7ca558301079cf08365ca6287b2bb608cca3e" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_test" -version = "1.0.134" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2616dbe01183e562d89c3614f03818b0ae90c218ad149034d957436fb5cba3f4" -dependencies = [ - "serde", -] - [[package]] name = "serde_with" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6056b4cb69b6e43e3a0f055def223380baecc99da683884f205bf347f7c4b3" +checksum = "b827f2113224f3f19a665136f006709194bdfdcb1fdc1e4b2b5cbac8e0cced54" dependencies = [ "rustversion", "serde", @@ -2568,9 +1903,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling", "proc-macro2", @@ -2580,32 +1915,15 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.8" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", + "digest 0.10.3", ] -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -2615,32 +1933,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simdeez" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4032959efda4ba5e9c0108c4c88bfa79b2f6eaf1f1e965290d6e8cd058f50887" -dependencies = [ - "cfg-if 0.1.10", - "paste 0.1.18", -] - -[[package]] -name = "simdnoise" -version = "3.1.7" -source = "git+https://github.com/jackmott/rust-simd-noise?rev=3a4f3e6#3a4f3e6f79608616b6ee186dc665b601d015dc1e" -dependencies = [ - "simdeez", -] - -[[package]] -name = "simple-plugin" -version = "0.1.0" -dependencies = [ - "quill", - "rand 0.8.4", -] - [[package]] name = "simple_asn1" version = "0.6.1" @@ -2650,14 +1942,17 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.6", + "time", ] [[package]] -name = "slab" -version = "0.4.5" +name = "slotmap" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] [[package]] name = "smallvec" @@ -2667,12 +1962,24 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" -version = "0.2.9" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31aa6a31c0c2b21327ce875f7e8952322acfcfd0c27569a6e18a647281352c9b" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ + "autocfg 1.1.0", "serde", "static_assertions", + "version_check", +] + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", ] [[package]] @@ -2683,9 +1990,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5" +checksum = "c530c2b0d0bf8b69304b39fe2001993e267461948b890cd037d8ad4293fa1a0d" dependencies = [ "lock_api", ] @@ -2699,76 +2006,12 @@ dependencies = [ "der", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strsim" version = "0.10.0" @@ -2777,19 +2020,20 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" +checksum = "e96acfc1b70604b8b2f1ffa4c57e59176c7dbb05d556c71ecd2f5498a1dee7f8" [[package]] name = "strum_macros" -version = "0.21.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" +checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro2", "quote", + "rustversion", "syn", ] @@ -2801,9 +2045,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", @@ -2828,36 +2072,13 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "tar" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "target-lexicon" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" - -[[package]] -name = "target-lexicon" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" - [[package]] name = "tempfile" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", @@ -2867,18 +2088,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" @@ -2901,61 +2122,32 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.2.27" +name = "thread_local" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check", - "winapi", +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", ] [[package]] name = "time" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d54b9298e05179c335de2b9645d061255bcd5155f843b3e328d2cfe0a5b413" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ "itoa", "libc", "num_threads", "quickcheck", - "time-macros 0.2.3", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", + "time-macros", ] [[package]] name = "time-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" - -[[package]] -name = "time-macros-impl" -version = "0.1.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn", -] +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tiny-keccak" @@ -2981,20 +2173,13 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "titles" -version = "0.1.0" -dependencies = [ - "quill", -] - [[package]] name = "tokio" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ - "bytes 1.1.0", + "bytes", "libc", "memchr", "mio", @@ -3003,6 +2188,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", "winapi", ] @@ -3020,58 +2206,19 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] -[[package]] -name = "tracing" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" -dependencies = [ - "cfg-if 1.0.0", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" -dependencies = [ - "lazy_static", -] - [[package]] name = "typenum" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - [[package]] name = "unicode-bidi" version = "0.3.7" @@ -3087,12 +2234,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - [[package]] name = "unicode-xid" version = "0.2.2" @@ -3142,8 +2283,24 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.4", + "getrandom", + "serde", +] + +[[package]] +name = "vane" +version = "0.1.0" +dependencies = [ + "ahash 0.7.6", + "anyhow", + "arrayvec 0.7.2", + "flume", + "itertools", + "log", + "once_cell", "serde", + "thiserror", + "thread_local", ] [[package]] @@ -3152,12 +2309,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec-arena" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae23c56872cdb2d1b1ddb90112da26615654fa4d4e3ee84e2d3b3e9c9853145" - [[package]] name = "vek" version = "0.14.1" @@ -3172,12 +2323,32 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "vek" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dcfb4368fdf4143fe9fe414293e7228b30e75a866ac94464d19824ca5c491df" +dependencies = [ + "approx 0.5.1", + "num-integer", + "num-traits", + "rustc_version 0.4.0", + "serde", + "static_assertions", +] + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "virtue" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757cfbfe0d17ee6f22fe97e536d463047d451b47cf9d11e2b7d1398b0ef274dd" + [[package]] name = "waker-fn" version = "1.1.0" @@ -3186,31 +2357,31 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -3223,9 +2394,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3233,9 +2404,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -3246,276 +2417,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" - -[[package]] -name = "wasmer" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f0188c23fc1b7de9bd7f8b834d0b1cd5edbe66e287452e8ce36d24418114f7" -dependencies = [ - "cfg-if 1.0.0", - "indexmap", - "js-sys", - "loupe", - "more-asserts", - "target-lexicon 0.12.2", - "thiserror", - "wasm-bindgen", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-compiler-llvm", - "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-compiler" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c51cc589772c5f90bd329244c2416976d6cb2ee00d59429aaa8f421d9fe447" -dependencies = [ - "enumset", - "loupe", - "rkyv", - "serde", - "serde_bytes", - "smallvec", - "target-lexicon 0.12.2", - "thiserror", - "wasmer-types", - "wasmer-vm", - "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09691e3e323b4e1128d2127f60f9cd988b66ce49afc8184b071c2b5ab16793f2" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.25.0", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon 0.12.2", - "tracing", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-compiler-llvm" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51c7fcf88c86c1ba050dfe1dd8fe3613ad1072a58b07a8c50148145cee249" -dependencies = [ - "byteorder", - "cc", - "inkwell", - "itertools", - "lazy_static", - "libc", - "loupe", - "object", - "rayon", - "regex", - "rustc_version 0.4.0", - "semver 1.0.4", - "smallvec", - "target-lexicon 0.12.2", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-derive" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f5cb7b09640e09f1215da95d6fb7477d2db572f064b803ff705f39ff079cc5" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "wasmer-engine" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab20311c354fe2c12bc766417e0a1a45f399c1cd8ff262127d1dc86d0588971a" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon 0.12.2", - "thiserror", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5b7a74731e1dcccaf10a8ff5f72216c82f12972ce17cc81c6caa1afff75ea" -dependencies = [ - "cfg-if 1.0.0", - "enumset", - "leb128", - "libloading", - "loupe", - "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfeae8d5b825ad7abcf9a34e66eb11e1507b21020efe7bbf9897e3dd8d7869e2" -dependencies = [ - "cfg-if 1.0.0", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-object" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4714e4f3bdc3b2157c24284417d19cd99de036da31d00ec5664712dcb72f7" -dependencies = [ - "object", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - -[[package]] -name = "wasmer-types" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434e1c0177da0a74ecca90b2aa7d5e86198260f07e8ba83be89feb5f0a4aeead" -dependencies = [ - "indexmap", - "loupe", - "rkyv", - "serde", - "thiserror", -] - -[[package]] -name = "wasmer-vfs" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3a58a3700781aa4f5344915ea082086e75ba7ebe294f60ae499614db92dd00" -dependencies = [ - "libc", - "thiserror", - "tracing", -] - -[[package]] -name = "wasmer-vm" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8f964ebba70d9f81340228b98a164782591f00239fc7f01e1b67afcf0e0156" -dependencies = [ - "backtrace", - "cc", - "cfg-if 1.0.0", - "indexmap", - "libc", - "loupe", - "memoffset", - "more-asserts", - "region", - "rkyv", - "serde", - "thiserror", - "wasmer-types", - "winapi", -] - -[[package]] -name = "wasmer-wasi" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2b1d981ad312dac6e74a41a35b9bca41a6d1157c3e6a575fb1041e4b516610" -dependencies = [ - "cfg-if 1.0.0", - "generational-arena", - "getrandom 0.2.4", - "libc", - "thiserror", - "tracing", - "wasm-bindgen", - "wasmer", - "wasmer-vfs", - "wasmer-wasi-types", - "winapi", -] - -[[package]] -name = "wasmer-wasi-types" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7731240c0ae536623414beb73091dddf68d1a080f49086fc31ec916536b1af98" -dependencies = [ - "byteorder", - "time 0.2.27", - "wasmer-types", -] - -[[package]] -name = "wasmparser" -version = "0.78.2" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.56" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -3533,24 +2443,13 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" dependencies = [ "webpki", ] -[[package]] -name = "which" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" -dependencies = [ - "either", - "lazy_static", - "libc", -] - [[package]] name = "winapi" version = "0.3.9" @@ -3583,18 +2482,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "wyz" -version = "0.2.0" +name = "windows-sys" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" +checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] [[package]] -name = "xattr" -version = "0.2.2" +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "wyz" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" dependencies = [ - "libc", + "tap", ] [[package]] @@ -3608,9 +2544,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", @@ -3620,13 +2556,42 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.13" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" dependencies = [ "byteorder", "bzip2", "crc32fast", + "crossbeam-utils", "flate2", - "thiserror", +] + +[[package]] +name = "zstd" +version = "0.11.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a16b8414fde0414e90c612eba70985577451c4c504b99885ebed24762cb81a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c12659121420dd6365c5c3de4901f97145b79651fb1d25814020ed2ed0585ae" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +dependencies = [ + "cc", + "libc", ] diff --git a/Cargo.toml b/Cargo.toml index d133b40c5..196ab8860 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,48 +3,34 @@ members = [ # libcraft "libcraft/core", "libcraft/blocks", - "libcraft/generators", "libcraft/items", "libcraft/macros", "libcraft/particles", "libcraft/text", "libcraft/inventory", + "libcraft/chunk", + "libcraft/anvil", + "libcraft/generators", + "libcraft", # Quill - "quill/sys-macros", - "quill/sys", - "quill/common", - "quill/api", - "quill/api/plugin-macro", - "quill/plugin-format", - "quill/cargo-quill", + "quill", - # Quill example plugins - "quill/example-plugins/titles", - "quill/example-plugins/block-access", - "quill/example-plugins/block-place", - "quill/example-plugins/particle-example", - "quill/example-plugins/plugin-message", - "quill/example-plugins/query-entities", - "quill/example-plugins/simple", - "quill/example-plugins/observe-creativemode-flight-event", + # Built-in plugins + "builtin-plugins/world-format", - # Feather (common and server) + # Feather + "feather/world-format", "feather/utils", - "feather/blocks", - "feather/blocks/generator", - "feather/base", - "feather/ecs", "feather/datapacks", "feather/worldgen", "feather/common", "feather/protocol", - "feather/plugin-host/macros", - "feather/plugin-host", "feather/server", - + # Other "proxy", + "vane", ] # No longer need to use release for "development": diff --git a/assets/dimension.nbt b/assets/dimension.nbt deleted file mode 100644 index 4e3238334..000000000 Binary files a/assets/dimension.nbt and /dev/null differ diff --git a/assets/dimension_codec.nbt b/assets/dimension_codec.nbt deleted file mode 100644 index 59c3fcd57..000000000 Binary files a/assets/dimension_codec.nbt and /dev/null differ diff --git a/builtin-plugins/world-format/Cargo.toml b/builtin-plugins/world-format/Cargo.toml new file mode 100644 index 000000000..306bbbaa1 --- /dev/null +++ b/builtin-plugins/world-format/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "feather-world-format-plugin" +version = "0.1.0" +edition = "2021" + +[dependencies] +ahash = "0.7" +anyhow = "1" +feather-world-format = { path = "../../feather/world-format" } +flume = "0.10" +log = "0.4" +num_cpus = "1" +parking_lot = "0.12" +quill = { path = "../../quill" } +serde = { version = "1", features = [ "derive" ] } +toml = "0.5" diff --git a/builtin-plugins/world-format/src/lib.rs b/builtin-plugins/world-format/src/lib.rs new file mode 100644 index 000000000..1d4e862f5 --- /dev/null +++ b/builtin-plugins/world-format/src/lib.rs @@ -0,0 +1,189 @@ +//! Plugin providing a `WorldSource` that uses the Feather world format. + +use std::{cell::RefCell, path::PathBuf, rc::Rc, sync::Arc, time::Duration}; + +use anyhow::Context; +use flume::{Receiver, Sender}; +use quill::{ + libcraft::{biome::BiomeList, dimension::DimensionInfo, RegionPosition, WorldHeight}, + saveload::{ + ChunkLoadError, ChunkLoadResult, ChunkSaveError, ChunkSaveResult, ChunkSaved, StoredChunk, + WorldSource, WorldSourceFactory, + }, + ChunkLock, ChunkPosition, Game, Plugin, PluginInfo, Setup, WorldId, +}; +use threadpool::{RegionKey, RegionThreadPool, Shared, WorldInfo}; + +mod threadpool; + +pub struct FeatherWorldFormat; + +impl Plugin for FeatherWorldFormat { + type State = (); + + fn info(&self) -> PluginInfo { + PluginInfo { + name: "FregWorldFormat", + id: "freg_world_format", + } + } + + fn initialize(&mut self, setup: &mut dyn Setup) -> anyhow::Result { + let thread_pool = RegionThreadPool::new( + Shared::new(setup.game().resources().get::>()?.clone()), + num_cpus::get(), + ); + setup + .game_mut() + .resources_mut() + .insert(Rc::new(RefCell::new(thread_pool))); + + setup + .game_mut() + .register_world_source_factory("freg", Box::new(FregWorldSourceFactory)); + + Ok(()) + } +} + +#[derive(Debug, serde::Deserialize)] +struct Params { + directory: String, +} + +pub struct FregWorldSourceFactory; + +impl WorldSourceFactory for FregWorldSourceFactory { + fn create_world_source( + &self, + game: &dyn Game, + params: &toml::Value, + dimension_info: &DimensionInfo, + world_id: WorldId, + ) -> anyhow::Result> { + let params: Params = params.clone().try_into()?; + + Ok(Box::new(FregWorldSource::new( + params.directory.into(), + game, + world_id, + dimension_info, + ))) + } +} + +const RETRY_INTERVAL: Duration = Duration::from_secs(10); + +/// A `WorldSource` that loads and saves chunks from the Feather world format, +/// dubbed `freg`. +/// +/// The world source uses a shared thread pool to parallelize chunk loading and saving. +/// Regions are distributed across threads in the pool. + +struct FregWorldSource { + world: WorldId, + thread_pool: Rc>, + + loaded_receiver: Receiver, + loaded_sender: Sender, + + saved_receiver: Receiver, + saved_sender: Sender, +} + +impl FregWorldSource { + pub fn new(dir: PathBuf, game: &dyn Game, world: WorldId, info: &DimensionInfo) -> Self { + let sections = WorldHeight(info.info.height as usize).into(); + let min_y = info.info.min_y; + + let thread_pool = Rc::clone( + &game + .resources() + .get::>>() + .unwrap(), + ); + thread_pool.borrow_mut().register_world( + world, + WorldInfo { + sections, + min_y, + dir, + }, + ); + + let (loaded_sender, loaded_receiver) = flume::unbounded(); + let (saved_sender, saved_receiver) = flume::unbounded(); + Self { + world, + thread_pool, + loaded_receiver, + loaded_sender, + saved_receiver, + saved_sender, + } + } +} + +impl WorldSource for FregWorldSource { + fn supports_saving(&self) -> bool { + true + } + + fn queue_load_chunk(&mut self, pos: ChunkPosition) { + let sender = self.loaded_sender.clone(); + let region = RegionPosition::from_chunk(pos); + let key = RegionKey { + region, + world: self.world, + }; + + let (chunk_x, chunk_z) = region.chunk_offset(pos).unwrap(); + + self.thread_pool.borrow_mut().spawn(key, move |region| { + let chunk = region + .context("failed to access region file") + .and_then(|region| region.load(chunk_x, chunk_z)); + + let result = match chunk { + Ok(Some(chunk)) => Ok(StoredChunk { + pos, + chunk: Arc::new(ChunkLock::new(chunk)), + }), + Ok(None) => Err(ChunkLoadError::Missing), + Err(e) => Err(ChunkLoadError::Other(e)), + }; + + let result = ChunkLoadResult { pos, result }; + sender.send(result).ok(); + }); + } + + fn poll_loaded_chunk(&mut self) -> Option { + self.loaded_receiver.try_recv().ok() + } + + fn queue_save_chunk(&mut self, chunk: StoredChunk) { + let pos = chunk.chunk.read().position(); + let sender = self.saved_sender.clone(); + let region = RegionPosition::from_chunk(pos); + let key = RegionKey { + region, + world: self.world, + }; + + self.thread_pool.borrow_mut().spawn(key, move |region| { + let result = region + .and_then(|region| region.save(&chunk.chunk.read())) + .map(|_| ChunkSaved) + .map_err(|e| ChunkSaveError { + error: e, + retry_in: RETRY_INTERVAL, + }); + sender.send(ChunkSaveResult { pos, result }).ok(); + }); + } + + fn poll_saved_chunk(&mut self) -> Option { + self.saved_receiver.try_recv().ok() + } +} diff --git a/builtin-plugins/world-format/src/threadpool.rs b/builtin-plugins/world-format/src/threadpool.rs new file mode 100644 index 000000000..6ee563483 --- /dev/null +++ b/builtin-plugins/world-format/src/threadpool.rs @@ -0,0 +1,218 @@ +use std::{ + collections::hash_map::Entry, + path::PathBuf, + sync::{ + atomic::{AtomicUsize, Ordering}, + Arc, + }, + time::{Duration, Instant}, +}; + +use ahash::AHashMap; +use feather_world_format::RegionHandle; +use flume::{Receiver, RecvTimeoutError, Sender}; +use parking_lot::RwLock; +use quill::{ + libcraft::{biome::BiomeList, RegionPosition, Sections}, + WorldId, +}; + +struct ThreadHandle { + num_open_regions: AtomicUsize, + sender: Sender, +} + +/// Manages threads used for region IO. +/// +/// The thread pool is shared between all worlds using the `FregWorldSource`. +pub struct RegionThreadPool { + threads: Vec>, + threads_by_key: AHashMap, + shared: Arc, +} + +impl RegionThreadPool { + pub fn new(shared: Shared, num_threads: usize) -> Self { + let mut threads = Vec::new(); + let shared = Arc::new(shared); + + for i in 0..num_threads { + let (sender, receiver) = flume::unbounded(); + let handle = Arc::new(ThreadHandle { + sender, + num_open_regions: AtomicUsize::new(0), + }); + + let thread = WorkerThread::new(Arc::clone(&shared), Arc::clone(&handle)); + std::thread::Builder::new() + .name(format!("Region IO Thread #{}", i)) + .spawn(move || { + thread.run(receiver); + }) + .expect("failed to create region IO thread"); + + threads.push(handle); + } + + Self { + threads, + threads_by_key: AHashMap::new(), + shared, + } + } + + pub fn register_world(&self, id: WorldId, info: WorldInfo) { + self.shared.worlds.write().insert(id, info); + } + + pub fn spawn( + &mut self, + key: RegionKey, + task: impl FnOnce(anyhow::Result<&mut RegionHandle>) + Send + 'static, + ) { + let thread = self.threads_by_key.entry(key).or_insert_with(|| { + self.threads + .iter() + .enumerate() + .min_by_key(|(_, thread)| thread.num_open_regions.load(Ordering::Relaxed)) + .expect("no threads available") + .0 + }); + + self.threads[*thread] + .num_open_regions + .fetch_add(1, Ordering::Relaxed); + + self.threads[*thread] + .sender + .send(Task { + key, + op: Box::new(task), + }) + .expect("thread shut down?"); + } +} + +pub struct WorldInfo { + pub sections: Sections, + pub min_y: i32, + pub dir: PathBuf, +} + +pub struct Shared { + pub biomes: Arc, + worlds: RwLock>, +} + +impl Shared { + pub fn new(biomes: Arc) -> Self { + Self { + biomes, + worlds: RwLock::new(AHashMap::new()), + } + } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +pub struct RegionKey { + pub region: RegionPosition, + pub world: WorldId, +} + +struct Task { + key: RegionKey, + op: Box) + Send>, +} + +struct WorkerThread { + shared: Arc, + open_regions: AHashMap, + handle: Arc, +} + +struct OpenRegion { + handle: RegionHandle, + last_used: Instant, +} + +const FLUSH_INTERVAL: Duration = Duration::from_secs(60); +const REGION_CACHE_TIME: Duration = Duration::from_secs(60); + +impl WorkerThread { + pub fn new(shared: Arc, handle: Arc) -> Self { + Self { + shared, + open_regions: AHashMap::new(), + handle, + } + } + + pub fn run(mut self, receiver: Receiver) { + let mut next_flush = Instant::now() + FLUSH_INTERVAL; + log::debug!("Region worker thread started"); + loop { + match receiver.recv_deadline(next_flush) { + Ok(task) => self.do_task(task), + Err(RecvTimeoutError::Timeout) => { + self.flush_unused_regions(); + next_flush = Instant::now() + FLUSH_INTERVAL; + } + Err(RecvTimeoutError::Disconnected) => { + log::debug!("Region worker thread shutting down"); + return; + } + } + + self.handle + .num_open_regions + .store(self.open_regions.len(), Ordering::Relaxed); + } + } + + fn do_task(&mut self, task: Task) { + let mut region = match self.open_regions.entry(task.key) { + Entry::Occupied(e) => Ok(e.into_mut()), + Entry::Vacant(v) => { + log::debug!("Opening region with key {:?}", v.key()); + let worlds = self.shared.worlds.read(); + let world = worlds + .get(&v.key().world) + .expect("unregistered world on region threadpool"); + let region = RegionHandle::open( + &world.dir, + v.key().region, + true, + Arc::clone(&self.shared.biomes), + world.sections, + world.min_y, + ); + let region = region.map(|handle| OpenRegion { + handle, + last_used: Instant::now(), + }); + region.map(|r| v.insert(r)) + } + }; + + if let Ok(region) = &mut region { + region.last_used = Instant::now(); + } + + (task.op)(region.map(|r| &mut r.handle)); + } + + fn flush_unused_regions(&mut self) { + let now = Instant::now(); + let initial_len = self.open_regions.len(); + self.open_regions + .retain(|_, region| now - region.last_used < REGION_CACHE_TIME); + if initial_len != self.open_regions.len() { + let closed = initial_len - self.open_regions.len(); + log::debug!( + "Closed {} region files ({} left open on this thread)", + closed, + self.open_regions.len() + ); + } + } +} diff --git a/docs/architecture.md b/docs/architecture.md index ad65df865..b560287de 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -6,8 +6,8 @@ is widely used in the Rust gamedev ecosystem. In the ECS architecture, there are three key types of objects: * Entities: these are just IDs. In Feather, these are represented by the `Entity` struct. They allow access to components. -* Components: these represent entities' data. Each entity can have zero or one component of every type. For example, `Position` -stores an entity position, and entities with the `Position` component have a position. You can access components +* Components: these represent entities' data. Each entity can have zero or one component of every type. For example, `EntityPosition` +stores an entity position, and entities with the `EntityPosition` component have a position. You can access components via `Game.ecs.get::()`, where `T` is the component you want. * Systems: functions that run each tick. While components are data, systems are logic. They operate on components. @@ -15,14 +15,12 @@ ECS implementations allow for _queries_ that allow iteration over all entities w For example, to implement trivial physics: ```rust -for (entity, (position, velocity)) in game.ecs.query::<(&mut Position, &Velocity)>().iter() { +for (entity, (position, velocity)) in game.ecs.query::<(&mut EntityPosition, &EntityVelocity)>().iter() { *position += *velocity; } ``` -The above code snippet iterates over _all_ entities with `Position` and `Velocity` components. - -For more information on the ECS, we recommend checking out the [`hecs`](https://docs.rs/hecs) documentation. +The above code snippet iterates over _all_ entities with `EntityPosition` and `EntityVelocity` components. The Feather game state is defined in the `Game` struct, which lives in `crates/common/src/game.rs`. This struct contains the `World` (blocks) and the `Ecs` (entities). It also provides @@ -35,12 +33,12 @@ this distinction. ### Commonly used components This is a list of components that are frequently accessed throughout the codebase. -* `Position` -* `Gamemode` for players +* `EntityPosition` +* `PlayerGamemode` for players * `Name` - player's username (not for other entities) * `CustomName` - entity's custom name (not for players) -* `Inventory` -* `Window` - wraps one or more `Inventory`s that the player is looking at right now. In a chest, +* `EntityInventory` +* `PlayerWindow` - wraps one or more `Inventory`s that the player is looking at right now. In a chest, for example, a player's window would wrap the player inventory and the chest inventory. ### Crate Structure diff --git a/feather/base/Cargo.toml b/feather/base/Cargo.toml deleted file mode 100644 index a0bdcf549..000000000 --- a/feather/base/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "feather-base" -version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" - -[dependencies] -ahash = "0.4" -anyhow = "1" -arrayvec = { version = "0.7", features = [ "serde" ] } -bitflags = "1" -bitvec = "0.21" -blocks = { path = "../blocks", package = "feather-blocks" } -byteorder = "1" -hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } - -libcraft-blocks = { path = "../../libcraft/blocks" } -libcraft-core = { path = "../../libcraft/core" } -libcraft-items = { path = "../../libcraft/items" } -libcraft-particles = { path = "../../libcraft/particles" } -libcraft-text = { path = "../../libcraft/text" } -libcraft-inventory = { path = "../../libcraft/inventory" } - -nom = "5" -nom_locate = "2" -num-derive = "0.3" -num-traits = "0.2" -parking_lot = "0.11" -quill-common = { path = "../../quill/common" } -serde = { version = "1", features = [ "derive" ] } -serde_json = "1" -serde_with = "1" -smallvec = "1" -thiserror = "1" -uuid = { version = "0.8", features = [ "serde" ] } -vek = "0.14" -bytemuck = { version = "1", features = ["derive"] } - -[dev-dependencies] -rand = "0.8" -rand_pcg = "0.3" -serde_test = "1" diff --git a/feather/base/src/anvil/serialization_helper.rs b/feather/base/src/anvil/serialization_helper.rs deleted file mode 100644 index f6c170f3f..000000000 --- a/feather/base/src/anvil/serialization_helper.rs +++ /dev/null @@ -1,206 +0,0 @@ -pub mod packed_u9 { - use serde::de::Error as DeError; - use serde::de::{SeqAccess, Visitor}; - use serde::export::Formatter; - use serde::ser::Error as SerError; - use serde::{Deserializer, Serializer}; - use std::marker::PhantomData; - - pub fn deserialize<'de, D>(deserializer: D) -> Result, D::Error> - where - D: Deserializer<'de>, - { - struct PackedVisitor(PhantomData u16>); - - impl<'de> Visitor<'de> for PackedVisitor { - type Value = Vec; - - fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { - formatter.write_str("a sequence of type long with length a multiple of 9") - } - - fn visit_seq(self, mut seq: A) -> Result - where - A: SeqAccess<'de>, - { - let len = seq.size_hint().unwrap(); // nbt always knows sequence size - if len % 9 != 0 { - // Invalid sequence length - return Err(A::Error::custom("sequence length must be a multiple of 9")); - } - let unpacked_len = len * 64 / 9; - - let mut u9_array: Vec = Vec::with_capacity(unpacked_len); - - let mut container: Option = seq.next_element()?.map(|x: i64| x as u64); // We checked the length - let mut shift = 0; - for _elem in 0..unpacked_len { - // For every element (u9) - - // unwrapping here is safe, as this can only fail if there is an implementation error in this algorithm - // or in the SeqAccess because we checked the sequence length - let mut element: u16 = ((container.unwrap() >> shift) & 0x1FF) as u16; - shift += 9; - - if shift >= 64 { - // Take next container - container = seq.next_element()?.map(|x: i64| x as u64); - - if shift > 64 { - // We have some bits left to get from the next container - - // same here with the unwrapping - element |= ((container.unwrap() << -(shift - 64 - 9)) & 0x1FF) as u16; - } - - shift -= 64; - } - - u9_array.push(element); - } - - debug_assert_eq!(container, None); - debug_assert_eq!(shift, 0); - - Ok(u9_array) - } - } - - deserializer.deserialize_seq(PackedVisitor(PhantomData)) - } - - pub fn serialize(u9_array: &[u16], serializer: S) -> Result - where - S: Serializer, - { - if u9_array.len() % 64 != 0 { - // Invalid array length - return Err(S::Error::custom("array length must be a multiple of 64")); - } - - let packed_iter = (0..u9_array.len() * 9 / 64) // iterate through each resulting u64 - .map(|i| { - ( - i / 9 * 64, // u9_array_offset; every 64 u9 the u64 boundary is aligned with the u9 boundary again -> one section. each section is 9 u64 long - i % 9, // container_index; index of the current container in this specific section - ) - }) - .map(|(u9_array_offset, container_index)| { - (0..8) // every u64 (partially) contains 8 u9 - .map(|i| { - ( - i + container_index * 7 + u9_array_offset, // u9_array index; times 7 because the u9 indices need to overlap - (i as isize) * 9 - container_index as isize, // amount of shift left (negative means shift right) - ) - }) - .map(|(u9_array_index, shift_left)| { - let u9 = u9_array[u9_array_index] as u64; - if shift_left < 0 { - u9 >> -shift_left as u64 - } else { - u9 << shift_left as u64 - } - }) - .fold(0, |container, u9| container | u9) - }) - .map(|container| container as i64); - - nbt::i64_array(packed_iter, serializer) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use core::iter; - use serde::{Deserialize, Serialize}; - use serde_test::Token; - - #[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] - struct TestPackedU9 { - #[serde(with = "packed_u9")] - list: Vec, - } - - #[test] - #[allow(clippy::inconsistent_digit_grouping)] - fn test_packed_u9_pattern() { - let data_u64 = iter::repeat(0xAAAA_AAAA_AAAA_AAAAu64 as i64); // 64-bit 0b1010... - let data_u9 = [0b01_01_01_01_0u16, 0b1_01_01_01_01u16] - .iter() - .cloned() - .cycle(); // corresponding 9-bit pattern - - let unpacked: Vec = data_u9.take(256).collect(); - let packed: Vec = data_u64.take(36).collect(); - - // Test serde serialization - let mut tokenized_vec = packed.iter().map(|&x| Token::I64(x)).collect(); - - let mut tokenized_sequence = Vec::new(); - tokenized_sequence.push(Token::Struct { - name: "TestPackedU9", - len: 1, - }); - tokenized_sequence.push(Token::Str("list")); - // see https://github.com/PistonDevelopers/hematite_nbt/pull/52 - tokenized_sequence.push(Token::TupleStruct { - name: "__hematite_nbt_i64_array__", - len: 36, - }); - tokenized_sequence.append(&mut tokenized_vec); - tokenized_sequence.push(Token::TupleStructEnd); - tokenized_sequence.push(Token::StructEnd); - - let test_object = TestPackedU9 { list: unpacked }; - - serde_test::assert_tokens(&test_object, tokenized_sequence.as_slice()) - } - - #[test] - #[allow(clippy::inconsistent_digit_grouping)] // Sorry clippy but grouping by 9 bits makes sense here - fn test_packed_u9_order() { - let data_u64 = [ - // this repeats every 9 u64... - 0b0_001000000_000100000_000010000_000001000_000000100_000000010_000000001u64, - 0b00_000100000_000010000_000001000_000000100_000000010_000000001_01000000u64, - 0b000_000010000_000001000_000000100_000000010_000000001_010000000_0010000u64, - 0b0000_000001000_000000100_000000010_000000001_010000000_001000000_000100u64, - 0b01000_000000100_000000010_000000001_010000000_001000000_000100000_00001u64, - 0b000100_000000010_000000001_010000000_001000000_000100000_000010000_0000u64, - 0b0000010_000000001_010000000_001000000_000100000_000010000_000001000_000u64, - 0b00000001_010000000_001000000_000100000_000010000_000001000_000000100_00u64, - 0b010000000_001000000_000100000_000010000_000001000_000000100_000000010_0u64, - ] - .iter() - .cloned() - .map(|x| x as i64) - .cycle(); - let data_u9 = (0..8).map(|x| 1 << x).cycle(); // corresponding 9-bit pattern - - let unpacked: Vec = data_u9.take(256).collect(); - let packed: Vec = data_u64.take(36).collect(); - - // Test serde serialization - let mut tokenized_vec = packed.iter().map(|&x| Token::I64(x)).collect(); - - let mut tokenized_sequence = Vec::new(); - tokenized_sequence.push(Token::Struct { - name: "TestPackedU9", - len: 1, - }); - tokenized_sequence.push(Token::Str("list")); - // see https://github.com/PistonDevelopers/hematite_nbt/pull/52 - tokenized_sequence.push(Token::TupleStruct { - name: "__hematite_nbt_i64_array__", - len: 36, - }); - tokenized_sequence.append(&mut tokenized_vec); - tokenized_sequence.push(Token::TupleStructEnd); - tokenized_sequence.push(Token::StructEnd); - - let test_object = TestPackedU9 { list: unpacked }; - - serde_test::assert_tokens(&test_object, tokenized_sequence.as_slice()) - } -} diff --git a/feather/base/src/block.rs b/feather/base/src/block.rs deleted file mode 100644 index be84a2049..000000000 --- a/feather/base/src/block.rs +++ /dev/null @@ -1,163 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -use serde::{Deserialize, Serialize}; - -use thiserror::Error; - -use libcraft_core::{BlockPosition, ChunkPosition, Position}; -use std::convert::TryFrom; - -/// Validated position of a block. -/// -/// This structure is immutable. -/// All operations that change a [`ValidBlockPosition`] must be done by -/// turning it into a [`BlockPosition`], performing said operations, -/// then using [`ValidBlockPosition`]'s [`TryFrom`] impl to get a [`ValidBlockPosition`]. -/// -/// The definition of a valid block position is defined by [`BlockPosition::valid`]. -/// -/// # Examples -/// -/// Converting a [`BlockPosition`] to a [`ValidBlockPosition`], unwrapping any errors that -/// occur. -/// ``` -/// # use feather_base::BlockPosition; -/// # use feather_base::ValidBlockPosition; -/// # use std::convert::TryInto; -/// // Create an unvalidated block position -/// let block_position = BlockPosition::new(727, 32, 727); -/// -/// // Validate the block position and unwrap any errors -/// let valid_block_position: ValidBlockPosition = block_position.try_into().unwrap(); -/// ``` -/// -/// Performing operations on a [`ValidBlockPosition`], then re-validating it. -/// ``` -/// # use feather_base::BlockPosition; -/// # use feather_base::ValidBlockPosition; -/// # use std::convert::TryInto; -/// # let mut valid_block_position: ValidBlockPosition = BlockPosition::new(727, 32, 727).try_into().unwrap(); -/// // Convert the ValidBlockPosition into an unvalidated one to perform math -/// let mut block_position: BlockPosition = valid_block_position.into(); -/// -/// block_position.x = 821; -/// block_position.z += 32; -/// -/// assert!(block_position.valid()); -/// -/// valid_block_position = block_position.try_into().unwrap(); -/// ``` -#[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - Default, - Serialize, - Deserialize, - Zeroable, - Pod, -)] -#[repr(C)] -pub struct ValidBlockPosition { - x: i32, - y: i32, - z: i32, -} - -impl ValidBlockPosition { - pub fn x(&self) -> i32 { - self.x - } - - pub fn y(&self) -> i32 { - self.y - } - - pub fn z(&self) -> i32 { - self.z - } - - pub fn chunk(self) -> ChunkPosition { - self.into() - } - - pub fn position(self) -> Position { - self.into() - } -} - -impl TryFrom for ValidBlockPosition { - type Error = BlockPositionValidationError; - - fn try_from(value: BlockPosition) -> Result { - if value.valid() { - Ok(ValidBlockPosition { - x: value.x, - y: value.y, - z: value.z, - }) - } else { - Err(BlockPositionValidationError::OutOfRange(value)) - } - } -} - -impl From for BlockPosition { - fn from(position: ValidBlockPosition) -> Self { - BlockPosition { - x: position.x, - y: position.y, - z: position.z, - } - } -} - -impl From for ChunkPosition { - fn from(position: ValidBlockPosition) -> Self { - let position: BlockPosition = position.into(); - position.into() - } -} - -impl From for Position { - fn from(position: ValidBlockPosition) -> Self { - let position: BlockPosition = position.into(); - position.into() - } -} - -#[derive(Error, Debug)] -pub enum BlockPositionValidationError { - #[error("coordinate {0:?} out of range")] - OutOfRange(BlockPosition), -} - -#[cfg(test)] -mod tests { - - use std::convert::TryInto; - - use libcraft_core::BlockPosition; - - use crate::ValidBlockPosition; - - #[test] - #[should_panic] - fn check_out_of_bounds_up() { - let block_position = BlockPosition::new(0, 39483298, 0); - - >::try_into(block_position).unwrap(); - } - - #[test] - #[should_panic] - fn check_out_of_bounds_down() { - let block_position = BlockPosition::new(0, -39483298, 0); - - >::try_into(block_position).unwrap(); - } -} diff --git a/feather/base/src/chunk.rs b/feather/base/src/chunk.rs deleted file mode 100644 index 8568ea366..000000000 --- a/feather/base/src/chunk.rs +++ /dev/null @@ -1,618 +0,0 @@ -use std::usize; - -use ::blocks::BlockId; -use libcraft_core::Biome; - -use crate::ChunkPosition; - -/// The number of bits used for each block -/// in the global palette. -pub const GLOBAL_BITS_PER_BLOCK: u8 = 15; - -/// The minimum bits per block allowed when -/// using a section palette. -/// Bits per block values lower than this -/// value will be offsetted to this value. -pub const MIN_BITS_PER_BLOCK: u8 = 4; - -/// The maximum number of bits per block -/// allowed when using a section palette. -/// Values above this will use the global palette -/// instead. -pub const MAX_BITS_PER_BLOCK: u8 = 8; - -/// The height in blocks of a chunk column. -pub const CHUNK_HEIGHT: usize = 256; -/// The width in blocks of a chunk column. -pub const CHUNK_WIDTH: usize = 16; - -/// The height in blocks of a chunk section. -pub const SECTION_HEIGHT: usize = 16; - -/// The width in blocks of a chunk section. -pub const SECTION_WIDTH: usize = CHUNK_WIDTH; - -/// The volume in blocks of a chunk section. -pub const SECTION_VOLUME: usize = (SECTION_HEIGHT * SECTION_WIDTH * SECTION_WIDTH) as usize; - -/// The number of chunk sections in a column. -pub const NUM_SECTIONS: usize = 16; - -mod biome_store; -mod blocks; -mod heightmap; -mod light; -mod packed_array; -mod palette; - -pub use self::blocks::BlockStore; -pub use biome_store::BiomeStore; -pub use heightmap::{Heightmap, HeightmapFunction, HeightmapStore}; -pub use light::LightStore; -pub use packed_array::PackedArray; -pub use palette::Palette; - -/// A 16x256x16 chunk of blocks plus associated -/// light, biome, and heightmap data. -/// Consists of 16 `ChunkSection`s. -#[derive(Debug, Clone)] -pub struct Chunk { - sections: [Option; NUM_SECTIONS + 2], - - biomes: BiomeStore, - - heightmaps: HeightmapStore, - - position: ChunkPosition, -} - -impl Default for Chunk { - fn default() -> Self { - let sections = [ - None, None, None, None, None, None, None, None, None, None, None, None, None, None, - None, None, None, None, - ]; - Self { - sections, - biomes: BiomeStore::default(), - position: ChunkPosition::new(0, 0), - heightmaps: HeightmapStore::new(), - } - } -} - -impl Chunk { - /// Creates a new empty chunk with the - /// specified position. - /// - /// Biomes are initialized to plains. - pub fn new(position: ChunkPosition) -> Self { - Self::new_with_default_biome(position, Biome::Plains) - } - - /// Creates a new empty chunk with the specified - /// position. - /// - /// Biomes are initialized to `biome`. - pub fn new_with_default_biome(position: ChunkPosition, default_biome: Biome) -> Self { - Self { - position, - biomes: BiomeStore::new(default_biome), - ..Default::default() - } - } - - /// Gets the position of this chunk. - pub fn position(&self) -> ChunkPosition { - self.position - } - - /// Sets the position of this chunk. - pub fn set_position(&mut self, pos: ChunkPosition) { - self.position = pos; - } - - /// Gets the block at the given position within this chunk. - /// - /// Returns `None` if the coordinates are out of bounds. - pub fn block_at(&self, x: usize, y: usize, z: usize) -> Option { - let section = self.section_for_y(y)?; - match section { - Some(section) => section.block_at(x, y % SECTION_HEIGHT, z), - None => Some(BlockId::air()), - } - } - - /// Sets the block at the given position within this chunk. - /// - /// Returns `None` if the coordinates are out of bounds. - /// FIXME: Do not update heightmap when it is not neccessary - pub fn set_block_at(&mut self, x: usize, y: usize, z: usize, block: BlockId) -> Option<()> { - let old_block = self.block_at(x, y, z)?; - let section = self.section_for_y_mut(y)?; - let result = match section { - Some(section) => { - let result = section.set_block_at(x, y % SECTION_HEIGHT, z, block); - // If the block update caused the section to contain only - // air, free it to conserve memory. - if section.is_empty() { - self.clear_section(y); - } - result - } - None => { - if !block.is_air() { - let mut section = ChunkSection::default(); - let result = section.set_block_at(x, y % SECTION_HEIGHT, z, block); - self.set_section_at((y / SECTION_HEIGHT) as isize, Some(section)); - result - } else { - Some(()) - } - } - }; - self.heightmaps - .update(x, y, z, old_block, block, Self::block_at_fn(&self.sections)); - result - } - - /// Fills the given chunk section with `block`. - pub fn fill_section(&mut self, section: usize, block: BlockId) -> bool { - let section = match self.sections.get_mut(section) { - Some(section) => section, - None => return false, - }; - - if block == BlockId::air() { - *section = None; - } else { - let section = section.get_or_insert_with(Default::default); - section.fill(block); - } - - true - } - - /// Recalculates heightmaps for this chunk. - pub fn recalculate_heightmaps(&mut self) { - self.heightmaps - .recalculate(Self::block_at_fn(&self.sections)) - } - - fn block_at_fn( - sections: &[Option], - ) -> impl Fn(usize, usize, usize) -> BlockId + '_ { - move |x, y, z| { - let section = §ions[(y / SECTION_HEIGHT) + 1]; - match section { - Some(section) => section.block_at(x, y % SECTION_HEIGHT, z).unwrap(), - None => BlockId::air(), - } - } - } - - pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { - match self.section_for_y(y)? { - Some(s) => s.block_light_at(x, y % SECTION_HEIGHT, z), - None => Some(15), - } - } - - pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { - match self.section_for_y(y)? { - Some(s) => s.sky_light_at(x, y % SECTION_HEIGHT, z), - None => Some(15), - } - } - - pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - if let Some(section) = self.section_for_y_mut(y)? { - section.set_block_light_at(x, y, z, light) - } else { - Some(()) - } - } - - pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - if let Some(section) = self.section_for_y_mut(y)? { - section.set_sky_light_at(x, y, z, light) - } else { - Some(()) - } - } - - fn section_for_y(&self, y: usize) -> Option<&Option> { - self.sections.get((y / SECTION_HEIGHT) + 1) - } - - fn section_for_y_mut(&mut self, y: usize) -> Option<&mut Option> { - self.sections.get_mut((y / SECTION_HEIGHT) + 1) - } - - fn clear_section(&mut self, y: usize) { - self.sections[(y / SECTION_HEIGHT) + 1] = None; - } - - /// Gets the [`BiomeStore`] for this chunk. - pub fn biomes(&self) -> &BiomeStore { - &self.biomes - } - - /// Mutably gets the [`BiomeStore`] for this chunk. - pub fn biomes_mut(&mut self) -> &mut BiomeStore { - &mut self.biomes - } - - /// Gets the [`HeightmapStore`] for this chunk. - pub fn heightmaps(&self) -> &HeightmapStore { - &self.heightmaps - } - - /// Mutably gets the [`HeightmapStore`] for this chunk. - pub fn heightmaps_mut(&mut self) -> &mut HeightmapStore { - &mut self.heightmaps - } - - /// Gets the chunk section at index `y`. - pub fn section(&self, y: isize) -> Option<&ChunkSection> { - self.sections.get((y + 1) as usize)?.as_ref() - } - - /// Mutably gets the chunk section at index `y`. - pub fn section_mut(&mut self, y: isize) -> Option<&mut ChunkSection> { - self.sections.get_mut((y + 1) as usize)?.as_mut() - } - - /// Sets the section at index `y`. - pub fn set_section_at(&mut self, y: isize, section: Option) { - self.sections[(y + 1) as usize] = section; - } - - /// Gets the sections of this chunk. - pub fn sections(&self) -> &[Option] { - &self.sections - } -} - -/// A 16x16x16 chunk of blocks. -#[derive(Debug, Clone)] -pub struct ChunkSection { - blocks: BlockStore, - - light: LightStore, -} - -impl Default for ChunkSection { - fn default() -> Self { - Self::new(BlockStore::new(), LightStore::new()) - } -} - -impl ChunkSection { - /// Creates new `ChunkSection` from its - /// raw parts. - pub fn new(blocks: BlockStore, light: LightStore) -> Self { - Self { blocks, light } - } - - /// Determines whether this chunk is empty (contains only air). - pub fn is_empty(&self) -> bool { - self.non_air_blocks() == 0 - } - - /// Returns the number of air blocks in this chunk section. - pub fn air_blocks(&self) -> u32 { - self.blocks.air_blocks() - } - - /// Returns the number of non-air blocks in this chunk section. - pub fn non_air_blocks(&self) -> u32 { - SECTION_VOLUME as u32 - self.air_blocks() - } - - /// Gets the block at the given coordinates within this - /// chunk section. - pub fn block_at(&self, x: usize, y: usize, z: usize) -> Option { - self.blocks.block_at(x, y, z) - } - - /// Sets the block at the given coordinates within - /// this chunk section. - /// - /// Returns `None` if the coordinates were out of bounds. - pub fn set_block_at(&mut self, x: usize, y: usize, z: usize, block: BlockId) -> Option<()> { - self.blocks.set_block_at(x, y, z, block) - } - - /// Fills this chunk section with the given block. - /// - /// Does not currently update heightmaps. - pub fn fill(&mut self, block: BlockId) { - self.blocks.fill(block); - } - - pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { - self.light.block_light_at(x, y, z) - } - - pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { - self.light.sky_light_at(x, y, z) - } - - pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - self.light.set_block_light_at(x, y, z, light) - } - - pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - self.light.set_sky_light_at(x, y, z, light) - } - - pub fn light(&self) -> &LightStore { - &self.light - } - - pub fn light_mut(&mut self) -> &mut LightStore { - &mut self.light - } - - pub fn blocks(&self) -> &BlockStore { - &self.blocks - } - - pub fn blocks_mut(&mut self) -> &mut BlockStore { - &mut self.blocks - } - - fn block_index(x: usize, y: usize, z: usize) -> Option { - if x >= SECTION_WIDTH || y >= SECTION_WIDTH || z >= SECTION_WIDTH { - None - } else { - Some((y << 8) | (z << 4) | x) - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::HIGHEST_ID; - - #[test] - fn chunk_new() { - let pos = ChunkPosition::new(0, 0); - let chunk = Chunk::new(pos); - - // Confirm that chunk is empty - for x in 0..16 { - assert!(chunk.section(x).is_none()); - assert!(chunk.section(x).is_none()); - } - - assert_eq!(chunk.position(), pos); - } - - #[test] - fn chunk_new_with_default_biome() { - let pos = ChunkPosition::new(0, 0); - let chunk = Chunk::new_with_default_biome(pos, Biome::Mountains); - - // Confirm that chunk is empty - for x in 0..16 { - assert!(chunk.section(x).is_none()); - assert!(chunk.section(x).is_none()); - } - - assert_eq!(chunk.position(), pos); - - // Confirm that biomes are set - for x in 0..4 { - for z in 0..4 { - assert_eq!(chunk.biomes.get(x, 0, z), Biome::Mountains); - } - } - } - - #[test] - fn set_block_simple() { - let pos = ChunkPosition::new(0, 0); - let mut chunk = Chunk::new(pos); - - chunk.set_block_at(0, 0, 0, BlockId::andesite()); - assert_eq!(chunk.block_at(0, 0, 0).unwrap(), BlockId::andesite()); - assert!(chunk.section(0).is_some()); - } - - #[test] - fn fill_chunk() { - let pos = ChunkPosition::new(0, 0); - let mut chunk = Chunk::new(pos); - - let block = BlockId::stone(); - - for x in 0..16 { - for y in 0..256 { - for z in 0..16 { - chunk.set_block_at(x, y, z, block).unwrap(); - assert_eq!(chunk.block_at(x, y, z), Some(block)); - } - } - } - - // Check again, just to be sure - for x in 0..16 { - for y in 0..256 { - for z in 0..16 { - assert_eq!(chunk.block_at(x, y, z), Some(block)); - } - } - } - } - - #[test] - fn spray_chunk() { - // This test fills each section of the chunk - // with the blocks with IDs corresponding - // to 0-4095 in order, testing that - // resizing, etc. works correctly. - - let pos = ChunkPosition::new(0, 0); - let mut chunk = Chunk::new(pos); - - for section in chunk.sections() { - assert!(section.is_none()); - } - - for section in 0..16 { - let mut counter = 0; - for x in 0..16 { - for y in 0..16 { - for z in 0..16 { - let block = BlockId::from_vanilla_id(counter); - chunk.set_block_at(x, (section * 16) + y, z, block); - assert_eq!(chunk.block_at(x, (section * 16) + y, z), Some(block)); - if counter != 0 { - assert!( - chunk.section(section as isize).is_some(), - "Section {} failed", - section - ); - } - counter += 1; - } - } - } - } - - // Go through again to be sure - for section in 0..16 { - assert!(chunk.section(section).is_some()); - let mut counter = 0; - for x in 0..16 { - for y in 0..16 { - for z in 0..16 { - let block = BlockId::from_vanilla_id(counter); - assert_eq!( - chunk.block_at(x, (section as usize * 16) + y, z), - Some(block) - ); - assert!(chunk.section(section).is_some()); - counter += 1; - } - } - } - } - - // Now, empty the chunk and ensure - // that the sections become empty. - for x in 0..16 { - for y in 0..256 { - for z in 0..16 { - chunk.set_block_at(x, y, z, BlockId::air()); - } - } - } - - for section in chunk.sections() { - assert!(section.is_none()); - } - } - - #[test] - fn section_from_data_and_palette() { - let pos = ChunkPosition::new(0, 0); - let mut chunk = Chunk::new(pos); - - let mut palette = Palette::new(); - let stone_index = palette.index_or_insert(BlockId::stone()); - - let mut data = PackedArray::new(4096, 5); - for i in 0..4096 { - data.set(i, stone_index as u64); - } - - let section = ChunkSection::new( - BlockStore::from_raw_parts(Some(palette), data), - LightStore::new(), - ); - chunk.set_section_at(0, Some(section)); - - for x in 0..16 { - for y in 0..16 { - for z in 0..16 { - assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockId::stone()); - } - } - } - } - - #[test] - fn test_palette_insertion_in_middle() { - let mut chunk = ChunkSection::default(); - - chunk.set_block_at(0, 0, 0, BlockId::cobblestone()).unwrap(); - chunk.set_block_at(0, 1, 0, BlockId::stone()).unwrap(); - - assert_eq!(chunk.block_at(0, 0, 0).unwrap(), BlockId::cobblestone()); - assert_eq!(chunk.block_at(0, 1, 0).unwrap(), BlockId::stone()); - } - - #[test] - fn test_biomes() { - let mut chunk = Chunk::default(); - - for x in 0..4 { - for z in 0..4 { - assert_eq!(chunk.biomes().get(x, 0, z), Biome::Plains); - chunk.biomes_mut().set(x, 0, z, Biome::BirchForest); - assert_eq!(chunk.biomes().get(x, 0, z), Biome::BirchForest); - } - } - } - - #[test] - fn test_light() { - let mut chunk = Chunk::default(); - - chunk.set_block_at(0, 0, 0, BlockId::stone()).unwrap(); - - for x in 0..SECTION_WIDTH { - for y in 0..SECTION_HEIGHT { - for z in 0..SECTION_WIDTH { - chunk.set_block_light_at(x, y, z, 10); - chunk.set_sky_light_at(x, y, z, 8); - assert_eq!(chunk.block_light_at(x, y, z), Some(10)); - assert_eq!(chunk.sky_light_at(x, y, z), Some(8)); - } - } - } - } - - #[test] - fn heightmaps() { - let mut chunk = Chunk::new(ChunkPosition::new(0, 0)); - - chunk.set_block_at(0, 10, 0, BlockId::stone()); - assert_eq!(chunk.heightmaps.motion_blocking.height(0, 0), Some(10)); - } - - #[test] - fn fill_chunk_section() { - let mut section = ChunkSection::default(); - section.set_block_at(0, 0, 0, BlockId::stone()); - section.fill(BlockId::acacia_wood()); - - for x in 0..CHUNK_WIDTH { - for y in 0..SECTION_HEIGHT { - for z in 0..CHUNK_WIDTH { - assert_eq!(section.block_at(x, y, z), Some(BlockId::acacia_wood())); - } - } - } - } - - #[test] - fn global_bits() { - //The highest block state id must fit into GLOBAL_BITS_PER_BLOCK - assert_eq!(HIGHEST_ID >> GLOBAL_BITS_PER_BLOCK, 0) - } -} diff --git a/feather/base/src/chunk/biome_store.rs b/feather/base/src/chunk/biome_store.rs deleted file mode 100644 index f1f1536d5..000000000 --- a/feather/base/src/chunk/biome_store.rs +++ /dev/null @@ -1,133 +0,0 @@ -use libcraft_core::Biome; - -use crate::{CHUNK_HEIGHT, CHUNK_WIDTH}; - -pub const BIOME_SAMPLE_RATE: usize = 4; - -pub const BIOMES_PER_CHUNK: usize = (CHUNK_WIDTH / BIOME_SAMPLE_RATE) - * (CHUNK_WIDTH / BIOME_SAMPLE_RATE) - * (CHUNK_HEIGHT / BIOME_SAMPLE_RATE); - -/// Stores the biomes of a chunk. -/// -/// Since Minecraft 1.16, Mojang uses a 3D -/// biome grid sampled in 4x4x4 blocks. We -/// do the same, though right now Feather -/// only uses 2D biomes. -#[derive(Debug, Copy, Clone)] -pub struct BiomeStore { - biomes: [Biome; BIOMES_PER_CHUNK], -} - -impl BiomeStore { - pub fn new(default_biome: Biome) -> Self { - Self { - biomes: [default_biome; BIOMES_PER_CHUNK], - } - } - - /// Creates a `BiomeStore` from a slice of `BIOMES_PER_CHUNK` biomes. - /// - /// Returns `None` if `biomes` is not of the correct length. - pub fn from_slice(biome_slice: &[Biome]) -> Option { - let mut biomes = [Biome::Plains; BIOMES_PER_CHUNK]; - if biomes.len() != biome_slice.len() { - return None; - } - - biomes.copy_from_slice(biome_slice); - Some(Self { biomes }) - } - - /// Sets the biome at the given coordinates, in multiples - /// of 4 blocks. - /// - /// # Panics - /// Panics if `x >= 4`, `z >= 4`, or `y >= 64`. - pub fn set(&mut self, x: usize, y: usize, z: usize, biome: Biome) { - let index = self.index(x, y, z); - self.biomes[index] = biome; - } - - /// Gets the biome at the given coordinates, - /// in multiples of 4 blocks. - /// - /// # Panics - /// Panics if `x >= 4`, `z >= 4`, or `y >= 64`. - pub fn get(&self, x: usize, y: usize, z: usize) -> Biome { - let index = self.index(x, y, z); - self.biomes[index] - } - - pub fn get_at_block(&self, x: usize, y: usize, z: usize) -> Biome { - self.get(x / 4, y / 4, z / 4) - } - - /// Gets biome data as a raw slice. - pub fn as_slice(&self) -> &[Biome] { - &self.biomes - } - - /// Gets biomes as a mutably slice. - pub fn as_slice_mut(&mut self) -> &mut [Biome] { - &mut self.biomes - } - - fn index(&self, x: usize, y: usize, z: usize) -> usize { - assert!(x < 4); - assert!(y < 64); - assert!(z < 4); - x + (z * 4) + (y * 16) - } -} - -impl Default for BiomeStore { - fn default() -> Self { - Self::new(Biome::Plains) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn default_biome() { - let biomes = BiomeStore::new(Biome::Badlands); - for x in 0..4 { - for y in 0..64 { - for z in 0..4 { - assert_eq!(biomes.get(x, y, z), Biome::Badlands); - } - } - } - } - - #[test] - fn set_and_get_biomes() { - let mut biomes = BiomeStore::new(Biome::Beach); - - biomes.set(0, 1, 2, Biome::BambooJungle); - assert_eq!(biomes.get(0, 1, 2), Biome::BambooJungle); - } - - #[test] - #[should_panic] - fn out_of_bounds() { - let biomes = BiomeStore::new(Biome::Plains); - biomes.get(4, 0, 0); - } - - #[test] - fn from_slice_correct_length() { - let biome_slice = [Biome::BasaltDeltas; BIOMES_PER_CHUNK]; - let biomes = BiomeStore::from_slice(&biome_slice).unwrap(); - assert_eq!(biomes.as_slice(), biome_slice); - } - - #[test] - fn from_slice_incorrect_length() { - let biome_slice = [Biome::BasaltDeltas; BIOMES_PER_CHUNK - 1]; - assert!(BiomeStore::from_slice(&biome_slice).is_none()); - } -} diff --git a/feather/base/src/chunk/blocks.rs b/feather/base/src/chunk/blocks.rs deleted file mode 100644 index 3fefe1258..000000000 --- a/feather/base/src/chunk/blocks.rs +++ /dev/null @@ -1,172 +0,0 @@ -use blocks::BlockId; - -use crate::ChunkSection; - -use super::{ - PackedArray, Palette, GLOBAL_BITS_PER_BLOCK, MAX_BITS_PER_BLOCK, MIN_BITS_PER_BLOCK, - SECTION_VOLUME, -}; - -/// Stores the blocks of a chunk section. -#[derive(Debug, Clone)] -pub struct BlockStore { - /// `None` if using the global palette - palette: Option, - - /// Stores indices into `palette`, or just block IDs - /// if using the global palette - blocks: PackedArray, - - air_block_count: u32, -} - -impl Default for BlockStore { - fn default() -> Self { - Self::new() - } -} - -impl BlockStore { - /// Creates a new `BlockStore` containing air. - pub fn new() -> Self { - Self { - palette: Some(Palette::new()), - blocks: PackedArray::new(SECTION_VOLUME, MIN_BITS_PER_BLOCK as usize), - air_block_count: SECTION_VOLUME as u32, - } - } - - /// Creates a new `BlockStore` from the palette - /// and data array. - pub fn from_raw_parts(palette: Option, blocks: PackedArray) -> Self { - let air_block_count = Self::count_air_blocks(&blocks, &palette); - Self { - palette, - blocks, - air_block_count, - } - } - - pub fn data(&self) -> &PackedArray { - &self.blocks - } - - pub fn data_mut(&mut self) -> &mut PackedArray { - &mut self.blocks - } - - pub fn palette(&self) -> Option<&Palette> { - self.palette.as_ref() - } - - pub fn palette_mut(&mut self) -> Option<&mut Palette> { - self.palette.as_mut() - } - - fn count_air_blocks(blocks: &PackedArray, palette: &Option) -> u32 { - let mut count = 0; - blocks.iter().for_each(|x| { - let block = match palette { - Some(p) => p.get(x as usize), - None => BlockId::from_vanilla_id(x as u16), - }; - if block.is_air() { - count += 1; - } - }); - count - } - - pub fn air_blocks(&self) -> u32 { - self.air_block_count - } - - pub fn set_air_blocks(&mut self, new_value: u32) { - self.air_block_count = new_value; - } - - pub fn block_at(&self, x: usize, y: usize, z: usize) -> Option { - let index = ChunkSection::block_index(x, y, z)?; - let block_index = self.blocks.get(index).expect("block_index out of bounds?"); - - Some(match &self.palette { - Some(palette) => palette.get(block_index as usize), - None => BlockId::from_vanilla_id(block_index as u16), - }) - } - - pub fn set_block_at(&mut self, x: usize, y: usize, z: usize, block: BlockId) -> Option<()> { - let index = ChunkSection::block_index(x, y, z)?; - self.update_air_block_count(x, y, z, block); - - let block_index = self.get_block_palette_index(block); - self.blocks.set(index, block_index as u64); - - Some(()) - } - - pub fn fill(&mut self, block: BlockId) { - let index = if let Some(ref mut palette) = self.palette { - palette.clear(); - palette.index_or_insert(block) - } else { - self.palette = Some(Palette::new()); - self.palette.as_mut().unwrap().index_or_insert(block) - }; - - self.blocks.fill(index as u64); - - if block.is_air() { - self.air_block_count = SECTION_VOLUME as u32; - } else { - self.air_block_count = 0; - } - } - - fn get_block_palette_index(&mut self, block: BlockId) -> usize { - match &mut self.palette { - Some(p) => { - let index = p.index_or_insert(block); - self.resize_if_needed(); - index - } - None => block.vanilla_id() as usize, - } - } - - fn resize_if_needed(&mut self) { - let palette = self.palette.as_ref().unwrap(); - - if palette.len() - 1 > self.blocks.max_value() as usize { - // Resize to either the global palette or a new section palette size. - let new_size = self.blocks.bits_per_value() + 1; - if new_size > MAX_BITS_PER_BLOCK as usize { - self.use_global_palette(); - } else { - self.blocks = self.blocks.resized(new_size); - } - } - } - - fn use_global_palette(&mut self) { - self.blocks = self.blocks.resized(GLOBAL_BITS_PER_BLOCK as usize); - let palette = self.palette.as_ref().unwrap(); - - // Update blocks to use vanilla IDs instead of palette indices - for i in 0..SECTION_VOLUME { - let block = palette.get(self.blocks.get(i).unwrap() as usize); - self.blocks.set(i, block.vanilla_id() as u64); - } - - self.palette = None; - } - - fn update_air_block_count(&mut self, x: usize, y: usize, z: usize, new: BlockId) { - let old = self.block_at(x, y, z).unwrap(); - if old.is_air() && !new.is_air() { - self.air_block_count -= 1; - } else if !old.is_air() && new.is_air() { - self.air_block_count += 1; - } - } -} diff --git a/feather/base/src/chunk/light.rs b/feather/base/src/chunk/light.rs deleted file mode 100644 index 433b01a4e..000000000 --- a/feather/base/src/chunk/light.rs +++ /dev/null @@ -1,74 +0,0 @@ -use crate::ChunkSection; - -use super::{PackedArray, SECTION_VOLUME}; - -/// Contains light data for a chunk section. -#[derive(Debug, Clone)] -pub struct LightStore { - block_light: PackedArray, - sky_light: PackedArray, -} - -impl Default for LightStore { - fn default() -> Self { - Self::new() - } -} - -impl LightStore { - /// Creates a `LightStore` with sky light set to 15. - pub fn new() -> Self { - let mut this = LightStore { - block_light: PackedArray::new(SECTION_VOLUME, 4), - sky_light: PackedArray::new(SECTION_VOLUME, 4), - }; - this.sky_light.fill(15); - this - } - - /// Creates a `LightStore` from packed arrays. - pub fn from_packed_arrays(block_light: PackedArray, sky_light: PackedArray) -> Option { - if block_light.len() != SECTION_VOLUME - || sky_light.len() != SECTION_VOLUME - || block_light.bits_per_value() != 4 - || sky_light.bits_per_value() != 4 - { - None - } else { - Some(Self { - block_light, - sky_light, - }) - } - } - - pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { - let index = ChunkSection::block_index(x, y, z)?; - self.block_light.get(index).map(|x| x as u8) - } - - pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { - let index = ChunkSection::block_index(x, y, z)?; - self.sky_light.get(index).map(|x| x as u8) - } - - pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - let index = ChunkSection::block_index(x, y, z)?; - self.block_light.set(index, light.min(15) as u64); - Some(()) - } - - pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { - let index = ChunkSection::block_index(x, y, z)?; - self.sky_light.set(index, light.min(15) as u64); - Some(()) - } - - pub fn block_light(&self) -> &PackedArray { - &self.block_light - } - - pub fn sky_light(&self) -> &PackedArray { - &self.sky_light - } -} diff --git a/feather/base/src/chunk/palette.rs b/feather/base/src/chunk/palette.rs deleted file mode 100644 index 97a05008d..000000000 --- a/feather/base/src/chunk/palette.rs +++ /dev/null @@ -1,152 +0,0 @@ -use blocks::BlockId; - -/// Stores the set of distinct `BlockId`s in a chunk section. -/// -/// Empty entries in the palette default to air. -/// -/// The entry with index 0 is always air. -#[derive(Debug, Clone)] -pub struct Palette { - blocks: Vec, - free_indices: Vec, -} - -impl Default for Palette { - fn default() -> Self { - Self::new() - } -} - -#[allow(clippy::len_without_is_empty)] // palette is never empty -impl Palette { - /// Creates an empty palette. - pub fn new() -> Self { - Self { - blocks: vec![BlockId::air()], - free_indices: Vec::new(), - } - } - - /// Gets the blocks in this palette as a slice. - pub fn as_slice(&self) -> &[BlockId] { - &self.blocks - } - - /// Gets the index in the palette of `block`. - /// Inserts the block into the palette if it - /// does not already exist. - pub fn index_or_insert(&mut self, block: BlockId) -> usize { - match self.index_of(block) { - Some(i) => i, - None => self.insert(block), - } - } - - fn insert(&mut self, block: BlockId) -> usize { - match self.free_indices.pop() { - Some(i) => { - self.blocks[i] = block; - i - } - None => { - let i = self.blocks.len(); - self.blocks.push(block); - i - } - } - } - - /// Gets the block at index `i`, or air if - /// the palette does not contain `i`. - pub fn get(&self, index: usize) -> BlockId { - self.blocks.get(index).copied().unwrap_or_else(BlockId::air) - } - - /// Gets the number of blocks in the palette. - pub fn len(&self) -> usize { - self.blocks.len() - } - - /// Removes the given block from this palette. - pub fn remove(&mut self, block: BlockId) { - if let Some(index) = self.index_of(block) { - self.blocks[index] = BlockId::air(); - self.free_indices.push(index); - } - } - - /// Clears the palette, leaving only the air entry at index 0. - pub fn clear(&mut self) { - self.blocks.clear(); - self.blocks.push(BlockId::air()); - } - - fn index_of(&self, block: BlockId) -> Option { - self.blocks.iter().position(|b| *b == block) - } -} - -#[cfg(test)] -mod tests { - use ahash::AHashMap; - use blocks::BlockId; - - use super::*; - - #[test] - fn add_blocks() { - let mut palette = Palette::new(); - - for i in 0..100 { - let index = palette.index_or_insert(BlockId::from_vanilla_id(i)); - assert_eq!(index, i as usize); - assert_eq!(palette.get(index), BlockId::from_vanilla_id(i)); - } - - assert_eq!(palette.len(), 100); - } - - #[test] - fn empty_entries_are_air() { - let palette = Palette::new(); - assert_eq!(palette.get(0), BlockId::air()); - } - - #[test] - fn remove_blocks() { - let mut palette = Palette::new(); - - let mut mapping: AHashMap = AHashMap::new(); - - for i in 0..100 { - let block = BlockId::from_vanilla_id(i); - let index = palette.index_or_insert(BlockId::from_vanilla_id(i)); - if i % 2 == 0 { - palette.remove(block); - } else { - mapping.insert(block, index); - } - } - - assert_eq!(palette.len(), 50); - - for i in 0..100 { - if i % 2 == 0 { - continue; - } - let block = BlockId::from_vanilla_id(i); - assert_eq!(palette.index_or_insert(block), mapping[&block]); - } - } - - #[test] - fn clear() { - let mut palette = Palette::new(); - for id in 100..200 { - palette.index_or_insert(BlockId::from_vanilla_id(id)); - } - palette.clear(); - assert_eq!(palette.len(), 1); - assert_eq!(palette.index_of(BlockId::air()), Some(0)); - } -} diff --git a/feather/base/src/lib.rs b/feather/base/src/lib.rs deleted file mode 100644 index 730d4c51a..000000000 --- a/feather/base/src/lib.rs +++ /dev/null @@ -1,61 +0,0 @@ -//! Core functionality for Feather. This crate primarily -//! implements or reexports essential data structures, such as: -//! * Inventories -//! * The block ID system -//! * The chunk data structure - -use std::time::Duration; - -use num_derive::{FromPrimitive, ToPrimitive}; -use serde::{Deserialize, Serialize}; - -pub mod anvil; -mod block; -pub mod chunk; -pub mod chunk_lock; -pub mod inventory; -pub mod metadata; - -pub use block::{BlockPositionValidationError, ValidBlockPosition}; -pub use blocks::*; -pub use chunk::{Chunk, ChunkSection, CHUNK_HEIGHT, CHUNK_WIDTH}; -pub use chunk_lock::*; - -pub use libcraft_blocks::{BlockKind, BlockState}; -pub use libcraft_core::{ - position, vec3, Biome, BlockPosition, ChunkPosition, EntityKind, Gamemode, Position, Vec3d, -}; -pub use libcraft_inventory::{Area, Inventory}; -pub use libcraft_items::{Item, ItemStack, ItemStackBuilder, ItemStackError}; -pub use libcraft_particles::{Particle, ParticleKind}; -pub use libcraft_text::{deserialize_text, Text, Title}; -#[doc(inline)] -pub use metadata::EntityMetadata; - -/// Number of updates (ticks) to do per second. -pub const TPS: u32 = 20; -/// The number of milliseconds per tick. -pub const TICK_MILLIS: u32 = 1000 / TPS; -/// The duration of a tick. -pub const TICK_DURATION: Duration = Duration::from_millis(TICK_MILLIS as u64); - -/// Default port for Minecraft servers. -pub const DEFAULT_PORT: u16 = 25565; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, FromPrimitive, ToPrimitive)] -pub enum Direction { - North, - South, - East, - West, -} - -/// A profile property, which stores metadata -/// for some player's account. This is usually -/// used to store skin data. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub struct ProfileProperty { - pub name: String, - pub value: String, - pub signature: String, -} diff --git a/feather/blocks/Cargo.toml b/feather/blocks/Cargo.toml deleted file mode 100644 index 12a8835a9..000000000 --- a/feather/blocks/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "feather-blocks" -version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" - -[dependencies] -anyhow = "1" -bincode = "1" -num-traits = "0.2" -once_cell = { version = "1" } -serde = { version = "1", features = [ "derive" ] } -thiserror = "1" -vek = "0.14" -libcraft-blocks = { path = "../../libcraft/blocks" } diff --git a/feather/blocks/generator/Cargo.toml b/feather/blocks/generator/Cargo.toml deleted file mode 100644 index d92d6c62f..000000000 --- a/feather/blocks/generator/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "feather-blocks-generator" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[lib] -name = "feather_blocks_generator" -path = "src/lib.rs" - -[[bin]] -name = "feather-blocks-generator" -path = "src/main.rs" - -[dependencies] -serde = { version = "1", features = ["derive"] } -serde_json = "1" -anyhow = "1" -indexmap = { version = "1", features = ["serde-1"] } -quote = "1" -syn = "1" -proc-macro2 = "1" -heck = "0.3" -once_cell = "1" -maplit = "1" -bincode = "1" diff --git a/feather/blocks/generator/src/lib.rs b/feather/blocks/generator/src/lib.rs deleted file mode 100644 index b5b8fbd84..000000000 --- a/feather/blocks/generator/src/lib.rs +++ /dev/null @@ -1,752 +0,0 @@ -use crate::load::ident; -use heck::CamelCase; -use heck::SnakeCase; -use proc_macro2::{Ident, TokenStream}; -use quote::quote; -use quote::ToTokens; -use serde::ser::{SerializeSeq, SerializeStruct}; -use serde::{Serialize, Serializer}; -use std::collections::BTreeMap; -use std::ops::RangeInclusive; -use std::str::FromStr; - -mod load; - -#[derive(Debug)] -struct Blocks { - property_types: BTreeMap, - blocks: Vec, -} - -#[derive(Debug)] -pub struct Block { - /// Lowercase name of this block, minecraft: prefix removed. - name: Ident, - /// `name.to_camel_case()` - name_camel_case: Ident, - /// This block's properties. - properties: Vec, - /// Default state and its property values. - default_state: Vec<(String, String)>, - /// Block states mapped to vanilla state IDs. - ids: Vec<(Vec<(String, String)>, u16)>, - /// Strides and offset coefficients for each property of this block. - index_parameters: BTreeMap, -} - -#[derive(Debug)] -struct Property { - /// Name of this property, with Rust keywords removed. (e.g. "type" => "kind") - name: Ident, - /// Actual name of this property before Feather renaming is applied. - real_name: String, - /// CamelCase name of this property if it were a struct or enum. - /// - /// Often prefixed with the name of the block to which this property belongs. - _name_camel_case: Ident, - /// The kind of this property. - kind: PropertyKind, - /// Possible values of this property. - possible_values: Vec, -} - -impl Property { - /// Returns the tokens to create an instance of this property from a `u16`. - fn tokens_for_from_u16(&self, input: TokenStream) -> TokenStream { - match &self.kind { - PropertyKind::Integer { range } => { - let min = *range.start(); - quote! {{ #input as i32 + #min }} - } - PropertyKind::Boolean { .. } => quote! { if #input == 0 { false } else { true } }, - PropertyKind::Enum { name, .. } => { - quote! { #name::try_from(#input).expect("invalid block state") } - } - } - } - - fn tokens_for_to_u16(&self, input: TokenStream) -> TokenStream { - match &self.kind { - PropertyKind::Integer { range } => { - let min = *range.start() as u16; - quote! { - #input as u16 - #min - } - } - _ => quote! { #input as u16 }, - } - } - - fn tokens_for_as_str(&self, input: TokenStream) -> TokenStream { - match &self.kind { - PropertyKind::Integer { range } => { - let nums = range.clone().collect::>(); - let strs = range.clone().map(|x| x.to_string()).collect::>(); - - quote! { - match #input { - #( - #nums => #strs, - )* - _ => "unknown", - } - } - } - PropertyKind::Boolean => quote! { - match #input { - true => "true", - false => "false", - } - }, - PropertyKind::Enum { .. } => quote! { #input.as_str() }, - } - } - - fn tokens_for_from_str(&self, input: TokenStream) -> TokenStream { - match &self.kind { - PropertyKind::Integer { range } => { - let start = *range.start(); - let end = *range.end(); - quote! { - { - let x = i32::from_str(#input).ok()?; - if !(#start..=#end).contains(&x) { - return None; - } - x - } - } - } - PropertyKind::Boolean => quote! { - bool::from_str(#input).ok()? - }, - PropertyKind::Enum { name, .. } => quote! { #name::from_str(#input).ok()?}, - } - } - - /// Returns an expression for a value of this property. - fn expr_for_value(&self, value: &str) -> TokenStream { - match &self.kind { - PropertyKind::Integer { .. } => { - let value = i32::from_str(value).unwrap(); - quote! { #value } - } - PropertyKind::Boolean => { - let value = bool::from_str(value).unwrap(); - quote! { #value } - } - PropertyKind::Enum { name, .. } => { - let variant = ident(value.to_camel_case()); - quote! { #name::#variant } - } - } - } -} - -impl ToTokens for Property { - fn to_tokens(&self, tokens: &mut TokenStream) { - let x = match &self.kind { - PropertyKind::Integer { .. } => quote! { i32 }, - PropertyKind::Boolean => quote! { bool }, - PropertyKind::Enum { name, .. } => quote! { #name }, - }; - - tokens.extend(x); - } -} - -impl Property { - /// Returns the tokens necessary to define this property's type, - /// i.e. if it is an enum. - pub fn tokens_for_definition(&self) -> Option { - match &self.kind { - PropertyKind::Enum { name, variants } => Some({ - let definition = quote! { - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] - #[repr(u16)] - pub enum #name { - #( - #variants, - )* - } - }; - - let variant_indices: Vec<_> = (0..variants.len() as u16).collect(); - let try_from_error_msg = format!("invalid value {{}} for {}", name); - let as_str: Vec<_> = variants - .iter() - .map(|ident| ident.to_string()) - .map(|x| x.to_snake_case()) - .collect(); - - let imp = quote! { - impl TryFrom for #name { - type Error = anyhow::Error; - - fn try_from(value: u16) -> anyhow::Result { - match value { - #( - #variant_indices => Ok(#name::#variants), - )* - x => Err(anyhow::anyhow!(#try_from_error_msg, x)), - } - } - } - - impl FromStr for #name { - type Err = anyhow::Error; - - fn from_str(s: &str) -> anyhow::Result { - match s { - #( - #as_str => Ok(#name::#variants), - )* - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(#name))), - } - } - } - - impl #name { - pub fn as_str(self) -> &'static str { - match self { - #( - #name::#variants => #as_str, - )* - } - } - } - }; - - quote! { - #definition - #imp - } - }), - _ => None, - } - } -} - -#[derive(Debug)] -enum PropertyKind { - Integer { range: RangeInclusive }, - Boolean, - Enum { name: Ident, variants: Vec }, -} - -#[derive(Debug, Default)] -pub struct Output { - pub block_fns: String, - pub block_properties: String, - pub block_table: String, - pub block_table_serialized: Vec, - pub vanilla_ids_serialized: Vec, -} - -/// Generates code for the block report. -pub fn generate() -> anyhow::Result { - let blocks = load::load()?; - - let mut output = Output::default(); - - let table_src = generate_table(&blocks); - output.block_table.push_str(&table_src.to_string()); - let properties_src = generate_properties(&blocks); - output - .block_properties - .push_str(&properties_src.to_string()); - let block_fns_src = generate_block_fns(&blocks); - output.block_fns.push_str(&block_fns_src.to_string()); - - output.block_table_serialized = serialize_block_table(&blocks); - output.vanilla_ids_serialized = serialized_vanilla_ids(&blocks); - - Ok(output) -} - -/// Generates the `BlockTable` struct and its implementation. -fn generate_table(blocks: &Blocks) -> TokenStream { - let mut fields = vec![]; - let mut fns = vec![]; - let mut types = vec![]; - - for property in blocks.property_types.values() { - let name = &property.name; - - types.push(property.tokens_for_definition()); - - fields.push(quote! { - #name: Vec<(u16, u16)> - }); - - let from_u16 = property.tokens_for_from_u16(quote! { x }); - - let doc = format!( - "Retrieves the `{}` value for the given block kind with the given state value. - Returns the value of the property, or `None` if it does not exist.", - name - ); - fns.push(quote! { - #[doc = #doc] - pub fn #name(&self, kind: BlockKind, state: u16) -> Option<#property> { - let (offset_coefficient, stride) = self.#name[kind as u16 as usize]; - - if offset_coefficient == 0 { - return None; - } - - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(#from_u16) - } - }); - - let set = ident(format!("set_{}", name)); - let doc = format!("Updates the state value for the given block kind such that its `{}` value is updated. Returns the new state, - or `None` if the block does not have this property.", name); - let to_u16 = property.tokens_for_to_u16(quote! { value }); - fns.push(quote! { - #[doc = #doc] - pub fn #set(&self, kind: BlockKind, state: u16, value: #property) -> Option { - let (offset_coefficient, stride) = self.#name[kind as u16 as usize]; - - if offset_coefficient == 0 { - return None; - } - - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ #to_u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - }); - } - - quote! { - use crate::BlockKind; - use std::convert::TryFrom; - use std::str::FromStr; - use serde::Deserialize; - - #[derive(Debug, Deserialize)] - pub struct BlockTable { - #(#fields,)* - } - - impl BlockTable { - #(#fns)* - } - - #(#types)* - } -} - -/// Generated functions for `BlockId`. -fn generate_block_fns(blocks: &Blocks) -> TokenStream { - let mut fns = vec![]; - - for block in &blocks.blocks { - let name = &block.name; - let name_camel_case = &block.name_camel_case; - - let default_state = &block.default_state; - - let mut state_intializers = vec![]; - for (name, value) in default_state { - let value_expr = blocks.property_types[name].expr_for_value(value); - - let name_fn = ident(format!("set_{}", name)); - state_intializers.push(quote! { - block.#name_fn(#value_expr); - }); - } - - let mut doc = format!( - "Returns an instance of `{}` with default state values.", - block.name - ); - - if !default_state.is_empty() { - doc.push_str("\nThe default state values are as follows:\n"); - } - - for (name, value) in default_state { - doc.push_str(&format!("* `{}`: {}\n", name, value)); - } - - fns.push(quote! { - #[doc = #doc] - pub fn #name() -> Self { - let mut block = Self { - kind: BlockKind::#name_camel_case, - state: 0, - }; - #(#state_intializers)* - block - } - }) - } - - for property in blocks.property_types.values() { - let property_name = &property.name; - let set = ident(format!("set_{}", property_name)); - let with = ident(format!("with_{}", property_name)); - - let f = quote! { - pub fn #property_name(self) -> Option<#property> { - BLOCK_TABLE.#property_name(self.kind, self.state) - } - - pub fn #set(&mut self, #property_name: #property) -> bool { - match BLOCK_TABLE.#set(self.kind, self.state, #property_name) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - - pub fn #with(mut self, #property_name: #property) -> Self { - self.#set(#property_name); - self - } - }; - fns.push(f); - } - - fns.extend(generate_block_serializing_fns(blocks)); - - let res = quote! { - use std::collections::BTreeMap; - use std::str::FromStr; - use crate::*; - - impl BlockId { - #(#fns)* - } - }; - res -} - -/// Generates `BlockId::identifier()`, `BlockId::to_properties_map()`, and `BlockId::from_properties_and_identifier()`. -fn generate_block_serializing_fns(blocks: &Blocks) -> Vec { - let mut fns = vec![]; - - let mut identifier_fn_match_arms = vec![]; - for block in &blocks.blocks { - let name_camel_case = &block.name_camel_case; - - let name = format!("minecraft:{}", block.name); - - identifier_fn_match_arms.push(quote! { - BlockKind::#name_camel_case => #name - }); - } - - fns.push(quote! { - #[doc = "Returns the identifier of this block. For example, returns `minecraft::air` for an air block."] - pub fn identifier(self) -> &'static str { - match self.kind { - #(#identifier_fn_match_arms,)* - } - } - }); - - let mut to_properties_map_fn_match_arms = vec![]; - let mut to_properties_map_util_fns = vec![]; - for block in &blocks.blocks { - let name_camel_case = &block.name_camel_case; - let fn_to_call = ident(format!("{}_to_properties_map", block.name)); - - to_properties_map_fn_match_arms.push(quote! { - BlockKind::#name_camel_case => self.#fn_to_call() - }); - - let mut inserts = vec![]; - for property_name in &block.properties { - let property = &blocks.property_types[property_name]; - // Use the vanilla name of the property rather than our custom - // mapping, to ensure world saves are compatible with vanilla. - let property_real_name = &property.real_name; - - let name = &property.name; - let as_str = property.tokens_for_as_str(quote! { #name }); - - inserts.push(quote! { - let #name = self.#name().unwrap(); - map.insert(#property_real_name, { #as_str }); - }) - } - - to_properties_map_util_fns.push(quote! { - fn #fn_to_call(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - #(#inserts)* - map - } - }); - } - - fns.push(quote! { - #[doc = "Returns a mapping from property name to property value for this block. Used to serialize blocks in vanilla world saves."] - pub fn to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - match self.kind { - #(#to_properties_map_fn_match_arms,)* - } - } - - #(#to_properties_map_util_fns)* - }); - - let mut from_identifier_and_properties_fn_match_arms = vec![]; - let mut from_identifier_and_properties_util_fns = vec![]; - for block in &blocks.blocks { - let name = &block.name; - let name_str = format!("minecraft:{}", name); - let fn_to_call = ident(format!("{}_from_identifier_and_properties", block.name)); - - from_identifier_and_properties_fn_match_arms.push(quote! { - #name_str => Self::#fn_to_call(properties) - }); - - let mut retrievals = vec![]; - for property_name in &block.properties { - let property = &blocks.property_types[property_name]; - let property_real_name = &property.real_name; - - let name = &property.name; - let from_str = property.tokens_for_from_str(quote! { #name }); - let set_fn = ident(format!("set_{}", name)); - - retrievals.push(quote! { - let #name = map.get(#property_real_name)?; - let #name = #from_str; - block.#set_fn(#name); - }); - } - - from_identifier_and_properties_util_fns.push(quote! { - fn #fn_to_call(map: &BTreeMap) -> Option { - let mut block = BlockId::#name(); - #(#retrievals)* - Some(block) - } - }); - } - - fns.push(quote! { - #[doc = "Attempts to convert a block kind identifier (e.g. `minecraft::air`) and properties map to a `BlockId`."] - pub fn from_identifier_and_properties(identifier: &str, properties: &BTreeMap) -> Option { - match identifier { - #(#from_identifier_and_properties_fn_match_arms,)* - _ => None, - } - } - - #(#from_identifier_and_properties_util_fns)* - }); - - let mut from_identifier_and_default_props_match_arms = vec![]; - for block in &blocks.blocks { - let name_str = format!("minecraft:{}", block.name); - let name = &block.name; - - from_identifier_and_default_props_match_arms.push(quote! { - #name_str => Some(Self::#name()) - }); - } - fns.push(quote! { - #[doc = "Attempts to convert a block identifier to a block with default property values."] - pub fn from_identifier(identifier: &str) -> Option { - match identifier { - #(#from_identifier_and_default_props_match_arms,)* - _ => None, - } - } - }); - - fns -} - -/// Returns the serialized `BlockTable`. -fn serialize_block_table(blocks: &Blocks) -> Vec { - let table = BlockTableSerialize::new(&blocks.blocks, &blocks.property_types); - - bincode::serialize(&table).expect("bincode failed to serialize block table") -} - -/// Serializable form of the generated `BlockTable`. -#[derive(Debug)] -struct BlockTableSerialize { - fields: BTreeMap>, -} - -// custom serialize impl needed because of https://github.com/servo/bincode/issues/245 -impl Serialize for BlockTableSerialize { - fn serialize(&self, serializer: S) -> Result<::Ok, ::Error> - where - S: Serializer, - { - let mut state = serializer.serialize_struct("BlockTable", self.fields.len())?; - - for (name, value) in &self.fields { - // Leak memory! This is a build script; it doesn't matter. - let name = Box::leak(name.clone().into_boxed_str()); - state.serialize_field(name, value)?; - } - - state.end() - } -} - -impl BlockTableSerialize { - pub fn new(blocks: &[Block], property_types: &BTreeMap) -> Self { - let mut fields: BTreeMap> = BTreeMap::new(); - - for block in blocks { - for property_name in property_types.keys() { - let index_parameters = match block.index_parameters.get(property_name) { - Some(params) => *params, - None => (0, 0), - }; - - fields - .entry(property_name.clone()) - .or_default() - .push(index_parameters); - } - } - - assert!(fields.values().map(Vec::len).all(|len| len == blocks.len())); - - Self { fields } - } -} - -/// Returns the serialized state ID map. -fn serialized_vanilla_ids(blocks: &Blocks) -> Vec { - let table = VanillaStateIdSerialize::new(blocks); - - bincode::serialize(&table).expect("bincode failed to serialize vanilla ID table") -} - -/// Serializable state ID table. -#[derive(Debug)] -struct VanillaStateIdSerialize { - ids: Vec>, // indexed by [kind as u16 as usize][state as usize] -} - -impl Serialize for VanillaStateIdSerialize { - fn serialize(&self, serializer: S) -> Result<::Ok, ::Error> - where - S: Serializer, - { - let mut state = serializer.serialize_seq(Some(self.ids.len()))?; - - for id in &self.ids { - state.serialize_element(id)?; - } - - state.end() - } -} - -impl VanillaStateIdSerialize { - pub fn new(blocks: &Blocks) -> Self { - let mut ids: Vec> = std::iter::repeat_with(Vec::new) - .take(blocks.blocks.len()) - .collect(); - - for (i, block) in blocks.blocks.iter().enumerate() { - for (state, id) in &block.ids { - let mut internal_id = 0; - - for (property_name, property_value) in state { - let (offset_coefficient, stride) = block.index_parameters[property_name]; - - let index = blocks.property_types[property_name] - .possible_values - .iter() - .position(|val| val == property_value) - .unwrap(); - - let multiplier = internal_id / offset_coefficient; - let mut new = property_value_as_u16( - property_value, - index, - &blocks.property_types[property_name].kind, - ) * stride; - new += multiplier * offset_coefficient; - internal_id = new; - } - - let internal_id = internal_id as usize; - // pad with zeroes - if internal_id >= ids[i].len() { - let to_extend = internal_id - ids[i].len() + 1; - ids[i].extend(std::iter::repeat(0).take(to_extend)); - } - assert_eq!(ids[i][internal_id], 0, "failed for {}", block.name); - ids[i][internal_id] = *id; - } - } - - Self { ids } - } -} - -fn property_value_as_u16(value: &str, index: usize, kind: &PropertyKind) -> u16 { - let start = match kind { - PropertyKind::Integer { range } => *range.start() as u16, - _ => 0, - }; - - if let Ok(x) = i32::from_str(value) { - x as u16 - start - } else if let Ok(x) = bool::from_str(value) { - x as u16 - } else { - index as u16 - } -} - -fn generate_properties(blocks: &Blocks) -> TokenStream { - let mut fns = vec![]; - - for property in blocks.property_types.values() { - let name = &property.name; - - let doc = format!( - "Determines whether or not a block has the `{}` property.", - name - ); - - let kinds = blocks - .blocks - .iter() - .filter(|block| block.default_state.iter().any(|(prop, _)| name == prop)) - .map(|block| { - let name_camel_case = &block.name_camel_case; - - quote! { BlockKind::#name_camel_case } - }); - - let fn_name = ident(format!("has_{}", name)); - fns.push(quote! { - #[doc = #doc] - pub fn #fn_name(self) -> bool { - match self.kind() { - #(#kinds)|* => true, - _ => false - } - } - }); - } - - quote! { - use crate::{BlockId, BlockKind}; - - impl BlockId { - #(#fns)* - } - } -} diff --git a/feather/blocks/generator/src/load.rs b/feather/blocks/generator/src/load.rs deleted file mode 100644 index 10bd98909..000000000 --- a/feather/blocks/generator/src/load.rs +++ /dev/null @@ -1,360 +0,0 @@ -//! Loads the vanilla blocks.json report into a `BlocksReport`, then -//! converts this report into a `Blocks`. - -use crate::{Block, Blocks, Property, PropertyKind}; -use anyhow::Context; -use heck::CamelCase; -use indexmap::map::IndexMap; -use once_cell::sync::Lazy; -use proc_macro2::{Ident, Span}; -use serde::Deserialize; -use std::collections::{BTreeMap, BTreeSet, HashMap}; -use std::str::FromStr; - -/// Special property name overrides, to avoid names like "shape_neaaaassnn." -static NAME_OVERRIDES: Lazy> = Lazy::new(|| { - maplit::hashmap! { - "east_tf" => "east_connected", - "east_usn" => "east_wire", - "north_tf" => "north_connected", - "north_usn" => "north_wire", - "west_tf" => "west_connected", - "west_usn" => "west_wire", - "south_tf" => "south_connected", - "south_usn" => "south_wire", - "facing_dnswe" => "facing_cardinal_and_down", - "facing_neswud" => "facing_cubic", - "facing_nswe" => "facing_cardinal", - "half_ul" => "half_upper_lower", - "half_tb" => "half_top_bottom", - "kind_slr" => "chest_kind", - "kind_tbd" => "slab_kind", - "kind_ns" => "piston_kind", - "mode_cs" => "comparator_mode", - "mode_slcd" => "structure_block_mode", - "shape_neaaaa" => "powered_rail_shape", - "shape_siioo" => "stairs_shape", - "shape_neaaaassnn" => "rail_shape", - "level_0_3" => "cauldron_level", - "level_0_15" => "water_level", - "type_slr" => "chest_kind", - "type_tbd" => "slab_kind", - "type_ns" => "piston_kind", - } -}); - -#[derive(Debug, Deserialize)] -struct BlocksReport { - #[serde(flatten)] - blocks: IndexMap, -} - -#[derive(Debug, Deserialize)] -struct BlockDefinition { - states: Vec, - #[serde(default)] - properties: BTreeMap>, // map from property name => possible values -} - -#[derive(Debug, Deserialize)] -struct StateDefinition { - id: u16, - #[serde(default)] - default: bool, - #[serde(default)] - properties: BTreeMap, -} - -#[derive(Debug, Default, Clone)] -struct PropertyStore { - /// Mapping from property name to the set of different sets - /// of values known for this property. - properties: BTreeMap>>, -} - -impl PropertyStore { - fn register(&mut self, property: String, possible_values: impl IntoIterator) { - self.properties - .entry(property) - .or_default() - .insert(possible_values.into_iter().collect()); - } - - fn finish(self) -> BTreeMap { - let mut map = BTreeMap::new(); - - for (name, possible_value_sets) in self.properties { - let name = Self::update_name(&name); - - if possible_value_sets.len() == 1 { - let possible_values = possible_value_sets.into_iter().next().unwrap(); - map.insert( - name.to_owned(), - Self::prop_from_possible_values_and_name(name, name, possible_values), - ); - } else { - // There are multiple variants of this property, each with their own set of values. - // Create properties suffixed with an index to differentiate between these variants. - for possible_values in possible_value_sets { - // Name is the name of the property followed by the first letter of each possible value. - // If it's an integer, it is the range of possible values. - let new_name = if possible_values[0].parse::().is_ok() { - let as_integer = possible_values - .iter() - .map(String::as_str) - .map(i32::from_str) - .map(Result::unwrap) - .collect::>(); - - let min = *as_integer.iter().min().unwrap(); - let max = *as_integer.iter().max().unwrap(); - - format!("{}_{}_{}", name, min, max) - } else { - let mut name = format!("{}_", name); - for value in &possible_values { - name.push(value.chars().next().unwrap().to_ascii_lowercase()); - } - name - }; - - let new_name = Self::update_name(&new_name); - - map.insert( - new_name.to_owned(), - Self::prop_from_possible_values_and_name(new_name, name, possible_values), - ); - } - } - } - - map - } - - fn update_name(name: &str) -> &str { - match NAME_OVERRIDES.get(&name) { - Some(x) => *x, - None => name, - } - } - - fn prop_from_possible_values_and_name( - name: &str, - real_name: &str, - possible_values: Vec, - ) -> Property { - Property { - name: ident(name), - real_name: real_name.to_owned(), - _name_camel_case: ident(name.to_camel_case()), - kind: guess_property_kind(&possible_values, &name.to_camel_case()), - possible_values, - } - } -} - -/// Parses the vanilla blocks report, returning a `Blocks`. -pub(super) fn load() -> anyhow::Result { - let mut report = parse_report()?; - - let mut blocks = vec![]; - let properties = fix_property_names(&mut report); - - for (identifier, block) in &report.blocks { - if let Some(block) = load_block(identifier, block)? { - blocks.push(block); - } - } - - Ok(Blocks { - blocks, - property_types: properties.finish(), - }) -} - -fn fix_property_names(report: &mut BlocksReport) -> PropertyStore { - let mut store = PropertyStore::default(); - - for block in report.blocks.values() { - for (property_name, possible_values) in &block.properties { - store.register(property_name.to_owned(), possible_values.clone()); - } - } - - // Correct block property names - let result = store.clone().finish(); - - for block in report.blocks.values_mut() { - let block: &mut BlockDefinition = block; - let mut overrides = vec![]; - for (property_name, possible_values) in &mut block.properties { - if result.get(property_name).is_none() { - let name = if possible_values[0].parse::().is_ok() { - let as_integer = possible_values - .iter() - .map(String::as_str) - .map(i32::from_str) - .map(Result::unwrap) - .collect::>(); - - let min = *as_integer.iter().min().unwrap(); - let max = *as_integer.iter().max().unwrap(); - - format!("{}_{}_{}", property_name, min, max) - } else { - let mut name = format!("{}_", property_name); - for value in possible_values { - name.push(value.chars().next().unwrap().to_ascii_lowercase()); - } - name - }; - let name = if let Some(name) = NAME_OVERRIDES.get(&name.as_str()) { - (*name).to_owned() - } else { - name - }; - - overrides.push((property_name.to_owned(), name)); - } - } - - for (old_name, new_name) in overrides { - let old_values = block.properties.remove(&old_name).unwrap(); - block.properties.insert(new_name.clone(), old_values); - - for state in &mut block.states { - let old_value = state.properties.remove(&old_name).unwrap(); - state.properties.insert(new_name.clone(), old_value); - } - } - } - - store -} - -fn load_block(identifier: &str, block: &BlockDefinition) -> anyhow::Result> { - let identifier = strip_prefix(identifier)?; - - let name_camel_case = identifier.to_camel_case(); - - let properties = load_block_properties(block); - - let index_parameters = load_block_index_parameters(block, &properties); - - let ids = load_block_ids(block); - - let default_state = block - .states - .iter() - .find(|state| state.default) - .map(|state| state.properties.clone()) - .unwrap_or_default() - .into_iter() - .collect(); - - let block = Block { - name: ident(identifier), - name_camel_case: ident(name_camel_case), - properties, - ids, - default_state, - index_parameters, - }; - - Ok(Some(block)) -} - -fn load_block_properties(block: &BlockDefinition) -> Vec { - let mut props = vec![]; - - for identifier in block.properties.keys() { - props.push(identifier.to_owned()); - } - - props -} - -fn load_block_index_parameters( - block: &BlockDefinition, - block_props: &[String], -) -> BTreeMap { - let mut map = BTreeMap::new(); - - let possible_values = block_props - .iter() - .map(|block_prop| block.properties.get(block_prop).map(Vec::len).unwrap_or(0)) - .map(|x| x as u16) - .collect::>(); - - for (i, block_prop) in block_props.iter().enumerate() { - let stride = possible_values.iter().skip(i + 1).product::(); - let offset_coefficient = stride * possible_values[i]; - - map.insert(block_prop.clone(), (offset_coefficient, stride)); - } - - map -} - -fn load_block_ids(block: &BlockDefinition) -> Vec<(Vec<(String, String)>, u16)> { - let mut res: Vec<(Vec<(String, String)>, u16)> = vec![]; - - for state in &block.states { - let properties = state.properties.clone().into_iter().collect(); - - res.push((properties, state.id)); - } - - res -} - -fn guess_property_kind(possible_values: &[String], property_struct_name: &str) -> PropertyKind { - let first = &possible_values[0]; - - if i32::from_str(first).is_ok() { - // integer - let as_integer: Vec<_> = possible_values - .iter() - .map(|x| i32::from_str(x).unwrap()) - .collect(); - - let min = *as_integer.iter().min().unwrap(); - let max = *as_integer.iter().max().unwrap(); - - PropertyKind::Integer { range: min..=max } - } else if bool::from_str(first).is_ok() { - // boolean - PropertyKind::Boolean - } else { - // enum - let name = ident(property_struct_name); - let variants: Vec<_> = possible_values - .iter() - .map(|variant| variant.to_camel_case()) - .map(ident) - .collect(); - PropertyKind::Enum { name, variants } - } -} - -/// Strips the minecraft: prefix from a block identifier. -fn strip_prefix(x: &str) -> anyhow::Result<&str> { - const PREFIX: &str = "minecraft:"; - - if x.len() <= PREFIX.len() { - anyhow::bail!("missing minecraft: prefix for block {}", x); - } - - Ok(&x[PREFIX.len()..]) -} - -pub fn ident(x: impl AsRef) -> Ident { - Ident::new(x.as_ref(), Span::call_site()) // span doesn't matter as this is not a proc macro -} - -fn parse_report() -> anyhow::Result { - let report = std::fs::read_to_string("blocks.json") - .context("failed to load blocks report. Please run the vanilla data generator and copy blocks.json to the current directory")?; - - Ok(serde_json::from_str(&report)?) -} diff --git a/feather/blocks/generator/src/main.rs b/feather/blocks/generator/src/main.rs deleted file mode 100644 index 3f30d7e07..000000000 --- a/feather/blocks/generator/src/main.rs +++ /dev/null @@ -1,49 +0,0 @@ -use std::env; -use std::fs::File; -use std::io::Write; -use std::process::Command; - -fn main() { - match feather_blocks_generator::generate() { - Ok(code) => { - let base = concat!(env!("CARGO_MANIFEST_DIR"), "/../src/generated"); - - let _ = std::fs::create_dir_all(base); - - let block_fns = format!("{}/block_fns.rs", base); - let props = format!("{}/properties.rs", base); - let table = format!("{}/table.rs", base); - - write_to_file(&block_fns, &code.block_fns); - write_to_file(&props, &code.block_properties); - write_to_file(&table, &code.block_table); - - [block_fns, props, table].iter().for_each(|path| { - let _ = Command::new("rustfmt").arg(path).output(); - }); - - let data = format!("{}/table.dat", base); - File::create(&data) - .unwrap() - .write_all(&code.block_table_serialized) - .unwrap(); - - let data = format!("{}/vanilla_ids.dat", base); - File::create(&data) - .unwrap() - .write_all(&code.vanilla_ids_serialized) - .unwrap(); - } - Err(e) => { - eprintln!("An error occurred: {}", e); - std::process::exit(1); - } - } -} - -fn write_to_file(path: impl AsRef, s: impl AsRef) { - File::create(path.as_ref()) - .unwrap() - .write_all(s.as_ref().as_bytes()) - .unwrap(); -} diff --git a/feather/blocks/src/directions.rs b/feather/blocks/src/directions.rs deleted file mode 100644 index a4c9d164e..000000000 --- a/feather/blocks/src/directions.rs +++ /dev/null @@ -1,162 +0,0 @@ -use crate::{AxisXyz, FacingCardinal, FacingCardinalAndDown, FacingCubic}; -use vek::Vec3; - -impl FacingCardinal { - pub fn opposite(self) -> FacingCardinal { - match self { - FacingCardinal::North => FacingCardinal::South, - FacingCardinal::East => FacingCardinal::West, - FacingCardinal::South => FacingCardinal::North, - FacingCardinal::West => FacingCardinal::East, - } - } - - pub fn right(self) -> FacingCardinal { - match self { - FacingCardinal::North => FacingCardinal::East, - FacingCardinal::East => FacingCardinal::South, - FacingCardinal::South => FacingCardinal::West, - FacingCardinal::West => FacingCardinal::North, - } - } - - pub fn left(self) -> FacingCardinal { - match self { - FacingCardinal::North => FacingCardinal::West, - FacingCardinal::East => FacingCardinal::North, - FacingCardinal::South => FacingCardinal::East, - FacingCardinal::West => FacingCardinal::South, - } - } - - pub fn is_horizontal(self) -> bool { - true - } - - pub fn to_facing_cardinal_and_down(self) -> FacingCardinalAndDown { - match self { - FacingCardinal::North => FacingCardinalAndDown::North, - FacingCardinal::East => FacingCardinalAndDown::East, - FacingCardinal::South => FacingCardinalAndDown::South, - FacingCardinal::West => FacingCardinalAndDown::West, - } - } - - pub fn to_facing_cubic(self) -> FacingCubic { - match self { - FacingCardinal::North => FacingCubic::North, - FacingCardinal::East => FacingCubic::East, - FacingCardinal::South => FacingCubic::South, - FacingCardinal::West => FacingCubic::West, - } - } - - pub fn axis(self) -> AxisXyz { - self.to_facing_cubic().axis() - } - - pub fn offset(self) -> Vec3 { - self.to_facing_cubic().offset() - } -} - -impl FacingCardinalAndDown { - pub fn opposite(self) -> Option { - match self { - FacingCardinalAndDown::North => Some(FacingCardinalAndDown::South), - FacingCardinalAndDown::East => Some(FacingCardinalAndDown::West), - FacingCardinalAndDown::South => Some(FacingCardinalAndDown::North), - FacingCardinalAndDown::West => Some(FacingCardinalAndDown::East), - _ => None, - } - } - - pub fn is_horizontal(self) -> bool { - self != FacingCardinalAndDown::Down - } - - pub fn to_facing_cardinal(self) -> Option { - match self { - FacingCardinalAndDown::North => Some(FacingCardinal::North), - FacingCardinalAndDown::East => Some(FacingCardinal::East), - FacingCardinalAndDown::South => Some(FacingCardinal::South), - FacingCardinalAndDown::West => Some(FacingCardinal::West), - _ => None, - } - } - - pub fn to_facing_cubic(self) -> FacingCubic { - match self { - FacingCardinalAndDown::North => FacingCubic::North, - FacingCardinalAndDown::East => FacingCubic::East, - FacingCardinalAndDown::South => FacingCubic::South, - FacingCardinalAndDown::West => FacingCubic::West, - FacingCardinalAndDown::Down => FacingCubic::Down, - } - } - - pub fn axis(self) -> AxisXyz { - self.to_facing_cubic().axis() - } - - pub fn offset(self) -> Vec3 { - self.to_facing_cubic().offset() - } -} - -impl FacingCubic { - pub fn opposite(self) -> FacingCubic { - match self { - FacingCubic::North => FacingCubic::South, - FacingCubic::East => FacingCubic::West, - FacingCubic::South => FacingCubic::North, - FacingCubic::West => FacingCubic::East, - FacingCubic::Up => FacingCubic::Down, - FacingCubic::Down => FacingCubic::Up, - } - } - - pub fn is_horizontal(self) -> bool { - !matches!(self, FacingCubic::Up | FacingCubic::Down) - } - - pub fn to_facing_cardinal(self) -> Option { - match self { - FacingCubic::North => Some(FacingCardinal::North), - FacingCubic::East => Some(FacingCardinal::East), - FacingCubic::South => Some(FacingCardinal::South), - FacingCubic::West => Some(FacingCardinal::West), - _ => None, - } - } - - pub fn to_facing_cardinal_and_down(self) -> Option { - match self { - FacingCubic::North => Some(FacingCardinalAndDown::North), - FacingCubic::East => Some(FacingCardinalAndDown::East), - FacingCubic::South => Some(FacingCardinalAndDown::South), - FacingCubic::West => Some(FacingCardinalAndDown::West), - FacingCubic::Down => Some(FacingCardinalAndDown::Down), - _ => None, - } - } - - pub fn axis(self) -> AxisXyz { - match self { - FacingCubic::East | FacingCubic::West => AxisXyz::X, - FacingCubic::Up | FacingCubic::Down => AxisXyz::Y, - FacingCubic::North | FacingCubic::South => AxisXyz::Z, - } - } - - pub fn offset(self) -> Vec3 { - match self { - FacingCubic::North => Vec3 { x: 0, y: 0, z: -1 }, - FacingCubic::East => Vec3 { x: 1, y: 0, z: 0 }, - FacingCubic::South => Vec3 { x: 0, y: 0, z: 1 }, - FacingCubic::West => Vec3 { x: -1, y: 0, z: 0 }, - FacingCubic::Up => Vec3 { x: 0, y: 1, z: 0 }, - FacingCubic::Down => Vec3 { x: 0, y: -1, z: 0 }, - } - } -} diff --git a/feather/blocks/src/generated/block_fns.rs b/feather/blocks/src/generated/block_fns.rs deleted file mode 100644 index f3eaaa1ad..000000000 --- a/feather/blocks/src/generated/block_fns.rs +++ /dev/null @@ -1,29645 +0,0 @@ -use crate::*; -use std::collections::BTreeMap; -use std::str::FromStr; -impl BlockId { - #[doc = "Returns an instance of `air` with default state values."] - pub fn air() -> Self { - let mut block = Self { - kind: BlockKind::Air, - state: 0, - }; - block - } - #[doc = "Returns an instance of `stone` with default state values."] - pub fn stone() -> Self { - let mut block = Self { - kind: BlockKind::Stone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `granite` with default state values."] - pub fn granite() -> Self { - let mut block = Self { - kind: BlockKind::Granite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_granite` with default state values."] - pub fn polished_granite() -> Self { - let mut block = Self { - kind: BlockKind::PolishedGranite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `diorite` with default state values."] - pub fn diorite() -> Self { - let mut block = Self { - kind: BlockKind::Diorite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_diorite` with default state values."] - pub fn polished_diorite() -> Self { - let mut block = Self { - kind: BlockKind::PolishedDiorite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `andesite` with default state values."] - pub fn andesite() -> Self { - let mut block = Self { - kind: BlockKind::Andesite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_andesite` with default state values."] - pub fn polished_andesite() -> Self { - let mut block = Self { - kind: BlockKind::PolishedAndesite, - state: 0, - }; - block - } - #[doc = "Returns an instance of `grass_block` with default state values.\nThe default state values are as follows:\n* `snowy`: false\n"] - pub fn grass_block() -> Self { - let mut block = Self { - kind: BlockKind::GrassBlock, - state: 0, - }; - block.set_snowy(false); - block - } - #[doc = "Returns an instance of `dirt` with default state values."] - pub fn dirt() -> Self { - let mut block = Self { - kind: BlockKind::Dirt, - state: 0, - }; - block - } - #[doc = "Returns an instance of `coarse_dirt` with default state values."] - pub fn coarse_dirt() -> Self { - let mut block = Self { - kind: BlockKind::CoarseDirt, - state: 0, - }; - block - } - #[doc = "Returns an instance of `podzol` with default state values.\nThe default state values are as follows:\n* `snowy`: false\n"] - pub fn podzol() -> Self { - let mut block = Self { - kind: BlockKind::Podzol, - state: 0, - }; - block.set_snowy(false); - block - } - #[doc = "Returns an instance of `cobblestone` with default state values."] - pub fn cobblestone() -> Self { - let mut block = Self { - kind: BlockKind::Cobblestone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oak_planks` with default state values."] - pub fn oak_planks() -> Self { - let mut block = Self { - kind: BlockKind::OakPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `spruce_planks` with default state values."] - pub fn spruce_planks() -> Self { - let mut block = Self { - kind: BlockKind::SprucePlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `birch_planks` with default state values."] - pub fn birch_planks() -> Self { - let mut block = Self { - kind: BlockKind::BirchPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `jungle_planks` with default state values."] - pub fn jungle_planks() -> Self { - let mut block = Self { - kind: BlockKind::JunglePlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `acacia_planks` with default state values."] - pub fn acacia_planks() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dark_oak_planks` with default state values."] - pub fn dark_oak_planks() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oak_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn oak_sapling() -> Self { - let mut block = Self { - kind: BlockKind::OakSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `spruce_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn spruce_sapling() -> Self { - let mut block = Self { - kind: BlockKind::SpruceSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `birch_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn birch_sapling() -> Self { - let mut block = Self { - kind: BlockKind::BirchSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `jungle_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn jungle_sapling() -> Self { - let mut block = Self { - kind: BlockKind::JungleSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `acacia_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn acacia_sapling() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `dark_oak_sapling` with default state values.\nThe default state values are as follows:\n* `stage`: 0\n"] - pub fn dark_oak_sapling() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakSapling, - state: 0, - }; - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `bedrock` with default state values."] - pub fn bedrock() -> Self { - let mut block = Self { - kind: BlockKind::Bedrock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `water` with default state values.\nThe default state values are as follows:\n* `water_level`: 0\n"] - pub fn water() -> Self { - let mut block = Self { - kind: BlockKind::Water, - state: 0, - }; - block.set_water_level(0i32); - block - } - #[doc = "Returns an instance of `lava` with default state values.\nThe default state values are as follows:\n* `water_level`: 0\n"] - pub fn lava() -> Self { - let mut block = Self { - kind: BlockKind::Lava, - state: 0, - }; - block.set_water_level(0i32); - block - } - #[doc = "Returns an instance of `sand` with default state values."] - pub fn sand() -> Self { - let mut block = Self { - kind: BlockKind::Sand, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_sand` with default state values."] - pub fn red_sand() -> Self { - let mut block = Self { - kind: BlockKind::RedSand, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gravel` with default state values."] - pub fn gravel() -> Self { - let mut block = Self { - kind: BlockKind::Gravel, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gold_ore` with default state values."] - pub fn gold_ore() -> Self { - let mut block = Self { - kind: BlockKind::GoldOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `iron_ore` with default state values."] - pub fn iron_ore() -> Self { - let mut block = Self { - kind: BlockKind::IronOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `coal_ore` with default state values."] - pub fn coal_ore() -> Self { - let mut block = Self { - kind: BlockKind::CoalOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_gold_ore` with default state values."] - pub fn nether_gold_ore() -> Self { - let mut block = Self { - kind: BlockKind::NetherGoldOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oak_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn oak_log() -> Self { - let mut block = Self { - kind: BlockKind::OakLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `spruce_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn spruce_log() -> Self { - let mut block = Self { - kind: BlockKind::SpruceLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `birch_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn birch_log() -> Self { - let mut block = Self { - kind: BlockKind::BirchLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `jungle_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn jungle_log() -> Self { - let mut block = Self { - kind: BlockKind::JungleLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `acacia_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn acacia_log() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `dark_oak_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn dark_oak_log() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_spruce_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_spruce_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedSpruceLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_birch_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_birch_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedBirchLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_jungle_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_jungle_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedJungleLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_acacia_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_acacia_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedAcaciaLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_dark_oak_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_dark_oak_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedDarkOakLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_oak_log` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_oak_log() -> Self { - let mut block = Self { - kind: BlockKind::StrippedOakLog, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `oak_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn oak_wood() -> Self { - let mut block = Self { - kind: BlockKind::OakWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `spruce_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn spruce_wood() -> Self { - let mut block = Self { - kind: BlockKind::SpruceWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `birch_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn birch_wood() -> Self { - let mut block = Self { - kind: BlockKind::BirchWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `jungle_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn jungle_wood() -> Self { - let mut block = Self { - kind: BlockKind::JungleWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `acacia_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn acacia_wood() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `dark_oak_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn dark_oak_wood() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_oak_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_oak_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedOakWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_spruce_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_spruce_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedSpruceWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_birch_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_birch_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedBirchWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_jungle_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_jungle_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedJungleWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_acacia_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_acacia_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedAcaciaWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_dark_oak_wood` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_dark_oak_wood() -> Self { - let mut block = Self { - kind: BlockKind::StrippedDarkOakWood, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `oak_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn oak_leaves() -> Self { - let mut block = Self { - kind: BlockKind::OakLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `spruce_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn spruce_leaves() -> Self { - let mut block = Self { - kind: BlockKind::SpruceLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `birch_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn birch_leaves() -> Self { - let mut block = Self { - kind: BlockKind::BirchLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `jungle_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn jungle_leaves() -> Self { - let mut block = Self { - kind: BlockKind::JungleLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `acacia_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn acacia_leaves() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `dark_oak_leaves` with default state values.\nThe default state values are as follows:\n* `distance_1_7`: 7\n* `persistent`: false\n"] - pub fn dark_oak_leaves() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakLeaves, - state: 0, - }; - block.set_distance_1_7(7i32); - block.set_persistent(false); - block - } - #[doc = "Returns an instance of `sponge` with default state values."] - pub fn sponge() -> Self { - let mut block = Self { - kind: BlockKind::Sponge, - state: 0, - }; - block - } - #[doc = "Returns an instance of `wet_sponge` with default state values."] - pub fn wet_sponge() -> Self { - let mut block = Self { - kind: BlockKind::WetSponge, - state: 0, - }; - block - } - #[doc = "Returns an instance of `glass` with default state values."] - pub fn glass() -> Self { - let mut block = Self { - kind: BlockKind::Glass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lapis_ore` with default state values."] - pub fn lapis_ore() -> Self { - let mut block = Self { - kind: BlockKind::LapisOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lapis_block` with default state values."] - pub fn lapis_block() -> Self { - let mut block = Self { - kind: BlockKind::LapisBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dispenser` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: north\n* `triggered`: false\n"] - pub fn dispenser() -> Self { - let mut block = Self { - kind: BlockKind::Dispenser, - state: 0, - }; - block.set_facing_cubic(FacingCubic::North); - block.set_triggered(false); - block - } - #[doc = "Returns an instance of `sandstone` with default state values."] - pub fn sandstone() -> Self { - let mut block = Self { - kind: BlockKind::Sandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `chiseled_sandstone` with default state values."] - pub fn chiseled_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cut_sandstone` with default state values."] - pub fn cut_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::CutSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `note_block` with default state values.\nThe default state values are as follows:\n* `instrument`: harp\n* `note`: 0\n* `powered`: false\n"] - pub fn note_block() -> Self { - let mut block = Self { - kind: BlockKind::NoteBlock, - state: 0, - }; - block.set_instrument(Instrument::Harp); - block.set_note(0i32); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `white_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn white_bed() -> Self { - let mut block = Self { - kind: BlockKind::WhiteBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `orange_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn orange_bed() -> Self { - let mut block = Self { - kind: BlockKind::OrangeBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `magenta_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn magenta_bed() -> Self { - let mut block = Self { - kind: BlockKind::MagentaBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `light_blue_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn light_blue_bed() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `yellow_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn yellow_bed() -> Self { - let mut block = Self { - kind: BlockKind::YellowBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `lime_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn lime_bed() -> Self { - let mut block = Self { - kind: BlockKind::LimeBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `pink_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn pink_bed() -> Self { - let mut block = Self { - kind: BlockKind::PinkBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `gray_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn gray_bed() -> Self { - let mut block = Self { - kind: BlockKind::GrayBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `light_gray_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn light_gray_bed() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `cyan_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn cyan_bed() -> Self { - let mut block = Self { - kind: BlockKind::CyanBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `purple_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn purple_bed() -> Self { - let mut block = Self { - kind: BlockKind::PurpleBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `blue_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn blue_bed() -> Self { - let mut block = Self { - kind: BlockKind::BlueBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `brown_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn brown_bed() -> Self { - let mut block = Self { - kind: BlockKind::BrownBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `green_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn green_bed() -> Self { - let mut block = Self { - kind: BlockKind::GreenBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `red_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn red_bed() -> Self { - let mut block = Self { - kind: BlockKind::RedBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `black_bed` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `occupied`: false\n* `part`: foot\n"] - pub fn black_bed() -> Self { - let mut block = Self { - kind: BlockKind::BlackBed, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_occupied(false); - block.set_part(Part::Foot); - block - } - #[doc = "Returns an instance of `powered_rail` with default state values.\nThe default state values are as follows:\n* `powered`: false\n* `powered_rail_shape`: north_south\n"] - pub fn powered_rail() -> Self { - let mut block = Self { - kind: BlockKind::PoweredRail, - state: 0, - }; - block.set_powered(false); - block.set_powered_rail_shape(PoweredRailShape::NorthSouth); - block - } - #[doc = "Returns an instance of `detector_rail` with default state values.\nThe default state values are as follows:\n* `powered`: false\n* `powered_rail_shape`: north_south\n"] - pub fn detector_rail() -> Self { - let mut block = Self { - kind: BlockKind::DetectorRail, - state: 0, - }; - block.set_powered(false); - block.set_powered_rail_shape(PoweredRailShape::NorthSouth); - block - } - #[doc = "Returns an instance of `sticky_piston` with default state values.\nThe default state values are as follows:\n* `extended`: false\n* `facing_cubic`: north\n"] - pub fn sticky_piston() -> Self { - let mut block = Self { - kind: BlockKind::StickyPiston, - state: 0, - }; - block.set_extended(false); - block.set_facing_cubic(FacingCubic::North); - block - } - #[doc = "Returns an instance of `cobweb` with default state values."] - pub fn cobweb() -> Self { - let mut block = Self { - kind: BlockKind::Cobweb, - state: 0, - }; - block - } - #[doc = "Returns an instance of `grass` with default state values."] - pub fn grass() -> Self { - let mut block = Self { - kind: BlockKind::Grass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `fern` with default state values."] - pub fn fern() -> Self { - let mut block = Self { - kind: BlockKind::Fern, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_bush` with default state values."] - pub fn dead_bush() -> Self { - let mut block = Self { - kind: BlockKind::DeadBush, - state: 0, - }; - block - } - #[doc = "Returns an instance of `seagrass` with default state values."] - pub fn seagrass() -> Self { - let mut block = Self { - kind: BlockKind::Seagrass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `tall_seagrass` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn tall_seagrass() -> Self { - let mut block = Self { - kind: BlockKind::TallSeagrass, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `piston` with default state values.\nThe default state values are as follows:\n* `extended`: false\n* `facing_cubic`: north\n"] - pub fn piston() -> Self { - let mut block = Self { - kind: BlockKind::Piston, - state: 0, - }; - block.set_extended(false); - block.set_facing_cubic(FacingCubic::North); - block - } - #[doc = "Returns an instance of `piston_head` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: north\n* `piston_kind`: normal\n* `short`: false\n"] - pub fn piston_head() -> Self { - let mut block = Self { - kind: BlockKind::PistonHead, - state: 0, - }; - block.set_facing_cubic(FacingCubic::North); - block.set_piston_kind(PistonKind::Normal); - block.set_short(false); - block - } - #[doc = "Returns an instance of `white_wool` with default state values."] - pub fn white_wool() -> Self { - let mut block = Self { - kind: BlockKind::WhiteWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_wool` with default state values."] - pub fn orange_wool() -> Self { - let mut block = Self { - kind: BlockKind::OrangeWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_wool` with default state values."] - pub fn magenta_wool() -> Self { - let mut block = Self { - kind: BlockKind::MagentaWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_wool` with default state values."] - pub fn light_blue_wool() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_wool` with default state values."] - pub fn yellow_wool() -> Self { - let mut block = Self { - kind: BlockKind::YellowWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_wool` with default state values."] - pub fn lime_wool() -> Self { - let mut block = Self { - kind: BlockKind::LimeWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_wool` with default state values."] - pub fn pink_wool() -> Self { - let mut block = Self { - kind: BlockKind::PinkWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_wool` with default state values."] - pub fn gray_wool() -> Self { - let mut block = Self { - kind: BlockKind::GrayWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_wool` with default state values."] - pub fn light_gray_wool() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_wool` with default state values."] - pub fn cyan_wool() -> Self { - let mut block = Self { - kind: BlockKind::CyanWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_wool` with default state values."] - pub fn purple_wool() -> Self { - let mut block = Self { - kind: BlockKind::PurpleWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_wool` with default state values."] - pub fn blue_wool() -> Self { - let mut block = Self { - kind: BlockKind::BlueWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_wool` with default state values."] - pub fn brown_wool() -> Self { - let mut block = Self { - kind: BlockKind::BrownWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_wool` with default state values."] - pub fn green_wool() -> Self { - let mut block = Self { - kind: BlockKind::GreenWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_wool` with default state values."] - pub fn red_wool() -> Self { - let mut block = Self { - kind: BlockKind::RedWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_wool` with default state values."] - pub fn black_wool() -> Self { - let mut block = Self { - kind: BlockKind::BlackWool, - state: 0, - }; - block - } - #[doc = "Returns an instance of `moving_piston` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: north\n* `piston_kind`: normal\n"] - pub fn moving_piston() -> Self { - let mut block = Self { - kind: BlockKind::MovingPiston, - state: 0, - }; - block.set_facing_cubic(FacingCubic::North); - block.set_piston_kind(PistonKind::Normal); - block - } - #[doc = "Returns an instance of `dandelion` with default state values."] - pub fn dandelion() -> Self { - let mut block = Self { - kind: BlockKind::Dandelion, - state: 0, - }; - block - } - #[doc = "Returns an instance of `poppy` with default state values."] - pub fn poppy() -> Self { - let mut block = Self { - kind: BlockKind::Poppy, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_orchid` with default state values."] - pub fn blue_orchid() -> Self { - let mut block = Self { - kind: BlockKind::BlueOrchid, - state: 0, - }; - block - } - #[doc = "Returns an instance of `allium` with default state values."] - pub fn allium() -> Self { - let mut block = Self { - kind: BlockKind::Allium, - state: 0, - }; - block - } - #[doc = "Returns an instance of `azure_bluet` with default state values."] - pub fn azure_bluet() -> Self { - let mut block = Self { - kind: BlockKind::AzureBluet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_tulip` with default state values."] - pub fn red_tulip() -> Self { - let mut block = Self { - kind: BlockKind::RedTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_tulip` with default state values."] - pub fn orange_tulip() -> Self { - let mut block = Self { - kind: BlockKind::OrangeTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `white_tulip` with default state values."] - pub fn white_tulip() -> Self { - let mut block = Self { - kind: BlockKind::WhiteTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_tulip` with default state values."] - pub fn pink_tulip() -> Self { - let mut block = Self { - kind: BlockKind::PinkTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oxeye_daisy` with default state values."] - pub fn oxeye_daisy() -> Self { - let mut block = Self { - kind: BlockKind::OxeyeDaisy, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cornflower` with default state values."] - pub fn cornflower() -> Self { - let mut block = Self { - kind: BlockKind::Cornflower, - state: 0, - }; - block - } - #[doc = "Returns an instance of `wither_rose` with default state values."] - pub fn wither_rose() -> Self { - let mut block = Self { - kind: BlockKind::WitherRose, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lily_of_the_valley` with default state values."] - pub fn lily_of_the_valley() -> Self { - let mut block = Self { - kind: BlockKind::LilyOfTheValley, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_mushroom` with default state values."] - pub fn brown_mushroom() -> Self { - let mut block = Self { - kind: BlockKind::BrownMushroom, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_mushroom` with default state values."] - pub fn red_mushroom() -> Self { - let mut block = Self { - kind: BlockKind::RedMushroom, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gold_block` with default state values."] - pub fn gold_block() -> Self { - let mut block = Self { - kind: BlockKind::GoldBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `iron_block` with default state values."] - pub fn iron_block() -> Self { - let mut block = Self { - kind: BlockKind::IronBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `bricks` with default state values."] - pub fn bricks() -> Self { - let mut block = Self { - kind: BlockKind::Bricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `tnt` with default state values.\nThe default state values are as follows:\n* `unstable`: false\n"] - pub fn tnt() -> Self { - let mut block = Self { - kind: BlockKind::Tnt, - state: 0, - }; - block.set_unstable(false); - block - } - #[doc = "Returns an instance of `bookshelf` with default state values."] - pub fn bookshelf() -> Self { - let mut block = Self { - kind: BlockKind::Bookshelf, - state: 0, - }; - block - } - #[doc = "Returns an instance of `mossy_cobblestone` with default state values."] - pub fn mossy_cobblestone() -> Self { - let mut block = Self { - kind: BlockKind::MossyCobblestone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `obsidian` with default state values."] - pub fn obsidian() -> Self { - let mut block = Self { - kind: BlockKind::Obsidian, - state: 0, - }; - block - } - #[doc = "Returns an instance of `torch` with default state values."] - pub fn torch() -> Self { - let mut block = Self { - kind: BlockKind::Torch, - state: 0, - }; - block - } - #[doc = "Returns an instance of `wall_torch` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn wall_torch() -> Self { - let mut block = Self { - kind: BlockKind::WallTorch, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `fire` with default state values.\nThe default state values are as follows:\n* `age_0_15`: 0\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `up`: false\n* `west_connected`: false\n"] - pub fn fire() -> Self { - let mut block = Self { - kind: BlockKind::Fire, - state: 0, - }; - block.set_age_0_15(0i32); - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_up(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `soul_fire` with default state values."] - pub fn soul_fire() -> Self { - let mut block = Self { - kind: BlockKind::SoulFire, - state: 0, - }; - block - } - #[doc = "Returns an instance of `spawner` with default state values."] - pub fn spawner() -> Self { - let mut block = Self { - kind: BlockKind::Spawner, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oak_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn oak_stairs() -> Self { - let mut block = Self { - kind: BlockKind::OakStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `chest` with default state values.\nThe default state values are as follows:\n* `chest_kind`: single\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn chest() -> Self { - let mut block = Self { - kind: BlockKind::Chest, - state: 0, - }; - block.set_chest_kind(ChestKind::Single); - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `redstone_wire` with default state values.\nThe default state values are as follows:\n* `east_wire`: none\n* `north_wire`: none\n* `power`: 0\n* `south_wire`: none\n* `west_wire`: none\n"] - pub fn redstone_wire() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneWire, - state: 0, - }; - block.set_east_wire(EastWire::None); - block.set_north_wire(NorthWire::None); - block.set_power(0i32); - block.set_south_wire(SouthWire::None); - block.set_west_wire(WestWire::None); - block - } - #[doc = "Returns an instance of `diamond_ore` with default state values."] - pub fn diamond_ore() -> Self { - let mut block = Self { - kind: BlockKind::DiamondOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `diamond_block` with default state values."] - pub fn diamond_block() -> Self { - let mut block = Self { - kind: BlockKind::DiamondBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crafting_table` with default state values."] - pub fn crafting_table() -> Self { - let mut block = Self { - kind: BlockKind::CraftingTable, - state: 0, - }; - block - } - #[doc = "Returns an instance of `wheat` with default state values.\nThe default state values are as follows:\n* `age_0_7`: 0\n"] - pub fn wheat() -> Self { - let mut block = Self { - kind: BlockKind::Wheat, - state: 0, - }; - block.set_age_0_7(0i32); - block - } - #[doc = "Returns an instance of `farmland` with default state values.\nThe default state values are as follows:\n* `moisture`: 0\n"] - pub fn farmland() -> Self { - let mut block = Self { - kind: BlockKind::Farmland, - state: 0, - }; - block.set_moisture(0i32); - block - } - #[doc = "Returns an instance of `furnace` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: false\n"] - pub fn furnace() -> Self { - let mut block = Self { - kind: BlockKind::Furnace, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(false); - block - } - #[doc = "Returns an instance of `oak_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn oak_sign() -> Self { - let mut block = Self { - kind: BlockKind::OakSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `spruce_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn spruce_sign() -> Self { - let mut block = Self { - kind: BlockKind::SpruceSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `birch_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn birch_sign() -> Self { - let mut block = Self { - kind: BlockKind::BirchSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `acacia_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn acacia_sign() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `jungle_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn jungle_sign() -> Self { - let mut block = Self { - kind: BlockKind::JungleSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_oak_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn dark_oak_sign() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `oak_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn oak_door() -> Self { - let mut block = Self { - kind: BlockKind::OakDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `ladder` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn ladder() -> Self { - let mut block = Self { - kind: BlockKind::Ladder, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `rail` with default state values.\nThe default state values are as follows:\n* `rail_shape`: north_south\n"] - pub fn rail() -> Self { - let mut block = Self { - kind: BlockKind::Rail, - state: 0, - }; - block.set_rail_shape(RailShape::NorthSouth); - block - } - #[doc = "Returns an instance of `cobblestone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn cobblestone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::CobblestoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `oak_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn oak_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::OakWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `spruce_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn spruce_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::SpruceWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `birch_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn birch_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::BirchWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `acacia_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn acacia_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `jungle_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn jungle_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::JungleWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_oak_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn dark_oak_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `lever` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn lever() -> Self { - let mut block = Self { - kind: BlockKind::Lever, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `stone_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn stone_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::StonePressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `iron_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn iron_door() -> Self { - let mut block = Self { - kind: BlockKind::IronDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `oak_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn oak_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::OakPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `spruce_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn spruce_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::SprucePressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `birch_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn birch_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::BirchPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `jungle_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn jungle_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::JunglePressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `acacia_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn acacia_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `dark_oak_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn dark_oak_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `redstone_ore` with default state values.\nThe default state values are as follows:\n* `lit`: false\n"] - pub fn redstone_ore() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneOre, - state: 0, - }; - block.set_lit(false); - block - } - #[doc = "Returns an instance of `redstone_torch` with default state values.\nThe default state values are as follows:\n* `lit`: true\n"] - pub fn redstone_torch() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneTorch, - state: 0, - }; - block.set_lit(true); - block - } - #[doc = "Returns an instance of `redstone_wall_torch` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: true\n"] - pub fn redstone_wall_torch() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneWallTorch, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(true); - block - } - #[doc = "Returns an instance of `stone_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn stone_button() -> Self { - let mut block = Self { - kind: BlockKind::StoneButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `snow` with default state values.\nThe default state values are as follows:\n* `layers`: 1\n"] - pub fn snow() -> Self { - let mut block = Self { - kind: BlockKind::Snow, - state: 0, - }; - block.set_layers(1i32); - block - } - #[doc = "Returns an instance of `ice` with default state values."] - pub fn ice() -> Self { - let mut block = Self { - kind: BlockKind::Ice, - state: 0, - }; - block - } - #[doc = "Returns an instance of `snow_block` with default state values."] - pub fn snow_block() -> Self { - let mut block = Self { - kind: BlockKind::SnowBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cactus` with default state values.\nThe default state values are as follows:\n* `age_0_15`: 0\n"] - pub fn cactus() -> Self { - let mut block = Self { - kind: BlockKind::Cactus, - state: 0, - }; - block.set_age_0_15(0i32); - block - } - #[doc = "Returns an instance of `clay` with default state values."] - pub fn clay() -> Self { - let mut block = Self { - kind: BlockKind::Clay, - state: 0, - }; - block - } - #[doc = "Returns an instance of `sugar_cane` with default state values.\nThe default state values are as follows:\n* `age_0_15`: 0\n"] - pub fn sugar_cane() -> Self { - let mut block = Self { - kind: BlockKind::SugarCane, - state: 0, - }; - block.set_age_0_15(0i32); - block - } - #[doc = "Returns an instance of `jukebox` with default state values.\nThe default state values are as follows:\n* `has_record`: false\n"] - pub fn jukebox() -> Self { - let mut block = Self { - kind: BlockKind::Jukebox, - state: 0, - }; - block.set_has_record(false); - block - } - #[doc = "Returns an instance of `oak_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn oak_fence() -> Self { - let mut block = Self { - kind: BlockKind::OakFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `pumpkin` with default state values."] - pub fn pumpkin() -> Self { - let mut block = Self { - kind: BlockKind::Pumpkin, - state: 0, - }; - block - } - #[doc = "Returns an instance of `netherrack` with default state values."] - pub fn netherrack() -> Self { - let mut block = Self { - kind: BlockKind::Netherrack, - state: 0, - }; - block - } - #[doc = "Returns an instance of `soul_sand` with default state values."] - pub fn soul_sand() -> Self { - let mut block = Self { - kind: BlockKind::SoulSand, - state: 0, - }; - block - } - #[doc = "Returns an instance of `soul_soil` with default state values."] - pub fn soul_soil() -> Self { - let mut block = Self { - kind: BlockKind::SoulSoil, - state: 0, - }; - block - } - #[doc = "Returns an instance of `basalt` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn basalt() -> Self { - let mut block = Self { - kind: BlockKind::Basalt, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `polished_basalt` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn polished_basalt() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBasalt, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `soul_torch` with default state values."] - pub fn soul_torch() -> Self { - let mut block = Self { - kind: BlockKind::SoulTorch, - state: 0, - }; - block - } - #[doc = "Returns an instance of `soul_wall_torch` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn soul_wall_torch() -> Self { - let mut block = Self { - kind: BlockKind::SoulWallTorch, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `glowstone` with default state values."] - pub fn glowstone() -> Self { - let mut block = Self { - kind: BlockKind::Glowstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_portal` with default state values.\nThe default state values are as follows:\n* `axis_xz`: x\n"] - pub fn nether_portal() -> Self { - let mut block = Self { - kind: BlockKind::NetherPortal, - state: 0, - }; - block.set_axis_xz(AxisXz::X); - block - } - #[doc = "Returns an instance of `carved_pumpkin` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn carved_pumpkin() -> Self { - let mut block = Self { - kind: BlockKind::CarvedPumpkin, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `jack_o_lantern` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn jack_o_lantern() -> Self { - let mut block = Self { - kind: BlockKind::JackOLantern, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `cake` with default state values.\nThe default state values are as follows:\n* `bites`: 0\n"] - pub fn cake() -> Self { - let mut block = Self { - kind: BlockKind::Cake, - state: 0, - }; - block.set_bites(0i32); - block - } - #[doc = "Returns an instance of `repeater` with default state values.\nThe default state values are as follows:\n* `delay`: 1\n* `facing_cardinal`: north\n* `locked`: false\n* `powered`: false\n"] - pub fn repeater() -> Self { - let mut block = Self { - kind: BlockKind::Repeater, - state: 0, - }; - block.set_delay(1i32); - block.set_facing_cardinal(FacingCardinal::North); - block.set_locked(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `white_stained_glass` with default state values."] - pub fn white_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::WhiteStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_stained_glass` with default state values."] - pub fn orange_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::OrangeStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_stained_glass` with default state values."] - pub fn magenta_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::MagentaStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_stained_glass` with default state values."] - pub fn light_blue_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_stained_glass` with default state values."] - pub fn yellow_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::YellowStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_stained_glass` with default state values."] - pub fn lime_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::LimeStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_stained_glass` with default state values."] - pub fn pink_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::PinkStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_stained_glass` with default state values."] - pub fn gray_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::GrayStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_stained_glass` with default state values."] - pub fn light_gray_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_stained_glass` with default state values."] - pub fn cyan_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::CyanStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_stained_glass` with default state values."] - pub fn purple_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::PurpleStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_stained_glass` with default state values."] - pub fn blue_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::BlueStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_stained_glass` with default state values."] - pub fn brown_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::BrownStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_stained_glass` with default state values."] - pub fn green_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::GreenStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_stained_glass` with default state values."] - pub fn red_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::RedStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_stained_glass` with default state values."] - pub fn black_stained_glass() -> Self { - let mut block = Self { - kind: BlockKind::BlackStainedGlass, - state: 0, - }; - block - } - #[doc = "Returns an instance of `oak_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn oak_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::OakTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `spruce_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn spruce_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::SpruceTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `birch_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn birch_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::BirchTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `jungle_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn jungle_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::JungleTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `acacia_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn acacia_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_oak_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn dark_oak_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `stone_bricks` with default state values."] - pub fn stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::StoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `mossy_stone_bricks` with default state values."] - pub fn mossy_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::MossyStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cracked_stone_bricks` with default state values."] - pub fn cracked_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::CrackedStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `chiseled_stone_bricks` with default state values."] - pub fn chiseled_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_stone` with default state values."] - pub fn infested_stone() -> Self { - let mut block = Self { - kind: BlockKind::InfestedStone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_cobblestone` with default state values."] - pub fn infested_cobblestone() -> Self { - let mut block = Self { - kind: BlockKind::InfestedCobblestone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_stone_bricks` with default state values."] - pub fn infested_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::InfestedStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_mossy_stone_bricks` with default state values."] - pub fn infested_mossy_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::InfestedMossyStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_cracked_stone_bricks` with default state values."] - pub fn infested_cracked_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::InfestedCrackedStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `infested_chiseled_stone_bricks` with default state values."] - pub fn infested_chiseled_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::InfestedChiseledStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_mushroom_block` with default state values.\nThe default state values are as follows:\n* `down`: true\n* `east_connected`: true\n* `north_connected`: true\n* `south_connected`: true\n* `up`: true\n* `west_connected`: true\n"] - pub fn brown_mushroom_block() -> Self { - let mut block = Self { - kind: BlockKind::BrownMushroomBlock, - state: 0, - }; - block.set_down(true); - block.set_east_connected(true); - block.set_north_connected(true); - block.set_south_connected(true); - block.set_up(true); - block.set_west_connected(true); - block - } - #[doc = "Returns an instance of `red_mushroom_block` with default state values.\nThe default state values are as follows:\n* `down`: true\n* `east_connected`: true\n* `north_connected`: true\n* `south_connected`: true\n* `up`: true\n* `west_connected`: true\n"] - pub fn red_mushroom_block() -> Self { - let mut block = Self { - kind: BlockKind::RedMushroomBlock, - state: 0, - }; - block.set_down(true); - block.set_east_connected(true); - block.set_north_connected(true); - block.set_south_connected(true); - block.set_up(true); - block.set_west_connected(true); - block - } - #[doc = "Returns an instance of `mushroom_stem` with default state values.\nThe default state values are as follows:\n* `down`: true\n* `east_connected`: true\n* `north_connected`: true\n* `south_connected`: true\n* `up`: true\n* `west_connected`: true\n"] - pub fn mushroom_stem() -> Self { - let mut block = Self { - kind: BlockKind::MushroomStem, - state: 0, - }; - block.set_down(true); - block.set_east_connected(true); - block.set_north_connected(true); - block.set_south_connected(true); - block.set_up(true); - block.set_west_connected(true); - block - } - #[doc = "Returns an instance of `iron_bars` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn iron_bars() -> Self { - let mut block = Self { - kind: BlockKind::IronBars, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `chain` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n* `waterlogged`: false\n"] - pub fn chain() -> Self { - let mut block = Self { - kind: BlockKind::Chain, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::GlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `melon` with default state values."] - pub fn melon() -> Self { - let mut block = Self { - kind: BlockKind::Melon, - state: 0, - }; - block - } - #[doc = "Returns an instance of `attached_pumpkin_stem` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn attached_pumpkin_stem() -> Self { - let mut block = Self { - kind: BlockKind::AttachedPumpkinStem, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `attached_melon_stem` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn attached_melon_stem() -> Self { - let mut block = Self { - kind: BlockKind::AttachedMelonStem, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `pumpkin_stem` with default state values.\nThe default state values are as follows:\n* `age_0_7`: 0\n"] - pub fn pumpkin_stem() -> Self { - let mut block = Self { - kind: BlockKind::PumpkinStem, - state: 0, - }; - block.set_age_0_7(0i32); - block - } - #[doc = "Returns an instance of `melon_stem` with default state values.\nThe default state values are as follows:\n* `age_0_7`: 0\n"] - pub fn melon_stem() -> Self { - let mut block = Self { - kind: BlockKind::MelonStem, - state: 0, - }; - block.set_age_0_7(0i32); - block - } - #[doc = "Returns an instance of `vine` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `up`: false\n* `west_connected`: false\n"] - pub fn vine() -> Self { - let mut block = Self { - kind: BlockKind::Vine, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_up(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `oak_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn oak_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::OakFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::BrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `stone_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn stone_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::StoneBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `mycelium` with default state values.\nThe default state values are as follows:\n* `snowy`: false\n"] - pub fn mycelium() -> Self { - let mut block = Self { - kind: BlockKind::Mycelium, - state: 0, - }; - block.set_snowy(false); - block - } - #[doc = "Returns an instance of `lily_pad` with default state values."] - pub fn lily_pad() -> Self { - let mut block = Self { - kind: BlockKind::LilyPad, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_bricks` with default state values."] - pub fn nether_bricks() -> Self { - let mut block = Self { - kind: BlockKind::NetherBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_brick_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn nether_brick_fence() -> Self { - let mut block = Self { - kind: BlockKind::NetherBrickFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `nether_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn nether_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::NetherBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `nether_wart` with default state values.\nThe default state values are as follows:\n* `age_0_3`: 0\n"] - pub fn nether_wart() -> Self { - let mut block = Self { - kind: BlockKind::NetherWart, - state: 0, - }; - block.set_age_0_3(0i32); - block - } - #[doc = "Returns an instance of `enchanting_table` with default state values."] - pub fn enchanting_table() -> Self { - let mut block = Self { - kind: BlockKind::EnchantingTable, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brewing_stand` with default state values.\nThe default state values are as follows:\n* `has_bottle_0`: false\n* `has_bottle_1`: false\n* `has_bottle_2`: false\n"] - pub fn brewing_stand() -> Self { - let mut block = Self { - kind: BlockKind::BrewingStand, - state: 0, - }; - block.set_has_bottle_0(false); - block.set_has_bottle_1(false); - block.set_has_bottle_2(false); - block - } - #[doc = "Returns an instance of `cauldron` with default state values.\nThe default state values are as follows:\n* `cauldron_level`: 0\n"] - pub fn cauldron() -> Self { - let mut block = Self { - kind: BlockKind::Cauldron, - state: 0, - }; - block.set_cauldron_level(0i32); - block - } - #[doc = "Returns an instance of `end_portal` with default state values."] - pub fn end_portal() -> Self { - let mut block = Self { - kind: BlockKind::EndPortal, - state: 0, - }; - block - } - #[doc = "Returns an instance of `end_portal_frame` with default state values.\nThe default state values are as follows:\n* `eye`: false\n* `facing_cardinal`: north\n"] - pub fn end_portal_frame() -> Self { - let mut block = Self { - kind: BlockKind::EndPortalFrame, - state: 0, - }; - block.set_eye(false); - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `end_stone` with default state values."] - pub fn end_stone() -> Self { - let mut block = Self { - kind: BlockKind::EndStone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dragon_egg` with default state values."] - pub fn dragon_egg() -> Self { - let mut block = Self { - kind: BlockKind::DragonEgg, - state: 0, - }; - block - } - #[doc = "Returns an instance of `redstone_lamp` with default state values.\nThe default state values are as follows:\n* `lit`: false\n"] - pub fn redstone_lamp() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneLamp, - state: 0, - }; - block.set_lit(false); - block - } - #[doc = "Returns an instance of `cocoa` with default state values.\nThe default state values are as follows:\n* `age_0_2`: 0\n* `facing_cardinal`: north\n"] - pub fn cocoa() -> Self { - let mut block = Self { - kind: BlockKind::Cocoa, - state: 0, - }; - block.set_age_0_2(0i32); - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `sandstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn sandstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::SandstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `emerald_ore` with default state values."] - pub fn emerald_ore() -> Self { - let mut block = Self { - kind: BlockKind::EmeraldOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `ender_chest` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn ender_chest() -> Self { - let mut block = Self { - kind: BlockKind::EnderChest, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `tripwire_hook` with default state values.\nThe default state values are as follows:\n* `attached`: false\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn tripwire_hook() -> Self { - let mut block = Self { - kind: BlockKind::TripwireHook, - state: 0, - }; - block.set_attached(false); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `tripwire` with default state values.\nThe default state values are as follows:\n* `attached`: false\n* `disarmed`: false\n* `east_connected`: false\n* `north_connected`: false\n* `powered`: false\n* `south_connected`: false\n* `west_connected`: false\n"] - pub fn tripwire() -> Self { - let mut block = Self { - kind: BlockKind::Tripwire, - state: 0, - }; - block.set_attached(false); - block.set_disarmed(false); - block.set_east_connected(false); - block.set_north_connected(false); - block.set_powered(false); - block.set_south_connected(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `emerald_block` with default state values."] - pub fn emerald_block() -> Self { - let mut block = Self { - kind: BlockKind::EmeraldBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `spruce_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn spruce_stairs() -> Self { - let mut block = Self { - kind: BlockKind::SpruceStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `birch_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn birch_stairs() -> Self { - let mut block = Self { - kind: BlockKind::BirchStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `jungle_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn jungle_stairs() -> Self { - let mut block = Self { - kind: BlockKind::JungleStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `command_block` with default state values.\nThe default state values are as follows:\n* `conditional`: false\n* `facing_cubic`: north\n"] - pub fn command_block() -> Self { - let mut block = Self { - kind: BlockKind::CommandBlock, - state: 0, - }; - block.set_conditional(false); - block.set_facing_cubic(FacingCubic::North); - block - } - #[doc = "Returns an instance of `beacon` with default state values."] - pub fn beacon() -> Self { - let mut block = Self { - kind: BlockKind::Beacon, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cobblestone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn cobblestone_wall() -> Self { - let mut block = Self { - kind: BlockKind::CobblestoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `mossy_cobblestone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn mossy_cobblestone_wall() -> Self { - let mut block = Self { - kind: BlockKind::MossyCobblestoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `flower_pot` with default state values."] - pub fn flower_pot() -> Self { - let mut block = Self { - kind: BlockKind::FlowerPot, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_oak_sapling` with default state values."] - pub fn potted_oak_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedOakSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_spruce_sapling` with default state values."] - pub fn potted_spruce_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedSpruceSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_birch_sapling` with default state values."] - pub fn potted_birch_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedBirchSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_jungle_sapling` with default state values."] - pub fn potted_jungle_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedJungleSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_acacia_sapling` with default state values."] - pub fn potted_acacia_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedAcaciaSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_dark_oak_sapling` with default state values."] - pub fn potted_dark_oak_sapling() -> Self { - let mut block = Self { - kind: BlockKind::PottedDarkOakSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_fern` with default state values."] - pub fn potted_fern() -> Self { - let mut block = Self { - kind: BlockKind::PottedFern, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_dandelion` with default state values."] - pub fn potted_dandelion() -> Self { - let mut block = Self { - kind: BlockKind::PottedDandelion, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_poppy` with default state values."] - pub fn potted_poppy() -> Self { - let mut block = Self { - kind: BlockKind::PottedPoppy, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_blue_orchid` with default state values."] - pub fn potted_blue_orchid() -> Self { - let mut block = Self { - kind: BlockKind::PottedBlueOrchid, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_allium` with default state values."] - pub fn potted_allium() -> Self { - let mut block = Self { - kind: BlockKind::PottedAllium, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_azure_bluet` with default state values."] - pub fn potted_azure_bluet() -> Self { - let mut block = Self { - kind: BlockKind::PottedAzureBluet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_red_tulip` with default state values."] - pub fn potted_red_tulip() -> Self { - let mut block = Self { - kind: BlockKind::PottedRedTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_orange_tulip` with default state values."] - pub fn potted_orange_tulip() -> Self { - let mut block = Self { - kind: BlockKind::PottedOrangeTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_white_tulip` with default state values."] - pub fn potted_white_tulip() -> Self { - let mut block = Self { - kind: BlockKind::PottedWhiteTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_pink_tulip` with default state values."] - pub fn potted_pink_tulip() -> Self { - let mut block = Self { - kind: BlockKind::PottedPinkTulip, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_oxeye_daisy` with default state values."] - pub fn potted_oxeye_daisy() -> Self { - let mut block = Self { - kind: BlockKind::PottedOxeyeDaisy, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_cornflower` with default state values."] - pub fn potted_cornflower() -> Self { - let mut block = Self { - kind: BlockKind::PottedCornflower, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_lily_of_the_valley` with default state values."] - pub fn potted_lily_of_the_valley() -> Self { - let mut block = Self { - kind: BlockKind::PottedLilyOfTheValley, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_wither_rose` with default state values."] - pub fn potted_wither_rose() -> Self { - let mut block = Self { - kind: BlockKind::PottedWitherRose, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_red_mushroom` with default state values."] - pub fn potted_red_mushroom() -> Self { - let mut block = Self { - kind: BlockKind::PottedRedMushroom, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_brown_mushroom` with default state values."] - pub fn potted_brown_mushroom() -> Self { - let mut block = Self { - kind: BlockKind::PottedBrownMushroom, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_dead_bush` with default state values."] - pub fn potted_dead_bush() -> Self { - let mut block = Self { - kind: BlockKind::PottedDeadBush, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_cactus` with default state values."] - pub fn potted_cactus() -> Self { - let mut block = Self { - kind: BlockKind::PottedCactus, - state: 0, - }; - block - } - #[doc = "Returns an instance of `carrots` with default state values.\nThe default state values are as follows:\n* `age_0_7`: 0\n"] - pub fn carrots() -> Self { - let mut block = Self { - kind: BlockKind::Carrots, - state: 0, - }; - block.set_age_0_7(0i32); - block - } - #[doc = "Returns an instance of `potatoes` with default state values.\nThe default state values are as follows:\n* `age_0_7`: 0\n"] - pub fn potatoes() -> Self { - let mut block = Self { - kind: BlockKind::Potatoes, - state: 0, - }; - block.set_age_0_7(0i32); - block - } - #[doc = "Returns an instance of `oak_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn oak_button() -> Self { - let mut block = Self { - kind: BlockKind::OakButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `spruce_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn spruce_button() -> Self { - let mut block = Self { - kind: BlockKind::SpruceButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `birch_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn birch_button() -> Self { - let mut block = Self { - kind: BlockKind::BirchButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `jungle_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn jungle_button() -> Self { - let mut block = Self { - kind: BlockKind::JungleButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `acacia_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn acacia_button() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `dark_oak_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn dark_oak_button() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `skeleton_skull` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn skeleton_skull() -> Self { - let mut block = Self { - kind: BlockKind::SkeletonSkull, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `skeleton_wall_skull` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn skeleton_wall_skull() -> Self { - let mut block = Self { - kind: BlockKind::SkeletonWallSkull, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `wither_skeleton_skull` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn wither_skeleton_skull() -> Self { - let mut block = Self { - kind: BlockKind::WitherSkeletonSkull, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `wither_skeleton_wall_skull` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn wither_skeleton_wall_skull() -> Self { - let mut block = Self { - kind: BlockKind::WitherSkeletonWallSkull, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `zombie_head` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn zombie_head() -> Self { - let mut block = Self { - kind: BlockKind::ZombieHead, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `zombie_wall_head` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn zombie_wall_head() -> Self { - let mut block = Self { - kind: BlockKind::ZombieWallHead, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `player_head` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn player_head() -> Self { - let mut block = Self { - kind: BlockKind::PlayerHead, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `player_wall_head` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn player_wall_head() -> Self { - let mut block = Self { - kind: BlockKind::PlayerWallHead, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `creeper_head` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn creeper_head() -> Self { - let mut block = Self { - kind: BlockKind::CreeperHead, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `creeper_wall_head` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn creeper_wall_head() -> Self { - let mut block = Self { - kind: BlockKind::CreeperWallHead, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `dragon_head` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn dragon_head() -> Self { - let mut block = Self { - kind: BlockKind::DragonHead, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `dragon_wall_head` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn dragon_wall_head() -> Self { - let mut block = Self { - kind: BlockKind::DragonWallHead, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `anvil` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn anvil() -> Self { - let mut block = Self { - kind: BlockKind::Anvil, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `chipped_anvil` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn chipped_anvil() -> Self { - let mut block = Self { - kind: BlockKind::ChippedAnvil, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `damaged_anvil` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn damaged_anvil() -> Self { - let mut block = Self { - kind: BlockKind::DamagedAnvil, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `trapped_chest` with default state values.\nThe default state values are as follows:\n* `chest_kind`: single\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn trapped_chest() -> Self { - let mut block = Self { - kind: BlockKind::TrappedChest, - state: 0, - }; - block.set_chest_kind(ChestKind::Single); - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `light_weighted_pressure_plate` with default state values.\nThe default state values are as follows:\n* `power`: 0\n"] - pub fn light_weighted_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::LightWeightedPressurePlate, - state: 0, - }; - block.set_power(0i32); - block - } - #[doc = "Returns an instance of `heavy_weighted_pressure_plate` with default state values.\nThe default state values are as follows:\n* `power`: 0\n"] - pub fn heavy_weighted_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::HeavyWeightedPressurePlate, - state: 0, - }; - block.set_power(0i32); - block - } - #[doc = "Returns an instance of `comparator` with default state values.\nThe default state values are as follows:\n* `comparator_mode`: compare\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn comparator() -> Self { - let mut block = Self { - kind: BlockKind::Comparator, - state: 0, - }; - block.set_comparator_mode(ComparatorMode::Compare); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `daylight_detector` with default state values.\nThe default state values are as follows:\n* `inverted`: false\n* `power`: 0\n"] - pub fn daylight_detector() -> Self { - let mut block = Self { - kind: BlockKind::DaylightDetector, - state: 0, - }; - block.set_inverted(false); - block.set_power(0i32); - block - } - #[doc = "Returns an instance of `redstone_block` with default state values."] - pub fn redstone_block() -> Self { - let mut block = Self { - kind: BlockKind::RedstoneBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_quartz_ore` with default state values."] - pub fn nether_quartz_ore() -> Self { - let mut block = Self { - kind: BlockKind::NetherQuartzOre, - state: 0, - }; - block - } - #[doc = "Returns an instance of `hopper` with default state values.\nThe default state values are as follows:\n* `enabled`: true\n* `facing_cardinal_and_down`: down\n"] - pub fn hopper() -> Self { - let mut block = Self { - kind: BlockKind::Hopper, - state: 0, - }; - block.set_enabled(true); - block.set_facing_cardinal_and_down(FacingCardinalAndDown::Down); - block - } - #[doc = "Returns an instance of `quartz_block` with default state values."] - pub fn quartz_block() -> Self { - let mut block = Self { - kind: BlockKind::QuartzBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `chiseled_quartz_block` with default state values."] - pub fn chiseled_quartz_block() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledQuartzBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `quartz_pillar` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn quartz_pillar() -> Self { - let mut block = Self { - kind: BlockKind::QuartzPillar, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `quartz_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn quartz_stairs() -> Self { - let mut block = Self { - kind: BlockKind::QuartzStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `activator_rail` with default state values.\nThe default state values are as follows:\n* `powered`: false\n* `powered_rail_shape`: north_south\n"] - pub fn activator_rail() -> Self { - let mut block = Self { - kind: BlockKind::ActivatorRail, - state: 0, - }; - block.set_powered(false); - block.set_powered_rail_shape(PoweredRailShape::NorthSouth); - block - } - #[doc = "Returns an instance of `dropper` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: north\n* `triggered`: false\n"] - pub fn dropper() -> Self { - let mut block = Self { - kind: BlockKind::Dropper, - state: 0, - }; - block.set_facing_cubic(FacingCubic::North); - block.set_triggered(false); - block - } - #[doc = "Returns an instance of `white_terracotta` with default state values."] - pub fn white_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::WhiteTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_terracotta` with default state values."] - pub fn orange_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::OrangeTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_terracotta` with default state values."] - pub fn magenta_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::MagentaTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_terracotta` with default state values."] - pub fn light_blue_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_terracotta` with default state values."] - pub fn yellow_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::YellowTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_terracotta` with default state values."] - pub fn lime_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LimeTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_terracotta` with default state values."] - pub fn pink_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::PinkTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_terracotta` with default state values."] - pub fn gray_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::GrayTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_terracotta` with default state values."] - pub fn light_gray_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_terracotta` with default state values."] - pub fn cyan_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::CyanTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_terracotta` with default state values."] - pub fn purple_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::PurpleTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_terracotta` with default state values."] - pub fn blue_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BlueTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_terracotta` with default state values."] - pub fn brown_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BrownTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_terracotta` with default state values."] - pub fn green_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::GreenTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_terracotta` with default state values."] - pub fn red_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::RedTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_terracotta` with default state values."] - pub fn black_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BlackTerracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `white_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn white_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::WhiteStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `orange_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn orange_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::OrangeStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `magenta_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn magenta_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::MagentaStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `light_blue_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn light_blue_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `yellow_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn yellow_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::YellowStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `lime_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn lime_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::LimeStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `pink_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn pink_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::PinkStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `gray_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn gray_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::GrayStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `light_gray_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn light_gray_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `cyan_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn cyan_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::CyanStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `purple_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn purple_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::PurpleStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `blue_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn blue_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::BlueStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `brown_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn brown_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::BrownStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `green_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn green_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::GreenStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `red_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn red_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::RedStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `black_stained_glass_pane` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn black_stained_glass_pane() -> Self { - let mut block = Self { - kind: BlockKind::BlackStainedGlassPane, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `acacia_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn acacia_stairs() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_oak_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn dark_oak_stairs() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `slime_block` with default state values."] - pub fn slime_block() -> Self { - let mut block = Self { - kind: BlockKind::SlimeBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `barrier` with default state values."] - pub fn barrier() -> Self { - let mut block = Self { - kind: BlockKind::Barrier, - state: 0, - }; - block - } - #[doc = "Returns an instance of `iron_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn iron_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::IronTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `prismarine` with default state values."] - pub fn prismarine() -> Self { - let mut block = Self { - kind: BlockKind::Prismarine, - state: 0, - }; - block - } - #[doc = "Returns an instance of `prismarine_bricks` with default state values."] - pub fn prismarine_bricks() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dark_prismarine` with default state values."] - pub fn dark_prismarine() -> Self { - let mut block = Self { - kind: BlockKind::DarkPrismarine, - state: 0, - }; - block - } - #[doc = "Returns an instance of `prismarine_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn prismarine_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `prismarine_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn prismarine_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_prismarine_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn dark_prismarine_stairs() -> Self { - let mut block = Self { - kind: BlockKind::DarkPrismarineStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `prismarine_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn prismarine_slab() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `prismarine_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn prismarine_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_prismarine_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn dark_prismarine_slab() -> Self { - let mut block = Self { - kind: BlockKind::DarkPrismarineSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `sea_lantern` with default state values."] - pub fn sea_lantern() -> Self { - let mut block = Self { - kind: BlockKind::SeaLantern, - state: 0, - }; - block - } - #[doc = "Returns an instance of `hay_block` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn hay_block() -> Self { - let mut block = Self { - kind: BlockKind::HayBlock, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `white_carpet` with default state values."] - pub fn white_carpet() -> Self { - let mut block = Self { - kind: BlockKind::WhiteCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_carpet` with default state values."] - pub fn orange_carpet() -> Self { - let mut block = Self { - kind: BlockKind::OrangeCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_carpet` with default state values."] - pub fn magenta_carpet() -> Self { - let mut block = Self { - kind: BlockKind::MagentaCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_carpet` with default state values."] - pub fn light_blue_carpet() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_carpet` with default state values."] - pub fn yellow_carpet() -> Self { - let mut block = Self { - kind: BlockKind::YellowCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_carpet` with default state values."] - pub fn lime_carpet() -> Self { - let mut block = Self { - kind: BlockKind::LimeCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_carpet` with default state values."] - pub fn pink_carpet() -> Self { - let mut block = Self { - kind: BlockKind::PinkCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_carpet` with default state values."] - pub fn gray_carpet() -> Self { - let mut block = Self { - kind: BlockKind::GrayCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_carpet` with default state values."] - pub fn light_gray_carpet() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_carpet` with default state values."] - pub fn cyan_carpet() -> Self { - let mut block = Self { - kind: BlockKind::CyanCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_carpet` with default state values."] - pub fn purple_carpet() -> Self { - let mut block = Self { - kind: BlockKind::PurpleCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_carpet` with default state values."] - pub fn blue_carpet() -> Self { - let mut block = Self { - kind: BlockKind::BlueCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_carpet` with default state values."] - pub fn brown_carpet() -> Self { - let mut block = Self { - kind: BlockKind::BrownCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_carpet` with default state values."] - pub fn green_carpet() -> Self { - let mut block = Self { - kind: BlockKind::GreenCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_carpet` with default state values."] - pub fn red_carpet() -> Self { - let mut block = Self { - kind: BlockKind::RedCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_carpet` with default state values."] - pub fn black_carpet() -> Self { - let mut block = Self { - kind: BlockKind::BlackCarpet, - state: 0, - }; - block - } - #[doc = "Returns an instance of `terracotta` with default state values."] - pub fn terracotta() -> Self { - let mut block = Self { - kind: BlockKind::Terracotta, - state: 0, - }; - block - } - #[doc = "Returns an instance of `coal_block` with default state values."] - pub fn coal_block() -> Self { - let mut block = Self { - kind: BlockKind::CoalBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `packed_ice` with default state values."] - pub fn packed_ice() -> Self { - let mut block = Self { - kind: BlockKind::PackedIce, - state: 0, - }; - block - } - #[doc = "Returns an instance of `sunflower` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn sunflower() -> Self { - let mut block = Self { - kind: BlockKind::Sunflower, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `lilac` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn lilac() -> Self { - let mut block = Self { - kind: BlockKind::Lilac, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `rose_bush` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn rose_bush() -> Self { - let mut block = Self { - kind: BlockKind::RoseBush, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `peony` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn peony() -> Self { - let mut block = Self { - kind: BlockKind::Peony, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `tall_grass` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn tall_grass() -> Self { - let mut block = Self { - kind: BlockKind::TallGrass, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `large_fern` with default state values.\nThe default state values are as follows:\n* `half_upper_lower`: lower\n"] - pub fn large_fern() -> Self { - let mut block = Self { - kind: BlockKind::LargeFern, - state: 0, - }; - block.set_half_upper_lower(HalfUpperLower::Lower); - block - } - #[doc = "Returns an instance of `white_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn white_banner() -> Self { - let mut block = Self { - kind: BlockKind::WhiteBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `orange_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn orange_banner() -> Self { - let mut block = Self { - kind: BlockKind::OrangeBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `magenta_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn magenta_banner() -> Self { - let mut block = Self { - kind: BlockKind::MagentaBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `light_blue_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn light_blue_banner() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `yellow_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn yellow_banner() -> Self { - let mut block = Self { - kind: BlockKind::YellowBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `lime_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn lime_banner() -> Self { - let mut block = Self { - kind: BlockKind::LimeBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `pink_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn pink_banner() -> Self { - let mut block = Self { - kind: BlockKind::PinkBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `gray_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn gray_banner() -> Self { - let mut block = Self { - kind: BlockKind::GrayBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `light_gray_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn light_gray_banner() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `cyan_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn cyan_banner() -> Self { - let mut block = Self { - kind: BlockKind::CyanBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `purple_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn purple_banner() -> Self { - let mut block = Self { - kind: BlockKind::PurpleBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `blue_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn blue_banner() -> Self { - let mut block = Self { - kind: BlockKind::BlueBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `brown_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn brown_banner() -> Self { - let mut block = Self { - kind: BlockKind::BrownBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `green_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn green_banner() -> Self { - let mut block = Self { - kind: BlockKind::GreenBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `red_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn red_banner() -> Self { - let mut block = Self { - kind: BlockKind::RedBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `black_banner` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n"] - pub fn black_banner() -> Self { - let mut block = Self { - kind: BlockKind::BlackBanner, - state: 0, - }; - block.set_rotation(0i32); - block - } - #[doc = "Returns an instance of `white_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn white_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::WhiteWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `orange_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn orange_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::OrangeWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `magenta_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn magenta_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::MagentaWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `light_blue_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn light_blue_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `yellow_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn yellow_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::YellowWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `lime_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn lime_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::LimeWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `pink_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn pink_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::PinkWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `gray_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn gray_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::GrayWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `light_gray_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn light_gray_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `cyan_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn cyan_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::CyanWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `purple_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn purple_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::PurpleWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `blue_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn blue_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::BlueWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `brown_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn brown_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::BrownWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `green_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn green_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::GreenWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `red_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn red_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::RedWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `black_wall_banner` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn black_wall_banner() -> Self { - let mut block = Self { - kind: BlockKind::BlackWallBanner, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `red_sandstone` with default state values."] - pub fn red_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::RedSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `chiseled_red_sandstone` with default state values."] - pub fn chiseled_red_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledRedSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cut_red_sandstone` with default state values."] - pub fn cut_red_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::CutRedSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_sandstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn red_sandstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::RedSandstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `oak_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn oak_slab() -> Self { - let mut block = Self { - kind: BlockKind::OakSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `spruce_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn spruce_slab() -> Self { - let mut block = Self { - kind: BlockKind::SpruceSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `birch_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn birch_slab() -> Self { - let mut block = Self { - kind: BlockKind::BirchSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `jungle_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn jungle_slab() -> Self { - let mut block = Self { - kind: BlockKind::JungleSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `acacia_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn acacia_slab() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `dark_oak_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn dark_oak_slab() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `stone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn stone_slab() -> Self { - let mut block = Self { - kind: BlockKind::StoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_stone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn smooth_stone_slab() -> Self { - let mut block = Self { - kind: BlockKind::SmoothStoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::SandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `cut_sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn cut_sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::CutSandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `petrified_oak_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn petrified_oak_slab() -> Self { - let mut block = Self { - kind: BlockKind::PetrifiedOakSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `cobblestone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn cobblestone_slab() -> Self { - let mut block = Self { - kind: BlockKind::CobblestoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::BrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `stone_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn stone_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::StoneBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `nether_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn nether_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::NetherBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `quartz_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn quartz_slab() -> Self { - let mut block = Self { - kind: BlockKind::QuartzSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `red_sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn red_sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::RedSandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `cut_red_sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn cut_red_sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::CutRedSandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `purpur_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn purpur_slab() -> Self { - let mut block = Self { - kind: BlockKind::PurpurSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_stone` with default state values."] - pub fn smooth_stone() -> Self { - let mut block = Self { - kind: BlockKind::SmoothStone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `smooth_sandstone` with default state values."] - pub fn smooth_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::SmoothSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `smooth_quartz` with default state values."] - pub fn smooth_quartz() -> Self { - let mut block = Self { - kind: BlockKind::SmoothQuartz, - state: 0, - }; - block - } - #[doc = "Returns an instance of `smooth_red_sandstone` with default state values."] - pub fn smooth_red_sandstone() -> Self { - let mut block = Self { - kind: BlockKind::SmoothRedSandstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `spruce_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn spruce_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::SpruceFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `birch_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn birch_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::BirchFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `jungle_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn jungle_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::JungleFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `acacia_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn acacia_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `dark_oak_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn dark_oak_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `spruce_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn spruce_fence() -> Self { - let mut block = Self { - kind: BlockKind::SpruceFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `birch_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn birch_fence() -> Self { - let mut block = Self { - kind: BlockKind::BirchFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `jungle_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn jungle_fence() -> Self { - let mut block = Self { - kind: BlockKind::JungleFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `acacia_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn acacia_fence() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `dark_oak_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn dark_oak_fence() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `spruce_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn spruce_door() -> Self { - let mut block = Self { - kind: BlockKind::SpruceDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `birch_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn birch_door() -> Self { - let mut block = Self { - kind: BlockKind::BirchDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `jungle_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn jungle_door() -> Self { - let mut block = Self { - kind: BlockKind::JungleDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `acacia_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn acacia_door() -> Self { - let mut block = Self { - kind: BlockKind::AcaciaDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `dark_oak_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn dark_oak_door() -> Self { - let mut block = Self { - kind: BlockKind::DarkOakDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `end_rod` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn end_rod() -> Self { - let mut block = Self { - kind: BlockKind::EndRod, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `chorus_plant` with default state values.\nThe default state values are as follows:\n* `down`: false\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `up`: false\n* `west_connected`: false\n"] - pub fn chorus_plant() -> Self { - let mut block = Self { - kind: BlockKind::ChorusPlant, - state: 0, - }; - block.set_down(false); - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_up(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `chorus_flower` with default state values.\nThe default state values are as follows:\n* `age_0_5`: 0\n"] - pub fn chorus_flower() -> Self { - let mut block = Self { - kind: BlockKind::ChorusFlower, - state: 0, - }; - block.set_age_0_5(0i32); - block - } - #[doc = "Returns an instance of `purpur_block` with default state values."] - pub fn purpur_block() -> Self { - let mut block = Self { - kind: BlockKind::PurpurBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purpur_pillar` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn purpur_pillar() -> Self { - let mut block = Self { - kind: BlockKind::PurpurPillar, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `purpur_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn purpur_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PurpurStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `end_stone_bricks` with default state values."] - pub fn end_stone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::EndStoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `beetroots` with default state values.\nThe default state values are as follows:\n* `age_0_3`: 0\n"] - pub fn beetroots() -> Self { - let mut block = Self { - kind: BlockKind::Beetroots, - state: 0, - }; - block.set_age_0_3(0i32); - block - } - #[doc = "Returns an instance of `grass_path` with default state values."] - pub fn grass_path() -> Self { - let mut block = Self { - kind: BlockKind::GrassPath, - state: 0, - }; - block - } - #[doc = "Returns an instance of `end_gateway` with default state values."] - pub fn end_gateway() -> Self { - let mut block = Self { - kind: BlockKind::EndGateway, - state: 0, - }; - block - } - #[doc = "Returns an instance of `repeating_command_block` with default state values.\nThe default state values are as follows:\n* `conditional`: false\n* `facing_cubic`: north\n"] - pub fn repeating_command_block() -> Self { - let mut block = Self { - kind: BlockKind::RepeatingCommandBlock, - state: 0, - }; - block.set_conditional(false); - block.set_facing_cubic(FacingCubic::North); - block - } - #[doc = "Returns an instance of `chain_command_block` with default state values.\nThe default state values are as follows:\n* `conditional`: false\n* `facing_cubic`: north\n"] - pub fn chain_command_block() -> Self { - let mut block = Self { - kind: BlockKind::ChainCommandBlock, - state: 0, - }; - block.set_conditional(false); - block.set_facing_cubic(FacingCubic::North); - block - } - #[doc = "Returns an instance of `frosted_ice` with default state values.\nThe default state values are as follows:\n* `age_0_3`: 0\n"] - pub fn frosted_ice() -> Self { - let mut block = Self { - kind: BlockKind::FrostedIce, - state: 0, - }; - block.set_age_0_3(0i32); - block - } - #[doc = "Returns an instance of `magma_block` with default state values."] - pub fn magma_block() -> Self { - let mut block = Self { - kind: BlockKind::MagmaBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_wart_block` with default state values."] - pub fn nether_wart_block() -> Self { - let mut block = Self { - kind: BlockKind::NetherWartBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_nether_bricks` with default state values."] - pub fn red_nether_bricks() -> Self { - let mut block = Self { - kind: BlockKind::RedNetherBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `bone_block` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn bone_block() -> Self { - let mut block = Self { - kind: BlockKind::BoneBlock, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `structure_void` with default state values."] - pub fn structure_void() -> Self { - let mut block = Self { - kind: BlockKind::StructureVoid, - state: 0, - }; - block - } - #[doc = "Returns an instance of `observer` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: south\n* `powered`: false\n"] - pub fn observer() -> Self { - let mut block = Self { - kind: BlockKind::Observer, - state: 0, - }; - block.set_facing_cubic(FacingCubic::South); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::ShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `white_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn white_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::WhiteShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `orange_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn orange_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::OrangeShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `magenta_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn magenta_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::MagentaShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `light_blue_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn light_blue_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `yellow_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn yellow_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::YellowShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `lime_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn lime_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::LimeShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `pink_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn pink_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::PinkShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `gray_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn gray_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::GrayShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `light_gray_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn light_gray_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `cyan_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn cyan_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::CyanShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `purple_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn purple_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::PurpleShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `blue_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn blue_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::BlueShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `brown_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn brown_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::BrownShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `green_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn green_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::GreenShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `red_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn red_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::RedShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `black_shulker_box` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: up\n"] - pub fn black_shulker_box() -> Self { - let mut block = Self { - kind: BlockKind::BlackShulkerBox, - state: 0, - }; - block.set_facing_cubic(FacingCubic::Up); - block - } - #[doc = "Returns an instance of `white_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn white_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::WhiteGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `orange_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn orange_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::OrangeGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `magenta_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn magenta_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::MagentaGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `light_blue_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn light_blue_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `yellow_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn yellow_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::YellowGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `lime_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn lime_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LimeGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `pink_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn pink_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::PinkGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `gray_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn gray_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::GrayGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `light_gray_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn light_gray_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `cyan_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn cyan_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::CyanGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `purple_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn purple_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::PurpleGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `blue_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn blue_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BlueGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `brown_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn brown_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BrownGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `green_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn green_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::GreenGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `red_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn red_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::RedGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `black_glazed_terracotta` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn black_glazed_terracotta() -> Self { - let mut block = Self { - kind: BlockKind::BlackGlazedTerracotta, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `white_concrete` with default state values."] - pub fn white_concrete() -> Self { - let mut block = Self { - kind: BlockKind::WhiteConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_concrete` with default state values."] - pub fn orange_concrete() -> Self { - let mut block = Self { - kind: BlockKind::OrangeConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_concrete` with default state values."] - pub fn magenta_concrete() -> Self { - let mut block = Self { - kind: BlockKind::MagentaConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_concrete` with default state values."] - pub fn light_blue_concrete() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_concrete` with default state values."] - pub fn yellow_concrete() -> Self { - let mut block = Self { - kind: BlockKind::YellowConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_concrete` with default state values."] - pub fn lime_concrete() -> Self { - let mut block = Self { - kind: BlockKind::LimeConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_concrete` with default state values."] - pub fn pink_concrete() -> Self { - let mut block = Self { - kind: BlockKind::PinkConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_concrete` with default state values."] - pub fn gray_concrete() -> Self { - let mut block = Self { - kind: BlockKind::GrayConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_concrete` with default state values."] - pub fn light_gray_concrete() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_concrete` with default state values."] - pub fn cyan_concrete() -> Self { - let mut block = Self { - kind: BlockKind::CyanConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_concrete` with default state values."] - pub fn purple_concrete() -> Self { - let mut block = Self { - kind: BlockKind::PurpleConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_concrete` with default state values."] - pub fn blue_concrete() -> Self { - let mut block = Self { - kind: BlockKind::BlueConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_concrete` with default state values."] - pub fn brown_concrete() -> Self { - let mut block = Self { - kind: BlockKind::BrownConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_concrete` with default state values."] - pub fn green_concrete() -> Self { - let mut block = Self { - kind: BlockKind::GreenConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_concrete` with default state values."] - pub fn red_concrete() -> Self { - let mut block = Self { - kind: BlockKind::RedConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_concrete` with default state values."] - pub fn black_concrete() -> Self { - let mut block = Self { - kind: BlockKind::BlackConcrete, - state: 0, - }; - block - } - #[doc = "Returns an instance of `white_concrete_powder` with default state values."] - pub fn white_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::WhiteConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `orange_concrete_powder` with default state values."] - pub fn orange_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::OrangeConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `magenta_concrete_powder` with default state values."] - pub fn magenta_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::MagentaConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_blue_concrete_powder` with default state values."] - pub fn light_blue_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::LightBlueConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `yellow_concrete_powder` with default state values."] - pub fn yellow_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::YellowConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lime_concrete_powder` with default state values."] - pub fn lime_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::LimeConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `pink_concrete_powder` with default state values."] - pub fn pink_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::PinkConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `gray_concrete_powder` with default state values."] - pub fn gray_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::GrayConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `light_gray_concrete_powder` with default state values."] - pub fn light_gray_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::LightGrayConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cyan_concrete_powder` with default state values."] - pub fn cyan_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::CyanConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `purple_concrete_powder` with default state values."] - pub fn purple_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::PurpleConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blue_concrete_powder` with default state values."] - pub fn blue_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::BlueConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brown_concrete_powder` with default state values."] - pub fn brown_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::BrownConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `green_concrete_powder` with default state values."] - pub fn green_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::GreenConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `red_concrete_powder` with default state values."] - pub fn red_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::RedConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `black_concrete_powder` with default state values."] - pub fn black_concrete_powder() -> Self { - let mut block = Self { - kind: BlockKind::BlackConcretePowder, - state: 0, - }; - block - } - #[doc = "Returns an instance of `kelp` with default state values.\nThe default state values are as follows:\n* `age_0_25`: 0\n"] - pub fn kelp() -> Self { - let mut block = Self { - kind: BlockKind::Kelp, - state: 0, - }; - block.set_age_0_25(0i32); - block - } - #[doc = "Returns an instance of `kelp_plant` with default state values."] - pub fn kelp_plant() -> Self { - let mut block = Self { - kind: BlockKind::KelpPlant, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dried_kelp_block` with default state values."] - pub fn dried_kelp_block() -> Self { - let mut block = Self { - kind: BlockKind::DriedKelpBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `turtle_egg` with default state values.\nThe default state values are as follows:\n* `eggs`: 1\n* `hatch`: 0\n"] - pub fn turtle_egg() -> Self { - let mut block = Self { - kind: BlockKind::TurtleEgg, - state: 0, - }; - block.set_eggs(1i32); - block.set_hatch(0i32); - block - } - #[doc = "Returns an instance of `dead_tube_coral_block` with default state values."] - pub fn dead_tube_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::DeadTubeCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_brain_coral_block` with default state values."] - pub fn dead_brain_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::DeadBrainCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_bubble_coral_block` with default state values."] - pub fn dead_bubble_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::DeadBubbleCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_fire_coral_block` with default state values."] - pub fn dead_fire_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::DeadFireCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_horn_coral_block` with default state values."] - pub fn dead_horn_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::DeadHornCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `tube_coral_block` with default state values."] - pub fn tube_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::TubeCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `brain_coral_block` with default state values."] - pub fn brain_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::BrainCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `bubble_coral_block` with default state values."] - pub fn bubble_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::BubbleCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `fire_coral_block` with default state values."] - pub fn fire_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::FireCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `horn_coral_block` with default state values."] - pub fn horn_coral_block() -> Self { - let mut block = Self { - kind: BlockKind::HornCoralBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `dead_tube_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_tube_coral() -> Self { - let mut block = Self { - kind: BlockKind::DeadTubeCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_brain_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_brain_coral() -> Self { - let mut block = Self { - kind: BlockKind::DeadBrainCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_bubble_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_bubble_coral() -> Self { - let mut block = Self { - kind: BlockKind::DeadBubbleCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_fire_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_fire_coral() -> Self { - let mut block = Self { - kind: BlockKind::DeadFireCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_horn_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_horn_coral() -> Self { - let mut block = Self { - kind: BlockKind::DeadHornCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `tube_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn tube_coral() -> Self { - let mut block = Self { - kind: BlockKind::TubeCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `brain_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn brain_coral() -> Self { - let mut block = Self { - kind: BlockKind::BrainCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `bubble_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn bubble_coral() -> Self { - let mut block = Self { - kind: BlockKind::BubbleCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `fire_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn fire_coral() -> Self { - let mut block = Self { - kind: BlockKind::FireCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `horn_coral` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn horn_coral() -> Self { - let mut block = Self { - kind: BlockKind::HornCoral, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_tube_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_tube_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadTubeCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_brain_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_brain_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadBrainCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_bubble_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_bubble_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadBubbleCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_fire_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_fire_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadFireCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_horn_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn dead_horn_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadHornCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `tube_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn tube_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::TubeCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `brain_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn brain_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::BrainCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `bubble_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn bubble_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::BubbleCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `fire_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn fire_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::FireCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `horn_coral_fan` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn horn_coral_fan() -> Self { - let mut block = Self { - kind: BlockKind::HornCoralFan, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_tube_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn dead_tube_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadTubeCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_brain_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn dead_brain_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadBrainCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_bubble_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn dead_bubble_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadBubbleCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_fire_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn dead_fire_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadFireCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `dead_horn_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn dead_horn_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::DeadHornCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `tube_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn tube_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::TubeCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `brain_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn brain_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::BrainCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `bubble_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn bubble_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::BubbleCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `fire_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn fire_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::FireCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `horn_coral_wall_fan` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: true\n"] - pub fn horn_coral_wall_fan() -> Self { - let mut block = Self { - kind: BlockKind::HornCoralWallFan, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `sea_pickle` with default state values.\nThe default state values are as follows:\n* `pickles`: 1\n* `waterlogged`: true\n"] - pub fn sea_pickle() -> Self { - let mut block = Self { - kind: BlockKind::SeaPickle, - state: 0, - }; - block.set_pickles(1i32); - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `blue_ice` with default state values."] - pub fn blue_ice() -> Self { - let mut block = Self { - kind: BlockKind::BlueIce, - state: 0, - }; - block - } - #[doc = "Returns an instance of `conduit` with default state values.\nThe default state values are as follows:\n* `waterlogged`: true\n"] - pub fn conduit() -> Self { - let mut block = Self { - kind: BlockKind::Conduit, - state: 0, - }; - block.set_waterlogged(true); - block - } - #[doc = "Returns an instance of `bamboo_sapling` with default state values."] - pub fn bamboo_sapling() -> Self { - let mut block = Self { - kind: BlockKind::BambooSapling, - state: 0, - }; - block - } - #[doc = "Returns an instance of `bamboo` with default state values.\nThe default state values are as follows:\n* `age_0_1`: 0\n* `leaves`: none\n* `stage`: 0\n"] - pub fn bamboo() -> Self { - let mut block = Self { - kind: BlockKind::Bamboo, - state: 0, - }; - block.set_age_0_1(0i32); - block.set_leaves(Leaves::None); - block.set_stage(0i32); - block - } - #[doc = "Returns an instance of `potted_bamboo` with default state values."] - pub fn potted_bamboo() -> Self { - let mut block = Self { - kind: BlockKind::PottedBamboo, - state: 0, - }; - block - } - #[doc = "Returns an instance of `void_air` with default state values."] - pub fn void_air() -> Self { - let mut block = Self { - kind: BlockKind::VoidAir, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cave_air` with default state values."] - pub fn cave_air() -> Self { - let mut block = Self { - kind: BlockKind::CaveAir, - state: 0, - }; - block - } - #[doc = "Returns an instance of `bubble_column` with default state values.\nThe default state values are as follows:\n* `drag`: true\n"] - pub fn bubble_column() -> Self { - let mut block = Self { - kind: BlockKind::BubbleColumn, - state: 0, - }; - block.set_drag(true); - block - } - #[doc = "Returns an instance of `polished_granite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn polished_granite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PolishedGraniteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_red_sandstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn smooth_red_sandstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::SmoothRedSandstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `mossy_stone_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn mossy_stone_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::MossyStoneBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_diorite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn polished_diorite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PolishedDioriteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `mossy_cobblestone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn mossy_cobblestone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::MossyCobblestoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `end_stone_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn end_stone_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::EndStoneBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `stone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn stone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::StoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_sandstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn smooth_sandstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::SmoothSandstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_quartz_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn smooth_quartz_stairs() -> Self { - let mut block = Self { - kind: BlockKind::SmoothQuartzStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `granite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn granite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::GraniteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `andesite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn andesite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::AndesiteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `red_nether_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn red_nether_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::RedNetherBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_andesite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn polished_andesite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PolishedAndesiteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `diorite_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn diorite_stairs() -> Self { - let mut block = Self { - kind: BlockKind::DioriteStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_granite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn polished_granite_slab() -> Self { - let mut block = Self { - kind: BlockKind::PolishedGraniteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_red_sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn smooth_red_sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::SmoothRedSandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `mossy_stone_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn mossy_stone_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::MossyStoneBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_diorite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn polished_diorite_slab() -> Self { - let mut block = Self { - kind: BlockKind::PolishedDioriteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `mossy_cobblestone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn mossy_cobblestone_slab() -> Self { - let mut block = Self { - kind: BlockKind::MossyCobblestoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `end_stone_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn end_stone_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::EndStoneBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_sandstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn smooth_sandstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::SmoothSandstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `smooth_quartz_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn smooth_quartz_slab() -> Self { - let mut block = Self { - kind: BlockKind::SmoothQuartzSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `granite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn granite_slab() -> Self { - let mut block = Self { - kind: BlockKind::GraniteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `andesite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn andesite_slab() -> Self { - let mut block = Self { - kind: BlockKind::AndesiteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `red_nether_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn red_nether_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::RedNetherBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_andesite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn polished_andesite_slab() -> Self { - let mut block = Self { - kind: BlockKind::PolishedAndesiteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `diorite_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn diorite_slab() -> Self { - let mut block = Self { - kind: BlockKind::DioriteSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::BrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `prismarine_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn prismarine_wall() -> Self { - let mut block = Self { - kind: BlockKind::PrismarineWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `red_sandstone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn red_sandstone_wall() -> Self { - let mut block = Self { - kind: BlockKind::RedSandstoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `mossy_stone_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn mossy_stone_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::MossyStoneBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `granite_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn granite_wall() -> Self { - let mut block = Self { - kind: BlockKind::GraniteWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `stone_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn stone_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::StoneBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `nether_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn nether_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::NetherBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `andesite_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn andesite_wall() -> Self { - let mut block = Self { - kind: BlockKind::AndesiteWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `red_nether_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn red_nether_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::RedNetherBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `sandstone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn sandstone_wall() -> Self { - let mut block = Self { - kind: BlockKind::SandstoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `end_stone_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn end_stone_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::EndStoneBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `diorite_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn diorite_wall() -> Self { - let mut block = Self { - kind: BlockKind::DioriteWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `scaffolding` with default state values.\nThe default state values are as follows:\n* `bottom`: false\n* `distance_0_7`: 7\n* `waterlogged`: false\n"] - pub fn scaffolding() -> Self { - let mut block = Self { - kind: BlockKind::Scaffolding, - state: 0, - }; - block.set_bottom(false); - block.set_distance_0_7(7i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `loom` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn loom() -> Self { - let mut block = Self { - kind: BlockKind::Loom, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `barrel` with default state values.\nThe default state values are as follows:\n* `facing_cubic`: north\n* `open`: false\n"] - pub fn barrel() -> Self { - let mut block = Self { - kind: BlockKind::Barrel, - state: 0, - }; - block.set_facing_cubic(FacingCubic::North); - block.set_open(false); - block - } - #[doc = "Returns an instance of `smoker` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: false\n"] - pub fn smoker() -> Self { - let mut block = Self { - kind: BlockKind::Smoker, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(false); - block - } - #[doc = "Returns an instance of `blast_furnace` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: false\n"] - pub fn blast_furnace() -> Self { - let mut block = Self { - kind: BlockKind::BlastFurnace, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(false); - block - } - #[doc = "Returns an instance of `cartography_table` with default state values."] - pub fn cartography_table() -> Self { - let mut block = Self { - kind: BlockKind::CartographyTable, - state: 0, - }; - block - } - #[doc = "Returns an instance of `fletching_table` with default state values."] - pub fn fletching_table() -> Self { - let mut block = Self { - kind: BlockKind::FletchingTable, - state: 0, - }; - block - } - #[doc = "Returns an instance of `grindstone` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n"] - pub fn grindstone() -> Self { - let mut block = Self { - kind: BlockKind::Grindstone, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `lectern` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `has_book`: false\n* `powered`: false\n"] - pub fn lectern() -> Self { - let mut block = Self { - kind: BlockKind::Lectern, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_has_book(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `smithing_table` with default state values."] - pub fn smithing_table() -> Self { - let mut block = Self { - kind: BlockKind::SmithingTable, - state: 0, - }; - block - } - #[doc = "Returns an instance of `stonecutter` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n"] - pub fn stonecutter() -> Self { - let mut block = Self { - kind: BlockKind::Stonecutter, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block - } - #[doc = "Returns an instance of `bell` with default state values.\nThe default state values are as follows:\n* `attachment`: floor\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn bell() -> Self { - let mut block = Self { - kind: BlockKind::Bell, - state: 0, - }; - block.set_attachment(Attachment::Floor); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `lantern` with default state values.\nThe default state values are as follows:\n* `hanging`: false\n* `waterlogged`: false\n"] - pub fn lantern() -> Self { - let mut block = Self { - kind: BlockKind::Lantern, - state: 0, - }; - block.set_hanging(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `soul_lantern` with default state values.\nThe default state values are as follows:\n* `hanging`: false\n* `waterlogged`: false\n"] - pub fn soul_lantern() -> Self { - let mut block = Self { - kind: BlockKind::SoulLantern, - state: 0, - }; - block.set_hanging(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `campfire` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: true\n* `signal_fire`: false\n* `waterlogged`: false\n"] - pub fn campfire() -> Self { - let mut block = Self { - kind: BlockKind::Campfire, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(true); - block.set_signal_fire(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `soul_campfire` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `lit`: true\n* `signal_fire`: false\n* `waterlogged`: false\n"] - pub fn soul_campfire() -> Self { - let mut block = Self { - kind: BlockKind::SoulCampfire, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_lit(true); - block.set_signal_fire(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `sweet_berry_bush` with default state values.\nThe default state values are as follows:\n* `age_0_3`: 0\n"] - pub fn sweet_berry_bush() -> Self { - let mut block = Self { - kind: BlockKind::SweetBerryBush, - state: 0, - }; - block.set_age_0_3(0i32); - block - } - #[doc = "Returns an instance of `warped_stem` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn warped_stem() -> Self { - let mut block = Self { - kind: BlockKind::WarpedStem, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_warped_stem` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_warped_stem() -> Self { - let mut block = Self { - kind: BlockKind::StrippedWarpedStem, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `warped_hyphae` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn warped_hyphae() -> Self { - let mut block = Self { - kind: BlockKind::WarpedHyphae, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_warped_hyphae` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_warped_hyphae() -> Self { - let mut block = Self { - kind: BlockKind::StrippedWarpedHyphae, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `warped_nylium` with default state values."] - pub fn warped_nylium() -> Self { - let mut block = Self { - kind: BlockKind::WarpedNylium, - state: 0, - }; - block - } - #[doc = "Returns an instance of `warped_fungus` with default state values."] - pub fn warped_fungus() -> Self { - let mut block = Self { - kind: BlockKind::WarpedFungus, - state: 0, - }; - block - } - #[doc = "Returns an instance of `warped_wart_block` with default state values."] - pub fn warped_wart_block() -> Self { - let mut block = Self { - kind: BlockKind::WarpedWartBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `warped_roots` with default state values."] - pub fn warped_roots() -> Self { - let mut block = Self { - kind: BlockKind::WarpedRoots, - state: 0, - }; - block - } - #[doc = "Returns an instance of `nether_sprouts` with default state values."] - pub fn nether_sprouts() -> Self { - let mut block = Self { - kind: BlockKind::NetherSprouts, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crimson_stem` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn crimson_stem() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonStem, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_crimson_stem` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_crimson_stem() -> Self { - let mut block = Self { - kind: BlockKind::StrippedCrimsonStem, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `crimson_hyphae` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn crimson_hyphae() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonHyphae, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `stripped_crimson_hyphae` with default state values.\nThe default state values are as follows:\n* `axis_xyz`: y\n"] - pub fn stripped_crimson_hyphae() -> Self { - let mut block = Self { - kind: BlockKind::StrippedCrimsonHyphae, - state: 0, - }; - block.set_axis_xyz(AxisXyz::Y); - block - } - #[doc = "Returns an instance of `crimson_nylium` with default state values."] - pub fn crimson_nylium() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonNylium, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crimson_fungus` with default state values."] - pub fn crimson_fungus() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonFungus, - state: 0, - }; - block - } - #[doc = "Returns an instance of `shroomlight` with default state values."] - pub fn shroomlight() -> Self { - let mut block = Self { - kind: BlockKind::Shroomlight, - state: 0, - }; - block - } - #[doc = "Returns an instance of `weeping_vines` with default state values.\nThe default state values are as follows:\n* `age_0_25`: 0\n"] - pub fn weeping_vines() -> Self { - let mut block = Self { - kind: BlockKind::WeepingVines, - state: 0, - }; - block.set_age_0_25(0i32); - block - } - #[doc = "Returns an instance of `weeping_vines_plant` with default state values."] - pub fn weeping_vines_plant() -> Self { - let mut block = Self { - kind: BlockKind::WeepingVinesPlant, - state: 0, - }; - block - } - #[doc = "Returns an instance of `twisting_vines` with default state values.\nThe default state values are as follows:\n* `age_0_25`: 0\n"] - pub fn twisting_vines() -> Self { - let mut block = Self { - kind: BlockKind::TwistingVines, - state: 0, - }; - block.set_age_0_25(0i32); - block - } - #[doc = "Returns an instance of `twisting_vines_plant` with default state values."] - pub fn twisting_vines_plant() -> Self { - let mut block = Self { - kind: BlockKind::TwistingVinesPlant, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crimson_roots` with default state values."] - pub fn crimson_roots() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonRoots, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crimson_planks` with default state values."] - pub fn crimson_planks() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `warped_planks` with default state values."] - pub fn warped_planks() -> Self { - let mut block = Self { - kind: BlockKind::WarpedPlanks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crimson_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn crimson_slab() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `warped_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn warped_slab() -> Self { - let mut block = Self { - kind: BlockKind::WarpedSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `crimson_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn crimson_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `warped_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn warped_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::WarpedPressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `crimson_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn crimson_fence() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `warped_fence` with default state values.\nThe default state values are as follows:\n* `east_connected`: false\n* `north_connected`: false\n* `south_connected`: false\n* `waterlogged`: false\n* `west_connected`: false\n"] - pub fn warped_fence() -> Self { - let mut block = Self { - kind: BlockKind::WarpedFence, - state: 0, - }; - block.set_east_connected(false); - block.set_north_connected(false); - block.set_south_connected(false); - block.set_waterlogged(false); - block.set_west_connected(false); - block - } - #[doc = "Returns an instance of `crimson_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn crimson_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `warped_trapdoor` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `open`: false\n* `powered`: false\n* `waterlogged`: false\n"] - pub fn warped_trapdoor() -> Self { - let mut block = Self { - kind: BlockKind::WarpedTrapdoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_open(false); - block.set_powered(false); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `crimson_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn crimson_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `warped_fence_gate` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `in_wall`: false\n* `open`: false\n* `powered`: false\n"] - pub fn warped_fence_gate() -> Self { - let mut block = Self { - kind: BlockKind::WarpedFenceGate, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_in_wall(false); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `crimson_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn crimson_stairs() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `warped_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn warped_stairs() -> Self { - let mut block = Self { - kind: BlockKind::WarpedStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `crimson_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn crimson_button() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `warped_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn warped_button() -> Self { - let mut block = Self { - kind: BlockKind::WarpedButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `crimson_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn crimson_door() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `warped_door` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_upper_lower`: lower\n* `hinge`: left\n* `open`: false\n* `powered`: false\n"] - pub fn warped_door() -> Self { - let mut block = Self { - kind: BlockKind::WarpedDoor, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_upper_lower(HalfUpperLower::Lower); - block.set_hinge(Hinge::Left); - block.set_open(false); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `crimson_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn crimson_sign() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `warped_sign` with default state values.\nThe default state values are as follows:\n* `rotation`: 0\n* `waterlogged`: false\n"] - pub fn warped_sign() -> Self { - let mut block = Self { - kind: BlockKind::WarpedSign, - state: 0, - }; - block.set_rotation(0i32); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `crimson_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn crimson_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::CrimsonWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `warped_wall_sign` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `waterlogged`: false\n"] - pub fn warped_wall_sign() -> Self { - let mut block = Self { - kind: BlockKind::WarpedWallSign, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `structure_block` with default state values.\nThe default state values are as follows:\n* `structure_block_mode`: save\n"] - pub fn structure_block() -> Self { - let mut block = Self { - kind: BlockKind::StructureBlock, - state: 0, - }; - block.set_structure_block_mode(StructureBlockMode::Save); - block - } - #[doc = "Returns an instance of `jigsaw` with default state values.\nThe default state values are as follows:\n* `orientation`: north_up\n"] - pub fn jigsaw() -> Self { - let mut block = Self { - kind: BlockKind::Jigsaw, - state: 0, - }; - block.set_orientation(Orientation::NorthUp); - block - } - #[doc = "Returns an instance of `composter` with default state values.\nThe default state values are as follows:\n* `level_0_8`: 0\n"] - pub fn composter() -> Self { - let mut block = Self { - kind: BlockKind::Composter, - state: 0, - }; - block.set_level_0_8(0i32); - block - } - #[doc = "Returns an instance of `target` with default state values.\nThe default state values are as follows:\n* `power`: 0\n"] - pub fn target() -> Self { - let mut block = Self { - kind: BlockKind::Target, - state: 0, - }; - block.set_power(0i32); - block - } - #[doc = "Returns an instance of `bee_nest` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `honey_level`: 0\n"] - pub fn bee_nest() -> Self { - let mut block = Self { - kind: BlockKind::BeeNest, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_honey_level(0i32); - block - } - #[doc = "Returns an instance of `beehive` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `honey_level`: 0\n"] - pub fn beehive() -> Self { - let mut block = Self { - kind: BlockKind::Beehive, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_honey_level(0i32); - block - } - #[doc = "Returns an instance of `honey_block` with default state values."] - pub fn honey_block() -> Self { - let mut block = Self { - kind: BlockKind::HoneyBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `honeycomb_block` with default state values."] - pub fn honeycomb_block() -> Self { - let mut block = Self { - kind: BlockKind::HoneycombBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `netherite_block` with default state values."] - pub fn netherite_block() -> Self { - let mut block = Self { - kind: BlockKind::NetheriteBlock, - state: 0, - }; - block - } - #[doc = "Returns an instance of `ancient_debris` with default state values."] - pub fn ancient_debris() -> Self { - let mut block = Self { - kind: BlockKind::AncientDebris, - state: 0, - }; - block - } - #[doc = "Returns an instance of `crying_obsidian` with default state values."] - pub fn crying_obsidian() -> Self { - let mut block = Self { - kind: BlockKind::CryingObsidian, - state: 0, - }; - block - } - #[doc = "Returns an instance of `respawn_anchor` with default state values.\nThe default state values are as follows:\n* `charges`: 0\n"] - pub fn respawn_anchor() -> Self { - let mut block = Self { - kind: BlockKind::RespawnAnchor, - state: 0, - }; - block.set_charges(0i32); - block - } - #[doc = "Returns an instance of `potted_crimson_fungus` with default state values."] - pub fn potted_crimson_fungus() -> Self { - let mut block = Self { - kind: BlockKind::PottedCrimsonFungus, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_warped_fungus` with default state values."] - pub fn potted_warped_fungus() -> Self { - let mut block = Self { - kind: BlockKind::PottedWarpedFungus, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_crimson_roots` with default state values."] - pub fn potted_crimson_roots() -> Self { - let mut block = Self { - kind: BlockKind::PottedCrimsonRoots, - state: 0, - }; - block - } - #[doc = "Returns an instance of `potted_warped_roots` with default state values."] - pub fn potted_warped_roots() -> Self { - let mut block = Self { - kind: BlockKind::PottedWarpedRoots, - state: 0, - }; - block - } - #[doc = "Returns an instance of `lodestone` with default state values."] - pub fn lodestone() -> Self { - let mut block = Self { - kind: BlockKind::Lodestone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blackstone` with default state values."] - pub fn blackstone() -> Self { - let mut block = Self { - kind: BlockKind::Blackstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `blackstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn blackstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::BlackstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `blackstone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn blackstone_wall() -> Self { - let mut block = Self { - kind: BlockKind::BlackstoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `blackstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn blackstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::BlackstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_blackstone` with default state values."] - pub fn polished_blackstone() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_blackstone_bricks` with default state values."] - pub fn polished_blackstone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cracked_polished_blackstone_bricks` with default state values."] - pub fn cracked_polished_blackstone_bricks() -> Self { - let mut block = Self { - kind: BlockKind::CrackedPolishedBlackstoneBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `chiseled_polished_blackstone` with default state values."] - pub fn chiseled_polished_blackstone() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledPolishedBlackstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_blackstone_brick_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn polished_blackstone_brick_slab() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneBrickSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_brick_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn polished_blackstone_brick_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneBrickStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_brick_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn polished_blackstone_brick_wall() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneBrickWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `gilded_blackstone` with default state values."] - pub fn gilded_blackstone() -> Self { - let mut block = Self { - kind: BlockKind::GildedBlackstone, - state: 0, - }; - block - } - #[doc = "Returns an instance of `polished_blackstone_stairs` with default state values.\nThe default state values are as follows:\n* `facing_cardinal`: north\n* `half_top_bottom`: bottom\n* `stairs_shape`: straight\n* `waterlogged`: false\n"] - pub fn polished_blackstone_stairs() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneStairs, - state: 0, - }; - block.set_facing_cardinal(FacingCardinal::North); - block.set_half_top_bottom(HalfTopBottom::Bottom); - block.set_stairs_shape(StairsShape::Straight); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_slab` with default state values.\nThe default state values are as follows:\n* `slab_kind`: bottom\n* `waterlogged`: false\n"] - pub fn polished_blackstone_slab() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneSlab, - state: 0, - }; - block.set_slab_kind(SlabKind::Bottom); - block.set_waterlogged(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_pressure_plate` with default state values.\nThe default state values are as follows:\n* `powered`: false\n"] - pub fn polished_blackstone_pressure_plate() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstonePressurePlate, - state: 0, - }; - block.set_powered(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_button` with default state values.\nThe default state values are as follows:\n* `face`: wall\n* `facing_cardinal`: north\n* `powered`: false\n"] - pub fn polished_blackstone_button() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneButton, - state: 0, - }; - block.set_face(Face::Wall); - block.set_facing_cardinal(FacingCardinal::North); - block.set_powered(false); - block - } - #[doc = "Returns an instance of `polished_blackstone_wall` with default state values.\nThe default state values are as follows:\n* `east_nlt`: none\n* `north_nlt`: none\n* `south_nlt`: none\n* `up`: true\n* `waterlogged`: false\n* `west_nlt`: none\n"] - pub fn polished_blackstone_wall() -> Self { - let mut block = Self { - kind: BlockKind::PolishedBlackstoneWall, - state: 0, - }; - block.set_east_nlt(EastNlt::None); - block.set_north_nlt(NorthNlt::None); - block.set_south_nlt(SouthNlt::None); - block.set_up(true); - block.set_waterlogged(false); - block.set_west_nlt(WestNlt::None); - block - } - #[doc = "Returns an instance of `chiseled_nether_bricks` with default state values."] - pub fn chiseled_nether_bricks() -> Self { - let mut block = Self { - kind: BlockKind::ChiseledNetherBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `cracked_nether_bricks` with default state values."] - pub fn cracked_nether_bricks() -> Self { - let mut block = Self { - kind: BlockKind::CrackedNetherBricks, - state: 0, - }; - block - } - #[doc = "Returns an instance of `quartz_bricks` with default state values."] - pub fn quartz_bricks() -> Self { - let mut block = Self { - kind: BlockKind::QuartzBricks, - state: 0, - }; - block - } - pub fn age_0_1(self) -> Option { - BLOCK_TABLE.age_0_1(self.kind, self.state) - } - pub fn set_age_0_1(&mut self, age_0_1: i32) -> bool { - match BLOCK_TABLE.set_age_0_1(self.kind, self.state, age_0_1) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_1(mut self, age_0_1: i32) -> Self { - self.set_age_0_1(age_0_1); - self - } - pub fn age_0_15(self) -> Option { - BLOCK_TABLE.age_0_15(self.kind, self.state) - } - pub fn set_age_0_15(&mut self, age_0_15: i32) -> bool { - match BLOCK_TABLE.set_age_0_15(self.kind, self.state, age_0_15) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_15(mut self, age_0_15: i32) -> Self { - self.set_age_0_15(age_0_15); - self - } - pub fn age_0_2(self) -> Option { - BLOCK_TABLE.age_0_2(self.kind, self.state) - } - pub fn set_age_0_2(&mut self, age_0_2: i32) -> bool { - match BLOCK_TABLE.set_age_0_2(self.kind, self.state, age_0_2) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_2(mut self, age_0_2: i32) -> Self { - self.set_age_0_2(age_0_2); - self - } - pub fn age_0_25(self) -> Option { - BLOCK_TABLE.age_0_25(self.kind, self.state) - } - pub fn set_age_0_25(&mut self, age_0_25: i32) -> bool { - match BLOCK_TABLE.set_age_0_25(self.kind, self.state, age_0_25) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_25(mut self, age_0_25: i32) -> Self { - self.set_age_0_25(age_0_25); - self - } - pub fn age_0_3(self) -> Option { - BLOCK_TABLE.age_0_3(self.kind, self.state) - } - pub fn set_age_0_3(&mut self, age_0_3: i32) -> bool { - match BLOCK_TABLE.set_age_0_3(self.kind, self.state, age_0_3) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_3(mut self, age_0_3: i32) -> Self { - self.set_age_0_3(age_0_3); - self - } - pub fn age_0_5(self) -> Option { - BLOCK_TABLE.age_0_5(self.kind, self.state) - } - pub fn set_age_0_5(&mut self, age_0_5: i32) -> bool { - match BLOCK_TABLE.set_age_0_5(self.kind, self.state, age_0_5) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_5(mut self, age_0_5: i32) -> Self { - self.set_age_0_5(age_0_5); - self - } - pub fn age_0_7(self) -> Option { - BLOCK_TABLE.age_0_7(self.kind, self.state) - } - pub fn set_age_0_7(&mut self, age_0_7: i32) -> bool { - match BLOCK_TABLE.set_age_0_7(self.kind, self.state, age_0_7) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_age_0_7(mut self, age_0_7: i32) -> Self { - self.set_age_0_7(age_0_7); - self - } - pub fn attached(self) -> Option { - BLOCK_TABLE.attached(self.kind, self.state) - } - pub fn set_attached(&mut self, attached: bool) -> bool { - match BLOCK_TABLE.set_attached(self.kind, self.state, attached) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_attached(mut self, attached: bool) -> Self { - self.set_attached(attached); - self - } - pub fn attachment(self) -> Option { - BLOCK_TABLE.attachment(self.kind, self.state) - } - pub fn set_attachment(&mut self, attachment: Attachment) -> bool { - match BLOCK_TABLE.set_attachment(self.kind, self.state, attachment) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_attachment(mut self, attachment: Attachment) -> Self { - self.set_attachment(attachment); - self - } - pub fn axis_xyz(self) -> Option { - BLOCK_TABLE.axis_xyz(self.kind, self.state) - } - pub fn set_axis_xyz(&mut self, axis_xyz: AxisXyz) -> bool { - match BLOCK_TABLE.set_axis_xyz(self.kind, self.state, axis_xyz) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_axis_xyz(mut self, axis_xyz: AxisXyz) -> Self { - self.set_axis_xyz(axis_xyz); - self - } - pub fn axis_xz(self) -> Option { - BLOCK_TABLE.axis_xz(self.kind, self.state) - } - pub fn set_axis_xz(&mut self, axis_xz: AxisXz) -> bool { - match BLOCK_TABLE.set_axis_xz(self.kind, self.state, axis_xz) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_axis_xz(mut self, axis_xz: AxisXz) -> Self { - self.set_axis_xz(axis_xz); - self - } - pub fn bites(self) -> Option { - BLOCK_TABLE.bites(self.kind, self.state) - } - pub fn set_bites(&mut self, bites: i32) -> bool { - match BLOCK_TABLE.set_bites(self.kind, self.state, bites) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_bites(mut self, bites: i32) -> Self { - self.set_bites(bites); - self - } - pub fn bottom(self) -> Option { - BLOCK_TABLE.bottom(self.kind, self.state) - } - pub fn set_bottom(&mut self, bottom: bool) -> bool { - match BLOCK_TABLE.set_bottom(self.kind, self.state, bottom) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_bottom(mut self, bottom: bool) -> Self { - self.set_bottom(bottom); - self - } - pub fn cauldron_level(self) -> Option { - BLOCK_TABLE.cauldron_level(self.kind, self.state) - } - pub fn set_cauldron_level(&mut self, cauldron_level: i32) -> bool { - match BLOCK_TABLE.set_cauldron_level(self.kind, self.state, cauldron_level) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_cauldron_level(mut self, cauldron_level: i32) -> Self { - self.set_cauldron_level(cauldron_level); - self - } - pub fn charges(self) -> Option { - BLOCK_TABLE.charges(self.kind, self.state) - } - pub fn set_charges(&mut self, charges: i32) -> bool { - match BLOCK_TABLE.set_charges(self.kind, self.state, charges) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_charges(mut self, charges: i32) -> Self { - self.set_charges(charges); - self - } - pub fn chest_kind(self) -> Option { - BLOCK_TABLE.chest_kind(self.kind, self.state) - } - pub fn set_chest_kind(&mut self, chest_kind: ChestKind) -> bool { - match BLOCK_TABLE.set_chest_kind(self.kind, self.state, chest_kind) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_chest_kind(mut self, chest_kind: ChestKind) -> Self { - self.set_chest_kind(chest_kind); - self - } - pub fn comparator_mode(self) -> Option { - BLOCK_TABLE.comparator_mode(self.kind, self.state) - } - pub fn set_comparator_mode(&mut self, comparator_mode: ComparatorMode) -> bool { - match BLOCK_TABLE.set_comparator_mode(self.kind, self.state, comparator_mode) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_comparator_mode(mut self, comparator_mode: ComparatorMode) -> Self { - self.set_comparator_mode(comparator_mode); - self - } - pub fn conditional(self) -> Option { - BLOCK_TABLE.conditional(self.kind, self.state) - } - pub fn set_conditional(&mut self, conditional: bool) -> bool { - match BLOCK_TABLE.set_conditional(self.kind, self.state, conditional) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_conditional(mut self, conditional: bool) -> Self { - self.set_conditional(conditional); - self - } - pub fn delay(self) -> Option { - BLOCK_TABLE.delay(self.kind, self.state) - } - pub fn set_delay(&mut self, delay: i32) -> bool { - match BLOCK_TABLE.set_delay(self.kind, self.state, delay) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_delay(mut self, delay: i32) -> Self { - self.set_delay(delay); - self - } - pub fn disarmed(self) -> Option { - BLOCK_TABLE.disarmed(self.kind, self.state) - } - pub fn set_disarmed(&mut self, disarmed: bool) -> bool { - match BLOCK_TABLE.set_disarmed(self.kind, self.state, disarmed) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_disarmed(mut self, disarmed: bool) -> Self { - self.set_disarmed(disarmed); - self - } - pub fn distance_0_7(self) -> Option { - BLOCK_TABLE.distance_0_7(self.kind, self.state) - } - pub fn set_distance_0_7(&mut self, distance_0_7: i32) -> bool { - match BLOCK_TABLE.set_distance_0_7(self.kind, self.state, distance_0_7) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_distance_0_7(mut self, distance_0_7: i32) -> Self { - self.set_distance_0_7(distance_0_7); - self - } - pub fn distance_1_7(self) -> Option { - BLOCK_TABLE.distance_1_7(self.kind, self.state) - } - pub fn set_distance_1_7(&mut self, distance_1_7: i32) -> bool { - match BLOCK_TABLE.set_distance_1_7(self.kind, self.state, distance_1_7) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_distance_1_7(mut self, distance_1_7: i32) -> Self { - self.set_distance_1_7(distance_1_7); - self - } - pub fn down(self) -> Option { - BLOCK_TABLE.down(self.kind, self.state) - } - pub fn set_down(&mut self, down: bool) -> bool { - match BLOCK_TABLE.set_down(self.kind, self.state, down) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_down(mut self, down: bool) -> Self { - self.set_down(down); - self - } - pub fn drag(self) -> Option { - BLOCK_TABLE.drag(self.kind, self.state) - } - pub fn set_drag(&mut self, drag: bool) -> bool { - match BLOCK_TABLE.set_drag(self.kind, self.state, drag) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_drag(mut self, drag: bool) -> Self { - self.set_drag(drag); - self - } - pub fn east_connected(self) -> Option { - BLOCK_TABLE.east_connected(self.kind, self.state) - } - pub fn set_east_connected(&mut self, east_connected: bool) -> bool { - match BLOCK_TABLE.set_east_connected(self.kind, self.state, east_connected) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_east_connected(mut self, east_connected: bool) -> Self { - self.set_east_connected(east_connected); - self - } - pub fn east_nlt(self) -> Option { - BLOCK_TABLE.east_nlt(self.kind, self.state) - } - pub fn set_east_nlt(&mut self, east_nlt: EastNlt) -> bool { - match BLOCK_TABLE.set_east_nlt(self.kind, self.state, east_nlt) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_east_nlt(mut self, east_nlt: EastNlt) -> Self { - self.set_east_nlt(east_nlt); - self - } - pub fn east_wire(self) -> Option { - BLOCK_TABLE.east_wire(self.kind, self.state) - } - pub fn set_east_wire(&mut self, east_wire: EastWire) -> bool { - match BLOCK_TABLE.set_east_wire(self.kind, self.state, east_wire) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_east_wire(mut self, east_wire: EastWire) -> Self { - self.set_east_wire(east_wire); - self - } - pub fn eggs(self) -> Option { - BLOCK_TABLE.eggs(self.kind, self.state) - } - pub fn set_eggs(&mut self, eggs: i32) -> bool { - match BLOCK_TABLE.set_eggs(self.kind, self.state, eggs) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_eggs(mut self, eggs: i32) -> Self { - self.set_eggs(eggs); - self - } - pub fn enabled(self) -> Option { - BLOCK_TABLE.enabled(self.kind, self.state) - } - pub fn set_enabled(&mut self, enabled: bool) -> bool { - match BLOCK_TABLE.set_enabled(self.kind, self.state, enabled) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_enabled(mut self, enabled: bool) -> Self { - self.set_enabled(enabled); - self - } - pub fn extended(self) -> Option { - BLOCK_TABLE.extended(self.kind, self.state) - } - pub fn set_extended(&mut self, extended: bool) -> bool { - match BLOCK_TABLE.set_extended(self.kind, self.state, extended) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_extended(mut self, extended: bool) -> Self { - self.set_extended(extended); - self - } - pub fn eye(self) -> Option { - BLOCK_TABLE.eye(self.kind, self.state) - } - pub fn set_eye(&mut self, eye: bool) -> bool { - match BLOCK_TABLE.set_eye(self.kind, self.state, eye) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_eye(mut self, eye: bool) -> Self { - self.set_eye(eye); - self - } - pub fn face(self) -> Option { - BLOCK_TABLE.face(self.kind, self.state) - } - pub fn set_face(&mut self, face: Face) -> bool { - match BLOCK_TABLE.set_face(self.kind, self.state, face) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_face(mut self, face: Face) -> Self { - self.set_face(face); - self - } - pub fn facing_cardinal(self) -> Option { - BLOCK_TABLE.facing_cardinal(self.kind, self.state) - } - pub fn set_facing_cardinal(&mut self, facing_cardinal: FacingCardinal) -> bool { - match BLOCK_TABLE.set_facing_cardinal(self.kind, self.state, facing_cardinal) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_facing_cardinal(mut self, facing_cardinal: FacingCardinal) -> Self { - self.set_facing_cardinal(facing_cardinal); - self - } - pub fn facing_cardinal_and_down(self) -> Option { - BLOCK_TABLE.facing_cardinal_and_down(self.kind, self.state) - } - pub fn set_facing_cardinal_and_down( - &mut self, - facing_cardinal_and_down: FacingCardinalAndDown, - ) -> bool { - match BLOCK_TABLE.set_facing_cardinal_and_down( - self.kind, - self.state, - facing_cardinal_and_down, - ) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_facing_cardinal_and_down( - mut self, - facing_cardinal_and_down: FacingCardinalAndDown, - ) -> Self { - self.set_facing_cardinal_and_down(facing_cardinal_and_down); - self - } - pub fn facing_cubic(self) -> Option { - BLOCK_TABLE.facing_cubic(self.kind, self.state) - } - pub fn set_facing_cubic(&mut self, facing_cubic: FacingCubic) -> bool { - match BLOCK_TABLE.set_facing_cubic(self.kind, self.state, facing_cubic) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_facing_cubic(mut self, facing_cubic: FacingCubic) -> Self { - self.set_facing_cubic(facing_cubic); - self - } - pub fn half_top_bottom(self) -> Option { - BLOCK_TABLE.half_top_bottom(self.kind, self.state) - } - pub fn set_half_top_bottom(&mut self, half_top_bottom: HalfTopBottom) -> bool { - match BLOCK_TABLE.set_half_top_bottom(self.kind, self.state, half_top_bottom) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_half_top_bottom(mut self, half_top_bottom: HalfTopBottom) -> Self { - self.set_half_top_bottom(half_top_bottom); - self - } - pub fn half_upper_lower(self) -> Option { - BLOCK_TABLE.half_upper_lower(self.kind, self.state) - } - pub fn set_half_upper_lower(&mut self, half_upper_lower: HalfUpperLower) -> bool { - match BLOCK_TABLE.set_half_upper_lower(self.kind, self.state, half_upper_lower) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_half_upper_lower(mut self, half_upper_lower: HalfUpperLower) -> Self { - self.set_half_upper_lower(half_upper_lower); - self - } - pub fn hanging(self) -> Option { - BLOCK_TABLE.hanging(self.kind, self.state) - } - pub fn set_hanging(&mut self, hanging: bool) -> bool { - match BLOCK_TABLE.set_hanging(self.kind, self.state, hanging) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_hanging(mut self, hanging: bool) -> Self { - self.set_hanging(hanging); - self - } - pub fn has_book(self) -> Option { - BLOCK_TABLE.has_book(self.kind, self.state) - } - pub fn set_has_book(&mut self, has_book: bool) -> bool { - match BLOCK_TABLE.set_has_book(self.kind, self.state, has_book) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_has_book(mut self, has_book: bool) -> Self { - self.set_has_book(has_book); - self - } - pub fn has_bottle_0(self) -> Option { - BLOCK_TABLE.has_bottle_0(self.kind, self.state) - } - pub fn set_has_bottle_0(&mut self, has_bottle_0: bool) -> bool { - match BLOCK_TABLE.set_has_bottle_0(self.kind, self.state, has_bottle_0) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_has_bottle_0(mut self, has_bottle_0: bool) -> Self { - self.set_has_bottle_0(has_bottle_0); - self - } - pub fn has_bottle_1(self) -> Option { - BLOCK_TABLE.has_bottle_1(self.kind, self.state) - } - pub fn set_has_bottle_1(&mut self, has_bottle_1: bool) -> bool { - match BLOCK_TABLE.set_has_bottle_1(self.kind, self.state, has_bottle_1) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_has_bottle_1(mut self, has_bottle_1: bool) -> Self { - self.set_has_bottle_1(has_bottle_1); - self - } - pub fn has_bottle_2(self) -> Option { - BLOCK_TABLE.has_bottle_2(self.kind, self.state) - } - pub fn set_has_bottle_2(&mut self, has_bottle_2: bool) -> bool { - match BLOCK_TABLE.set_has_bottle_2(self.kind, self.state, has_bottle_2) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_has_bottle_2(mut self, has_bottle_2: bool) -> Self { - self.set_has_bottle_2(has_bottle_2); - self - } - pub fn has_record(self) -> Option { - BLOCK_TABLE.has_record(self.kind, self.state) - } - pub fn set_has_record(&mut self, has_record: bool) -> bool { - match BLOCK_TABLE.set_has_record(self.kind, self.state, has_record) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_has_record(mut self, has_record: bool) -> Self { - self.set_has_record(has_record); - self - } - pub fn hatch(self) -> Option { - BLOCK_TABLE.hatch(self.kind, self.state) - } - pub fn set_hatch(&mut self, hatch: i32) -> bool { - match BLOCK_TABLE.set_hatch(self.kind, self.state, hatch) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_hatch(mut self, hatch: i32) -> Self { - self.set_hatch(hatch); - self - } - pub fn hinge(self) -> Option { - BLOCK_TABLE.hinge(self.kind, self.state) - } - pub fn set_hinge(&mut self, hinge: Hinge) -> bool { - match BLOCK_TABLE.set_hinge(self.kind, self.state, hinge) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_hinge(mut self, hinge: Hinge) -> Self { - self.set_hinge(hinge); - self - } - pub fn honey_level(self) -> Option { - BLOCK_TABLE.honey_level(self.kind, self.state) - } - pub fn set_honey_level(&mut self, honey_level: i32) -> bool { - match BLOCK_TABLE.set_honey_level(self.kind, self.state, honey_level) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_honey_level(mut self, honey_level: i32) -> Self { - self.set_honey_level(honey_level); - self - } - pub fn in_wall(self) -> Option { - BLOCK_TABLE.in_wall(self.kind, self.state) - } - pub fn set_in_wall(&mut self, in_wall: bool) -> bool { - match BLOCK_TABLE.set_in_wall(self.kind, self.state, in_wall) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_in_wall(mut self, in_wall: bool) -> Self { - self.set_in_wall(in_wall); - self - } - pub fn instrument(self) -> Option { - BLOCK_TABLE.instrument(self.kind, self.state) - } - pub fn set_instrument(&mut self, instrument: Instrument) -> bool { - match BLOCK_TABLE.set_instrument(self.kind, self.state, instrument) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_instrument(mut self, instrument: Instrument) -> Self { - self.set_instrument(instrument); - self - } - pub fn inverted(self) -> Option { - BLOCK_TABLE.inverted(self.kind, self.state) - } - pub fn set_inverted(&mut self, inverted: bool) -> bool { - match BLOCK_TABLE.set_inverted(self.kind, self.state, inverted) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_inverted(mut self, inverted: bool) -> Self { - self.set_inverted(inverted); - self - } - pub fn layers(self) -> Option { - BLOCK_TABLE.layers(self.kind, self.state) - } - pub fn set_layers(&mut self, layers: i32) -> bool { - match BLOCK_TABLE.set_layers(self.kind, self.state, layers) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_layers(mut self, layers: i32) -> Self { - self.set_layers(layers); - self - } - pub fn leaves(self) -> Option { - BLOCK_TABLE.leaves(self.kind, self.state) - } - pub fn set_leaves(&mut self, leaves: Leaves) -> bool { - match BLOCK_TABLE.set_leaves(self.kind, self.state, leaves) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_leaves(mut self, leaves: Leaves) -> Self { - self.set_leaves(leaves); - self - } - pub fn level_0_8(self) -> Option { - BLOCK_TABLE.level_0_8(self.kind, self.state) - } - pub fn set_level_0_8(&mut self, level_0_8: i32) -> bool { - match BLOCK_TABLE.set_level_0_8(self.kind, self.state, level_0_8) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_level_0_8(mut self, level_0_8: i32) -> Self { - self.set_level_0_8(level_0_8); - self - } - pub fn lit(self) -> Option { - BLOCK_TABLE.lit(self.kind, self.state) - } - pub fn set_lit(&mut self, lit: bool) -> bool { - match BLOCK_TABLE.set_lit(self.kind, self.state, lit) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_lit(mut self, lit: bool) -> Self { - self.set_lit(lit); - self - } - pub fn locked(self) -> Option { - BLOCK_TABLE.locked(self.kind, self.state) - } - pub fn set_locked(&mut self, locked: bool) -> bool { - match BLOCK_TABLE.set_locked(self.kind, self.state, locked) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_locked(mut self, locked: bool) -> Self { - self.set_locked(locked); - self - } - pub fn moisture(self) -> Option { - BLOCK_TABLE.moisture(self.kind, self.state) - } - pub fn set_moisture(&mut self, moisture: i32) -> bool { - match BLOCK_TABLE.set_moisture(self.kind, self.state, moisture) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_moisture(mut self, moisture: i32) -> Self { - self.set_moisture(moisture); - self - } - pub fn north_connected(self) -> Option { - BLOCK_TABLE.north_connected(self.kind, self.state) - } - pub fn set_north_connected(&mut self, north_connected: bool) -> bool { - match BLOCK_TABLE.set_north_connected(self.kind, self.state, north_connected) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_north_connected(mut self, north_connected: bool) -> Self { - self.set_north_connected(north_connected); - self - } - pub fn north_nlt(self) -> Option { - BLOCK_TABLE.north_nlt(self.kind, self.state) - } - pub fn set_north_nlt(&mut self, north_nlt: NorthNlt) -> bool { - match BLOCK_TABLE.set_north_nlt(self.kind, self.state, north_nlt) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_north_nlt(mut self, north_nlt: NorthNlt) -> Self { - self.set_north_nlt(north_nlt); - self - } - pub fn north_wire(self) -> Option { - BLOCK_TABLE.north_wire(self.kind, self.state) - } - pub fn set_north_wire(&mut self, north_wire: NorthWire) -> bool { - match BLOCK_TABLE.set_north_wire(self.kind, self.state, north_wire) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_north_wire(mut self, north_wire: NorthWire) -> Self { - self.set_north_wire(north_wire); - self - } - pub fn note(self) -> Option { - BLOCK_TABLE.note(self.kind, self.state) - } - pub fn set_note(&mut self, note: i32) -> bool { - match BLOCK_TABLE.set_note(self.kind, self.state, note) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_note(mut self, note: i32) -> Self { - self.set_note(note); - self - } - pub fn occupied(self) -> Option { - BLOCK_TABLE.occupied(self.kind, self.state) - } - pub fn set_occupied(&mut self, occupied: bool) -> bool { - match BLOCK_TABLE.set_occupied(self.kind, self.state, occupied) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_occupied(mut self, occupied: bool) -> Self { - self.set_occupied(occupied); - self - } - pub fn open(self) -> Option { - BLOCK_TABLE.open(self.kind, self.state) - } - pub fn set_open(&mut self, open: bool) -> bool { - match BLOCK_TABLE.set_open(self.kind, self.state, open) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_open(mut self, open: bool) -> Self { - self.set_open(open); - self - } - pub fn orientation(self) -> Option { - BLOCK_TABLE.orientation(self.kind, self.state) - } - pub fn set_orientation(&mut self, orientation: Orientation) -> bool { - match BLOCK_TABLE.set_orientation(self.kind, self.state, orientation) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_orientation(mut self, orientation: Orientation) -> Self { - self.set_orientation(orientation); - self - } - pub fn part(self) -> Option { - BLOCK_TABLE.part(self.kind, self.state) - } - pub fn set_part(&mut self, part: Part) -> bool { - match BLOCK_TABLE.set_part(self.kind, self.state, part) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_part(mut self, part: Part) -> Self { - self.set_part(part); - self - } - pub fn persistent(self) -> Option { - BLOCK_TABLE.persistent(self.kind, self.state) - } - pub fn set_persistent(&mut self, persistent: bool) -> bool { - match BLOCK_TABLE.set_persistent(self.kind, self.state, persistent) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_persistent(mut self, persistent: bool) -> Self { - self.set_persistent(persistent); - self - } - pub fn pickles(self) -> Option { - BLOCK_TABLE.pickles(self.kind, self.state) - } - pub fn set_pickles(&mut self, pickles: i32) -> bool { - match BLOCK_TABLE.set_pickles(self.kind, self.state, pickles) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_pickles(mut self, pickles: i32) -> Self { - self.set_pickles(pickles); - self - } - pub fn piston_kind(self) -> Option { - BLOCK_TABLE.piston_kind(self.kind, self.state) - } - pub fn set_piston_kind(&mut self, piston_kind: PistonKind) -> bool { - match BLOCK_TABLE.set_piston_kind(self.kind, self.state, piston_kind) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_piston_kind(mut self, piston_kind: PistonKind) -> Self { - self.set_piston_kind(piston_kind); - self - } - pub fn power(self) -> Option { - BLOCK_TABLE.power(self.kind, self.state) - } - pub fn set_power(&mut self, power: i32) -> bool { - match BLOCK_TABLE.set_power(self.kind, self.state, power) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_power(mut self, power: i32) -> Self { - self.set_power(power); - self - } - pub fn powered(self) -> Option { - BLOCK_TABLE.powered(self.kind, self.state) - } - pub fn set_powered(&mut self, powered: bool) -> bool { - match BLOCK_TABLE.set_powered(self.kind, self.state, powered) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_powered(mut self, powered: bool) -> Self { - self.set_powered(powered); - self - } - pub fn powered_rail_shape(self) -> Option { - BLOCK_TABLE.powered_rail_shape(self.kind, self.state) - } - pub fn set_powered_rail_shape(&mut self, powered_rail_shape: PoweredRailShape) -> bool { - match BLOCK_TABLE.set_powered_rail_shape(self.kind, self.state, powered_rail_shape) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_powered_rail_shape(mut self, powered_rail_shape: PoweredRailShape) -> Self { - self.set_powered_rail_shape(powered_rail_shape); - self - } - pub fn rail_shape(self) -> Option { - BLOCK_TABLE.rail_shape(self.kind, self.state) - } - pub fn set_rail_shape(&mut self, rail_shape: RailShape) -> bool { - match BLOCK_TABLE.set_rail_shape(self.kind, self.state, rail_shape) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_rail_shape(mut self, rail_shape: RailShape) -> Self { - self.set_rail_shape(rail_shape); - self - } - pub fn rotation(self) -> Option { - BLOCK_TABLE.rotation(self.kind, self.state) - } - pub fn set_rotation(&mut self, rotation: i32) -> bool { - match BLOCK_TABLE.set_rotation(self.kind, self.state, rotation) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_rotation(mut self, rotation: i32) -> Self { - self.set_rotation(rotation); - self - } - pub fn short(self) -> Option { - BLOCK_TABLE.short(self.kind, self.state) - } - pub fn set_short(&mut self, short: bool) -> bool { - match BLOCK_TABLE.set_short(self.kind, self.state, short) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_short(mut self, short: bool) -> Self { - self.set_short(short); - self - } - pub fn signal_fire(self) -> Option { - BLOCK_TABLE.signal_fire(self.kind, self.state) - } - pub fn set_signal_fire(&mut self, signal_fire: bool) -> bool { - match BLOCK_TABLE.set_signal_fire(self.kind, self.state, signal_fire) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_signal_fire(mut self, signal_fire: bool) -> Self { - self.set_signal_fire(signal_fire); - self - } - pub fn slab_kind(self) -> Option { - BLOCK_TABLE.slab_kind(self.kind, self.state) - } - pub fn set_slab_kind(&mut self, slab_kind: SlabKind) -> bool { - match BLOCK_TABLE.set_slab_kind(self.kind, self.state, slab_kind) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_slab_kind(mut self, slab_kind: SlabKind) -> Self { - self.set_slab_kind(slab_kind); - self - } - pub fn snowy(self) -> Option { - BLOCK_TABLE.snowy(self.kind, self.state) - } - pub fn set_snowy(&mut self, snowy: bool) -> bool { - match BLOCK_TABLE.set_snowy(self.kind, self.state, snowy) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_snowy(mut self, snowy: bool) -> Self { - self.set_snowy(snowy); - self - } - pub fn south_connected(self) -> Option { - BLOCK_TABLE.south_connected(self.kind, self.state) - } - pub fn set_south_connected(&mut self, south_connected: bool) -> bool { - match BLOCK_TABLE.set_south_connected(self.kind, self.state, south_connected) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_south_connected(mut self, south_connected: bool) -> Self { - self.set_south_connected(south_connected); - self - } - pub fn south_nlt(self) -> Option { - BLOCK_TABLE.south_nlt(self.kind, self.state) - } - pub fn set_south_nlt(&mut self, south_nlt: SouthNlt) -> bool { - match BLOCK_TABLE.set_south_nlt(self.kind, self.state, south_nlt) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_south_nlt(mut self, south_nlt: SouthNlt) -> Self { - self.set_south_nlt(south_nlt); - self - } - pub fn south_wire(self) -> Option { - BLOCK_TABLE.south_wire(self.kind, self.state) - } - pub fn set_south_wire(&mut self, south_wire: SouthWire) -> bool { - match BLOCK_TABLE.set_south_wire(self.kind, self.state, south_wire) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_south_wire(mut self, south_wire: SouthWire) -> Self { - self.set_south_wire(south_wire); - self - } - pub fn stage(self) -> Option { - BLOCK_TABLE.stage(self.kind, self.state) - } - pub fn set_stage(&mut self, stage: i32) -> bool { - match BLOCK_TABLE.set_stage(self.kind, self.state, stage) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_stage(mut self, stage: i32) -> Self { - self.set_stage(stage); - self - } - pub fn stairs_shape(self) -> Option { - BLOCK_TABLE.stairs_shape(self.kind, self.state) - } - pub fn set_stairs_shape(&mut self, stairs_shape: StairsShape) -> bool { - match BLOCK_TABLE.set_stairs_shape(self.kind, self.state, stairs_shape) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_stairs_shape(mut self, stairs_shape: StairsShape) -> Self { - self.set_stairs_shape(stairs_shape); - self - } - pub fn structure_block_mode(self) -> Option { - BLOCK_TABLE.structure_block_mode(self.kind, self.state) - } - pub fn set_structure_block_mode(&mut self, structure_block_mode: StructureBlockMode) -> bool { - match BLOCK_TABLE.set_structure_block_mode(self.kind, self.state, structure_block_mode) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_structure_block_mode(mut self, structure_block_mode: StructureBlockMode) -> Self { - self.set_structure_block_mode(structure_block_mode); - self - } - pub fn triggered(self) -> Option { - BLOCK_TABLE.triggered(self.kind, self.state) - } - pub fn set_triggered(&mut self, triggered: bool) -> bool { - match BLOCK_TABLE.set_triggered(self.kind, self.state, triggered) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_triggered(mut self, triggered: bool) -> Self { - self.set_triggered(triggered); - self - } - pub fn unstable(self) -> Option { - BLOCK_TABLE.unstable(self.kind, self.state) - } - pub fn set_unstable(&mut self, unstable: bool) -> bool { - match BLOCK_TABLE.set_unstable(self.kind, self.state, unstable) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_unstable(mut self, unstable: bool) -> Self { - self.set_unstable(unstable); - self - } - pub fn up(self) -> Option { - BLOCK_TABLE.up(self.kind, self.state) - } - pub fn set_up(&mut self, up: bool) -> bool { - match BLOCK_TABLE.set_up(self.kind, self.state, up) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_up(mut self, up: bool) -> Self { - self.set_up(up); - self - } - pub fn water_level(self) -> Option { - BLOCK_TABLE.water_level(self.kind, self.state) - } - pub fn set_water_level(&mut self, water_level: i32) -> bool { - match BLOCK_TABLE.set_water_level(self.kind, self.state, water_level) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_water_level(mut self, water_level: i32) -> Self { - self.set_water_level(water_level); - self - } - pub fn waterlogged(self) -> Option { - BLOCK_TABLE.waterlogged(self.kind, self.state) - } - pub fn set_waterlogged(&mut self, waterlogged: bool) -> bool { - match BLOCK_TABLE.set_waterlogged(self.kind, self.state, waterlogged) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_waterlogged(mut self, waterlogged: bool) -> Self { - self.set_waterlogged(waterlogged); - self - } - pub fn west_connected(self) -> Option { - BLOCK_TABLE.west_connected(self.kind, self.state) - } - pub fn set_west_connected(&mut self, west_connected: bool) -> bool { - match BLOCK_TABLE.set_west_connected(self.kind, self.state, west_connected) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_west_connected(mut self, west_connected: bool) -> Self { - self.set_west_connected(west_connected); - self - } - pub fn west_nlt(self) -> Option { - BLOCK_TABLE.west_nlt(self.kind, self.state) - } - pub fn set_west_nlt(&mut self, west_nlt: WestNlt) -> bool { - match BLOCK_TABLE.set_west_nlt(self.kind, self.state, west_nlt) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_west_nlt(mut self, west_nlt: WestNlt) -> Self { - self.set_west_nlt(west_nlt); - self - } - pub fn west_wire(self) -> Option { - BLOCK_TABLE.west_wire(self.kind, self.state) - } - pub fn set_west_wire(&mut self, west_wire: WestWire) -> bool { - match BLOCK_TABLE.set_west_wire(self.kind, self.state, west_wire) { - Some(new_state) => { - self.state = new_state; - true - } - None => false, - } - } - pub fn with_west_wire(mut self, west_wire: WestWire) -> Self { - self.set_west_wire(west_wire); - self - } - #[doc = "Returns the identifier of this block. For example, returns `minecraft::air` for an air block."] - pub fn identifier(self) -> &'static str { - match self.kind { - BlockKind::Air => "minecraft:air", - BlockKind::Stone => "minecraft:stone", - BlockKind::Granite => "minecraft:granite", - BlockKind::PolishedGranite => "minecraft:polished_granite", - BlockKind::Diorite => "minecraft:diorite", - BlockKind::PolishedDiorite => "minecraft:polished_diorite", - BlockKind::Andesite => "minecraft:andesite", - BlockKind::PolishedAndesite => "minecraft:polished_andesite", - BlockKind::GrassBlock => "minecraft:grass_block", - BlockKind::Dirt => "minecraft:dirt", - BlockKind::CoarseDirt => "minecraft:coarse_dirt", - BlockKind::Podzol => "minecraft:podzol", - BlockKind::Cobblestone => "minecraft:cobblestone", - BlockKind::OakPlanks => "minecraft:oak_planks", - BlockKind::SprucePlanks => "minecraft:spruce_planks", - BlockKind::BirchPlanks => "minecraft:birch_planks", - BlockKind::JunglePlanks => "minecraft:jungle_planks", - BlockKind::AcaciaPlanks => "minecraft:acacia_planks", - BlockKind::DarkOakPlanks => "minecraft:dark_oak_planks", - BlockKind::OakSapling => "minecraft:oak_sapling", - BlockKind::SpruceSapling => "minecraft:spruce_sapling", - BlockKind::BirchSapling => "minecraft:birch_sapling", - BlockKind::JungleSapling => "minecraft:jungle_sapling", - BlockKind::AcaciaSapling => "minecraft:acacia_sapling", - BlockKind::DarkOakSapling => "minecraft:dark_oak_sapling", - BlockKind::Bedrock => "minecraft:bedrock", - BlockKind::Water => "minecraft:water", - BlockKind::Lava => "minecraft:lava", - BlockKind::Sand => "minecraft:sand", - BlockKind::RedSand => "minecraft:red_sand", - BlockKind::Gravel => "minecraft:gravel", - BlockKind::GoldOre => "minecraft:gold_ore", - BlockKind::IronOre => "minecraft:iron_ore", - BlockKind::CoalOre => "minecraft:coal_ore", - BlockKind::NetherGoldOre => "minecraft:nether_gold_ore", - BlockKind::OakLog => "minecraft:oak_log", - BlockKind::SpruceLog => "minecraft:spruce_log", - BlockKind::BirchLog => "minecraft:birch_log", - BlockKind::JungleLog => "minecraft:jungle_log", - BlockKind::AcaciaLog => "minecraft:acacia_log", - BlockKind::DarkOakLog => "minecraft:dark_oak_log", - BlockKind::StrippedSpruceLog => "minecraft:stripped_spruce_log", - BlockKind::StrippedBirchLog => "minecraft:stripped_birch_log", - BlockKind::StrippedJungleLog => "minecraft:stripped_jungle_log", - BlockKind::StrippedAcaciaLog => "minecraft:stripped_acacia_log", - BlockKind::StrippedDarkOakLog => "minecraft:stripped_dark_oak_log", - BlockKind::StrippedOakLog => "minecraft:stripped_oak_log", - BlockKind::OakWood => "minecraft:oak_wood", - BlockKind::SpruceWood => "minecraft:spruce_wood", - BlockKind::BirchWood => "minecraft:birch_wood", - BlockKind::JungleWood => "minecraft:jungle_wood", - BlockKind::AcaciaWood => "minecraft:acacia_wood", - BlockKind::DarkOakWood => "minecraft:dark_oak_wood", - BlockKind::StrippedOakWood => "minecraft:stripped_oak_wood", - BlockKind::StrippedSpruceWood => "minecraft:stripped_spruce_wood", - BlockKind::StrippedBirchWood => "minecraft:stripped_birch_wood", - BlockKind::StrippedJungleWood => "minecraft:stripped_jungle_wood", - BlockKind::StrippedAcaciaWood => "minecraft:stripped_acacia_wood", - BlockKind::StrippedDarkOakWood => "minecraft:stripped_dark_oak_wood", - BlockKind::OakLeaves => "minecraft:oak_leaves", - BlockKind::SpruceLeaves => "minecraft:spruce_leaves", - BlockKind::BirchLeaves => "minecraft:birch_leaves", - BlockKind::JungleLeaves => "minecraft:jungle_leaves", - BlockKind::AcaciaLeaves => "minecraft:acacia_leaves", - BlockKind::DarkOakLeaves => "minecraft:dark_oak_leaves", - BlockKind::Sponge => "minecraft:sponge", - BlockKind::WetSponge => "minecraft:wet_sponge", - BlockKind::Glass => "minecraft:glass", - BlockKind::LapisOre => "minecraft:lapis_ore", - BlockKind::LapisBlock => "minecraft:lapis_block", - BlockKind::Dispenser => "minecraft:dispenser", - BlockKind::Sandstone => "minecraft:sandstone", - BlockKind::ChiseledSandstone => "minecraft:chiseled_sandstone", - BlockKind::CutSandstone => "minecraft:cut_sandstone", - BlockKind::NoteBlock => "minecraft:note_block", - BlockKind::WhiteBed => "minecraft:white_bed", - BlockKind::OrangeBed => "minecraft:orange_bed", - BlockKind::MagentaBed => "minecraft:magenta_bed", - BlockKind::LightBlueBed => "minecraft:light_blue_bed", - BlockKind::YellowBed => "minecraft:yellow_bed", - BlockKind::LimeBed => "minecraft:lime_bed", - BlockKind::PinkBed => "minecraft:pink_bed", - BlockKind::GrayBed => "minecraft:gray_bed", - BlockKind::LightGrayBed => "minecraft:light_gray_bed", - BlockKind::CyanBed => "minecraft:cyan_bed", - BlockKind::PurpleBed => "minecraft:purple_bed", - BlockKind::BlueBed => "minecraft:blue_bed", - BlockKind::BrownBed => "minecraft:brown_bed", - BlockKind::GreenBed => "minecraft:green_bed", - BlockKind::RedBed => "minecraft:red_bed", - BlockKind::BlackBed => "minecraft:black_bed", - BlockKind::PoweredRail => "minecraft:powered_rail", - BlockKind::DetectorRail => "minecraft:detector_rail", - BlockKind::StickyPiston => "minecraft:sticky_piston", - BlockKind::Cobweb => "minecraft:cobweb", - BlockKind::Grass => "minecraft:grass", - BlockKind::Fern => "minecraft:fern", - BlockKind::DeadBush => "minecraft:dead_bush", - BlockKind::Seagrass => "minecraft:seagrass", - BlockKind::TallSeagrass => "minecraft:tall_seagrass", - BlockKind::Piston => "minecraft:piston", - BlockKind::PistonHead => "minecraft:piston_head", - BlockKind::WhiteWool => "minecraft:white_wool", - BlockKind::OrangeWool => "minecraft:orange_wool", - BlockKind::MagentaWool => "minecraft:magenta_wool", - BlockKind::LightBlueWool => "minecraft:light_blue_wool", - BlockKind::YellowWool => "minecraft:yellow_wool", - BlockKind::LimeWool => "minecraft:lime_wool", - BlockKind::PinkWool => "minecraft:pink_wool", - BlockKind::GrayWool => "minecraft:gray_wool", - BlockKind::LightGrayWool => "minecraft:light_gray_wool", - BlockKind::CyanWool => "minecraft:cyan_wool", - BlockKind::PurpleWool => "minecraft:purple_wool", - BlockKind::BlueWool => "minecraft:blue_wool", - BlockKind::BrownWool => "minecraft:brown_wool", - BlockKind::GreenWool => "minecraft:green_wool", - BlockKind::RedWool => "minecraft:red_wool", - BlockKind::BlackWool => "minecraft:black_wool", - BlockKind::MovingPiston => "minecraft:moving_piston", - BlockKind::Dandelion => "minecraft:dandelion", - BlockKind::Poppy => "minecraft:poppy", - BlockKind::BlueOrchid => "minecraft:blue_orchid", - BlockKind::Allium => "minecraft:allium", - BlockKind::AzureBluet => "minecraft:azure_bluet", - BlockKind::RedTulip => "minecraft:red_tulip", - BlockKind::OrangeTulip => "minecraft:orange_tulip", - BlockKind::WhiteTulip => "minecraft:white_tulip", - BlockKind::PinkTulip => "minecraft:pink_tulip", - BlockKind::OxeyeDaisy => "minecraft:oxeye_daisy", - BlockKind::Cornflower => "minecraft:cornflower", - BlockKind::WitherRose => "minecraft:wither_rose", - BlockKind::LilyOfTheValley => "minecraft:lily_of_the_valley", - BlockKind::BrownMushroom => "minecraft:brown_mushroom", - BlockKind::RedMushroom => "minecraft:red_mushroom", - BlockKind::GoldBlock => "minecraft:gold_block", - BlockKind::IronBlock => "minecraft:iron_block", - BlockKind::Bricks => "minecraft:bricks", - BlockKind::Tnt => "minecraft:tnt", - BlockKind::Bookshelf => "minecraft:bookshelf", - BlockKind::MossyCobblestone => "minecraft:mossy_cobblestone", - BlockKind::Obsidian => "minecraft:obsidian", - BlockKind::Torch => "minecraft:torch", - BlockKind::WallTorch => "minecraft:wall_torch", - BlockKind::Fire => "minecraft:fire", - BlockKind::SoulFire => "minecraft:soul_fire", - BlockKind::Spawner => "minecraft:spawner", - BlockKind::OakStairs => "minecraft:oak_stairs", - BlockKind::Chest => "minecraft:chest", - BlockKind::RedstoneWire => "minecraft:redstone_wire", - BlockKind::DiamondOre => "minecraft:diamond_ore", - BlockKind::DiamondBlock => "minecraft:diamond_block", - BlockKind::CraftingTable => "minecraft:crafting_table", - BlockKind::Wheat => "minecraft:wheat", - BlockKind::Farmland => "minecraft:farmland", - BlockKind::Furnace => "minecraft:furnace", - BlockKind::OakSign => "minecraft:oak_sign", - BlockKind::SpruceSign => "minecraft:spruce_sign", - BlockKind::BirchSign => "minecraft:birch_sign", - BlockKind::AcaciaSign => "minecraft:acacia_sign", - BlockKind::JungleSign => "minecraft:jungle_sign", - BlockKind::DarkOakSign => "minecraft:dark_oak_sign", - BlockKind::OakDoor => "minecraft:oak_door", - BlockKind::Ladder => "minecraft:ladder", - BlockKind::Rail => "minecraft:rail", - BlockKind::CobblestoneStairs => "minecraft:cobblestone_stairs", - BlockKind::OakWallSign => "minecraft:oak_wall_sign", - BlockKind::SpruceWallSign => "minecraft:spruce_wall_sign", - BlockKind::BirchWallSign => "minecraft:birch_wall_sign", - BlockKind::AcaciaWallSign => "minecraft:acacia_wall_sign", - BlockKind::JungleWallSign => "minecraft:jungle_wall_sign", - BlockKind::DarkOakWallSign => "minecraft:dark_oak_wall_sign", - BlockKind::Lever => "minecraft:lever", - BlockKind::StonePressurePlate => "minecraft:stone_pressure_plate", - BlockKind::IronDoor => "minecraft:iron_door", - BlockKind::OakPressurePlate => "minecraft:oak_pressure_plate", - BlockKind::SprucePressurePlate => "minecraft:spruce_pressure_plate", - BlockKind::BirchPressurePlate => "minecraft:birch_pressure_plate", - BlockKind::JunglePressurePlate => "minecraft:jungle_pressure_plate", - BlockKind::AcaciaPressurePlate => "minecraft:acacia_pressure_plate", - BlockKind::DarkOakPressurePlate => "minecraft:dark_oak_pressure_plate", - BlockKind::RedstoneOre => "minecraft:redstone_ore", - BlockKind::RedstoneTorch => "minecraft:redstone_torch", - BlockKind::RedstoneWallTorch => "minecraft:redstone_wall_torch", - BlockKind::StoneButton => "minecraft:stone_button", - BlockKind::Snow => "minecraft:snow", - BlockKind::Ice => "minecraft:ice", - BlockKind::SnowBlock => "minecraft:snow_block", - BlockKind::Cactus => "minecraft:cactus", - BlockKind::Clay => "minecraft:clay", - BlockKind::SugarCane => "minecraft:sugar_cane", - BlockKind::Jukebox => "minecraft:jukebox", - BlockKind::OakFence => "minecraft:oak_fence", - BlockKind::Pumpkin => "minecraft:pumpkin", - BlockKind::Netherrack => "minecraft:netherrack", - BlockKind::SoulSand => "minecraft:soul_sand", - BlockKind::SoulSoil => "minecraft:soul_soil", - BlockKind::Basalt => "minecraft:basalt", - BlockKind::PolishedBasalt => "minecraft:polished_basalt", - BlockKind::SoulTorch => "minecraft:soul_torch", - BlockKind::SoulWallTorch => "minecraft:soul_wall_torch", - BlockKind::Glowstone => "minecraft:glowstone", - BlockKind::NetherPortal => "minecraft:nether_portal", - BlockKind::CarvedPumpkin => "minecraft:carved_pumpkin", - BlockKind::JackOLantern => "minecraft:jack_o_lantern", - BlockKind::Cake => "minecraft:cake", - BlockKind::Repeater => "minecraft:repeater", - BlockKind::WhiteStainedGlass => "minecraft:white_stained_glass", - BlockKind::OrangeStainedGlass => "minecraft:orange_stained_glass", - BlockKind::MagentaStainedGlass => "minecraft:magenta_stained_glass", - BlockKind::LightBlueStainedGlass => "minecraft:light_blue_stained_glass", - BlockKind::YellowStainedGlass => "minecraft:yellow_stained_glass", - BlockKind::LimeStainedGlass => "minecraft:lime_stained_glass", - BlockKind::PinkStainedGlass => "minecraft:pink_stained_glass", - BlockKind::GrayStainedGlass => "minecraft:gray_stained_glass", - BlockKind::LightGrayStainedGlass => "minecraft:light_gray_stained_glass", - BlockKind::CyanStainedGlass => "minecraft:cyan_stained_glass", - BlockKind::PurpleStainedGlass => "minecraft:purple_stained_glass", - BlockKind::BlueStainedGlass => "minecraft:blue_stained_glass", - BlockKind::BrownStainedGlass => "minecraft:brown_stained_glass", - BlockKind::GreenStainedGlass => "minecraft:green_stained_glass", - BlockKind::RedStainedGlass => "minecraft:red_stained_glass", - BlockKind::BlackStainedGlass => "minecraft:black_stained_glass", - BlockKind::OakTrapdoor => "minecraft:oak_trapdoor", - BlockKind::SpruceTrapdoor => "minecraft:spruce_trapdoor", - BlockKind::BirchTrapdoor => "minecraft:birch_trapdoor", - BlockKind::JungleTrapdoor => "minecraft:jungle_trapdoor", - BlockKind::AcaciaTrapdoor => "minecraft:acacia_trapdoor", - BlockKind::DarkOakTrapdoor => "minecraft:dark_oak_trapdoor", - BlockKind::StoneBricks => "minecraft:stone_bricks", - BlockKind::MossyStoneBricks => "minecraft:mossy_stone_bricks", - BlockKind::CrackedStoneBricks => "minecraft:cracked_stone_bricks", - BlockKind::ChiseledStoneBricks => "minecraft:chiseled_stone_bricks", - BlockKind::InfestedStone => "minecraft:infested_stone", - BlockKind::InfestedCobblestone => "minecraft:infested_cobblestone", - BlockKind::InfestedStoneBricks => "minecraft:infested_stone_bricks", - BlockKind::InfestedMossyStoneBricks => "minecraft:infested_mossy_stone_bricks", - BlockKind::InfestedCrackedStoneBricks => "minecraft:infested_cracked_stone_bricks", - BlockKind::InfestedChiseledStoneBricks => "minecraft:infested_chiseled_stone_bricks", - BlockKind::BrownMushroomBlock => "minecraft:brown_mushroom_block", - BlockKind::RedMushroomBlock => "minecraft:red_mushroom_block", - BlockKind::MushroomStem => "minecraft:mushroom_stem", - BlockKind::IronBars => "minecraft:iron_bars", - BlockKind::Chain => "minecraft:chain", - BlockKind::GlassPane => "minecraft:glass_pane", - BlockKind::Melon => "minecraft:melon", - BlockKind::AttachedPumpkinStem => "minecraft:attached_pumpkin_stem", - BlockKind::AttachedMelonStem => "minecraft:attached_melon_stem", - BlockKind::PumpkinStem => "minecraft:pumpkin_stem", - BlockKind::MelonStem => "minecraft:melon_stem", - BlockKind::Vine => "minecraft:vine", - BlockKind::OakFenceGate => "minecraft:oak_fence_gate", - BlockKind::BrickStairs => "minecraft:brick_stairs", - BlockKind::StoneBrickStairs => "minecraft:stone_brick_stairs", - BlockKind::Mycelium => "minecraft:mycelium", - BlockKind::LilyPad => "minecraft:lily_pad", - BlockKind::NetherBricks => "minecraft:nether_bricks", - BlockKind::NetherBrickFence => "minecraft:nether_brick_fence", - BlockKind::NetherBrickStairs => "minecraft:nether_brick_stairs", - BlockKind::NetherWart => "minecraft:nether_wart", - BlockKind::EnchantingTable => "minecraft:enchanting_table", - BlockKind::BrewingStand => "minecraft:brewing_stand", - BlockKind::Cauldron => "minecraft:cauldron", - BlockKind::EndPortal => "minecraft:end_portal", - BlockKind::EndPortalFrame => "minecraft:end_portal_frame", - BlockKind::EndStone => "minecraft:end_stone", - BlockKind::DragonEgg => "minecraft:dragon_egg", - BlockKind::RedstoneLamp => "minecraft:redstone_lamp", - BlockKind::Cocoa => "minecraft:cocoa", - BlockKind::SandstoneStairs => "minecraft:sandstone_stairs", - BlockKind::EmeraldOre => "minecraft:emerald_ore", - BlockKind::EnderChest => "minecraft:ender_chest", - BlockKind::TripwireHook => "minecraft:tripwire_hook", - BlockKind::Tripwire => "minecraft:tripwire", - BlockKind::EmeraldBlock => "minecraft:emerald_block", - BlockKind::SpruceStairs => "minecraft:spruce_stairs", - BlockKind::BirchStairs => "minecraft:birch_stairs", - BlockKind::JungleStairs => "minecraft:jungle_stairs", - BlockKind::CommandBlock => "minecraft:command_block", - BlockKind::Beacon => "minecraft:beacon", - BlockKind::CobblestoneWall => "minecraft:cobblestone_wall", - BlockKind::MossyCobblestoneWall => "minecraft:mossy_cobblestone_wall", - BlockKind::FlowerPot => "minecraft:flower_pot", - BlockKind::PottedOakSapling => "minecraft:potted_oak_sapling", - BlockKind::PottedSpruceSapling => "minecraft:potted_spruce_sapling", - BlockKind::PottedBirchSapling => "minecraft:potted_birch_sapling", - BlockKind::PottedJungleSapling => "minecraft:potted_jungle_sapling", - BlockKind::PottedAcaciaSapling => "minecraft:potted_acacia_sapling", - BlockKind::PottedDarkOakSapling => "minecraft:potted_dark_oak_sapling", - BlockKind::PottedFern => "minecraft:potted_fern", - BlockKind::PottedDandelion => "minecraft:potted_dandelion", - BlockKind::PottedPoppy => "minecraft:potted_poppy", - BlockKind::PottedBlueOrchid => "minecraft:potted_blue_orchid", - BlockKind::PottedAllium => "minecraft:potted_allium", - BlockKind::PottedAzureBluet => "minecraft:potted_azure_bluet", - BlockKind::PottedRedTulip => "minecraft:potted_red_tulip", - BlockKind::PottedOrangeTulip => "minecraft:potted_orange_tulip", - BlockKind::PottedWhiteTulip => "minecraft:potted_white_tulip", - BlockKind::PottedPinkTulip => "minecraft:potted_pink_tulip", - BlockKind::PottedOxeyeDaisy => "minecraft:potted_oxeye_daisy", - BlockKind::PottedCornflower => "minecraft:potted_cornflower", - BlockKind::PottedLilyOfTheValley => "minecraft:potted_lily_of_the_valley", - BlockKind::PottedWitherRose => "minecraft:potted_wither_rose", - BlockKind::PottedRedMushroom => "minecraft:potted_red_mushroom", - BlockKind::PottedBrownMushroom => "minecraft:potted_brown_mushroom", - BlockKind::PottedDeadBush => "minecraft:potted_dead_bush", - BlockKind::PottedCactus => "minecraft:potted_cactus", - BlockKind::Carrots => "minecraft:carrots", - BlockKind::Potatoes => "minecraft:potatoes", - BlockKind::OakButton => "minecraft:oak_button", - BlockKind::SpruceButton => "minecraft:spruce_button", - BlockKind::BirchButton => "minecraft:birch_button", - BlockKind::JungleButton => "minecraft:jungle_button", - BlockKind::AcaciaButton => "minecraft:acacia_button", - BlockKind::DarkOakButton => "minecraft:dark_oak_button", - BlockKind::SkeletonSkull => "minecraft:skeleton_skull", - BlockKind::SkeletonWallSkull => "minecraft:skeleton_wall_skull", - BlockKind::WitherSkeletonSkull => "minecraft:wither_skeleton_skull", - BlockKind::WitherSkeletonWallSkull => "minecraft:wither_skeleton_wall_skull", - BlockKind::ZombieHead => "minecraft:zombie_head", - BlockKind::ZombieWallHead => "minecraft:zombie_wall_head", - BlockKind::PlayerHead => "minecraft:player_head", - BlockKind::PlayerWallHead => "minecraft:player_wall_head", - BlockKind::CreeperHead => "minecraft:creeper_head", - BlockKind::CreeperWallHead => "minecraft:creeper_wall_head", - BlockKind::DragonHead => "minecraft:dragon_head", - BlockKind::DragonWallHead => "minecraft:dragon_wall_head", - BlockKind::Anvil => "minecraft:anvil", - BlockKind::ChippedAnvil => "minecraft:chipped_anvil", - BlockKind::DamagedAnvil => "minecraft:damaged_anvil", - BlockKind::TrappedChest => "minecraft:trapped_chest", - BlockKind::LightWeightedPressurePlate => "minecraft:light_weighted_pressure_plate", - BlockKind::HeavyWeightedPressurePlate => "minecraft:heavy_weighted_pressure_plate", - BlockKind::Comparator => "minecraft:comparator", - BlockKind::DaylightDetector => "minecraft:daylight_detector", - BlockKind::RedstoneBlock => "minecraft:redstone_block", - BlockKind::NetherQuartzOre => "minecraft:nether_quartz_ore", - BlockKind::Hopper => "minecraft:hopper", - BlockKind::QuartzBlock => "minecraft:quartz_block", - BlockKind::ChiseledQuartzBlock => "minecraft:chiseled_quartz_block", - BlockKind::QuartzPillar => "minecraft:quartz_pillar", - BlockKind::QuartzStairs => "minecraft:quartz_stairs", - BlockKind::ActivatorRail => "minecraft:activator_rail", - BlockKind::Dropper => "minecraft:dropper", - BlockKind::WhiteTerracotta => "minecraft:white_terracotta", - BlockKind::OrangeTerracotta => "minecraft:orange_terracotta", - BlockKind::MagentaTerracotta => "minecraft:magenta_terracotta", - BlockKind::LightBlueTerracotta => "minecraft:light_blue_terracotta", - BlockKind::YellowTerracotta => "minecraft:yellow_terracotta", - BlockKind::LimeTerracotta => "minecraft:lime_terracotta", - BlockKind::PinkTerracotta => "minecraft:pink_terracotta", - BlockKind::GrayTerracotta => "minecraft:gray_terracotta", - BlockKind::LightGrayTerracotta => "minecraft:light_gray_terracotta", - BlockKind::CyanTerracotta => "minecraft:cyan_terracotta", - BlockKind::PurpleTerracotta => "minecraft:purple_terracotta", - BlockKind::BlueTerracotta => "minecraft:blue_terracotta", - BlockKind::BrownTerracotta => "minecraft:brown_terracotta", - BlockKind::GreenTerracotta => "minecraft:green_terracotta", - BlockKind::RedTerracotta => "minecraft:red_terracotta", - BlockKind::BlackTerracotta => "minecraft:black_terracotta", - BlockKind::WhiteStainedGlassPane => "minecraft:white_stained_glass_pane", - BlockKind::OrangeStainedGlassPane => "minecraft:orange_stained_glass_pane", - BlockKind::MagentaStainedGlassPane => "minecraft:magenta_stained_glass_pane", - BlockKind::LightBlueStainedGlassPane => "minecraft:light_blue_stained_glass_pane", - BlockKind::YellowStainedGlassPane => "minecraft:yellow_stained_glass_pane", - BlockKind::LimeStainedGlassPane => "minecraft:lime_stained_glass_pane", - BlockKind::PinkStainedGlassPane => "minecraft:pink_stained_glass_pane", - BlockKind::GrayStainedGlassPane => "minecraft:gray_stained_glass_pane", - BlockKind::LightGrayStainedGlassPane => "minecraft:light_gray_stained_glass_pane", - BlockKind::CyanStainedGlassPane => "minecraft:cyan_stained_glass_pane", - BlockKind::PurpleStainedGlassPane => "minecraft:purple_stained_glass_pane", - BlockKind::BlueStainedGlassPane => "minecraft:blue_stained_glass_pane", - BlockKind::BrownStainedGlassPane => "minecraft:brown_stained_glass_pane", - BlockKind::GreenStainedGlassPane => "minecraft:green_stained_glass_pane", - BlockKind::RedStainedGlassPane => "minecraft:red_stained_glass_pane", - BlockKind::BlackStainedGlassPane => "minecraft:black_stained_glass_pane", - BlockKind::AcaciaStairs => "minecraft:acacia_stairs", - BlockKind::DarkOakStairs => "minecraft:dark_oak_stairs", - BlockKind::SlimeBlock => "minecraft:slime_block", - BlockKind::Barrier => "minecraft:barrier", - BlockKind::IronTrapdoor => "minecraft:iron_trapdoor", - BlockKind::Prismarine => "minecraft:prismarine", - BlockKind::PrismarineBricks => "minecraft:prismarine_bricks", - BlockKind::DarkPrismarine => "minecraft:dark_prismarine", - BlockKind::PrismarineStairs => "minecraft:prismarine_stairs", - BlockKind::PrismarineBrickStairs => "minecraft:prismarine_brick_stairs", - BlockKind::DarkPrismarineStairs => "minecraft:dark_prismarine_stairs", - BlockKind::PrismarineSlab => "minecraft:prismarine_slab", - BlockKind::PrismarineBrickSlab => "minecraft:prismarine_brick_slab", - BlockKind::DarkPrismarineSlab => "minecraft:dark_prismarine_slab", - BlockKind::SeaLantern => "minecraft:sea_lantern", - BlockKind::HayBlock => "minecraft:hay_block", - BlockKind::WhiteCarpet => "minecraft:white_carpet", - BlockKind::OrangeCarpet => "minecraft:orange_carpet", - BlockKind::MagentaCarpet => "minecraft:magenta_carpet", - BlockKind::LightBlueCarpet => "minecraft:light_blue_carpet", - BlockKind::YellowCarpet => "minecraft:yellow_carpet", - BlockKind::LimeCarpet => "minecraft:lime_carpet", - BlockKind::PinkCarpet => "minecraft:pink_carpet", - BlockKind::GrayCarpet => "minecraft:gray_carpet", - BlockKind::LightGrayCarpet => "minecraft:light_gray_carpet", - BlockKind::CyanCarpet => "minecraft:cyan_carpet", - BlockKind::PurpleCarpet => "minecraft:purple_carpet", - BlockKind::BlueCarpet => "minecraft:blue_carpet", - BlockKind::BrownCarpet => "minecraft:brown_carpet", - BlockKind::GreenCarpet => "minecraft:green_carpet", - BlockKind::RedCarpet => "minecraft:red_carpet", - BlockKind::BlackCarpet => "minecraft:black_carpet", - BlockKind::Terracotta => "minecraft:terracotta", - BlockKind::CoalBlock => "minecraft:coal_block", - BlockKind::PackedIce => "minecraft:packed_ice", - BlockKind::Sunflower => "minecraft:sunflower", - BlockKind::Lilac => "minecraft:lilac", - BlockKind::RoseBush => "minecraft:rose_bush", - BlockKind::Peony => "minecraft:peony", - BlockKind::TallGrass => "minecraft:tall_grass", - BlockKind::LargeFern => "minecraft:large_fern", - BlockKind::WhiteBanner => "minecraft:white_banner", - BlockKind::OrangeBanner => "minecraft:orange_banner", - BlockKind::MagentaBanner => "minecraft:magenta_banner", - BlockKind::LightBlueBanner => "minecraft:light_blue_banner", - BlockKind::YellowBanner => "minecraft:yellow_banner", - BlockKind::LimeBanner => "minecraft:lime_banner", - BlockKind::PinkBanner => "minecraft:pink_banner", - BlockKind::GrayBanner => "minecraft:gray_banner", - BlockKind::LightGrayBanner => "minecraft:light_gray_banner", - BlockKind::CyanBanner => "minecraft:cyan_banner", - BlockKind::PurpleBanner => "minecraft:purple_banner", - BlockKind::BlueBanner => "minecraft:blue_banner", - BlockKind::BrownBanner => "minecraft:brown_banner", - BlockKind::GreenBanner => "minecraft:green_banner", - BlockKind::RedBanner => "minecraft:red_banner", - BlockKind::BlackBanner => "minecraft:black_banner", - BlockKind::WhiteWallBanner => "minecraft:white_wall_banner", - BlockKind::OrangeWallBanner => "minecraft:orange_wall_banner", - BlockKind::MagentaWallBanner => "minecraft:magenta_wall_banner", - BlockKind::LightBlueWallBanner => "minecraft:light_blue_wall_banner", - BlockKind::YellowWallBanner => "minecraft:yellow_wall_banner", - BlockKind::LimeWallBanner => "minecraft:lime_wall_banner", - BlockKind::PinkWallBanner => "minecraft:pink_wall_banner", - BlockKind::GrayWallBanner => "minecraft:gray_wall_banner", - BlockKind::LightGrayWallBanner => "minecraft:light_gray_wall_banner", - BlockKind::CyanWallBanner => "minecraft:cyan_wall_banner", - BlockKind::PurpleWallBanner => "minecraft:purple_wall_banner", - BlockKind::BlueWallBanner => "minecraft:blue_wall_banner", - BlockKind::BrownWallBanner => "minecraft:brown_wall_banner", - BlockKind::GreenWallBanner => "minecraft:green_wall_banner", - BlockKind::RedWallBanner => "minecraft:red_wall_banner", - BlockKind::BlackWallBanner => "minecraft:black_wall_banner", - BlockKind::RedSandstone => "minecraft:red_sandstone", - BlockKind::ChiseledRedSandstone => "minecraft:chiseled_red_sandstone", - BlockKind::CutRedSandstone => "minecraft:cut_red_sandstone", - BlockKind::RedSandstoneStairs => "minecraft:red_sandstone_stairs", - BlockKind::OakSlab => "minecraft:oak_slab", - BlockKind::SpruceSlab => "minecraft:spruce_slab", - BlockKind::BirchSlab => "minecraft:birch_slab", - BlockKind::JungleSlab => "minecraft:jungle_slab", - BlockKind::AcaciaSlab => "minecraft:acacia_slab", - BlockKind::DarkOakSlab => "minecraft:dark_oak_slab", - BlockKind::StoneSlab => "minecraft:stone_slab", - BlockKind::SmoothStoneSlab => "minecraft:smooth_stone_slab", - BlockKind::SandstoneSlab => "minecraft:sandstone_slab", - BlockKind::CutSandstoneSlab => "minecraft:cut_sandstone_slab", - BlockKind::PetrifiedOakSlab => "minecraft:petrified_oak_slab", - BlockKind::CobblestoneSlab => "minecraft:cobblestone_slab", - BlockKind::BrickSlab => "minecraft:brick_slab", - BlockKind::StoneBrickSlab => "minecraft:stone_brick_slab", - BlockKind::NetherBrickSlab => "minecraft:nether_brick_slab", - BlockKind::QuartzSlab => "minecraft:quartz_slab", - BlockKind::RedSandstoneSlab => "minecraft:red_sandstone_slab", - BlockKind::CutRedSandstoneSlab => "minecraft:cut_red_sandstone_slab", - BlockKind::PurpurSlab => "minecraft:purpur_slab", - BlockKind::SmoothStone => "minecraft:smooth_stone", - BlockKind::SmoothSandstone => "minecraft:smooth_sandstone", - BlockKind::SmoothQuartz => "minecraft:smooth_quartz", - BlockKind::SmoothRedSandstone => "minecraft:smooth_red_sandstone", - BlockKind::SpruceFenceGate => "minecraft:spruce_fence_gate", - BlockKind::BirchFenceGate => "minecraft:birch_fence_gate", - BlockKind::JungleFenceGate => "minecraft:jungle_fence_gate", - BlockKind::AcaciaFenceGate => "minecraft:acacia_fence_gate", - BlockKind::DarkOakFenceGate => "minecraft:dark_oak_fence_gate", - BlockKind::SpruceFence => "minecraft:spruce_fence", - BlockKind::BirchFence => "minecraft:birch_fence", - BlockKind::JungleFence => "minecraft:jungle_fence", - BlockKind::AcaciaFence => "minecraft:acacia_fence", - BlockKind::DarkOakFence => "minecraft:dark_oak_fence", - BlockKind::SpruceDoor => "minecraft:spruce_door", - BlockKind::BirchDoor => "minecraft:birch_door", - BlockKind::JungleDoor => "minecraft:jungle_door", - BlockKind::AcaciaDoor => "minecraft:acacia_door", - BlockKind::DarkOakDoor => "minecraft:dark_oak_door", - BlockKind::EndRod => "minecraft:end_rod", - BlockKind::ChorusPlant => "minecraft:chorus_plant", - BlockKind::ChorusFlower => "minecraft:chorus_flower", - BlockKind::PurpurBlock => "minecraft:purpur_block", - BlockKind::PurpurPillar => "minecraft:purpur_pillar", - BlockKind::PurpurStairs => "minecraft:purpur_stairs", - BlockKind::EndStoneBricks => "minecraft:end_stone_bricks", - BlockKind::Beetroots => "minecraft:beetroots", - BlockKind::GrassPath => "minecraft:grass_path", - BlockKind::EndGateway => "minecraft:end_gateway", - BlockKind::RepeatingCommandBlock => "minecraft:repeating_command_block", - BlockKind::ChainCommandBlock => "minecraft:chain_command_block", - BlockKind::FrostedIce => "minecraft:frosted_ice", - BlockKind::MagmaBlock => "minecraft:magma_block", - BlockKind::NetherWartBlock => "minecraft:nether_wart_block", - BlockKind::RedNetherBricks => "minecraft:red_nether_bricks", - BlockKind::BoneBlock => "minecraft:bone_block", - BlockKind::StructureVoid => "minecraft:structure_void", - BlockKind::Observer => "minecraft:observer", - BlockKind::ShulkerBox => "minecraft:shulker_box", - BlockKind::WhiteShulkerBox => "minecraft:white_shulker_box", - BlockKind::OrangeShulkerBox => "minecraft:orange_shulker_box", - BlockKind::MagentaShulkerBox => "minecraft:magenta_shulker_box", - BlockKind::LightBlueShulkerBox => "minecraft:light_blue_shulker_box", - BlockKind::YellowShulkerBox => "minecraft:yellow_shulker_box", - BlockKind::LimeShulkerBox => "minecraft:lime_shulker_box", - BlockKind::PinkShulkerBox => "minecraft:pink_shulker_box", - BlockKind::GrayShulkerBox => "minecraft:gray_shulker_box", - BlockKind::LightGrayShulkerBox => "minecraft:light_gray_shulker_box", - BlockKind::CyanShulkerBox => "minecraft:cyan_shulker_box", - BlockKind::PurpleShulkerBox => "minecraft:purple_shulker_box", - BlockKind::BlueShulkerBox => "minecraft:blue_shulker_box", - BlockKind::BrownShulkerBox => "minecraft:brown_shulker_box", - BlockKind::GreenShulkerBox => "minecraft:green_shulker_box", - BlockKind::RedShulkerBox => "minecraft:red_shulker_box", - BlockKind::BlackShulkerBox => "minecraft:black_shulker_box", - BlockKind::WhiteGlazedTerracotta => "minecraft:white_glazed_terracotta", - BlockKind::OrangeGlazedTerracotta => "minecraft:orange_glazed_terracotta", - BlockKind::MagentaGlazedTerracotta => "minecraft:magenta_glazed_terracotta", - BlockKind::LightBlueGlazedTerracotta => "minecraft:light_blue_glazed_terracotta", - BlockKind::YellowGlazedTerracotta => "minecraft:yellow_glazed_terracotta", - BlockKind::LimeGlazedTerracotta => "minecraft:lime_glazed_terracotta", - BlockKind::PinkGlazedTerracotta => "minecraft:pink_glazed_terracotta", - BlockKind::GrayGlazedTerracotta => "minecraft:gray_glazed_terracotta", - BlockKind::LightGrayGlazedTerracotta => "minecraft:light_gray_glazed_terracotta", - BlockKind::CyanGlazedTerracotta => "minecraft:cyan_glazed_terracotta", - BlockKind::PurpleGlazedTerracotta => "minecraft:purple_glazed_terracotta", - BlockKind::BlueGlazedTerracotta => "minecraft:blue_glazed_terracotta", - BlockKind::BrownGlazedTerracotta => "minecraft:brown_glazed_terracotta", - BlockKind::GreenGlazedTerracotta => "minecraft:green_glazed_terracotta", - BlockKind::RedGlazedTerracotta => "minecraft:red_glazed_terracotta", - BlockKind::BlackGlazedTerracotta => "minecraft:black_glazed_terracotta", - BlockKind::WhiteConcrete => "minecraft:white_concrete", - BlockKind::OrangeConcrete => "minecraft:orange_concrete", - BlockKind::MagentaConcrete => "minecraft:magenta_concrete", - BlockKind::LightBlueConcrete => "minecraft:light_blue_concrete", - BlockKind::YellowConcrete => "minecraft:yellow_concrete", - BlockKind::LimeConcrete => "minecraft:lime_concrete", - BlockKind::PinkConcrete => "minecraft:pink_concrete", - BlockKind::GrayConcrete => "minecraft:gray_concrete", - BlockKind::LightGrayConcrete => "minecraft:light_gray_concrete", - BlockKind::CyanConcrete => "minecraft:cyan_concrete", - BlockKind::PurpleConcrete => "minecraft:purple_concrete", - BlockKind::BlueConcrete => "minecraft:blue_concrete", - BlockKind::BrownConcrete => "minecraft:brown_concrete", - BlockKind::GreenConcrete => "minecraft:green_concrete", - BlockKind::RedConcrete => "minecraft:red_concrete", - BlockKind::BlackConcrete => "minecraft:black_concrete", - BlockKind::WhiteConcretePowder => "minecraft:white_concrete_powder", - BlockKind::OrangeConcretePowder => "minecraft:orange_concrete_powder", - BlockKind::MagentaConcretePowder => "minecraft:magenta_concrete_powder", - BlockKind::LightBlueConcretePowder => "minecraft:light_blue_concrete_powder", - BlockKind::YellowConcretePowder => "minecraft:yellow_concrete_powder", - BlockKind::LimeConcretePowder => "minecraft:lime_concrete_powder", - BlockKind::PinkConcretePowder => "minecraft:pink_concrete_powder", - BlockKind::GrayConcretePowder => "minecraft:gray_concrete_powder", - BlockKind::LightGrayConcretePowder => "minecraft:light_gray_concrete_powder", - BlockKind::CyanConcretePowder => "minecraft:cyan_concrete_powder", - BlockKind::PurpleConcretePowder => "minecraft:purple_concrete_powder", - BlockKind::BlueConcretePowder => "minecraft:blue_concrete_powder", - BlockKind::BrownConcretePowder => "minecraft:brown_concrete_powder", - BlockKind::GreenConcretePowder => "minecraft:green_concrete_powder", - BlockKind::RedConcretePowder => "minecraft:red_concrete_powder", - BlockKind::BlackConcretePowder => "minecraft:black_concrete_powder", - BlockKind::Kelp => "minecraft:kelp", - BlockKind::KelpPlant => "minecraft:kelp_plant", - BlockKind::DriedKelpBlock => "minecraft:dried_kelp_block", - BlockKind::TurtleEgg => "minecraft:turtle_egg", - BlockKind::DeadTubeCoralBlock => "minecraft:dead_tube_coral_block", - BlockKind::DeadBrainCoralBlock => "minecraft:dead_brain_coral_block", - BlockKind::DeadBubbleCoralBlock => "minecraft:dead_bubble_coral_block", - BlockKind::DeadFireCoralBlock => "minecraft:dead_fire_coral_block", - BlockKind::DeadHornCoralBlock => "minecraft:dead_horn_coral_block", - BlockKind::TubeCoralBlock => "minecraft:tube_coral_block", - BlockKind::BrainCoralBlock => "minecraft:brain_coral_block", - BlockKind::BubbleCoralBlock => "minecraft:bubble_coral_block", - BlockKind::FireCoralBlock => "minecraft:fire_coral_block", - BlockKind::HornCoralBlock => "minecraft:horn_coral_block", - BlockKind::DeadTubeCoral => "minecraft:dead_tube_coral", - BlockKind::DeadBrainCoral => "minecraft:dead_brain_coral", - BlockKind::DeadBubbleCoral => "minecraft:dead_bubble_coral", - BlockKind::DeadFireCoral => "minecraft:dead_fire_coral", - BlockKind::DeadHornCoral => "minecraft:dead_horn_coral", - BlockKind::TubeCoral => "minecraft:tube_coral", - BlockKind::BrainCoral => "minecraft:brain_coral", - BlockKind::BubbleCoral => "minecraft:bubble_coral", - BlockKind::FireCoral => "minecraft:fire_coral", - BlockKind::HornCoral => "minecraft:horn_coral", - BlockKind::DeadTubeCoralFan => "minecraft:dead_tube_coral_fan", - BlockKind::DeadBrainCoralFan => "minecraft:dead_brain_coral_fan", - BlockKind::DeadBubbleCoralFan => "minecraft:dead_bubble_coral_fan", - BlockKind::DeadFireCoralFan => "minecraft:dead_fire_coral_fan", - BlockKind::DeadHornCoralFan => "minecraft:dead_horn_coral_fan", - BlockKind::TubeCoralFan => "minecraft:tube_coral_fan", - BlockKind::BrainCoralFan => "minecraft:brain_coral_fan", - BlockKind::BubbleCoralFan => "minecraft:bubble_coral_fan", - BlockKind::FireCoralFan => "minecraft:fire_coral_fan", - BlockKind::HornCoralFan => "minecraft:horn_coral_fan", - BlockKind::DeadTubeCoralWallFan => "minecraft:dead_tube_coral_wall_fan", - BlockKind::DeadBrainCoralWallFan => "minecraft:dead_brain_coral_wall_fan", - BlockKind::DeadBubbleCoralWallFan => "minecraft:dead_bubble_coral_wall_fan", - BlockKind::DeadFireCoralWallFan => "minecraft:dead_fire_coral_wall_fan", - BlockKind::DeadHornCoralWallFan => "minecraft:dead_horn_coral_wall_fan", - BlockKind::TubeCoralWallFan => "minecraft:tube_coral_wall_fan", - BlockKind::BrainCoralWallFan => "minecraft:brain_coral_wall_fan", - BlockKind::BubbleCoralWallFan => "minecraft:bubble_coral_wall_fan", - BlockKind::FireCoralWallFan => "minecraft:fire_coral_wall_fan", - BlockKind::HornCoralWallFan => "minecraft:horn_coral_wall_fan", - BlockKind::SeaPickle => "minecraft:sea_pickle", - BlockKind::BlueIce => "minecraft:blue_ice", - BlockKind::Conduit => "minecraft:conduit", - BlockKind::BambooSapling => "minecraft:bamboo_sapling", - BlockKind::Bamboo => "minecraft:bamboo", - BlockKind::PottedBamboo => "minecraft:potted_bamboo", - BlockKind::VoidAir => "minecraft:void_air", - BlockKind::CaveAir => "minecraft:cave_air", - BlockKind::BubbleColumn => "minecraft:bubble_column", - BlockKind::PolishedGraniteStairs => "minecraft:polished_granite_stairs", - BlockKind::SmoothRedSandstoneStairs => "minecraft:smooth_red_sandstone_stairs", - BlockKind::MossyStoneBrickStairs => "minecraft:mossy_stone_brick_stairs", - BlockKind::PolishedDioriteStairs => "minecraft:polished_diorite_stairs", - BlockKind::MossyCobblestoneStairs => "minecraft:mossy_cobblestone_stairs", - BlockKind::EndStoneBrickStairs => "minecraft:end_stone_brick_stairs", - BlockKind::StoneStairs => "minecraft:stone_stairs", - BlockKind::SmoothSandstoneStairs => "minecraft:smooth_sandstone_stairs", - BlockKind::SmoothQuartzStairs => "minecraft:smooth_quartz_stairs", - BlockKind::GraniteStairs => "minecraft:granite_stairs", - BlockKind::AndesiteStairs => "minecraft:andesite_stairs", - BlockKind::RedNetherBrickStairs => "minecraft:red_nether_brick_stairs", - BlockKind::PolishedAndesiteStairs => "minecraft:polished_andesite_stairs", - BlockKind::DioriteStairs => "minecraft:diorite_stairs", - BlockKind::PolishedGraniteSlab => "minecraft:polished_granite_slab", - BlockKind::SmoothRedSandstoneSlab => "minecraft:smooth_red_sandstone_slab", - BlockKind::MossyStoneBrickSlab => "minecraft:mossy_stone_brick_slab", - BlockKind::PolishedDioriteSlab => "minecraft:polished_diorite_slab", - BlockKind::MossyCobblestoneSlab => "minecraft:mossy_cobblestone_slab", - BlockKind::EndStoneBrickSlab => "minecraft:end_stone_brick_slab", - BlockKind::SmoothSandstoneSlab => "minecraft:smooth_sandstone_slab", - BlockKind::SmoothQuartzSlab => "minecraft:smooth_quartz_slab", - BlockKind::GraniteSlab => "minecraft:granite_slab", - BlockKind::AndesiteSlab => "minecraft:andesite_slab", - BlockKind::RedNetherBrickSlab => "minecraft:red_nether_brick_slab", - BlockKind::PolishedAndesiteSlab => "minecraft:polished_andesite_slab", - BlockKind::DioriteSlab => "minecraft:diorite_slab", - BlockKind::BrickWall => "minecraft:brick_wall", - BlockKind::PrismarineWall => "minecraft:prismarine_wall", - BlockKind::RedSandstoneWall => "minecraft:red_sandstone_wall", - BlockKind::MossyStoneBrickWall => "minecraft:mossy_stone_brick_wall", - BlockKind::GraniteWall => "minecraft:granite_wall", - BlockKind::StoneBrickWall => "minecraft:stone_brick_wall", - BlockKind::NetherBrickWall => "minecraft:nether_brick_wall", - BlockKind::AndesiteWall => "minecraft:andesite_wall", - BlockKind::RedNetherBrickWall => "minecraft:red_nether_brick_wall", - BlockKind::SandstoneWall => "minecraft:sandstone_wall", - BlockKind::EndStoneBrickWall => "minecraft:end_stone_brick_wall", - BlockKind::DioriteWall => "minecraft:diorite_wall", - BlockKind::Scaffolding => "minecraft:scaffolding", - BlockKind::Loom => "minecraft:loom", - BlockKind::Barrel => "minecraft:barrel", - BlockKind::Smoker => "minecraft:smoker", - BlockKind::BlastFurnace => "minecraft:blast_furnace", - BlockKind::CartographyTable => "minecraft:cartography_table", - BlockKind::FletchingTable => "minecraft:fletching_table", - BlockKind::Grindstone => "minecraft:grindstone", - BlockKind::Lectern => "minecraft:lectern", - BlockKind::SmithingTable => "minecraft:smithing_table", - BlockKind::Stonecutter => "minecraft:stonecutter", - BlockKind::Bell => "minecraft:bell", - BlockKind::Lantern => "minecraft:lantern", - BlockKind::SoulLantern => "minecraft:soul_lantern", - BlockKind::Campfire => "minecraft:campfire", - BlockKind::SoulCampfire => "minecraft:soul_campfire", - BlockKind::SweetBerryBush => "minecraft:sweet_berry_bush", - BlockKind::WarpedStem => "minecraft:warped_stem", - BlockKind::StrippedWarpedStem => "minecraft:stripped_warped_stem", - BlockKind::WarpedHyphae => "minecraft:warped_hyphae", - BlockKind::StrippedWarpedHyphae => "minecraft:stripped_warped_hyphae", - BlockKind::WarpedNylium => "minecraft:warped_nylium", - BlockKind::WarpedFungus => "minecraft:warped_fungus", - BlockKind::WarpedWartBlock => "minecraft:warped_wart_block", - BlockKind::WarpedRoots => "minecraft:warped_roots", - BlockKind::NetherSprouts => "minecraft:nether_sprouts", - BlockKind::CrimsonStem => "minecraft:crimson_stem", - BlockKind::StrippedCrimsonStem => "minecraft:stripped_crimson_stem", - BlockKind::CrimsonHyphae => "minecraft:crimson_hyphae", - BlockKind::StrippedCrimsonHyphae => "minecraft:stripped_crimson_hyphae", - BlockKind::CrimsonNylium => "minecraft:crimson_nylium", - BlockKind::CrimsonFungus => "minecraft:crimson_fungus", - BlockKind::Shroomlight => "minecraft:shroomlight", - BlockKind::WeepingVines => "minecraft:weeping_vines", - BlockKind::WeepingVinesPlant => "minecraft:weeping_vines_plant", - BlockKind::TwistingVines => "minecraft:twisting_vines", - BlockKind::TwistingVinesPlant => "minecraft:twisting_vines_plant", - BlockKind::CrimsonRoots => "minecraft:crimson_roots", - BlockKind::CrimsonPlanks => "minecraft:crimson_planks", - BlockKind::WarpedPlanks => "minecraft:warped_planks", - BlockKind::CrimsonSlab => "minecraft:crimson_slab", - BlockKind::WarpedSlab => "minecraft:warped_slab", - BlockKind::CrimsonPressurePlate => "minecraft:crimson_pressure_plate", - BlockKind::WarpedPressurePlate => "minecraft:warped_pressure_plate", - BlockKind::CrimsonFence => "minecraft:crimson_fence", - BlockKind::WarpedFence => "minecraft:warped_fence", - BlockKind::CrimsonTrapdoor => "minecraft:crimson_trapdoor", - BlockKind::WarpedTrapdoor => "minecraft:warped_trapdoor", - BlockKind::CrimsonFenceGate => "minecraft:crimson_fence_gate", - BlockKind::WarpedFenceGate => "minecraft:warped_fence_gate", - BlockKind::CrimsonStairs => "minecraft:crimson_stairs", - BlockKind::WarpedStairs => "minecraft:warped_stairs", - BlockKind::CrimsonButton => "minecraft:crimson_button", - BlockKind::WarpedButton => "minecraft:warped_button", - BlockKind::CrimsonDoor => "minecraft:crimson_door", - BlockKind::WarpedDoor => "minecraft:warped_door", - BlockKind::CrimsonSign => "minecraft:crimson_sign", - BlockKind::WarpedSign => "minecraft:warped_sign", - BlockKind::CrimsonWallSign => "minecraft:crimson_wall_sign", - BlockKind::WarpedWallSign => "minecraft:warped_wall_sign", - BlockKind::StructureBlock => "minecraft:structure_block", - BlockKind::Jigsaw => "minecraft:jigsaw", - BlockKind::Composter => "minecraft:composter", - BlockKind::Target => "minecraft:target", - BlockKind::BeeNest => "minecraft:bee_nest", - BlockKind::Beehive => "minecraft:beehive", - BlockKind::HoneyBlock => "minecraft:honey_block", - BlockKind::HoneycombBlock => "minecraft:honeycomb_block", - BlockKind::NetheriteBlock => "minecraft:netherite_block", - BlockKind::AncientDebris => "minecraft:ancient_debris", - BlockKind::CryingObsidian => "minecraft:crying_obsidian", - BlockKind::RespawnAnchor => "minecraft:respawn_anchor", - BlockKind::PottedCrimsonFungus => "minecraft:potted_crimson_fungus", - BlockKind::PottedWarpedFungus => "minecraft:potted_warped_fungus", - BlockKind::PottedCrimsonRoots => "minecraft:potted_crimson_roots", - BlockKind::PottedWarpedRoots => "minecraft:potted_warped_roots", - BlockKind::Lodestone => "minecraft:lodestone", - BlockKind::Blackstone => "minecraft:blackstone", - BlockKind::BlackstoneStairs => "minecraft:blackstone_stairs", - BlockKind::BlackstoneWall => "minecraft:blackstone_wall", - BlockKind::BlackstoneSlab => "minecraft:blackstone_slab", - BlockKind::PolishedBlackstone => "minecraft:polished_blackstone", - BlockKind::PolishedBlackstoneBricks => "minecraft:polished_blackstone_bricks", - BlockKind::CrackedPolishedBlackstoneBricks => { - "minecraft:cracked_polished_blackstone_bricks" - } - BlockKind::ChiseledPolishedBlackstone => "minecraft:chiseled_polished_blackstone", - BlockKind::PolishedBlackstoneBrickSlab => "minecraft:polished_blackstone_brick_slab", - BlockKind::PolishedBlackstoneBrickStairs => { - "minecraft:polished_blackstone_brick_stairs" - } - BlockKind::PolishedBlackstoneBrickWall => "minecraft:polished_blackstone_brick_wall", - BlockKind::GildedBlackstone => "minecraft:gilded_blackstone", - BlockKind::PolishedBlackstoneStairs => "minecraft:polished_blackstone_stairs", - BlockKind::PolishedBlackstoneSlab => "minecraft:polished_blackstone_slab", - BlockKind::PolishedBlackstonePressurePlate => { - "minecraft:polished_blackstone_pressure_plate" - } - BlockKind::PolishedBlackstoneButton => "minecraft:polished_blackstone_button", - BlockKind::PolishedBlackstoneWall => "minecraft:polished_blackstone_wall", - BlockKind::ChiseledNetherBricks => "minecraft:chiseled_nether_bricks", - BlockKind::CrackedNetherBricks => "minecraft:cracked_nether_bricks", - BlockKind::QuartzBricks => "minecraft:quartz_bricks", - } - } - #[doc = "Returns a mapping from property name to property value for this block. Used to serialize blocks in vanilla world saves."] - pub fn to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - match self.kind { - BlockKind::Air => self.air_to_properties_map(), - BlockKind::Stone => self.stone_to_properties_map(), - BlockKind::Granite => self.granite_to_properties_map(), - BlockKind::PolishedGranite => self.polished_granite_to_properties_map(), - BlockKind::Diorite => self.diorite_to_properties_map(), - BlockKind::PolishedDiorite => self.polished_diorite_to_properties_map(), - BlockKind::Andesite => self.andesite_to_properties_map(), - BlockKind::PolishedAndesite => self.polished_andesite_to_properties_map(), - BlockKind::GrassBlock => self.grass_block_to_properties_map(), - BlockKind::Dirt => self.dirt_to_properties_map(), - BlockKind::CoarseDirt => self.coarse_dirt_to_properties_map(), - BlockKind::Podzol => self.podzol_to_properties_map(), - BlockKind::Cobblestone => self.cobblestone_to_properties_map(), - BlockKind::OakPlanks => self.oak_planks_to_properties_map(), - BlockKind::SprucePlanks => self.spruce_planks_to_properties_map(), - BlockKind::BirchPlanks => self.birch_planks_to_properties_map(), - BlockKind::JunglePlanks => self.jungle_planks_to_properties_map(), - BlockKind::AcaciaPlanks => self.acacia_planks_to_properties_map(), - BlockKind::DarkOakPlanks => self.dark_oak_planks_to_properties_map(), - BlockKind::OakSapling => self.oak_sapling_to_properties_map(), - BlockKind::SpruceSapling => self.spruce_sapling_to_properties_map(), - BlockKind::BirchSapling => self.birch_sapling_to_properties_map(), - BlockKind::JungleSapling => self.jungle_sapling_to_properties_map(), - BlockKind::AcaciaSapling => self.acacia_sapling_to_properties_map(), - BlockKind::DarkOakSapling => self.dark_oak_sapling_to_properties_map(), - BlockKind::Bedrock => self.bedrock_to_properties_map(), - BlockKind::Water => self.water_to_properties_map(), - BlockKind::Lava => self.lava_to_properties_map(), - BlockKind::Sand => self.sand_to_properties_map(), - BlockKind::RedSand => self.red_sand_to_properties_map(), - BlockKind::Gravel => self.gravel_to_properties_map(), - BlockKind::GoldOre => self.gold_ore_to_properties_map(), - BlockKind::IronOre => self.iron_ore_to_properties_map(), - BlockKind::CoalOre => self.coal_ore_to_properties_map(), - BlockKind::NetherGoldOre => self.nether_gold_ore_to_properties_map(), - BlockKind::OakLog => self.oak_log_to_properties_map(), - BlockKind::SpruceLog => self.spruce_log_to_properties_map(), - BlockKind::BirchLog => self.birch_log_to_properties_map(), - BlockKind::JungleLog => self.jungle_log_to_properties_map(), - BlockKind::AcaciaLog => self.acacia_log_to_properties_map(), - BlockKind::DarkOakLog => self.dark_oak_log_to_properties_map(), - BlockKind::StrippedSpruceLog => self.stripped_spruce_log_to_properties_map(), - BlockKind::StrippedBirchLog => self.stripped_birch_log_to_properties_map(), - BlockKind::StrippedJungleLog => self.stripped_jungle_log_to_properties_map(), - BlockKind::StrippedAcaciaLog => self.stripped_acacia_log_to_properties_map(), - BlockKind::StrippedDarkOakLog => self.stripped_dark_oak_log_to_properties_map(), - BlockKind::StrippedOakLog => self.stripped_oak_log_to_properties_map(), - BlockKind::OakWood => self.oak_wood_to_properties_map(), - BlockKind::SpruceWood => self.spruce_wood_to_properties_map(), - BlockKind::BirchWood => self.birch_wood_to_properties_map(), - BlockKind::JungleWood => self.jungle_wood_to_properties_map(), - BlockKind::AcaciaWood => self.acacia_wood_to_properties_map(), - BlockKind::DarkOakWood => self.dark_oak_wood_to_properties_map(), - BlockKind::StrippedOakWood => self.stripped_oak_wood_to_properties_map(), - BlockKind::StrippedSpruceWood => self.stripped_spruce_wood_to_properties_map(), - BlockKind::StrippedBirchWood => self.stripped_birch_wood_to_properties_map(), - BlockKind::StrippedJungleWood => self.stripped_jungle_wood_to_properties_map(), - BlockKind::StrippedAcaciaWood => self.stripped_acacia_wood_to_properties_map(), - BlockKind::StrippedDarkOakWood => self.stripped_dark_oak_wood_to_properties_map(), - BlockKind::OakLeaves => self.oak_leaves_to_properties_map(), - BlockKind::SpruceLeaves => self.spruce_leaves_to_properties_map(), - BlockKind::BirchLeaves => self.birch_leaves_to_properties_map(), - BlockKind::JungleLeaves => self.jungle_leaves_to_properties_map(), - BlockKind::AcaciaLeaves => self.acacia_leaves_to_properties_map(), - BlockKind::DarkOakLeaves => self.dark_oak_leaves_to_properties_map(), - BlockKind::Sponge => self.sponge_to_properties_map(), - BlockKind::WetSponge => self.wet_sponge_to_properties_map(), - BlockKind::Glass => self.glass_to_properties_map(), - BlockKind::LapisOre => self.lapis_ore_to_properties_map(), - BlockKind::LapisBlock => self.lapis_block_to_properties_map(), - BlockKind::Dispenser => self.dispenser_to_properties_map(), - BlockKind::Sandstone => self.sandstone_to_properties_map(), - BlockKind::ChiseledSandstone => self.chiseled_sandstone_to_properties_map(), - BlockKind::CutSandstone => self.cut_sandstone_to_properties_map(), - BlockKind::NoteBlock => self.note_block_to_properties_map(), - BlockKind::WhiteBed => self.white_bed_to_properties_map(), - BlockKind::OrangeBed => self.orange_bed_to_properties_map(), - BlockKind::MagentaBed => self.magenta_bed_to_properties_map(), - BlockKind::LightBlueBed => self.light_blue_bed_to_properties_map(), - BlockKind::YellowBed => self.yellow_bed_to_properties_map(), - BlockKind::LimeBed => self.lime_bed_to_properties_map(), - BlockKind::PinkBed => self.pink_bed_to_properties_map(), - BlockKind::GrayBed => self.gray_bed_to_properties_map(), - BlockKind::LightGrayBed => self.light_gray_bed_to_properties_map(), - BlockKind::CyanBed => self.cyan_bed_to_properties_map(), - BlockKind::PurpleBed => self.purple_bed_to_properties_map(), - BlockKind::BlueBed => self.blue_bed_to_properties_map(), - BlockKind::BrownBed => self.brown_bed_to_properties_map(), - BlockKind::GreenBed => self.green_bed_to_properties_map(), - BlockKind::RedBed => self.red_bed_to_properties_map(), - BlockKind::BlackBed => self.black_bed_to_properties_map(), - BlockKind::PoweredRail => self.powered_rail_to_properties_map(), - BlockKind::DetectorRail => self.detector_rail_to_properties_map(), - BlockKind::StickyPiston => self.sticky_piston_to_properties_map(), - BlockKind::Cobweb => self.cobweb_to_properties_map(), - BlockKind::Grass => self.grass_to_properties_map(), - BlockKind::Fern => self.fern_to_properties_map(), - BlockKind::DeadBush => self.dead_bush_to_properties_map(), - BlockKind::Seagrass => self.seagrass_to_properties_map(), - BlockKind::TallSeagrass => self.tall_seagrass_to_properties_map(), - BlockKind::Piston => self.piston_to_properties_map(), - BlockKind::PistonHead => self.piston_head_to_properties_map(), - BlockKind::WhiteWool => self.white_wool_to_properties_map(), - BlockKind::OrangeWool => self.orange_wool_to_properties_map(), - BlockKind::MagentaWool => self.magenta_wool_to_properties_map(), - BlockKind::LightBlueWool => self.light_blue_wool_to_properties_map(), - BlockKind::YellowWool => self.yellow_wool_to_properties_map(), - BlockKind::LimeWool => self.lime_wool_to_properties_map(), - BlockKind::PinkWool => self.pink_wool_to_properties_map(), - BlockKind::GrayWool => self.gray_wool_to_properties_map(), - BlockKind::LightGrayWool => self.light_gray_wool_to_properties_map(), - BlockKind::CyanWool => self.cyan_wool_to_properties_map(), - BlockKind::PurpleWool => self.purple_wool_to_properties_map(), - BlockKind::BlueWool => self.blue_wool_to_properties_map(), - BlockKind::BrownWool => self.brown_wool_to_properties_map(), - BlockKind::GreenWool => self.green_wool_to_properties_map(), - BlockKind::RedWool => self.red_wool_to_properties_map(), - BlockKind::BlackWool => self.black_wool_to_properties_map(), - BlockKind::MovingPiston => self.moving_piston_to_properties_map(), - BlockKind::Dandelion => self.dandelion_to_properties_map(), - BlockKind::Poppy => self.poppy_to_properties_map(), - BlockKind::BlueOrchid => self.blue_orchid_to_properties_map(), - BlockKind::Allium => self.allium_to_properties_map(), - BlockKind::AzureBluet => self.azure_bluet_to_properties_map(), - BlockKind::RedTulip => self.red_tulip_to_properties_map(), - BlockKind::OrangeTulip => self.orange_tulip_to_properties_map(), - BlockKind::WhiteTulip => self.white_tulip_to_properties_map(), - BlockKind::PinkTulip => self.pink_tulip_to_properties_map(), - BlockKind::OxeyeDaisy => self.oxeye_daisy_to_properties_map(), - BlockKind::Cornflower => self.cornflower_to_properties_map(), - BlockKind::WitherRose => self.wither_rose_to_properties_map(), - BlockKind::LilyOfTheValley => self.lily_of_the_valley_to_properties_map(), - BlockKind::BrownMushroom => self.brown_mushroom_to_properties_map(), - BlockKind::RedMushroom => self.red_mushroom_to_properties_map(), - BlockKind::GoldBlock => self.gold_block_to_properties_map(), - BlockKind::IronBlock => self.iron_block_to_properties_map(), - BlockKind::Bricks => self.bricks_to_properties_map(), - BlockKind::Tnt => self.tnt_to_properties_map(), - BlockKind::Bookshelf => self.bookshelf_to_properties_map(), - BlockKind::MossyCobblestone => self.mossy_cobblestone_to_properties_map(), - BlockKind::Obsidian => self.obsidian_to_properties_map(), - BlockKind::Torch => self.torch_to_properties_map(), - BlockKind::WallTorch => self.wall_torch_to_properties_map(), - BlockKind::Fire => self.fire_to_properties_map(), - BlockKind::SoulFire => self.soul_fire_to_properties_map(), - BlockKind::Spawner => self.spawner_to_properties_map(), - BlockKind::OakStairs => self.oak_stairs_to_properties_map(), - BlockKind::Chest => self.chest_to_properties_map(), - BlockKind::RedstoneWire => self.redstone_wire_to_properties_map(), - BlockKind::DiamondOre => self.diamond_ore_to_properties_map(), - BlockKind::DiamondBlock => self.diamond_block_to_properties_map(), - BlockKind::CraftingTable => self.crafting_table_to_properties_map(), - BlockKind::Wheat => self.wheat_to_properties_map(), - BlockKind::Farmland => self.farmland_to_properties_map(), - BlockKind::Furnace => self.furnace_to_properties_map(), - BlockKind::OakSign => self.oak_sign_to_properties_map(), - BlockKind::SpruceSign => self.spruce_sign_to_properties_map(), - BlockKind::BirchSign => self.birch_sign_to_properties_map(), - BlockKind::AcaciaSign => self.acacia_sign_to_properties_map(), - BlockKind::JungleSign => self.jungle_sign_to_properties_map(), - BlockKind::DarkOakSign => self.dark_oak_sign_to_properties_map(), - BlockKind::OakDoor => self.oak_door_to_properties_map(), - BlockKind::Ladder => self.ladder_to_properties_map(), - BlockKind::Rail => self.rail_to_properties_map(), - BlockKind::CobblestoneStairs => self.cobblestone_stairs_to_properties_map(), - BlockKind::OakWallSign => self.oak_wall_sign_to_properties_map(), - BlockKind::SpruceWallSign => self.spruce_wall_sign_to_properties_map(), - BlockKind::BirchWallSign => self.birch_wall_sign_to_properties_map(), - BlockKind::AcaciaWallSign => self.acacia_wall_sign_to_properties_map(), - BlockKind::JungleWallSign => self.jungle_wall_sign_to_properties_map(), - BlockKind::DarkOakWallSign => self.dark_oak_wall_sign_to_properties_map(), - BlockKind::Lever => self.lever_to_properties_map(), - BlockKind::StonePressurePlate => self.stone_pressure_plate_to_properties_map(), - BlockKind::IronDoor => self.iron_door_to_properties_map(), - BlockKind::OakPressurePlate => self.oak_pressure_plate_to_properties_map(), - BlockKind::SprucePressurePlate => self.spruce_pressure_plate_to_properties_map(), - BlockKind::BirchPressurePlate => self.birch_pressure_plate_to_properties_map(), - BlockKind::JunglePressurePlate => self.jungle_pressure_plate_to_properties_map(), - BlockKind::AcaciaPressurePlate => self.acacia_pressure_plate_to_properties_map(), - BlockKind::DarkOakPressurePlate => self.dark_oak_pressure_plate_to_properties_map(), - BlockKind::RedstoneOre => self.redstone_ore_to_properties_map(), - BlockKind::RedstoneTorch => self.redstone_torch_to_properties_map(), - BlockKind::RedstoneWallTorch => self.redstone_wall_torch_to_properties_map(), - BlockKind::StoneButton => self.stone_button_to_properties_map(), - BlockKind::Snow => self.snow_to_properties_map(), - BlockKind::Ice => self.ice_to_properties_map(), - BlockKind::SnowBlock => self.snow_block_to_properties_map(), - BlockKind::Cactus => self.cactus_to_properties_map(), - BlockKind::Clay => self.clay_to_properties_map(), - BlockKind::SugarCane => self.sugar_cane_to_properties_map(), - BlockKind::Jukebox => self.jukebox_to_properties_map(), - BlockKind::OakFence => self.oak_fence_to_properties_map(), - BlockKind::Pumpkin => self.pumpkin_to_properties_map(), - BlockKind::Netherrack => self.netherrack_to_properties_map(), - BlockKind::SoulSand => self.soul_sand_to_properties_map(), - BlockKind::SoulSoil => self.soul_soil_to_properties_map(), - BlockKind::Basalt => self.basalt_to_properties_map(), - BlockKind::PolishedBasalt => self.polished_basalt_to_properties_map(), - BlockKind::SoulTorch => self.soul_torch_to_properties_map(), - BlockKind::SoulWallTorch => self.soul_wall_torch_to_properties_map(), - BlockKind::Glowstone => self.glowstone_to_properties_map(), - BlockKind::NetherPortal => self.nether_portal_to_properties_map(), - BlockKind::CarvedPumpkin => self.carved_pumpkin_to_properties_map(), - BlockKind::JackOLantern => self.jack_o_lantern_to_properties_map(), - BlockKind::Cake => self.cake_to_properties_map(), - BlockKind::Repeater => self.repeater_to_properties_map(), - BlockKind::WhiteStainedGlass => self.white_stained_glass_to_properties_map(), - BlockKind::OrangeStainedGlass => self.orange_stained_glass_to_properties_map(), - BlockKind::MagentaStainedGlass => self.magenta_stained_glass_to_properties_map(), - BlockKind::LightBlueStainedGlass => self.light_blue_stained_glass_to_properties_map(), - BlockKind::YellowStainedGlass => self.yellow_stained_glass_to_properties_map(), - BlockKind::LimeStainedGlass => self.lime_stained_glass_to_properties_map(), - BlockKind::PinkStainedGlass => self.pink_stained_glass_to_properties_map(), - BlockKind::GrayStainedGlass => self.gray_stained_glass_to_properties_map(), - BlockKind::LightGrayStainedGlass => self.light_gray_stained_glass_to_properties_map(), - BlockKind::CyanStainedGlass => self.cyan_stained_glass_to_properties_map(), - BlockKind::PurpleStainedGlass => self.purple_stained_glass_to_properties_map(), - BlockKind::BlueStainedGlass => self.blue_stained_glass_to_properties_map(), - BlockKind::BrownStainedGlass => self.brown_stained_glass_to_properties_map(), - BlockKind::GreenStainedGlass => self.green_stained_glass_to_properties_map(), - BlockKind::RedStainedGlass => self.red_stained_glass_to_properties_map(), - BlockKind::BlackStainedGlass => self.black_stained_glass_to_properties_map(), - BlockKind::OakTrapdoor => self.oak_trapdoor_to_properties_map(), - BlockKind::SpruceTrapdoor => self.spruce_trapdoor_to_properties_map(), - BlockKind::BirchTrapdoor => self.birch_trapdoor_to_properties_map(), - BlockKind::JungleTrapdoor => self.jungle_trapdoor_to_properties_map(), - BlockKind::AcaciaTrapdoor => self.acacia_trapdoor_to_properties_map(), - BlockKind::DarkOakTrapdoor => self.dark_oak_trapdoor_to_properties_map(), - BlockKind::StoneBricks => self.stone_bricks_to_properties_map(), - BlockKind::MossyStoneBricks => self.mossy_stone_bricks_to_properties_map(), - BlockKind::CrackedStoneBricks => self.cracked_stone_bricks_to_properties_map(), - BlockKind::ChiseledStoneBricks => self.chiseled_stone_bricks_to_properties_map(), - BlockKind::InfestedStone => self.infested_stone_to_properties_map(), - BlockKind::InfestedCobblestone => self.infested_cobblestone_to_properties_map(), - BlockKind::InfestedStoneBricks => self.infested_stone_bricks_to_properties_map(), - BlockKind::InfestedMossyStoneBricks => { - self.infested_mossy_stone_bricks_to_properties_map() - } - BlockKind::InfestedCrackedStoneBricks => { - self.infested_cracked_stone_bricks_to_properties_map() - } - BlockKind::InfestedChiseledStoneBricks => { - self.infested_chiseled_stone_bricks_to_properties_map() - } - BlockKind::BrownMushroomBlock => self.brown_mushroom_block_to_properties_map(), - BlockKind::RedMushroomBlock => self.red_mushroom_block_to_properties_map(), - BlockKind::MushroomStem => self.mushroom_stem_to_properties_map(), - BlockKind::IronBars => self.iron_bars_to_properties_map(), - BlockKind::Chain => self.chain_to_properties_map(), - BlockKind::GlassPane => self.glass_pane_to_properties_map(), - BlockKind::Melon => self.melon_to_properties_map(), - BlockKind::AttachedPumpkinStem => self.attached_pumpkin_stem_to_properties_map(), - BlockKind::AttachedMelonStem => self.attached_melon_stem_to_properties_map(), - BlockKind::PumpkinStem => self.pumpkin_stem_to_properties_map(), - BlockKind::MelonStem => self.melon_stem_to_properties_map(), - BlockKind::Vine => self.vine_to_properties_map(), - BlockKind::OakFenceGate => self.oak_fence_gate_to_properties_map(), - BlockKind::BrickStairs => self.brick_stairs_to_properties_map(), - BlockKind::StoneBrickStairs => self.stone_brick_stairs_to_properties_map(), - BlockKind::Mycelium => self.mycelium_to_properties_map(), - BlockKind::LilyPad => self.lily_pad_to_properties_map(), - BlockKind::NetherBricks => self.nether_bricks_to_properties_map(), - BlockKind::NetherBrickFence => self.nether_brick_fence_to_properties_map(), - BlockKind::NetherBrickStairs => self.nether_brick_stairs_to_properties_map(), - BlockKind::NetherWart => self.nether_wart_to_properties_map(), - BlockKind::EnchantingTable => self.enchanting_table_to_properties_map(), - BlockKind::BrewingStand => self.brewing_stand_to_properties_map(), - BlockKind::Cauldron => self.cauldron_to_properties_map(), - BlockKind::EndPortal => self.end_portal_to_properties_map(), - BlockKind::EndPortalFrame => self.end_portal_frame_to_properties_map(), - BlockKind::EndStone => self.end_stone_to_properties_map(), - BlockKind::DragonEgg => self.dragon_egg_to_properties_map(), - BlockKind::RedstoneLamp => self.redstone_lamp_to_properties_map(), - BlockKind::Cocoa => self.cocoa_to_properties_map(), - BlockKind::SandstoneStairs => self.sandstone_stairs_to_properties_map(), - BlockKind::EmeraldOre => self.emerald_ore_to_properties_map(), - BlockKind::EnderChest => self.ender_chest_to_properties_map(), - BlockKind::TripwireHook => self.tripwire_hook_to_properties_map(), - BlockKind::Tripwire => self.tripwire_to_properties_map(), - BlockKind::EmeraldBlock => self.emerald_block_to_properties_map(), - BlockKind::SpruceStairs => self.spruce_stairs_to_properties_map(), - BlockKind::BirchStairs => self.birch_stairs_to_properties_map(), - BlockKind::JungleStairs => self.jungle_stairs_to_properties_map(), - BlockKind::CommandBlock => self.command_block_to_properties_map(), - BlockKind::Beacon => self.beacon_to_properties_map(), - BlockKind::CobblestoneWall => self.cobblestone_wall_to_properties_map(), - BlockKind::MossyCobblestoneWall => self.mossy_cobblestone_wall_to_properties_map(), - BlockKind::FlowerPot => self.flower_pot_to_properties_map(), - BlockKind::PottedOakSapling => self.potted_oak_sapling_to_properties_map(), - BlockKind::PottedSpruceSapling => self.potted_spruce_sapling_to_properties_map(), - BlockKind::PottedBirchSapling => self.potted_birch_sapling_to_properties_map(), - BlockKind::PottedJungleSapling => self.potted_jungle_sapling_to_properties_map(), - BlockKind::PottedAcaciaSapling => self.potted_acacia_sapling_to_properties_map(), - BlockKind::PottedDarkOakSapling => self.potted_dark_oak_sapling_to_properties_map(), - BlockKind::PottedFern => self.potted_fern_to_properties_map(), - BlockKind::PottedDandelion => self.potted_dandelion_to_properties_map(), - BlockKind::PottedPoppy => self.potted_poppy_to_properties_map(), - BlockKind::PottedBlueOrchid => self.potted_blue_orchid_to_properties_map(), - BlockKind::PottedAllium => self.potted_allium_to_properties_map(), - BlockKind::PottedAzureBluet => self.potted_azure_bluet_to_properties_map(), - BlockKind::PottedRedTulip => self.potted_red_tulip_to_properties_map(), - BlockKind::PottedOrangeTulip => self.potted_orange_tulip_to_properties_map(), - BlockKind::PottedWhiteTulip => self.potted_white_tulip_to_properties_map(), - BlockKind::PottedPinkTulip => self.potted_pink_tulip_to_properties_map(), - BlockKind::PottedOxeyeDaisy => self.potted_oxeye_daisy_to_properties_map(), - BlockKind::PottedCornflower => self.potted_cornflower_to_properties_map(), - BlockKind::PottedLilyOfTheValley => self.potted_lily_of_the_valley_to_properties_map(), - BlockKind::PottedWitherRose => self.potted_wither_rose_to_properties_map(), - BlockKind::PottedRedMushroom => self.potted_red_mushroom_to_properties_map(), - BlockKind::PottedBrownMushroom => self.potted_brown_mushroom_to_properties_map(), - BlockKind::PottedDeadBush => self.potted_dead_bush_to_properties_map(), - BlockKind::PottedCactus => self.potted_cactus_to_properties_map(), - BlockKind::Carrots => self.carrots_to_properties_map(), - BlockKind::Potatoes => self.potatoes_to_properties_map(), - BlockKind::OakButton => self.oak_button_to_properties_map(), - BlockKind::SpruceButton => self.spruce_button_to_properties_map(), - BlockKind::BirchButton => self.birch_button_to_properties_map(), - BlockKind::JungleButton => self.jungle_button_to_properties_map(), - BlockKind::AcaciaButton => self.acacia_button_to_properties_map(), - BlockKind::DarkOakButton => self.dark_oak_button_to_properties_map(), - BlockKind::SkeletonSkull => self.skeleton_skull_to_properties_map(), - BlockKind::SkeletonWallSkull => self.skeleton_wall_skull_to_properties_map(), - BlockKind::WitherSkeletonSkull => self.wither_skeleton_skull_to_properties_map(), - BlockKind::WitherSkeletonWallSkull => { - self.wither_skeleton_wall_skull_to_properties_map() - } - BlockKind::ZombieHead => self.zombie_head_to_properties_map(), - BlockKind::ZombieWallHead => self.zombie_wall_head_to_properties_map(), - BlockKind::PlayerHead => self.player_head_to_properties_map(), - BlockKind::PlayerWallHead => self.player_wall_head_to_properties_map(), - BlockKind::CreeperHead => self.creeper_head_to_properties_map(), - BlockKind::CreeperWallHead => self.creeper_wall_head_to_properties_map(), - BlockKind::DragonHead => self.dragon_head_to_properties_map(), - BlockKind::DragonWallHead => self.dragon_wall_head_to_properties_map(), - BlockKind::Anvil => self.anvil_to_properties_map(), - BlockKind::ChippedAnvil => self.chipped_anvil_to_properties_map(), - BlockKind::DamagedAnvil => self.damaged_anvil_to_properties_map(), - BlockKind::TrappedChest => self.trapped_chest_to_properties_map(), - BlockKind::LightWeightedPressurePlate => { - self.light_weighted_pressure_plate_to_properties_map() - } - BlockKind::HeavyWeightedPressurePlate => { - self.heavy_weighted_pressure_plate_to_properties_map() - } - BlockKind::Comparator => self.comparator_to_properties_map(), - BlockKind::DaylightDetector => self.daylight_detector_to_properties_map(), - BlockKind::RedstoneBlock => self.redstone_block_to_properties_map(), - BlockKind::NetherQuartzOre => self.nether_quartz_ore_to_properties_map(), - BlockKind::Hopper => self.hopper_to_properties_map(), - BlockKind::QuartzBlock => self.quartz_block_to_properties_map(), - BlockKind::ChiseledQuartzBlock => self.chiseled_quartz_block_to_properties_map(), - BlockKind::QuartzPillar => self.quartz_pillar_to_properties_map(), - BlockKind::QuartzStairs => self.quartz_stairs_to_properties_map(), - BlockKind::ActivatorRail => self.activator_rail_to_properties_map(), - BlockKind::Dropper => self.dropper_to_properties_map(), - BlockKind::WhiteTerracotta => self.white_terracotta_to_properties_map(), - BlockKind::OrangeTerracotta => self.orange_terracotta_to_properties_map(), - BlockKind::MagentaTerracotta => self.magenta_terracotta_to_properties_map(), - BlockKind::LightBlueTerracotta => self.light_blue_terracotta_to_properties_map(), - BlockKind::YellowTerracotta => self.yellow_terracotta_to_properties_map(), - BlockKind::LimeTerracotta => self.lime_terracotta_to_properties_map(), - BlockKind::PinkTerracotta => self.pink_terracotta_to_properties_map(), - BlockKind::GrayTerracotta => self.gray_terracotta_to_properties_map(), - BlockKind::LightGrayTerracotta => self.light_gray_terracotta_to_properties_map(), - BlockKind::CyanTerracotta => self.cyan_terracotta_to_properties_map(), - BlockKind::PurpleTerracotta => self.purple_terracotta_to_properties_map(), - BlockKind::BlueTerracotta => self.blue_terracotta_to_properties_map(), - BlockKind::BrownTerracotta => self.brown_terracotta_to_properties_map(), - BlockKind::GreenTerracotta => self.green_terracotta_to_properties_map(), - BlockKind::RedTerracotta => self.red_terracotta_to_properties_map(), - BlockKind::BlackTerracotta => self.black_terracotta_to_properties_map(), - BlockKind::WhiteStainedGlassPane => self.white_stained_glass_pane_to_properties_map(), - BlockKind::OrangeStainedGlassPane => self.orange_stained_glass_pane_to_properties_map(), - BlockKind::MagentaStainedGlassPane => { - self.magenta_stained_glass_pane_to_properties_map() - } - BlockKind::LightBlueStainedGlassPane => { - self.light_blue_stained_glass_pane_to_properties_map() - } - BlockKind::YellowStainedGlassPane => self.yellow_stained_glass_pane_to_properties_map(), - BlockKind::LimeStainedGlassPane => self.lime_stained_glass_pane_to_properties_map(), - BlockKind::PinkStainedGlassPane => self.pink_stained_glass_pane_to_properties_map(), - BlockKind::GrayStainedGlassPane => self.gray_stained_glass_pane_to_properties_map(), - BlockKind::LightGrayStainedGlassPane => { - self.light_gray_stained_glass_pane_to_properties_map() - } - BlockKind::CyanStainedGlassPane => self.cyan_stained_glass_pane_to_properties_map(), - BlockKind::PurpleStainedGlassPane => self.purple_stained_glass_pane_to_properties_map(), - BlockKind::BlueStainedGlassPane => self.blue_stained_glass_pane_to_properties_map(), - BlockKind::BrownStainedGlassPane => self.brown_stained_glass_pane_to_properties_map(), - BlockKind::GreenStainedGlassPane => self.green_stained_glass_pane_to_properties_map(), - BlockKind::RedStainedGlassPane => self.red_stained_glass_pane_to_properties_map(), - BlockKind::BlackStainedGlassPane => self.black_stained_glass_pane_to_properties_map(), - BlockKind::AcaciaStairs => self.acacia_stairs_to_properties_map(), - BlockKind::DarkOakStairs => self.dark_oak_stairs_to_properties_map(), - BlockKind::SlimeBlock => self.slime_block_to_properties_map(), - BlockKind::Barrier => self.barrier_to_properties_map(), - BlockKind::IronTrapdoor => self.iron_trapdoor_to_properties_map(), - BlockKind::Prismarine => self.prismarine_to_properties_map(), - BlockKind::PrismarineBricks => self.prismarine_bricks_to_properties_map(), - BlockKind::DarkPrismarine => self.dark_prismarine_to_properties_map(), - BlockKind::PrismarineStairs => self.prismarine_stairs_to_properties_map(), - BlockKind::PrismarineBrickStairs => self.prismarine_brick_stairs_to_properties_map(), - BlockKind::DarkPrismarineStairs => self.dark_prismarine_stairs_to_properties_map(), - BlockKind::PrismarineSlab => self.prismarine_slab_to_properties_map(), - BlockKind::PrismarineBrickSlab => self.prismarine_brick_slab_to_properties_map(), - BlockKind::DarkPrismarineSlab => self.dark_prismarine_slab_to_properties_map(), - BlockKind::SeaLantern => self.sea_lantern_to_properties_map(), - BlockKind::HayBlock => self.hay_block_to_properties_map(), - BlockKind::WhiteCarpet => self.white_carpet_to_properties_map(), - BlockKind::OrangeCarpet => self.orange_carpet_to_properties_map(), - BlockKind::MagentaCarpet => self.magenta_carpet_to_properties_map(), - BlockKind::LightBlueCarpet => self.light_blue_carpet_to_properties_map(), - BlockKind::YellowCarpet => self.yellow_carpet_to_properties_map(), - BlockKind::LimeCarpet => self.lime_carpet_to_properties_map(), - BlockKind::PinkCarpet => self.pink_carpet_to_properties_map(), - BlockKind::GrayCarpet => self.gray_carpet_to_properties_map(), - BlockKind::LightGrayCarpet => self.light_gray_carpet_to_properties_map(), - BlockKind::CyanCarpet => self.cyan_carpet_to_properties_map(), - BlockKind::PurpleCarpet => self.purple_carpet_to_properties_map(), - BlockKind::BlueCarpet => self.blue_carpet_to_properties_map(), - BlockKind::BrownCarpet => self.brown_carpet_to_properties_map(), - BlockKind::GreenCarpet => self.green_carpet_to_properties_map(), - BlockKind::RedCarpet => self.red_carpet_to_properties_map(), - BlockKind::BlackCarpet => self.black_carpet_to_properties_map(), - BlockKind::Terracotta => self.terracotta_to_properties_map(), - BlockKind::CoalBlock => self.coal_block_to_properties_map(), - BlockKind::PackedIce => self.packed_ice_to_properties_map(), - BlockKind::Sunflower => self.sunflower_to_properties_map(), - BlockKind::Lilac => self.lilac_to_properties_map(), - BlockKind::RoseBush => self.rose_bush_to_properties_map(), - BlockKind::Peony => self.peony_to_properties_map(), - BlockKind::TallGrass => self.tall_grass_to_properties_map(), - BlockKind::LargeFern => self.large_fern_to_properties_map(), - BlockKind::WhiteBanner => self.white_banner_to_properties_map(), - BlockKind::OrangeBanner => self.orange_banner_to_properties_map(), - BlockKind::MagentaBanner => self.magenta_banner_to_properties_map(), - BlockKind::LightBlueBanner => self.light_blue_banner_to_properties_map(), - BlockKind::YellowBanner => self.yellow_banner_to_properties_map(), - BlockKind::LimeBanner => self.lime_banner_to_properties_map(), - BlockKind::PinkBanner => self.pink_banner_to_properties_map(), - BlockKind::GrayBanner => self.gray_banner_to_properties_map(), - BlockKind::LightGrayBanner => self.light_gray_banner_to_properties_map(), - BlockKind::CyanBanner => self.cyan_banner_to_properties_map(), - BlockKind::PurpleBanner => self.purple_banner_to_properties_map(), - BlockKind::BlueBanner => self.blue_banner_to_properties_map(), - BlockKind::BrownBanner => self.brown_banner_to_properties_map(), - BlockKind::GreenBanner => self.green_banner_to_properties_map(), - BlockKind::RedBanner => self.red_banner_to_properties_map(), - BlockKind::BlackBanner => self.black_banner_to_properties_map(), - BlockKind::WhiteWallBanner => self.white_wall_banner_to_properties_map(), - BlockKind::OrangeWallBanner => self.orange_wall_banner_to_properties_map(), - BlockKind::MagentaWallBanner => self.magenta_wall_banner_to_properties_map(), - BlockKind::LightBlueWallBanner => self.light_blue_wall_banner_to_properties_map(), - BlockKind::YellowWallBanner => self.yellow_wall_banner_to_properties_map(), - BlockKind::LimeWallBanner => self.lime_wall_banner_to_properties_map(), - BlockKind::PinkWallBanner => self.pink_wall_banner_to_properties_map(), - BlockKind::GrayWallBanner => self.gray_wall_banner_to_properties_map(), - BlockKind::LightGrayWallBanner => self.light_gray_wall_banner_to_properties_map(), - BlockKind::CyanWallBanner => self.cyan_wall_banner_to_properties_map(), - BlockKind::PurpleWallBanner => self.purple_wall_banner_to_properties_map(), - BlockKind::BlueWallBanner => self.blue_wall_banner_to_properties_map(), - BlockKind::BrownWallBanner => self.brown_wall_banner_to_properties_map(), - BlockKind::GreenWallBanner => self.green_wall_banner_to_properties_map(), - BlockKind::RedWallBanner => self.red_wall_banner_to_properties_map(), - BlockKind::BlackWallBanner => self.black_wall_banner_to_properties_map(), - BlockKind::RedSandstone => self.red_sandstone_to_properties_map(), - BlockKind::ChiseledRedSandstone => self.chiseled_red_sandstone_to_properties_map(), - BlockKind::CutRedSandstone => self.cut_red_sandstone_to_properties_map(), - BlockKind::RedSandstoneStairs => self.red_sandstone_stairs_to_properties_map(), - BlockKind::OakSlab => self.oak_slab_to_properties_map(), - BlockKind::SpruceSlab => self.spruce_slab_to_properties_map(), - BlockKind::BirchSlab => self.birch_slab_to_properties_map(), - BlockKind::JungleSlab => self.jungle_slab_to_properties_map(), - BlockKind::AcaciaSlab => self.acacia_slab_to_properties_map(), - BlockKind::DarkOakSlab => self.dark_oak_slab_to_properties_map(), - BlockKind::StoneSlab => self.stone_slab_to_properties_map(), - BlockKind::SmoothStoneSlab => self.smooth_stone_slab_to_properties_map(), - BlockKind::SandstoneSlab => self.sandstone_slab_to_properties_map(), - BlockKind::CutSandstoneSlab => self.cut_sandstone_slab_to_properties_map(), - BlockKind::PetrifiedOakSlab => self.petrified_oak_slab_to_properties_map(), - BlockKind::CobblestoneSlab => self.cobblestone_slab_to_properties_map(), - BlockKind::BrickSlab => self.brick_slab_to_properties_map(), - BlockKind::StoneBrickSlab => self.stone_brick_slab_to_properties_map(), - BlockKind::NetherBrickSlab => self.nether_brick_slab_to_properties_map(), - BlockKind::QuartzSlab => self.quartz_slab_to_properties_map(), - BlockKind::RedSandstoneSlab => self.red_sandstone_slab_to_properties_map(), - BlockKind::CutRedSandstoneSlab => self.cut_red_sandstone_slab_to_properties_map(), - BlockKind::PurpurSlab => self.purpur_slab_to_properties_map(), - BlockKind::SmoothStone => self.smooth_stone_to_properties_map(), - BlockKind::SmoothSandstone => self.smooth_sandstone_to_properties_map(), - BlockKind::SmoothQuartz => self.smooth_quartz_to_properties_map(), - BlockKind::SmoothRedSandstone => self.smooth_red_sandstone_to_properties_map(), - BlockKind::SpruceFenceGate => self.spruce_fence_gate_to_properties_map(), - BlockKind::BirchFenceGate => self.birch_fence_gate_to_properties_map(), - BlockKind::JungleFenceGate => self.jungle_fence_gate_to_properties_map(), - BlockKind::AcaciaFenceGate => self.acacia_fence_gate_to_properties_map(), - BlockKind::DarkOakFenceGate => self.dark_oak_fence_gate_to_properties_map(), - BlockKind::SpruceFence => self.spruce_fence_to_properties_map(), - BlockKind::BirchFence => self.birch_fence_to_properties_map(), - BlockKind::JungleFence => self.jungle_fence_to_properties_map(), - BlockKind::AcaciaFence => self.acacia_fence_to_properties_map(), - BlockKind::DarkOakFence => self.dark_oak_fence_to_properties_map(), - BlockKind::SpruceDoor => self.spruce_door_to_properties_map(), - BlockKind::BirchDoor => self.birch_door_to_properties_map(), - BlockKind::JungleDoor => self.jungle_door_to_properties_map(), - BlockKind::AcaciaDoor => self.acacia_door_to_properties_map(), - BlockKind::DarkOakDoor => self.dark_oak_door_to_properties_map(), - BlockKind::EndRod => self.end_rod_to_properties_map(), - BlockKind::ChorusPlant => self.chorus_plant_to_properties_map(), - BlockKind::ChorusFlower => self.chorus_flower_to_properties_map(), - BlockKind::PurpurBlock => self.purpur_block_to_properties_map(), - BlockKind::PurpurPillar => self.purpur_pillar_to_properties_map(), - BlockKind::PurpurStairs => self.purpur_stairs_to_properties_map(), - BlockKind::EndStoneBricks => self.end_stone_bricks_to_properties_map(), - BlockKind::Beetroots => self.beetroots_to_properties_map(), - BlockKind::GrassPath => self.grass_path_to_properties_map(), - BlockKind::EndGateway => self.end_gateway_to_properties_map(), - BlockKind::RepeatingCommandBlock => self.repeating_command_block_to_properties_map(), - BlockKind::ChainCommandBlock => self.chain_command_block_to_properties_map(), - BlockKind::FrostedIce => self.frosted_ice_to_properties_map(), - BlockKind::MagmaBlock => self.magma_block_to_properties_map(), - BlockKind::NetherWartBlock => self.nether_wart_block_to_properties_map(), - BlockKind::RedNetherBricks => self.red_nether_bricks_to_properties_map(), - BlockKind::BoneBlock => self.bone_block_to_properties_map(), - BlockKind::StructureVoid => self.structure_void_to_properties_map(), - BlockKind::Observer => self.observer_to_properties_map(), - BlockKind::ShulkerBox => self.shulker_box_to_properties_map(), - BlockKind::WhiteShulkerBox => self.white_shulker_box_to_properties_map(), - BlockKind::OrangeShulkerBox => self.orange_shulker_box_to_properties_map(), - BlockKind::MagentaShulkerBox => self.magenta_shulker_box_to_properties_map(), - BlockKind::LightBlueShulkerBox => self.light_blue_shulker_box_to_properties_map(), - BlockKind::YellowShulkerBox => self.yellow_shulker_box_to_properties_map(), - BlockKind::LimeShulkerBox => self.lime_shulker_box_to_properties_map(), - BlockKind::PinkShulkerBox => self.pink_shulker_box_to_properties_map(), - BlockKind::GrayShulkerBox => self.gray_shulker_box_to_properties_map(), - BlockKind::LightGrayShulkerBox => self.light_gray_shulker_box_to_properties_map(), - BlockKind::CyanShulkerBox => self.cyan_shulker_box_to_properties_map(), - BlockKind::PurpleShulkerBox => self.purple_shulker_box_to_properties_map(), - BlockKind::BlueShulkerBox => self.blue_shulker_box_to_properties_map(), - BlockKind::BrownShulkerBox => self.brown_shulker_box_to_properties_map(), - BlockKind::GreenShulkerBox => self.green_shulker_box_to_properties_map(), - BlockKind::RedShulkerBox => self.red_shulker_box_to_properties_map(), - BlockKind::BlackShulkerBox => self.black_shulker_box_to_properties_map(), - BlockKind::WhiteGlazedTerracotta => self.white_glazed_terracotta_to_properties_map(), - BlockKind::OrangeGlazedTerracotta => self.orange_glazed_terracotta_to_properties_map(), - BlockKind::MagentaGlazedTerracotta => { - self.magenta_glazed_terracotta_to_properties_map() - } - BlockKind::LightBlueGlazedTerracotta => { - self.light_blue_glazed_terracotta_to_properties_map() - } - BlockKind::YellowGlazedTerracotta => self.yellow_glazed_terracotta_to_properties_map(), - BlockKind::LimeGlazedTerracotta => self.lime_glazed_terracotta_to_properties_map(), - BlockKind::PinkGlazedTerracotta => self.pink_glazed_terracotta_to_properties_map(), - BlockKind::GrayGlazedTerracotta => self.gray_glazed_terracotta_to_properties_map(), - BlockKind::LightGrayGlazedTerracotta => { - self.light_gray_glazed_terracotta_to_properties_map() - } - BlockKind::CyanGlazedTerracotta => self.cyan_glazed_terracotta_to_properties_map(), - BlockKind::PurpleGlazedTerracotta => self.purple_glazed_terracotta_to_properties_map(), - BlockKind::BlueGlazedTerracotta => self.blue_glazed_terracotta_to_properties_map(), - BlockKind::BrownGlazedTerracotta => self.brown_glazed_terracotta_to_properties_map(), - BlockKind::GreenGlazedTerracotta => self.green_glazed_terracotta_to_properties_map(), - BlockKind::RedGlazedTerracotta => self.red_glazed_terracotta_to_properties_map(), - BlockKind::BlackGlazedTerracotta => self.black_glazed_terracotta_to_properties_map(), - BlockKind::WhiteConcrete => self.white_concrete_to_properties_map(), - BlockKind::OrangeConcrete => self.orange_concrete_to_properties_map(), - BlockKind::MagentaConcrete => self.magenta_concrete_to_properties_map(), - BlockKind::LightBlueConcrete => self.light_blue_concrete_to_properties_map(), - BlockKind::YellowConcrete => self.yellow_concrete_to_properties_map(), - BlockKind::LimeConcrete => self.lime_concrete_to_properties_map(), - BlockKind::PinkConcrete => self.pink_concrete_to_properties_map(), - BlockKind::GrayConcrete => self.gray_concrete_to_properties_map(), - BlockKind::LightGrayConcrete => self.light_gray_concrete_to_properties_map(), - BlockKind::CyanConcrete => self.cyan_concrete_to_properties_map(), - BlockKind::PurpleConcrete => self.purple_concrete_to_properties_map(), - BlockKind::BlueConcrete => self.blue_concrete_to_properties_map(), - BlockKind::BrownConcrete => self.brown_concrete_to_properties_map(), - BlockKind::GreenConcrete => self.green_concrete_to_properties_map(), - BlockKind::RedConcrete => self.red_concrete_to_properties_map(), - BlockKind::BlackConcrete => self.black_concrete_to_properties_map(), - BlockKind::WhiteConcretePowder => self.white_concrete_powder_to_properties_map(), - BlockKind::OrangeConcretePowder => self.orange_concrete_powder_to_properties_map(), - BlockKind::MagentaConcretePowder => self.magenta_concrete_powder_to_properties_map(), - BlockKind::LightBlueConcretePowder => { - self.light_blue_concrete_powder_to_properties_map() - } - BlockKind::YellowConcretePowder => self.yellow_concrete_powder_to_properties_map(), - BlockKind::LimeConcretePowder => self.lime_concrete_powder_to_properties_map(), - BlockKind::PinkConcretePowder => self.pink_concrete_powder_to_properties_map(), - BlockKind::GrayConcretePowder => self.gray_concrete_powder_to_properties_map(), - BlockKind::LightGrayConcretePowder => { - self.light_gray_concrete_powder_to_properties_map() - } - BlockKind::CyanConcretePowder => self.cyan_concrete_powder_to_properties_map(), - BlockKind::PurpleConcretePowder => self.purple_concrete_powder_to_properties_map(), - BlockKind::BlueConcretePowder => self.blue_concrete_powder_to_properties_map(), - BlockKind::BrownConcretePowder => self.brown_concrete_powder_to_properties_map(), - BlockKind::GreenConcretePowder => self.green_concrete_powder_to_properties_map(), - BlockKind::RedConcretePowder => self.red_concrete_powder_to_properties_map(), - BlockKind::BlackConcretePowder => self.black_concrete_powder_to_properties_map(), - BlockKind::Kelp => self.kelp_to_properties_map(), - BlockKind::KelpPlant => self.kelp_plant_to_properties_map(), - BlockKind::DriedKelpBlock => self.dried_kelp_block_to_properties_map(), - BlockKind::TurtleEgg => self.turtle_egg_to_properties_map(), - BlockKind::DeadTubeCoralBlock => self.dead_tube_coral_block_to_properties_map(), - BlockKind::DeadBrainCoralBlock => self.dead_brain_coral_block_to_properties_map(), - BlockKind::DeadBubbleCoralBlock => self.dead_bubble_coral_block_to_properties_map(), - BlockKind::DeadFireCoralBlock => self.dead_fire_coral_block_to_properties_map(), - BlockKind::DeadHornCoralBlock => self.dead_horn_coral_block_to_properties_map(), - BlockKind::TubeCoralBlock => self.tube_coral_block_to_properties_map(), - BlockKind::BrainCoralBlock => self.brain_coral_block_to_properties_map(), - BlockKind::BubbleCoralBlock => self.bubble_coral_block_to_properties_map(), - BlockKind::FireCoralBlock => self.fire_coral_block_to_properties_map(), - BlockKind::HornCoralBlock => self.horn_coral_block_to_properties_map(), - BlockKind::DeadTubeCoral => self.dead_tube_coral_to_properties_map(), - BlockKind::DeadBrainCoral => self.dead_brain_coral_to_properties_map(), - BlockKind::DeadBubbleCoral => self.dead_bubble_coral_to_properties_map(), - BlockKind::DeadFireCoral => self.dead_fire_coral_to_properties_map(), - BlockKind::DeadHornCoral => self.dead_horn_coral_to_properties_map(), - BlockKind::TubeCoral => self.tube_coral_to_properties_map(), - BlockKind::BrainCoral => self.brain_coral_to_properties_map(), - BlockKind::BubbleCoral => self.bubble_coral_to_properties_map(), - BlockKind::FireCoral => self.fire_coral_to_properties_map(), - BlockKind::HornCoral => self.horn_coral_to_properties_map(), - BlockKind::DeadTubeCoralFan => self.dead_tube_coral_fan_to_properties_map(), - BlockKind::DeadBrainCoralFan => self.dead_brain_coral_fan_to_properties_map(), - BlockKind::DeadBubbleCoralFan => self.dead_bubble_coral_fan_to_properties_map(), - BlockKind::DeadFireCoralFan => self.dead_fire_coral_fan_to_properties_map(), - BlockKind::DeadHornCoralFan => self.dead_horn_coral_fan_to_properties_map(), - BlockKind::TubeCoralFan => self.tube_coral_fan_to_properties_map(), - BlockKind::BrainCoralFan => self.brain_coral_fan_to_properties_map(), - BlockKind::BubbleCoralFan => self.bubble_coral_fan_to_properties_map(), - BlockKind::FireCoralFan => self.fire_coral_fan_to_properties_map(), - BlockKind::HornCoralFan => self.horn_coral_fan_to_properties_map(), - BlockKind::DeadTubeCoralWallFan => self.dead_tube_coral_wall_fan_to_properties_map(), - BlockKind::DeadBrainCoralWallFan => self.dead_brain_coral_wall_fan_to_properties_map(), - BlockKind::DeadBubbleCoralWallFan => { - self.dead_bubble_coral_wall_fan_to_properties_map() - } - BlockKind::DeadFireCoralWallFan => self.dead_fire_coral_wall_fan_to_properties_map(), - BlockKind::DeadHornCoralWallFan => self.dead_horn_coral_wall_fan_to_properties_map(), - BlockKind::TubeCoralWallFan => self.tube_coral_wall_fan_to_properties_map(), - BlockKind::BrainCoralWallFan => self.brain_coral_wall_fan_to_properties_map(), - BlockKind::BubbleCoralWallFan => self.bubble_coral_wall_fan_to_properties_map(), - BlockKind::FireCoralWallFan => self.fire_coral_wall_fan_to_properties_map(), - BlockKind::HornCoralWallFan => self.horn_coral_wall_fan_to_properties_map(), - BlockKind::SeaPickle => self.sea_pickle_to_properties_map(), - BlockKind::BlueIce => self.blue_ice_to_properties_map(), - BlockKind::Conduit => self.conduit_to_properties_map(), - BlockKind::BambooSapling => self.bamboo_sapling_to_properties_map(), - BlockKind::Bamboo => self.bamboo_to_properties_map(), - BlockKind::PottedBamboo => self.potted_bamboo_to_properties_map(), - BlockKind::VoidAir => self.void_air_to_properties_map(), - BlockKind::CaveAir => self.cave_air_to_properties_map(), - BlockKind::BubbleColumn => self.bubble_column_to_properties_map(), - BlockKind::PolishedGraniteStairs => self.polished_granite_stairs_to_properties_map(), - BlockKind::SmoothRedSandstoneStairs => { - self.smooth_red_sandstone_stairs_to_properties_map() - } - BlockKind::MossyStoneBrickStairs => self.mossy_stone_brick_stairs_to_properties_map(), - BlockKind::PolishedDioriteStairs => self.polished_diorite_stairs_to_properties_map(), - BlockKind::MossyCobblestoneStairs => self.mossy_cobblestone_stairs_to_properties_map(), - BlockKind::EndStoneBrickStairs => self.end_stone_brick_stairs_to_properties_map(), - BlockKind::StoneStairs => self.stone_stairs_to_properties_map(), - BlockKind::SmoothSandstoneStairs => self.smooth_sandstone_stairs_to_properties_map(), - BlockKind::SmoothQuartzStairs => self.smooth_quartz_stairs_to_properties_map(), - BlockKind::GraniteStairs => self.granite_stairs_to_properties_map(), - BlockKind::AndesiteStairs => self.andesite_stairs_to_properties_map(), - BlockKind::RedNetherBrickStairs => self.red_nether_brick_stairs_to_properties_map(), - BlockKind::PolishedAndesiteStairs => self.polished_andesite_stairs_to_properties_map(), - BlockKind::DioriteStairs => self.diorite_stairs_to_properties_map(), - BlockKind::PolishedGraniteSlab => self.polished_granite_slab_to_properties_map(), - BlockKind::SmoothRedSandstoneSlab => self.smooth_red_sandstone_slab_to_properties_map(), - BlockKind::MossyStoneBrickSlab => self.mossy_stone_brick_slab_to_properties_map(), - BlockKind::PolishedDioriteSlab => self.polished_diorite_slab_to_properties_map(), - BlockKind::MossyCobblestoneSlab => self.mossy_cobblestone_slab_to_properties_map(), - BlockKind::EndStoneBrickSlab => self.end_stone_brick_slab_to_properties_map(), - BlockKind::SmoothSandstoneSlab => self.smooth_sandstone_slab_to_properties_map(), - BlockKind::SmoothQuartzSlab => self.smooth_quartz_slab_to_properties_map(), - BlockKind::GraniteSlab => self.granite_slab_to_properties_map(), - BlockKind::AndesiteSlab => self.andesite_slab_to_properties_map(), - BlockKind::RedNetherBrickSlab => self.red_nether_brick_slab_to_properties_map(), - BlockKind::PolishedAndesiteSlab => self.polished_andesite_slab_to_properties_map(), - BlockKind::DioriteSlab => self.diorite_slab_to_properties_map(), - BlockKind::BrickWall => self.brick_wall_to_properties_map(), - BlockKind::PrismarineWall => self.prismarine_wall_to_properties_map(), - BlockKind::RedSandstoneWall => self.red_sandstone_wall_to_properties_map(), - BlockKind::MossyStoneBrickWall => self.mossy_stone_brick_wall_to_properties_map(), - BlockKind::GraniteWall => self.granite_wall_to_properties_map(), - BlockKind::StoneBrickWall => self.stone_brick_wall_to_properties_map(), - BlockKind::NetherBrickWall => self.nether_brick_wall_to_properties_map(), - BlockKind::AndesiteWall => self.andesite_wall_to_properties_map(), - BlockKind::RedNetherBrickWall => self.red_nether_brick_wall_to_properties_map(), - BlockKind::SandstoneWall => self.sandstone_wall_to_properties_map(), - BlockKind::EndStoneBrickWall => self.end_stone_brick_wall_to_properties_map(), - BlockKind::DioriteWall => self.diorite_wall_to_properties_map(), - BlockKind::Scaffolding => self.scaffolding_to_properties_map(), - BlockKind::Loom => self.loom_to_properties_map(), - BlockKind::Barrel => self.barrel_to_properties_map(), - BlockKind::Smoker => self.smoker_to_properties_map(), - BlockKind::BlastFurnace => self.blast_furnace_to_properties_map(), - BlockKind::CartographyTable => self.cartography_table_to_properties_map(), - BlockKind::FletchingTable => self.fletching_table_to_properties_map(), - BlockKind::Grindstone => self.grindstone_to_properties_map(), - BlockKind::Lectern => self.lectern_to_properties_map(), - BlockKind::SmithingTable => self.smithing_table_to_properties_map(), - BlockKind::Stonecutter => self.stonecutter_to_properties_map(), - BlockKind::Bell => self.bell_to_properties_map(), - BlockKind::Lantern => self.lantern_to_properties_map(), - BlockKind::SoulLantern => self.soul_lantern_to_properties_map(), - BlockKind::Campfire => self.campfire_to_properties_map(), - BlockKind::SoulCampfire => self.soul_campfire_to_properties_map(), - BlockKind::SweetBerryBush => self.sweet_berry_bush_to_properties_map(), - BlockKind::WarpedStem => self.warped_stem_to_properties_map(), - BlockKind::StrippedWarpedStem => self.stripped_warped_stem_to_properties_map(), - BlockKind::WarpedHyphae => self.warped_hyphae_to_properties_map(), - BlockKind::StrippedWarpedHyphae => self.stripped_warped_hyphae_to_properties_map(), - BlockKind::WarpedNylium => self.warped_nylium_to_properties_map(), - BlockKind::WarpedFungus => self.warped_fungus_to_properties_map(), - BlockKind::WarpedWartBlock => self.warped_wart_block_to_properties_map(), - BlockKind::WarpedRoots => self.warped_roots_to_properties_map(), - BlockKind::NetherSprouts => self.nether_sprouts_to_properties_map(), - BlockKind::CrimsonStem => self.crimson_stem_to_properties_map(), - BlockKind::StrippedCrimsonStem => self.stripped_crimson_stem_to_properties_map(), - BlockKind::CrimsonHyphae => self.crimson_hyphae_to_properties_map(), - BlockKind::StrippedCrimsonHyphae => self.stripped_crimson_hyphae_to_properties_map(), - BlockKind::CrimsonNylium => self.crimson_nylium_to_properties_map(), - BlockKind::CrimsonFungus => self.crimson_fungus_to_properties_map(), - BlockKind::Shroomlight => self.shroomlight_to_properties_map(), - BlockKind::WeepingVines => self.weeping_vines_to_properties_map(), - BlockKind::WeepingVinesPlant => self.weeping_vines_plant_to_properties_map(), - BlockKind::TwistingVines => self.twisting_vines_to_properties_map(), - BlockKind::TwistingVinesPlant => self.twisting_vines_plant_to_properties_map(), - BlockKind::CrimsonRoots => self.crimson_roots_to_properties_map(), - BlockKind::CrimsonPlanks => self.crimson_planks_to_properties_map(), - BlockKind::WarpedPlanks => self.warped_planks_to_properties_map(), - BlockKind::CrimsonSlab => self.crimson_slab_to_properties_map(), - BlockKind::WarpedSlab => self.warped_slab_to_properties_map(), - BlockKind::CrimsonPressurePlate => self.crimson_pressure_plate_to_properties_map(), - BlockKind::WarpedPressurePlate => self.warped_pressure_plate_to_properties_map(), - BlockKind::CrimsonFence => self.crimson_fence_to_properties_map(), - BlockKind::WarpedFence => self.warped_fence_to_properties_map(), - BlockKind::CrimsonTrapdoor => self.crimson_trapdoor_to_properties_map(), - BlockKind::WarpedTrapdoor => self.warped_trapdoor_to_properties_map(), - BlockKind::CrimsonFenceGate => self.crimson_fence_gate_to_properties_map(), - BlockKind::WarpedFenceGate => self.warped_fence_gate_to_properties_map(), - BlockKind::CrimsonStairs => self.crimson_stairs_to_properties_map(), - BlockKind::WarpedStairs => self.warped_stairs_to_properties_map(), - BlockKind::CrimsonButton => self.crimson_button_to_properties_map(), - BlockKind::WarpedButton => self.warped_button_to_properties_map(), - BlockKind::CrimsonDoor => self.crimson_door_to_properties_map(), - BlockKind::WarpedDoor => self.warped_door_to_properties_map(), - BlockKind::CrimsonSign => self.crimson_sign_to_properties_map(), - BlockKind::WarpedSign => self.warped_sign_to_properties_map(), - BlockKind::CrimsonWallSign => self.crimson_wall_sign_to_properties_map(), - BlockKind::WarpedWallSign => self.warped_wall_sign_to_properties_map(), - BlockKind::StructureBlock => self.structure_block_to_properties_map(), - BlockKind::Jigsaw => self.jigsaw_to_properties_map(), - BlockKind::Composter => self.composter_to_properties_map(), - BlockKind::Target => self.target_to_properties_map(), - BlockKind::BeeNest => self.bee_nest_to_properties_map(), - BlockKind::Beehive => self.beehive_to_properties_map(), - BlockKind::HoneyBlock => self.honey_block_to_properties_map(), - BlockKind::HoneycombBlock => self.honeycomb_block_to_properties_map(), - BlockKind::NetheriteBlock => self.netherite_block_to_properties_map(), - BlockKind::AncientDebris => self.ancient_debris_to_properties_map(), - BlockKind::CryingObsidian => self.crying_obsidian_to_properties_map(), - BlockKind::RespawnAnchor => self.respawn_anchor_to_properties_map(), - BlockKind::PottedCrimsonFungus => self.potted_crimson_fungus_to_properties_map(), - BlockKind::PottedWarpedFungus => self.potted_warped_fungus_to_properties_map(), - BlockKind::PottedCrimsonRoots => self.potted_crimson_roots_to_properties_map(), - BlockKind::PottedWarpedRoots => self.potted_warped_roots_to_properties_map(), - BlockKind::Lodestone => self.lodestone_to_properties_map(), - BlockKind::Blackstone => self.blackstone_to_properties_map(), - BlockKind::BlackstoneStairs => self.blackstone_stairs_to_properties_map(), - BlockKind::BlackstoneWall => self.blackstone_wall_to_properties_map(), - BlockKind::BlackstoneSlab => self.blackstone_slab_to_properties_map(), - BlockKind::PolishedBlackstone => self.polished_blackstone_to_properties_map(), - BlockKind::PolishedBlackstoneBricks => { - self.polished_blackstone_bricks_to_properties_map() - } - BlockKind::CrackedPolishedBlackstoneBricks => { - self.cracked_polished_blackstone_bricks_to_properties_map() - } - BlockKind::ChiseledPolishedBlackstone => { - self.chiseled_polished_blackstone_to_properties_map() - } - BlockKind::PolishedBlackstoneBrickSlab => { - self.polished_blackstone_brick_slab_to_properties_map() - } - BlockKind::PolishedBlackstoneBrickStairs => { - self.polished_blackstone_brick_stairs_to_properties_map() - } - BlockKind::PolishedBlackstoneBrickWall => { - self.polished_blackstone_brick_wall_to_properties_map() - } - BlockKind::GildedBlackstone => self.gilded_blackstone_to_properties_map(), - BlockKind::PolishedBlackstoneStairs => { - self.polished_blackstone_stairs_to_properties_map() - } - BlockKind::PolishedBlackstoneSlab => self.polished_blackstone_slab_to_properties_map(), - BlockKind::PolishedBlackstonePressurePlate => { - self.polished_blackstone_pressure_plate_to_properties_map() - } - BlockKind::PolishedBlackstoneButton => { - self.polished_blackstone_button_to_properties_map() - } - BlockKind::PolishedBlackstoneWall => self.polished_blackstone_wall_to_properties_map(), - BlockKind::ChiseledNetherBricks => self.chiseled_nether_bricks_to_properties_map(), - BlockKind::CrackedNetherBricks => self.cracked_nether_bricks_to_properties_map(), - BlockKind::QuartzBricks => self.quartz_bricks_to_properties_map(), - } - } - fn air_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn stone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn granite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_granite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn diorite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_diorite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn andesite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_andesite_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn grass_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let snowy = self.snowy().unwrap(); - map.insert("snowy", { - match snowy { - true => "true", - false => "false", - } - }); - map - } - fn dirt_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn coarse_dirt_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn podzol_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let snowy = self.snowy().unwrap(); - map.insert("snowy", { - match snowy { - true => "true", - false => "false", - } - }); - map - } - fn cobblestone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oak_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn spruce_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn birch_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn jungle_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn acacia_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dark_oak_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oak_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn spruce_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn birch_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn jungle_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn acacia_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn dark_oak_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn bedrock_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn water_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let water_level = self.water_level().unwrap(); - map.insert("level", { - match water_level { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn lava_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let water_level = self.water_level().unwrap(); - map.insert("level", { - match water_level { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn sand_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_sand_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gravel_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gold_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn iron_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn coal_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_gold_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oak_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn spruce_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn birch_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn jungle_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn acacia_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn dark_oak_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_spruce_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_birch_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_jungle_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_acacia_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_dark_oak_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_oak_log_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn oak_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn spruce_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn birch_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn jungle_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn acacia_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn dark_oak_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_oak_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_spruce_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_birch_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_jungle_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_acacia_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_dark_oak_wood_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn oak_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn spruce_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn birch_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn jungle_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn acacia_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_leaves_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let distance_1_7 = self.distance_1_7().unwrap(); - map.insert("distance", { - match distance_1_7 { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let persistent = self.persistent().unwrap(); - map.insert("persistent", { - match persistent { - true => "true", - false => "false", - } - }); - map - } - fn sponge_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn wet_sponge_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lapis_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lapis_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dispenser_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let triggered = self.triggered().unwrap(); - map.insert("triggered", { - match triggered { - true => "true", - false => "false", - } - }); - map - } - fn sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn chiseled_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cut_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn note_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let instrument = self.instrument().unwrap(); - map.insert("instrument", { instrument.as_str() }); - let note = self.note().unwrap(); - map.insert("note", { - match note { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - 16i32 => "16", - 17i32 => "17", - 18i32 => "18", - 19i32 => "19", - 20i32 => "20", - 21i32 => "21", - 22i32 => "22", - 23i32 => "23", - 24i32 => "24", - _ => "unknown", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn white_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn orange_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn magenta_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn light_blue_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn yellow_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn lime_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn pink_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn gray_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn light_gray_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn cyan_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn purple_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn blue_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn brown_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn green_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn red_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn black_bed_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let occupied = self.occupied().unwrap(); - map.insert("occupied", { - match occupied { - true => "true", - false => "false", - } - }); - let part = self.part().unwrap(); - map.insert("part", { part.as_str() }); - map - } - fn powered_rail_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let powered_rail_shape = self.powered_rail_shape().unwrap(); - map.insert("shape", { powered_rail_shape.as_str() }); - map - } - fn detector_rail_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let powered_rail_shape = self.powered_rail_shape().unwrap(); - map.insert("shape", { powered_rail_shape.as_str() }); - map - } - fn sticky_piston_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let extended = self.extended().unwrap(); - map.insert("extended", { - match extended { - true => "true", - false => "false", - } - }); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn cobweb_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn grass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn fern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_bush_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn seagrass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn tall_seagrass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn piston_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let extended = self.extended().unwrap(); - map.insert("extended", { - match extended { - true => "true", - false => "false", - } - }); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn piston_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let piston_kind = self.piston_kind().unwrap(); - map.insert("type", { piston_kind.as_str() }); - let short = self.short().unwrap(); - map.insert("short", { - match short { - true => "true", - false => "false", - } - }); - map - } - fn white_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_wool_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn moving_piston_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let piston_kind = self.piston_kind().unwrap(); - map.insert("type", { piston_kind.as_str() }); - map - } - fn dandelion_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn poppy_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_orchid_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn allium_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn azure_bluet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn white_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oxeye_daisy_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cornflower_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn wither_rose_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lily_of_the_valley_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_mushroom_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_mushroom_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gold_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn iron_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn tnt_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let unstable = self.unstable().unwrap(); - map.insert("unstable", { - match unstable { - true => "true", - false => "false", - } - }); - map - } - fn bookshelf_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn mossy_cobblestone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn obsidian_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn wall_torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn fire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_15 = self.age_0_15().unwrap(); - map.insert("age", { - match age_0_15 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn soul_fire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn spawner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oak_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn chest_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let chest_kind = self.chest_kind().unwrap(); - map.insert("type", { chest_kind.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn redstone_wire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_wire = self.east_wire().unwrap(); - map.insert("east", { east_wire.as_str() }); - let north_wire = self.north_wire().unwrap(); - map.insert("north", { north_wire.as_str() }); - let power = self.power().unwrap(); - map.insert("power", { - match power { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let south_wire = self.south_wire().unwrap(); - map.insert("south", { south_wire.as_str() }); - let west_wire = self.west_wire().unwrap(); - map.insert("west", { west_wire.as_str() }); - map - } - fn diamond_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn diamond_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crafting_table_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn wheat_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_7 = self.age_0_7().unwrap(); - map.insert("age", { - match age_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn farmland_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let moisture = self.moisture().unwrap(); - map.insert("moisture", { - match moisture { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn furnace_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn oak_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn spruce_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn birch_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn acacia_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn jungle_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn oak_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn ladder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn rail_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rail_shape = self.rail_shape().unwrap(); - map.insert("shape", { rail_shape.as_str() }); - map - } - fn cobblestone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn oak_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn spruce_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn birch_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn acacia_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn jungle_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn lever_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn stone_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn iron_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn oak_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn spruce_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn birch_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn jungle_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn acacia_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn redstone_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn redstone_torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn redstone_wall_torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn stone_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn snow_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let layers = self.layers().unwrap(); - map.insert("layers", { - match layers { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - _ => "unknown", - } - }); - map - } - fn ice_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn snow_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cactus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_15 = self.age_0_15().unwrap(); - map.insert("age", { - match age_0_15 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn clay_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn sugar_cane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_15 = self.age_0_15().unwrap(); - map.insert("age", { - match age_0_15 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn jukebox_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let has_record = self.has_record().unwrap(); - map.insert("has_record", { - match has_record { - true => "true", - false => "false", - } - }); - map - } - fn oak_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn pumpkin_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn netherrack_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn soul_sand_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn soul_soil_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn basalt_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn polished_basalt_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn soul_torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn soul_wall_torch_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn glowstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_portal_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xz = self.axis_xz().unwrap(); - map.insert("axis", { axis_xz.as_str() }); - map - } - fn carved_pumpkin_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn jack_o_lantern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn cake_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let bites = self.bites().unwrap(); - map.insert("bites", { - match bites { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - _ => "unknown", - } - }); - map - } - fn repeater_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let delay = self.delay().unwrap(); - map.insert("delay", { - match delay { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - _ => "unknown", - } - }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let locked = self.locked().unwrap(); - map.insert("locked", { - match locked { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn white_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_stained_glass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn oak_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn spruce_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn birch_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn jungle_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn acacia_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn mossy_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cracked_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn chiseled_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_stone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_cobblestone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_mossy_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_cracked_stone_bricks_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn infested_chiseled_stone_bricks_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_mushroom_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let down = self.down().unwrap(); - map.insert("down", { - match down { - true => "true", - false => "false", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn red_mushroom_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let down = self.down().unwrap(); - map.insert("down", { - match down { - true => "true", - false => "false", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn mushroom_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let down = self.down().unwrap(); - map.insert("down", { - match down { - true => "true", - false => "false", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn iron_bars_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn chain_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn melon_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn attached_pumpkin_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn attached_melon_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn pumpkin_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_7 = self.age_0_7().unwrap(); - map.insert("age", { - match age_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn melon_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_7 = self.age_0_7().unwrap(); - map.insert("age", { - match age_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn vine_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn oak_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn stone_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn mycelium_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let snowy = self.snowy().unwrap(); - map.insert("snowy", { - match snowy { - true => "true", - false => "false", - } - }); - map - } - fn lily_pad_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_brick_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn nether_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn nether_wart_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_3 = self.age_0_3().unwrap(); - map.insert("age", { - match age_0_3 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - _ => "unknown", - } - }); - map - } - fn enchanting_table_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brewing_stand_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let has_bottle_0 = self.has_bottle_0().unwrap(); - map.insert("has_bottle_0", { - match has_bottle_0 { - true => "true", - false => "false", - } - }); - let has_bottle_1 = self.has_bottle_1().unwrap(); - map.insert("has_bottle_1", { - match has_bottle_1 { - true => "true", - false => "false", - } - }); - let has_bottle_2 = self.has_bottle_2().unwrap(); - map.insert("has_bottle_2", { - match has_bottle_2 { - true => "true", - false => "false", - } - }); - map - } - fn cauldron_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let cauldron_level = self.cauldron_level().unwrap(); - map.insert("level", { - match cauldron_level { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - _ => "unknown", - } - }); - map - } - fn end_portal_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn end_portal_frame_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let eye = self.eye().unwrap(); - map.insert("eye", { - match eye { - true => "true", - false => "false", - } - }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn end_stone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dragon_egg_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn redstone_lamp_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn cocoa_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_2 = self.age_0_2().unwrap(); - map.insert("age", { - match age_0_2 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - _ => "unknown", - } - }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn sandstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn emerald_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn ender_chest_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn tripwire_hook_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let attached = self.attached().unwrap(); - map.insert("attached", { - match attached { - true => "true", - false => "false", - } - }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn tripwire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let attached = self.attached().unwrap(); - map.insert("attached", { - match attached { - true => "true", - false => "false", - } - }); - let disarmed = self.disarmed().unwrap(); - map.insert("disarmed", { - match disarmed { - true => "true", - false => "false", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn emerald_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn spruce_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn birch_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn jungle_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn command_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let conditional = self.conditional().unwrap(); - map.insert("conditional", { - match conditional { - true => "true", - false => "false", - } - }); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn beacon_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cobblestone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn mossy_cobblestone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn flower_pot_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_oak_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_spruce_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_birch_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_jungle_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_acacia_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_dark_oak_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_fern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_dandelion_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_poppy_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_blue_orchid_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_allium_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_azure_bluet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_red_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_orange_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_white_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_pink_tulip_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_oxeye_daisy_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_cornflower_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_lily_of_the_valley_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_wither_rose_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_red_mushroom_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_brown_mushroom_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_dead_bush_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_cactus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn carrots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_7 = self.age_0_7().unwrap(); - map.insert("age", { - match age_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn potatoes_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_7 = self.age_0_7().unwrap(); - map.insert("age", { - match age_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - map - } - fn oak_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn spruce_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn birch_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn jungle_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn acacia_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn skeleton_skull_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn skeleton_wall_skull_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn wither_skeleton_skull_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn wither_skeleton_wall_skull_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn zombie_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn zombie_wall_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn player_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn player_wall_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn creeper_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn creeper_wall_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn dragon_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn dragon_wall_head_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn anvil_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn chipped_anvil_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn damaged_anvil_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn trapped_chest_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let chest_kind = self.chest_kind().unwrap(); - map.insert("type", { chest_kind.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn light_weighted_pressure_plate_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let power = self.power().unwrap(); - map.insert("power", { - match power { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn heavy_weighted_pressure_plate_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let power = self.power().unwrap(); - map.insert("power", { - match power { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn comparator_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let comparator_mode = self.comparator_mode().unwrap(); - map.insert("mode", { comparator_mode.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn daylight_detector_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let inverted = self.inverted().unwrap(); - map.insert("inverted", { - match inverted { - true => "true", - false => "false", - } - }); - let power = self.power().unwrap(); - map.insert("power", { - match power { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn redstone_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_quartz_ore_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn hopper_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let enabled = self.enabled().unwrap(); - map.insert("enabled", { - match enabled { - true => "true", - false => "false", - } - }); - let facing_cardinal_and_down = self.facing_cardinal_and_down().unwrap(); - map.insert("facing", { facing_cardinal_and_down.as_str() }); - map - } - fn quartz_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn chiseled_quartz_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn quartz_pillar_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn quartz_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn activator_rail_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let powered_rail_shape = self.powered_rail_shape().unwrap(); - map.insert("shape", { powered_rail_shape.as_str() }); - map - } - fn dropper_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let triggered = self.triggered().unwrap(); - map.insert("triggered", { - match triggered { - true => "true", - false => "false", - } - }); - map - } - fn white_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn white_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn orange_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn magenta_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn light_blue_stained_glass_pane_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn yellow_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn lime_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn pink_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn gray_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn light_gray_stained_glass_pane_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn cyan_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn purple_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn blue_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn brown_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn green_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn red_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn black_stained_glass_pane_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn acacia_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn slime_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn barrier_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn iron_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn prismarine_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn prismarine_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dark_prismarine_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn prismarine_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn prismarine_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_prismarine_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn prismarine_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn prismarine_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_prismarine_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn sea_lantern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn hay_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn white_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_carpet_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn coal_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn packed_ice_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn sunflower_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn lilac_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn rose_bush_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn peony_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn tall_grass_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn large_fern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - map - } - fn white_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn orange_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn magenta_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn light_blue_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn yellow_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn lime_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn pink_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn gray_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn light_gray_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn cyan_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn purple_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn blue_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn brown_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn green_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn red_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn black_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn white_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn orange_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn magenta_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn light_blue_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn yellow_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn lime_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn pink_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn gray_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn light_gray_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn cyan_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn purple_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn blue_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn brown_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn green_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn red_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn black_wall_banner_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn red_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn chiseled_red_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cut_red_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_sandstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn oak_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn spruce_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn birch_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn jungle_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn acacia_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn stone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_stone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn cut_sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn petrified_oak_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn cobblestone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn stone_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn nether_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn quartz_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn red_sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn cut_red_sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn purpur_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_stone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn smooth_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn smooth_quartz_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn smooth_red_sandstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn spruce_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn birch_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn jungle_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn acacia_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn spruce_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn birch_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn jungle_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn acacia_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn spruce_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn birch_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn jungle_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn acacia_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn dark_oak_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn end_rod_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn chorus_plant_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let down = self.down().unwrap(); - map.insert("down", { - match down { - true => "true", - false => "false", - } - }); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn chorus_flower_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_5 = self.age_0_5().unwrap(); - map.insert("age", { - match age_0_5 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - _ => "unknown", - } - }); - map - } - fn purpur_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purpur_pillar_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn purpur_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn end_stone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn beetroots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_3 = self.age_0_3().unwrap(); - map.insert("age", { - match age_0_3 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - _ => "unknown", - } - }); - map - } - fn grass_path_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn end_gateway_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn repeating_command_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let conditional = self.conditional().unwrap(); - map.insert("conditional", { - match conditional { - true => "true", - false => "false", - } - }); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn chain_command_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let conditional = self.conditional().unwrap(); - map.insert("conditional", { - match conditional { - true => "true", - false => "false", - } - }); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn frosted_ice_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_3 = self.age_0_3().unwrap(); - map.insert("age", { - match age_0_3 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - _ => "unknown", - } - }); - map - } - fn magma_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_wart_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_nether_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn bone_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn structure_void_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn observer_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn white_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn orange_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn magenta_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn light_blue_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn yellow_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn lime_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn pink_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn gray_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn light_gray_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn cyan_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn purple_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn blue_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn brown_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn green_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn red_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn black_shulker_box_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - map - } - fn white_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn orange_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn magenta_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn light_blue_glazed_terracotta_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn yellow_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn lime_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn pink_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn gray_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn light_gray_glazed_terracotta_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn cyan_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn purple_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn blue_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn brown_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn green_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn red_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn black_glazed_terracotta_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn white_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_concrete_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn white_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn orange_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn magenta_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_blue_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn yellow_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lime_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn pink_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn gray_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn light_gray_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cyan_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn purple_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blue_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brown_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn green_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn red_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn black_concrete_powder_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn kelp_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_25 = self.age_0_25().unwrap(); - map.insert("age", { - match age_0_25 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - 16i32 => "16", - 17i32 => "17", - 18i32 => "18", - 19i32 => "19", - 20i32 => "20", - 21i32 => "21", - 22i32 => "22", - 23i32 => "23", - 24i32 => "24", - 25i32 => "25", - _ => "unknown", - } - }); - map - } - fn kelp_plant_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dried_kelp_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn turtle_egg_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let eggs = self.eggs().unwrap(); - map.insert("eggs", { - match eggs { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - _ => "unknown", - } - }); - let hatch = self.hatch().unwrap(); - map.insert("hatch", { - match hatch { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - _ => "unknown", - } - }); - map - } - fn dead_tube_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_brain_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_bubble_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_fire_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_horn_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn tube_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn brain_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn bubble_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn fire_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn horn_coral_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn dead_tube_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_brain_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_bubble_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_fire_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_horn_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn tube_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn brain_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn bubble_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn fire_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn horn_coral_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_tube_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_brain_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_bubble_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_fire_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_horn_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn tube_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn brain_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn bubble_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn fire_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn horn_coral_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_tube_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_brain_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_bubble_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_fire_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn dead_horn_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn tube_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn brain_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn bubble_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn fire_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn horn_coral_wall_fan_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn sea_pickle_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let pickles = self.pickles().unwrap(); - map.insert("pickles", { - match pickles { - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn blue_ice_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn conduit_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn bamboo_sapling_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn bamboo_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_1 = self.age_0_1().unwrap(); - map.insert("age", { - match age_0_1 { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - let leaves = self.leaves().unwrap(); - map.insert("leaves", { leaves.as_str() }); - let stage = self.stage().unwrap(); - map.insert("stage", { - match stage { - 0i32 => "0", - 1i32 => "1", - _ => "unknown", - } - }); - map - } - fn potted_bamboo_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn void_air_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cave_air_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn bubble_column_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let drag = self.drag().unwrap(); - map.insert("drag", { - match drag { - true => "true", - false => "false", - } - }); - map - } - fn polished_granite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_red_sandstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn mossy_stone_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_diorite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn mossy_cobblestone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn end_stone_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn stone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_sandstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_quartz_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn granite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn andesite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn red_nether_brick_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_andesite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn diorite_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_granite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_red_sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn mossy_stone_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_diorite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn mossy_cobblestone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn end_stone_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_sandstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn smooth_quartz_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn granite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn andesite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn red_nether_brick_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_andesite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn diorite_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn prismarine_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn red_sandstone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn mossy_stone_brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn granite_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn stone_brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn nether_brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn andesite_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn red_nether_brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn sandstone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn end_stone_brick_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn diorite_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn scaffolding_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let bottom = self.bottom().unwrap(); - map.insert("bottom", { - match bottom { - true => "true", - false => "false", - } - }); - let distance_0_7 = self.distance_0_7().unwrap(); - map.insert("distance", { - match distance_0_7 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn loom_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn barrel_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cubic = self.facing_cubic().unwrap(); - map.insert("facing", { facing_cubic.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - map - } - fn smoker_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn blast_furnace_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - map - } - fn cartography_table_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn fletching_table_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn grindstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn lectern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let has_book = self.has_book().unwrap(); - map.insert("has_book", { - match has_book { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn smithing_table_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn stonecutter_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - map - } - fn bell_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let attachment = self.attachment().unwrap(); - map.insert("attachment", { attachment.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn lantern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let hanging = self.hanging().unwrap(); - map.insert("hanging", { - match hanging { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn soul_lantern_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let hanging = self.hanging().unwrap(); - map.insert("hanging", { - match hanging { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn campfire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - let signal_fire = self.signal_fire().unwrap(); - map.insert("signal_fire", { - match signal_fire { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn soul_campfire_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let lit = self.lit().unwrap(); - map.insert("lit", { - match lit { - true => "true", - false => "false", - } - }); - let signal_fire = self.signal_fire().unwrap(); - map.insert("signal_fire", { - match signal_fire { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn sweet_berry_bush_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_3 = self.age_0_3().unwrap(); - map.insert("age", { - match age_0_3 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - _ => "unknown", - } - }); - map - } - fn warped_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_warped_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn warped_hyphae_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_warped_hyphae_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn warped_nylium_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn warped_fungus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn warped_wart_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn warped_roots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn nether_sprouts_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crimson_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_crimson_stem_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn crimson_hyphae_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn stripped_crimson_hyphae_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let axis_xyz = self.axis_xyz().unwrap(); - map.insert("axis", { axis_xyz.as_str() }); - map - } - fn crimson_nylium_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crimson_fungus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn shroomlight_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn weeping_vines_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_25 = self.age_0_25().unwrap(); - map.insert("age", { - match age_0_25 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - 16i32 => "16", - 17i32 => "17", - 18i32 => "18", - 19i32 => "19", - 20i32 => "20", - 21i32 => "21", - 22i32 => "22", - 23i32 => "23", - 24i32 => "24", - 25i32 => "25", - _ => "unknown", - } - }); - map - } - fn weeping_vines_plant_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn twisting_vines_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let age_0_25 = self.age_0_25().unwrap(); - map.insert("age", { - match age_0_25 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - 16i32 => "16", - 17i32 => "17", - 18i32 => "18", - 19i32 => "19", - 20i32 => "20", - 21i32 => "21", - 22i32 => "22", - 23i32 => "23", - 24i32 => "24", - 25i32 => "25", - _ => "unknown", - } - }); - map - } - fn twisting_vines_plant_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crimson_roots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crimson_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn warped_planks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crimson_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn warped_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn crimson_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn warped_pressure_plate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn crimson_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn warped_fence_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_connected = self.east_connected().unwrap(); - map.insert("east", { - match east_connected { - true => "true", - false => "false", - } - }); - let north_connected = self.north_connected().unwrap(); - map.insert("north", { - match north_connected { - true => "true", - false => "false", - } - }); - let south_connected = self.south_connected().unwrap(); - map.insert("south", { - match south_connected { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_connected = self.west_connected().unwrap(); - map.insert("west", { - match west_connected { - true => "true", - false => "false", - } - }); - map - } - fn crimson_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn warped_trapdoor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn crimson_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn warped_fence_gate_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let in_wall = self.in_wall().unwrap(); - map.insert("in_wall", { - match in_wall { - true => "true", - false => "false", - } - }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn crimson_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn warped_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn crimson_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn warped_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn crimson_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn warped_door_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_upper_lower = self.half_upper_lower().unwrap(); - map.insert("half", { half_upper_lower.as_str() }); - let hinge = self.hinge().unwrap(); - map.insert("hinge", { hinge.as_str() }); - let open = self.open().unwrap(); - map.insert("open", { - match open { - true => "true", - false => "false", - } - }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn crimson_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn warped_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let rotation = self.rotation().unwrap(); - map.insert("rotation", { - match rotation { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn crimson_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn warped_wall_sign_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn structure_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let structure_block_mode = self.structure_block_mode().unwrap(); - map.insert("mode", { structure_block_mode.as_str() }); - map - } - fn jigsaw_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let orientation = self.orientation().unwrap(); - map.insert("orientation", { orientation.as_str() }); - map - } - fn composter_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let level_0_8 = self.level_0_8().unwrap(); - map.insert("level", { - match level_0_8 { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - _ => "unknown", - } - }); - map - } - fn target_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let power = self.power().unwrap(); - map.insert("power", { - match power { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - 6i32 => "6", - 7i32 => "7", - 8i32 => "8", - 9i32 => "9", - 10i32 => "10", - 11i32 => "11", - 12i32 => "12", - 13i32 => "13", - 14i32 => "14", - 15i32 => "15", - _ => "unknown", - } - }); - map - } - fn bee_nest_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let honey_level = self.honey_level().unwrap(); - map.insert("honey_level", { - match honey_level { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - _ => "unknown", - } - }); - map - } - fn beehive_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let honey_level = self.honey_level().unwrap(); - map.insert("honey_level", { - match honey_level { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - 5i32 => "5", - _ => "unknown", - } - }); - map - } - fn honey_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn honeycomb_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn netherite_block_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn ancient_debris_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn crying_obsidian_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn respawn_anchor_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let charges = self.charges().unwrap(); - map.insert("charges", { - match charges { - 0i32 => "0", - 1i32 => "1", - 2i32 => "2", - 3i32 => "3", - 4i32 => "4", - _ => "unknown", - } - }); - map - } - fn potted_crimson_fungus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_warped_fungus_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_crimson_roots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn potted_warped_roots_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn lodestone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blackstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn blackstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn blackstone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn blackstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_blackstone_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cracked_polished_blackstone_bricks_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn chiseled_polished_blackstone_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_blackstone_brick_slab_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_brick_stairs_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_brick_wall_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn gilded_blackstone_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn polished_blackstone_stairs_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let half_top_bottom = self.half_top_bottom().unwrap(); - map.insert("half", { half_top_bottom.as_str() }); - let stairs_shape = self.stairs_shape().unwrap(); - map.insert("shape", { stairs_shape.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_slab_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let slab_kind = self.slab_kind().unwrap(); - map.insert("type", { slab_kind.as_str() }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_pressure_plate_to_properties_map( - self, - ) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_button_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let face = self.face().unwrap(); - map.insert("face", { face.as_str() }); - let facing_cardinal = self.facing_cardinal().unwrap(); - map.insert("facing", { facing_cardinal.as_str() }); - let powered = self.powered().unwrap(); - map.insert("powered", { - match powered { - true => "true", - false => "false", - } - }); - map - } - fn polished_blackstone_wall_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - let east_nlt = self.east_nlt().unwrap(); - map.insert("east", { east_nlt.as_str() }); - let north_nlt = self.north_nlt().unwrap(); - map.insert("north", { north_nlt.as_str() }); - let south_nlt = self.south_nlt().unwrap(); - map.insert("south", { south_nlt.as_str() }); - let up = self.up().unwrap(); - map.insert("up", { - match up { - true => "true", - false => "false", - } - }); - let waterlogged = self.waterlogged().unwrap(); - map.insert("waterlogged", { - match waterlogged { - true => "true", - false => "false", - } - }); - let west_nlt = self.west_nlt().unwrap(); - map.insert("west", { west_nlt.as_str() }); - map - } - fn chiseled_nether_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn cracked_nether_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - fn quartz_bricks_to_properties_map(self) -> BTreeMap<&'static str, &'static str> { - let mut map = BTreeMap::new(); - map - } - #[doc = "Attempts to convert a block kind identifier (e.g. `minecraft::air`) and properties map to a `BlockId`."] - pub fn from_identifier_and_properties( - identifier: &str, - properties: &BTreeMap, - ) -> Option { - match identifier { - "minecraft:air" => Self::air_from_identifier_and_properties(properties), - "minecraft:stone" => Self::stone_from_identifier_and_properties(properties), - "minecraft:granite" => Self::granite_from_identifier_and_properties(properties), - "minecraft:polished_granite" => { - Self::polished_granite_from_identifier_and_properties(properties) - } - "minecraft:diorite" => Self::diorite_from_identifier_and_properties(properties), - "minecraft:polished_diorite" => { - Self::polished_diorite_from_identifier_and_properties(properties) - } - "minecraft:andesite" => Self::andesite_from_identifier_and_properties(properties), - "minecraft:polished_andesite" => { - Self::polished_andesite_from_identifier_and_properties(properties) - } - "minecraft:grass_block" => Self::grass_block_from_identifier_and_properties(properties), - "minecraft:dirt" => Self::dirt_from_identifier_and_properties(properties), - "minecraft:coarse_dirt" => Self::coarse_dirt_from_identifier_and_properties(properties), - "minecraft:podzol" => Self::podzol_from_identifier_and_properties(properties), - "minecraft:cobblestone" => Self::cobblestone_from_identifier_and_properties(properties), - "minecraft:oak_planks" => Self::oak_planks_from_identifier_and_properties(properties), - "minecraft:spruce_planks" => { - Self::spruce_planks_from_identifier_and_properties(properties) - } - "minecraft:birch_planks" => { - Self::birch_planks_from_identifier_and_properties(properties) - } - "minecraft:jungle_planks" => { - Self::jungle_planks_from_identifier_and_properties(properties) - } - "minecraft:acacia_planks" => { - Self::acacia_planks_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_planks" => { - Self::dark_oak_planks_from_identifier_and_properties(properties) - } - "minecraft:oak_sapling" => Self::oak_sapling_from_identifier_and_properties(properties), - "minecraft:spruce_sapling" => { - Self::spruce_sapling_from_identifier_and_properties(properties) - } - "minecraft:birch_sapling" => { - Self::birch_sapling_from_identifier_and_properties(properties) - } - "minecraft:jungle_sapling" => { - Self::jungle_sapling_from_identifier_and_properties(properties) - } - "minecraft:acacia_sapling" => { - Self::acacia_sapling_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_sapling" => { - Self::dark_oak_sapling_from_identifier_and_properties(properties) - } - "minecraft:bedrock" => Self::bedrock_from_identifier_and_properties(properties), - "minecraft:water" => Self::water_from_identifier_and_properties(properties), - "minecraft:lava" => Self::lava_from_identifier_and_properties(properties), - "minecraft:sand" => Self::sand_from_identifier_and_properties(properties), - "minecraft:red_sand" => Self::red_sand_from_identifier_and_properties(properties), - "minecraft:gravel" => Self::gravel_from_identifier_and_properties(properties), - "minecraft:gold_ore" => Self::gold_ore_from_identifier_and_properties(properties), - "minecraft:iron_ore" => Self::iron_ore_from_identifier_and_properties(properties), - "minecraft:coal_ore" => Self::coal_ore_from_identifier_and_properties(properties), - "minecraft:nether_gold_ore" => { - Self::nether_gold_ore_from_identifier_and_properties(properties) - } - "minecraft:oak_log" => Self::oak_log_from_identifier_and_properties(properties), - "minecraft:spruce_log" => Self::spruce_log_from_identifier_and_properties(properties), - "minecraft:birch_log" => Self::birch_log_from_identifier_and_properties(properties), - "minecraft:jungle_log" => Self::jungle_log_from_identifier_and_properties(properties), - "minecraft:acacia_log" => Self::acacia_log_from_identifier_and_properties(properties), - "minecraft:dark_oak_log" => { - Self::dark_oak_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_spruce_log" => { - Self::stripped_spruce_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_birch_log" => { - Self::stripped_birch_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_jungle_log" => { - Self::stripped_jungle_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_acacia_log" => { - Self::stripped_acacia_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_dark_oak_log" => { - Self::stripped_dark_oak_log_from_identifier_and_properties(properties) - } - "minecraft:stripped_oak_log" => { - Self::stripped_oak_log_from_identifier_and_properties(properties) - } - "minecraft:oak_wood" => Self::oak_wood_from_identifier_and_properties(properties), - "minecraft:spruce_wood" => Self::spruce_wood_from_identifier_and_properties(properties), - "minecraft:birch_wood" => Self::birch_wood_from_identifier_and_properties(properties), - "minecraft:jungle_wood" => Self::jungle_wood_from_identifier_and_properties(properties), - "minecraft:acacia_wood" => Self::acacia_wood_from_identifier_and_properties(properties), - "minecraft:dark_oak_wood" => { - Self::dark_oak_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_oak_wood" => { - Self::stripped_oak_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_spruce_wood" => { - Self::stripped_spruce_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_birch_wood" => { - Self::stripped_birch_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_jungle_wood" => { - Self::stripped_jungle_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_acacia_wood" => { - Self::stripped_acacia_wood_from_identifier_and_properties(properties) - } - "minecraft:stripped_dark_oak_wood" => { - Self::stripped_dark_oak_wood_from_identifier_and_properties(properties) - } - "minecraft:oak_leaves" => Self::oak_leaves_from_identifier_and_properties(properties), - "minecraft:spruce_leaves" => { - Self::spruce_leaves_from_identifier_and_properties(properties) - } - "minecraft:birch_leaves" => { - Self::birch_leaves_from_identifier_and_properties(properties) - } - "minecraft:jungle_leaves" => { - Self::jungle_leaves_from_identifier_and_properties(properties) - } - "minecraft:acacia_leaves" => { - Self::acacia_leaves_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_leaves" => { - Self::dark_oak_leaves_from_identifier_and_properties(properties) - } - "minecraft:sponge" => Self::sponge_from_identifier_and_properties(properties), - "minecraft:wet_sponge" => Self::wet_sponge_from_identifier_and_properties(properties), - "minecraft:glass" => Self::glass_from_identifier_and_properties(properties), - "minecraft:lapis_ore" => Self::lapis_ore_from_identifier_and_properties(properties), - "minecraft:lapis_block" => Self::lapis_block_from_identifier_and_properties(properties), - "minecraft:dispenser" => Self::dispenser_from_identifier_and_properties(properties), - "minecraft:sandstone" => Self::sandstone_from_identifier_and_properties(properties), - "minecraft:chiseled_sandstone" => { - Self::chiseled_sandstone_from_identifier_and_properties(properties) - } - "minecraft:cut_sandstone" => { - Self::cut_sandstone_from_identifier_and_properties(properties) - } - "minecraft:note_block" => Self::note_block_from_identifier_and_properties(properties), - "minecraft:white_bed" => Self::white_bed_from_identifier_and_properties(properties), - "minecraft:orange_bed" => Self::orange_bed_from_identifier_and_properties(properties), - "minecraft:magenta_bed" => Self::magenta_bed_from_identifier_and_properties(properties), - "minecraft:light_blue_bed" => { - Self::light_blue_bed_from_identifier_and_properties(properties) - } - "minecraft:yellow_bed" => Self::yellow_bed_from_identifier_and_properties(properties), - "minecraft:lime_bed" => Self::lime_bed_from_identifier_and_properties(properties), - "minecraft:pink_bed" => Self::pink_bed_from_identifier_and_properties(properties), - "minecraft:gray_bed" => Self::gray_bed_from_identifier_and_properties(properties), - "minecraft:light_gray_bed" => { - Self::light_gray_bed_from_identifier_and_properties(properties) - } - "minecraft:cyan_bed" => Self::cyan_bed_from_identifier_and_properties(properties), - "minecraft:purple_bed" => Self::purple_bed_from_identifier_and_properties(properties), - "minecraft:blue_bed" => Self::blue_bed_from_identifier_and_properties(properties), - "minecraft:brown_bed" => Self::brown_bed_from_identifier_and_properties(properties), - "minecraft:green_bed" => Self::green_bed_from_identifier_and_properties(properties), - "minecraft:red_bed" => Self::red_bed_from_identifier_and_properties(properties), - "minecraft:black_bed" => Self::black_bed_from_identifier_and_properties(properties), - "minecraft:powered_rail" => { - Self::powered_rail_from_identifier_and_properties(properties) - } - "minecraft:detector_rail" => { - Self::detector_rail_from_identifier_and_properties(properties) - } - "minecraft:sticky_piston" => { - Self::sticky_piston_from_identifier_and_properties(properties) - } - "minecraft:cobweb" => Self::cobweb_from_identifier_and_properties(properties), - "minecraft:grass" => Self::grass_from_identifier_and_properties(properties), - "minecraft:fern" => Self::fern_from_identifier_and_properties(properties), - "minecraft:dead_bush" => Self::dead_bush_from_identifier_and_properties(properties), - "minecraft:seagrass" => Self::seagrass_from_identifier_and_properties(properties), - "minecraft:tall_seagrass" => { - Self::tall_seagrass_from_identifier_and_properties(properties) - } - "minecraft:piston" => Self::piston_from_identifier_and_properties(properties), - "minecraft:piston_head" => Self::piston_head_from_identifier_and_properties(properties), - "minecraft:white_wool" => Self::white_wool_from_identifier_and_properties(properties), - "minecraft:orange_wool" => Self::orange_wool_from_identifier_and_properties(properties), - "minecraft:magenta_wool" => { - Self::magenta_wool_from_identifier_and_properties(properties) - } - "minecraft:light_blue_wool" => { - Self::light_blue_wool_from_identifier_and_properties(properties) - } - "minecraft:yellow_wool" => Self::yellow_wool_from_identifier_and_properties(properties), - "minecraft:lime_wool" => Self::lime_wool_from_identifier_and_properties(properties), - "minecraft:pink_wool" => Self::pink_wool_from_identifier_and_properties(properties), - "minecraft:gray_wool" => Self::gray_wool_from_identifier_and_properties(properties), - "minecraft:light_gray_wool" => { - Self::light_gray_wool_from_identifier_and_properties(properties) - } - "minecraft:cyan_wool" => Self::cyan_wool_from_identifier_and_properties(properties), - "minecraft:purple_wool" => Self::purple_wool_from_identifier_and_properties(properties), - "minecraft:blue_wool" => Self::blue_wool_from_identifier_and_properties(properties), - "minecraft:brown_wool" => Self::brown_wool_from_identifier_and_properties(properties), - "minecraft:green_wool" => Self::green_wool_from_identifier_and_properties(properties), - "minecraft:red_wool" => Self::red_wool_from_identifier_and_properties(properties), - "minecraft:black_wool" => Self::black_wool_from_identifier_and_properties(properties), - "minecraft:moving_piston" => { - Self::moving_piston_from_identifier_and_properties(properties) - } - "minecraft:dandelion" => Self::dandelion_from_identifier_and_properties(properties), - "minecraft:poppy" => Self::poppy_from_identifier_and_properties(properties), - "minecraft:blue_orchid" => Self::blue_orchid_from_identifier_and_properties(properties), - "minecraft:allium" => Self::allium_from_identifier_and_properties(properties), - "minecraft:azure_bluet" => Self::azure_bluet_from_identifier_and_properties(properties), - "minecraft:red_tulip" => Self::red_tulip_from_identifier_and_properties(properties), - "minecraft:orange_tulip" => { - Self::orange_tulip_from_identifier_and_properties(properties) - } - "minecraft:white_tulip" => Self::white_tulip_from_identifier_and_properties(properties), - "minecraft:pink_tulip" => Self::pink_tulip_from_identifier_and_properties(properties), - "minecraft:oxeye_daisy" => Self::oxeye_daisy_from_identifier_and_properties(properties), - "minecraft:cornflower" => Self::cornflower_from_identifier_and_properties(properties), - "minecraft:wither_rose" => Self::wither_rose_from_identifier_and_properties(properties), - "minecraft:lily_of_the_valley" => { - Self::lily_of_the_valley_from_identifier_and_properties(properties) - } - "minecraft:brown_mushroom" => { - Self::brown_mushroom_from_identifier_and_properties(properties) - } - "minecraft:red_mushroom" => { - Self::red_mushroom_from_identifier_and_properties(properties) - } - "minecraft:gold_block" => Self::gold_block_from_identifier_and_properties(properties), - "minecraft:iron_block" => Self::iron_block_from_identifier_and_properties(properties), - "minecraft:bricks" => Self::bricks_from_identifier_and_properties(properties), - "minecraft:tnt" => Self::tnt_from_identifier_and_properties(properties), - "minecraft:bookshelf" => Self::bookshelf_from_identifier_and_properties(properties), - "minecraft:mossy_cobblestone" => { - Self::mossy_cobblestone_from_identifier_and_properties(properties) - } - "minecraft:obsidian" => Self::obsidian_from_identifier_and_properties(properties), - "minecraft:torch" => Self::torch_from_identifier_and_properties(properties), - "minecraft:wall_torch" => Self::wall_torch_from_identifier_and_properties(properties), - "minecraft:fire" => Self::fire_from_identifier_and_properties(properties), - "minecraft:soul_fire" => Self::soul_fire_from_identifier_and_properties(properties), - "minecraft:spawner" => Self::spawner_from_identifier_and_properties(properties), - "minecraft:oak_stairs" => Self::oak_stairs_from_identifier_and_properties(properties), - "minecraft:chest" => Self::chest_from_identifier_and_properties(properties), - "minecraft:redstone_wire" => { - Self::redstone_wire_from_identifier_and_properties(properties) - } - "minecraft:diamond_ore" => Self::diamond_ore_from_identifier_and_properties(properties), - "minecraft:diamond_block" => { - Self::diamond_block_from_identifier_and_properties(properties) - } - "minecraft:crafting_table" => { - Self::crafting_table_from_identifier_and_properties(properties) - } - "minecraft:wheat" => Self::wheat_from_identifier_and_properties(properties), - "minecraft:farmland" => Self::farmland_from_identifier_and_properties(properties), - "minecraft:furnace" => Self::furnace_from_identifier_and_properties(properties), - "minecraft:oak_sign" => Self::oak_sign_from_identifier_and_properties(properties), - "minecraft:spruce_sign" => Self::spruce_sign_from_identifier_and_properties(properties), - "minecraft:birch_sign" => Self::birch_sign_from_identifier_and_properties(properties), - "minecraft:acacia_sign" => Self::acacia_sign_from_identifier_and_properties(properties), - "minecraft:jungle_sign" => Self::jungle_sign_from_identifier_and_properties(properties), - "minecraft:dark_oak_sign" => { - Self::dark_oak_sign_from_identifier_and_properties(properties) - } - "minecraft:oak_door" => Self::oak_door_from_identifier_and_properties(properties), - "minecraft:ladder" => Self::ladder_from_identifier_and_properties(properties), - "minecraft:rail" => Self::rail_from_identifier_and_properties(properties), - "minecraft:cobblestone_stairs" => { - Self::cobblestone_stairs_from_identifier_and_properties(properties) - } - "minecraft:oak_wall_sign" => { - Self::oak_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:spruce_wall_sign" => { - Self::spruce_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:birch_wall_sign" => { - Self::birch_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:acacia_wall_sign" => { - Self::acacia_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:jungle_wall_sign" => { - Self::jungle_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_wall_sign" => { - Self::dark_oak_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:lever" => Self::lever_from_identifier_and_properties(properties), - "minecraft:stone_pressure_plate" => { - Self::stone_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:iron_door" => Self::iron_door_from_identifier_and_properties(properties), - "minecraft:oak_pressure_plate" => { - Self::oak_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:spruce_pressure_plate" => { - Self::spruce_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:birch_pressure_plate" => { - Self::birch_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:jungle_pressure_plate" => { - Self::jungle_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:acacia_pressure_plate" => { - Self::acacia_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_pressure_plate" => { - Self::dark_oak_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:redstone_ore" => { - Self::redstone_ore_from_identifier_and_properties(properties) - } - "minecraft:redstone_torch" => { - Self::redstone_torch_from_identifier_and_properties(properties) - } - "minecraft:redstone_wall_torch" => { - Self::redstone_wall_torch_from_identifier_and_properties(properties) - } - "minecraft:stone_button" => { - Self::stone_button_from_identifier_and_properties(properties) - } - "minecraft:snow" => Self::snow_from_identifier_and_properties(properties), - "minecraft:ice" => Self::ice_from_identifier_and_properties(properties), - "minecraft:snow_block" => Self::snow_block_from_identifier_and_properties(properties), - "minecraft:cactus" => Self::cactus_from_identifier_and_properties(properties), - "minecraft:clay" => Self::clay_from_identifier_and_properties(properties), - "minecraft:sugar_cane" => Self::sugar_cane_from_identifier_and_properties(properties), - "minecraft:jukebox" => Self::jukebox_from_identifier_and_properties(properties), - "minecraft:oak_fence" => Self::oak_fence_from_identifier_and_properties(properties), - "minecraft:pumpkin" => Self::pumpkin_from_identifier_and_properties(properties), - "minecraft:netherrack" => Self::netherrack_from_identifier_and_properties(properties), - "minecraft:soul_sand" => Self::soul_sand_from_identifier_and_properties(properties), - "minecraft:soul_soil" => Self::soul_soil_from_identifier_and_properties(properties), - "minecraft:basalt" => Self::basalt_from_identifier_and_properties(properties), - "minecraft:polished_basalt" => { - Self::polished_basalt_from_identifier_and_properties(properties) - } - "minecraft:soul_torch" => Self::soul_torch_from_identifier_and_properties(properties), - "minecraft:soul_wall_torch" => { - Self::soul_wall_torch_from_identifier_and_properties(properties) - } - "minecraft:glowstone" => Self::glowstone_from_identifier_and_properties(properties), - "minecraft:nether_portal" => { - Self::nether_portal_from_identifier_and_properties(properties) - } - "minecraft:carved_pumpkin" => { - Self::carved_pumpkin_from_identifier_and_properties(properties) - } - "minecraft:jack_o_lantern" => { - Self::jack_o_lantern_from_identifier_and_properties(properties) - } - "minecraft:cake" => Self::cake_from_identifier_and_properties(properties), - "minecraft:repeater" => Self::repeater_from_identifier_and_properties(properties), - "minecraft:white_stained_glass" => { - Self::white_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:orange_stained_glass" => { - Self::orange_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:magenta_stained_glass" => { - Self::magenta_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:light_blue_stained_glass" => { - Self::light_blue_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:yellow_stained_glass" => { - Self::yellow_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:lime_stained_glass" => { - Self::lime_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:pink_stained_glass" => { - Self::pink_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:gray_stained_glass" => { - Self::gray_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:light_gray_stained_glass" => { - Self::light_gray_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:cyan_stained_glass" => { - Self::cyan_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:purple_stained_glass" => { - Self::purple_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:blue_stained_glass" => { - Self::blue_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:brown_stained_glass" => { - Self::brown_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:green_stained_glass" => { - Self::green_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:red_stained_glass" => { - Self::red_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:black_stained_glass" => { - Self::black_stained_glass_from_identifier_and_properties(properties) - } - "minecraft:oak_trapdoor" => { - Self::oak_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:spruce_trapdoor" => { - Self::spruce_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:birch_trapdoor" => { - Self::birch_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:jungle_trapdoor" => { - Self::jungle_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:acacia_trapdoor" => { - Self::acacia_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_trapdoor" => { - Self::dark_oak_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:stone_bricks" => { - Self::stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:mossy_stone_bricks" => { - Self::mossy_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:cracked_stone_bricks" => { - Self::cracked_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:chiseled_stone_bricks" => { - Self::chiseled_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:infested_stone" => { - Self::infested_stone_from_identifier_and_properties(properties) - } - "minecraft:infested_cobblestone" => { - Self::infested_cobblestone_from_identifier_and_properties(properties) - } - "minecraft:infested_stone_bricks" => { - Self::infested_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:infested_mossy_stone_bricks" => { - Self::infested_mossy_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:infested_cracked_stone_bricks" => { - Self::infested_cracked_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:infested_chiseled_stone_bricks" => { - Self::infested_chiseled_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:brown_mushroom_block" => { - Self::brown_mushroom_block_from_identifier_and_properties(properties) - } - "minecraft:red_mushroom_block" => { - Self::red_mushroom_block_from_identifier_and_properties(properties) - } - "minecraft:mushroom_stem" => { - Self::mushroom_stem_from_identifier_and_properties(properties) - } - "minecraft:iron_bars" => Self::iron_bars_from_identifier_and_properties(properties), - "minecraft:chain" => Self::chain_from_identifier_and_properties(properties), - "minecraft:glass_pane" => Self::glass_pane_from_identifier_and_properties(properties), - "minecraft:melon" => Self::melon_from_identifier_and_properties(properties), - "minecraft:attached_pumpkin_stem" => { - Self::attached_pumpkin_stem_from_identifier_and_properties(properties) - } - "minecraft:attached_melon_stem" => { - Self::attached_melon_stem_from_identifier_and_properties(properties) - } - "minecraft:pumpkin_stem" => { - Self::pumpkin_stem_from_identifier_and_properties(properties) - } - "minecraft:melon_stem" => Self::melon_stem_from_identifier_and_properties(properties), - "minecraft:vine" => Self::vine_from_identifier_and_properties(properties), - "minecraft:oak_fence_gate" => { - Self::oak_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:brick_stairs" => { - Self::brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:stone_brick_stairs" => { - Self::stone_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:mycelium" => Self::mycelium_from_identifier_and_properties(properties), - "minecraft:lily_pad" => Self::lily_pad_from_identifier_and_properties(properties), - "minecraft:nether_bricks" => { - Self::nether_bricks_from_identifier_and_properties(properties) - } - "minecraft:nether_brick_fence" => { - Self::nether_brick_fence_from_identifier_and_properties(properties) - } - "minecraft:nether_brick_stairs" => { - Self::nether_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:nether_wart" => Self::nether_wart_from_identifier_and_properties(properties), - "minecraft:enchanting_table" => { - Self::enchanting_table_from_identifier_and_properties(properties) - } - "minecraft:brewing_stand" => { - Self::brewing_stand_from_identifier_and_properties(properties) - } - "minecraft:cauldron" => Self::cauldron_from_identifier_and_properties(properties), - "minecraft:end_portal" => Self::end_portal_from_identifier_and_properties(properties), - "minecraft:end_portal_frame" => { - Self::end_portal_frame_from_identifier_and_properties(properties) - } - "minecraft:end_stone" => Self::end_stone_from_identifier_and_properties(properties), - "minecraft:dragon_egg" => Self::dragon_egg_from_identifier_and_properties(properties), - "minecraft:redstone_lamp" => { - Self::redstone_lamp_from_identifier_and_properties(properties) - } - "minecraft:cocoa" => Self::cocoa_from_identifier_and_properties(properties), - "minecraft:sandstone_stairs" => { - Self::sandstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:emerald_ore" => Self::emerald_ore_from_identifier_and_properties(properties), - "minecraft:ender_chest" => Self::ender_chest_from_identifier_and_properties(properties), - "minecraft:tripwire_hook" => { - Self::tripwire_hook_from_identifier_and_properties(properties) - } - "minecraft:tripwire" => Self::tripwire_from_identifier_and_properties(properties), - "minecraft:emerald_block" => { - Self::emerald_block_from_identifier_and_properties(properties) - } - "minecraft:spruce_stairs" => { - Self::spruce_stairs_from_identifier_and_properties(properties) - } - "minecraft:birch_stairs" => { - Self::birch_stairs_from_identifier_and_properties(properties) - } - "minecraft:jungle_stairs" => { - Self::jungle_stairs_from_identifier_and_properties(properties) - } - "minecraft:command_block" => { - Self::command_block_from_identifier_and_properties(properties) - } - "minecraft:beacon" => Self::beacon_from_identifier_and_properties(properties), - "minecraft:cobblestone_wall" => { - Self::cobblestone_wall_from_identifier_and_properties(properties) - } - "minecraft:mossy_cobblestone_wall" => { - Self::mossy_cobblestone_wall_from_identifier_and_properties(properties) - } - "minecraft:flower_pot" => Self::flower_pot_from_identifier_and_properties(properties), - "minecraft:potted_oak_sapling" => { - Self::potted_oak_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_spruce_sapling" => { - Self::potted_spruce_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_birch_sapling" => { - Self::potted_birch_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_jungle_sapling" => { - Self::potted_jungle_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_acacia_sapling" => { - Self::potted_acacia_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_dark_oak_sapling" => { - Self::potted_dark_oak_sapling_from_identifier_and_properties(properties) - } - "minecraft:potted_fern" => Self::potted_fern_from_identifier_and_properties(properties), - "minecraft:potted_dandelion" => { - Self::potted_dandelion_from_identifier_and_properties(properties) - } - "minecraft:potted_poppy" => { - Self::potted_poppy_from_identifier_and_properties(properties) - } - "minecraft:potted_blue_orchid" => { - Self::potted_blue_orchid_from_identifier_and_properties(properties) - } - "minecraft:potted_allium" => { - Self::potted_allium_from_identifier_and_properties(properties) - } - "minecraft:potted_azure_bluet" => { - Self::potted_azure_bluet_from_identifier_and_properties(properties) - } - "minecraft:potted_red_tulip" => { - Self::potted_red_tulip_from_identifier_and_properties(properties) - } - "minecraft:potted_orange_tulip" => { - Self::potted_orange_tulip_from_identifier_and_properties(properties) - } - "minecraft:potted_white_tulip" => { - Self::potted_white_tulip_from_identifier_and_properties(properties) - } - "minecraft:potted_pink_tulip" => { - Self::potted_pink_tulip_from_identifier_and_properties(properties) - } - "minecraft:potted_oxeye_daisy" => { - Self::potted_oxeye_daisy_from_identifier_and_properties(properties) - } - "minecraft:potted_cornflower" => { - Self::potted_cornflower_from_identifier_and_properties(properties) - } - "minecraft:potted_lily_of_the_valley" => { - Self::potted_lily_of_the_valley_from_identifier_and_properties(properties) - } - "minecraft:potted_wither_rose" => { - Self::potted_wither_rose_from_identifier_and_properties(properties) - } - "minecraft:potted_red_mushroom" => { - Self::potted_red_mushroom_from_identifier_and_properties(properties) - } - "minecraft:potted_brown_mushroom" => { - Self::potted_brown_mushroom_from_identifier_and_properties(properties) - } - "minecraft:potted_dead_bush" => { - Self::potted_dead_bush_from_identifier_and_properties(properties) - } - "minecraft:potted_cactus" => { - Self::potted_cactus_from_identifier_and_properties(properties) - } - "minecraft:carrots" => Self::carrots_from_identifier_and_properties(properties), - "minecraft:potatoes" => Self::potatoes_from_identifier_and_properties(properties), - "minecraft:oak_button" => Self::oak_button_from_identifier_and_properties(properties), - "minecraft:spruce_button" => { - Self::spruce_button_from_identifier_and_properties(properties) - } - "minecraft:birch_button" => { - Self::birch_button_from_identifier_and_properties(properties) - } - "minecraft:jungle_button" => { - Self::jungle_button_from_identifier_and_properties(properties) - } - "minecraft:acacia_button" => { - Self::acacia_button_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_button" => { - Self::dark_oak_button_from_identifier_and_properties(properties) - } - "minecraft:skeleton_skull" => { - Self::skeleton_skull_from_identifier_and_properties(properties) - } - "minecraft:skeleton_wall_skull" => { - Self::skeleton_wall_skull_from_identifier_and_properties(properties) - } - "minecraft:wither_skeleton_skull" => { - Self::wither_skeleton_skull_from_identifier_and_properties(properties) - } - "minecraft:wither_skeleton_wall_skull" => { - Self::wither_skeleton_wall_skull_from_identifier_and_properties(properties) - } - "minecraft:zombie_head" => Self::zombie_head_from_identifier_and_properties(properties), - "minecraft:zombie_wall_head" => { - Self::zombie_wall_head_from_identifier_and_properties(properties) - } - "minecraft:player_head" => Self::player_head_from_identifier_and_properties(properties), - "minecraft:player_wall_head" => { - Self::player_wall_head_from_identifier_and_properties(properties) - } - "minecraft:creeper_head" => { - Self::creeper_head_from_identifier_and_properties(properties) - } - "minecraft:creeper_wall_head" => { - Self::creeper_wall_head_from_identifier_and_properties(properties) - } - "minecraft:dragon_head" => Self::dragon_head_from_identifier_and_properties(properties), - "minecraft:dragon_wall_head" => { - Self::dragon_wall_head_from_identifier_and_properties(properties) - } - "minecraft:anvil" => Self::anvil_from_identifier_and_properties(properties), - "minecraft:chipped_anvil" => { - Self::chipped_anvil_from_identifier_and_properties(properties) - } - "minecraft:damaged_anvil" => { - Self::damaged_anvil_from_identifier_and_properties(properties) - } - "minecraft:trapped_chest" => { - Self::trapped_chest_from_identifier_and_properties(properties) - } - "minecraft:light_weighted_pressure_plate" => { - Self::light_weighted_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:heavy_weighted_pressure_plate" => { - Self::heavy_weighted_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:comparator" => Self::comparator_from_identifier_and_properties(properties), - "minecraft:daylight_detector" => { - Self::daylight_detector_from_identifier_and_properties(properties) - } - "minecraft:redstone_block" => { - Self::redstone_block_from_identifier_and_properties(properties) - } - "minecraft:nether_quartz_ore" => { - Self::nether_quartz_ore_from_identifier_and_properties(properties) - } - "minecraft:hopper" => Self::hopper_from_identifier_and_properties(properties), - "minecraft:quartz_block" => { - Self::quartz_block_from_identifier_and_properties(properties) - } - "minecraft:chiseled_quartz_block" => { - Self::chiseled_quartz_block_from_identifier_and_properties(properties) - } - "minecraft:quartz_pillar" => { - Self::quartz_pillar_from_identifier_and_properties(properties) - } - "minecraft:quartz_stairs" => { - Self::quartz_stairs_from_identifier_and_properties(properties) - } - "minecraft:activator_rail" => { - Self::activator_rail_from_identifier_and_properties(properties) - } - "minecraft:dropper" => Self::dropper_from_identifier_and_properties(properties), - "minecraft:white_terracotta" => { - Self::white_terracotta_from_identifier_and_properties(properties) - } - "minecraft:orange_terracotta" => { - Self::orange_terracotta_from_identifier_and_properties(properties) - } - "minecraft:magenta_terracotta" => { - Self::magenta_terracotta_from_identifier_and_properties(properties) - } - "minecraft:light_blue_terracotta" => { - Self::light_blue_terracotta_from_identifier_and_properties(properties) - } - "minecraft:yellow_terracotta" => { - Self::yellow_terracotta_from_identifier_and_properties(properties) - } - "minecraft:lime_terracotta" => { - Self::lime_terracotta_from_identifier_and_properties(properties) - } - "minecraft:pink_terracotta" => { - Self::pink_terracotta_from_identifier_and_properties(properties) - } - "minecraft:gray_terracotta" => { - Self::gray_terracotta_from_identifier_and_properties(properties) - } - "minecraft:light_gray_terracotta" => { - Self::light_gray_terracotta_from_identifier_and_properties(properties) - } - "minecraft:cyan_terracotta" => { - Self::cyan_terracotta_from_identifier_and_properties(properties) - } - "minecraft:purple_terracotta" => { - Self::purple_terracotta_from_identifier_and_properties(properties) - } - "minecraft:blue_terracotta" => { - Self::blue_terracotta_from_identifier_and_properties(properties) - } - "minecraft:brown_terracotta" => { - Self::brown_terracotta_from_identifier_and_properties(properties) - } - "minecraft:green_terracotta" => { - Self::green_terracotta_from_identifier_and_properties(properties) - } - "minecraft:red_terracotta" => { - Self::red_terracotta_from_identifier_and_properties(properties) - } - "minecraft:black_terracotta" => { - Self::black_terracotta_from_identifier_and_properties(properties) - } - "minecraft:white_stained_glass_pane" => { - Self::white_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:orange_stained_glass_pane" => { - Self::orange_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:magenta_stained_glass_pane" => { - Self::magenta_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:light_blue_stained_glass_pane" => { - Self::light_blue_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:yellow_stained_glass_pane" => { - Self::yellow_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:lime_stained_glass_pane" => { - Self::lime_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:pink_stained_glass_pane" => { - Self::pink_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:gray_stained_glass_pane" => { - Self::gray_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:light_gray_stained_glass_pane" => { - Self::light_gray_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:cyan_stained_glass_pane" => { - Self::cyan_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:purple_stained_glass_pane" => { - Self::purple_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:blue_stained_glass_pane" => { - Self::blue_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:brown_stained_glass_pane" => { - Self::brown_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:green_stained_glass_pane" => { - Self::green_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:red_stained_glass_pane" => { - Self::red_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:black_stained_glass_pane" => { - Self::black_stained_glass_pane_from_identifier_and_properties(properties) - } - "minecraft:acacia_stairs" => { - Self::acacia_stairs_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_stairs" => { - Self::dark_oak_stairs_from_identifier_and_properties(properties) - } - "minecraft:slime_block" => Self::slime_block_from_identifier_and_properties(properties), - "minecraft:barrier" => Self::barrier_from_identifier_and_properties(properties), - "minecraft:iron_trapdoor" => { - Self::iron_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:prismarine" => Self::prismarine_from_identifier_and_properties(properties), - "minecraft:prismarine_bricks" => { - Self::prismarine_bricks_from_identifier_and_properties(properties) - } - "minecraft:dark_prismarine" => { - Self::dark_prismarine_from_identifier_and_properties(properties) - } - "minecraft:prismarine_stairs" => { - Self::prismarine_stairs_from_identifier_and_properties(properties) - } - "minecraft:prismarine_brick_stairs" => { - Self::prismarine_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:dark_prismarine_stairs" => { - Self::dark_prismarine_stairs_from_identifier_and_properties(properties) - } - "minecraft:prismarine_slab" => { - Self::prismarine_slab_from_identifier_and_properties(properties) - } - "minecraft:prismarine_brick_slab" => { - Self::prismarine_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:dark_prismarine_slab" => { - Self::dark_prismarine_slab_from_identifier_and_properties(properties) - } - "minecraft:sea_lantern" => Self::sea_lantern_from_identifier_and_properties(properties), - "minecraft:hay_block" => Self::hay_block_from_identifier_and_properties(properties), - "minecraft:white_carpet" => { - Self::white_carpet_from_identifier_and_properties(properties) - } - "minecraft:orange_carpet" => { - Self::orange_carpet_from_identifier_and_properties(properties) - } - "minecraft:magenta_carpet" => { - Self::magenta_carpet_from_identifier_and_properties(properties) - } - "minecraft:light_blue_carpet" => { - Self::light_blue_carpet_from_identifier_and_properties(properties) - } - "minecraft:yellow_carpet" => { - Self::yellow_carpet_from_identifier_and_properties(properties) - } - "minecraft:lime_carpet" => Self::lime_carpet_from_identifier_and_properties(properties), - "minecraft:pink_carpet" => Self::pink_carpet_from_identifier_and_properties(properties), - "minecraft:gray_carpet" => Self::gray_carpet_from_identifier_and_properties(properties), - "minecraft:light_gray_carpet" => { - Self::light_gray_carpet_from_identifier_and_properties(properties) - } - "minecraft:cyan_carpet" => Self::cyan_carpet_from_identifier_and_properties(properties), - "minecraft:purple_carpet" => { - Self::purple_carpet_from_identifier_and_properties(properties) - } - "minecraft:blue_carpet" => Self::blue_carpet_from_identifier_and_properties(properties), - "minecraft:brown_carpet" => { - Self::brown_carpet_from_identifier_and_properties(properties) - } - "minecraft:green_carpet" => { - Self::green_carpet_from_identifier_and_properties(properties) - } - "minecraft:red_carpet" => Self::red_carpet_from_identifier_and_properties(properties), - "minecraft:black_carpet" => { - Self::black_carpet_from_identifier_and_properties(properties) - } - "minecraft:terracotta" => Self::terracotta_from_identifier_and_properties(properties), - "minecraft:coal_block" => Self::coal_block_from_identifier_and_properties(properties), - "minecraft:packed_ice" => Self::packed_ice_from_identifier_and_properties(properties), - "minecraft:sunflower" => Self::sunflower_from_identifier_and_properties(properties), - "minecraft:lilac" => Self::lilac_from_identifier_and_properties(properties), - "minecraft:rose_bush" => Self::rose_bush_from_identifier_and_properties(properties), - "minecraft:peony" => Self::peony_from_identifier_and_properties(properties), - "minecraft:tall_grass" => Self::tall_grass_from_identifier_and_properties(properties), - "minecraft:large_fern" => Self::large_fern_from_identifier_and_properties(properties), - "minecraft:white_banner" => { - Self::white_banner_from_identifier_and_properties(properties) - } - "minecraft:orange_banner" => { - Self::orange_banner_from_identifier_and_properties(properties) - } - "minecraft:magenta_banner" => { - Self::magenta_banner_from_identifier_and_properties(properties) - } - "minecraft:light_blue_banner" => { - Self::light_blue_banner_from_identifier_and_properties(properties) - } - "minecraft:yellow_banner" => { - Self::yellow_banner_from_identifier_and_properties(properties) - } - "minecraft:lime_banner" => Self::lime_banner_from_identifier_and_properties(properties), - "minecraft:pink_banner" => Self::pink_banner_from_identifier_and_properties(properties), - "minecraft:gray_banner" => Self::gray_banner_from_identifier_and_properties(properties), - "minecraft:light_gray_banner" => { - Self::light_gray_banner_from_identifier_and_properties(properties) - } - "minecraft:cyan_banner" => Self::cyan_banner_from_identifier_and_properties(properties), - "minecraft:purple_banner" => { - Self::purple_banner_from_identifier_and_properties(properties) - } - "minecraft:blue_banner" => Self::blue_banner_from_identifier_and_properties(properties), - "minecraft:brown_banner" => { - Self::brown_banner_from_identifier_and_properties(properties) - } - "minecraft:green_banner" => { - Self::green_banner_from_identifier_and_properties(properties) - } - "minecraft:red_banner" => Self::red_banner_from_identifier_and_properties(properties), - "minecraft:black_banner" => { - Self::black_banner_from_identifier_and_properties(properties) - } - "minecraft:white_wall_banner" => { - Self::white_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:orange_wall_banner" => { - Self::orange_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:magenta_wall_banner" => { - Self::magenta_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:light_blue_wall_banner" => { - Self::light_blue_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:yellow_wall_banner" => { - Self::yellow_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:lime_wall_banner" => { - Self::lime_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:pink_wall_banner" => { - Self::pink_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:gray_wall_banner" => { - Self::gray_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:light_gray_wall_banner" => { - Self::light_gray_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:cyan_wall_banner" => { - Self::cyan_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:purple_wall_banner" => { - Self::purple_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:blue_wall_banner" => { - Self::blue_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:brown_wall_banner" => { - Self::brown_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:green_wall_banner" => { - Self::green_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:red_wall_banner" => { - Self::red_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:black_wall_banner" => { - Self::black_wall_banner_from_identifier_and_properties(properties) - } - "minecraft:red_sandstone" => { - Self::red_sandstone_from_identifier_and_properties(properties) - } - "minecraft:chiseled_red_sandstone" => { - Self::chiseled_red_sandstone_from_identifier_and_properties(properties) - } - "minecraft:cut_red_sandstone" => { - Self::cut_red_sandstone_from_identifier_and_properties(properties) - } - "minecraft:red_sandstone_stairs" => { - Self::red_sandstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:oak_slab" => Self::oak_slab_from_identifier_and_properties(properties), - "minecraft:spruce_slab" => Self::spruce_slab_from_identifier_and_properties(properties), - "minecraft:birch_slab" => Self::birch_slab_from_identifier_and_properties(properties), - "minecraft:jungle_slab" => Self::jungle_slab_from_identifier_and_properties(properties), - "minecraft:acacia_slab" => Self::acacia_slab_from_identifier_and_properties(properties), - "minecraft:dark_oak_slab" => { - Self::dark_oak_slab_from_identifier_and_properties(properties) - } - "minecraft:stone_slab" => Self::stone_slab_from_identifier_and_properties(properties), - "minecraft:smooth_stone_slab" => { - Self::smooth_stone_slab_from_identifier_and_properties(properties) - } - "minecraft:sandstone_slab" => { - Self::sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:cut_sandstone_slab" => { - Self::cut_sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:petrified_oak_slab" => { - Self::petrified_oak_slab_from_identifier_and_properties(properties) - } - "minecraft:cobblestone_slab" => { - Self::cobblestone_slab_from_identifier_and_properties(properties) - } - "minecraft:brick_slab" => Self::brick_slab_from_identifier_and_properties(properties), - "minecraft:stone_brick_slab" => { - Self::stone_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:nether_brick_slab" => { - Self::nether_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:quartz_slab" => Self::quartz_slab_from_identifier_and_properties(properties), - "minecraft:red_sandstone_slab" => { - Self::red_sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:cut_red_sandstone_slab" => { - Self::cut_red_sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:purpur_slab" => Self::purpur_slab_from_identifier_and_properties(properties), - "minecraft:smooth_stone" => { - Self::smooth_stone_from_identifier_and_properties(properties) - } - "minecraft:smooth_sandstone" => { - Self::smooth_sandstone_from_identifier_and_properties(properties) - } - "minecraft:smooth_quartz" => { - Self::smooth_quartz_from_identifier_and_properties(properties) - } - "minecraft:smooth_red_sandstone" => { - Self::smooth_red_sandstone_from_identifier_and_properties(properties) - } - "minecraft:spruce_fence_gate" => { - Self::spruce_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:birch_fence_gate" => { - Self::birch_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:jungle_fence_gate" => { - Self::jungle_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:acacia_fence_gate" => { - Self::acacia_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_fence_gate" => { - Self::dark_oak_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:spruce_fence" => { - Self::spruce_fence_from_identifier_and_properties(properties) - } - "minecraft:birch_fence" => Self::birch_fence_from_identifier_and_properties(properties), - "minecraft:jungle_fence" => { - Self::jungle_fence_from_identifier_and_properties(properties) - } - "minecraft:acacia_fence" => { - Self::acacia_fence_from_identifier_and_properties(properties) - } - "minecraft:dark_oak_fence" => { - Self::dark_oak_fence_from_identifier_and_properties(properties) - } - "minecraft:spruce_door" => Self::spruce_door_from_identifier_and_properties(properties), - "minecraft:birch_door" => Self::birch_door_from_identifier_and_properties(properties), - "minecraft:jungle_door" => Self::jungle_door_from_identifier_and_properties(properties), - "minecraft:acacia_door" => Self::acacia_door_from_identifier_and_properties(properties), - "minecraft:dark_oak_door" => { - Self::dark_oak_door_from_identifier_and_properties(properties) - } - "minecraft:end_rod" => Self::end_rod_from_identifier_and_properties(properties), - "minecraft:chorus_plant" => { - Self::chorus_plant_from_identifier_and_properties(properties) - } - "minecraft:chorus_flower" => { - Self::chorus_flower_from_identifier_and_properties(properties) - } - "minecraft:purpur_block" => { - Self::purpur_block_from_identifier_and_properties(properties) - } - "minecraft:purpur_pillar" => { - Self::purpur_pillar_from_identifier_and_properties(properties) - } - "minecraft:purpur_stairs" => { - Self::purpur_stairs_from_identifier_and_properties(properties) - } - "minecraft:end_stone_bricks" => { - Self::end_stone_bricks_from_identifier_and_properties(properties) - } - "minecraft:beetroots" => Self::beetroots_from_identifier_and_properties(properties), - "minecraft:grass_path" => Self::grass_path_from_identifier_and_properties(properties), - "minecraft:end_gateway" => Self::end_gateway_from_identifier_and_properties(properties), - "minecraft:repeating_command_block" => { - Self::repeating_command_block_from_identifier_and_properties(properties) - } - "minecraft:chain_command_block" => { - Self::chain_command_block_from_identifier_and_properties(properties) - } - "minecraft:frosted_ice" => Self::frosted_ice_from_identifier_and_properties(properties), - "minecraft:magma_block" => Self::magma_block_from_identifier_and_properties(properties), - "minecraft:nether_wart_block" => { - Self::nether_wart_block_from_identifier_and_properties(properties) - } - "minecraft:red_nether_bricks" => { - Self::red_nether_bricks_from_identifier_and_properties(properties) - } - "minecraft:bone_block" => Self::bone_block_from_identifier_and_properties(properties), - "minecraft:structure_void" => { - Self::structure_void_from_identifier_and_properties(properties) - } - "minecraft:observer" => Self::observer_from_identifier_and_properties(properties), - "minecraft:shulker_box" => Self::shulker_box_from_identifier_and_properties(properties), - "minecraft:white_shulker_box" => { - Self::white_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:orange_shulker_box" => { - Self::orange_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:magenta_shulker_box" => { - Self::magenta_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:light_blue_shulker_box" => { - Self::light_blue_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:yellow_shulker_box" => { - Self::yellow_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:lime_shulker_box" => { - Self::lime_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:pink_shulker_box" => { - Self::pink_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:gray_shulker_box" => { - Self::gray_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:light_gray_shulker_box" => { - Self::light_gray_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:cyan_shulker_box" => { - Self::cyan_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:purple_shulker_box" => { - Self::purple_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:blue_shulker_box" => { - Self::blue_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:brown_shulker_box" => { - Self::brown_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:green_shulker_box" => { - Self::green_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:red_shulker_box" => { - Self::red_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:black_shulker_box" => { - Self::black_shulker_box_from_identifier_and_properties(properties) - } - "minecraft:white_glazed_terracotta" => { - Self::white_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:orange_glazed_terracotta" => { - Self::orange_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:magenta_glazed_terracotta" => { - Self::magenta_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:light_blue_glazed_terracotta" => { - Self::light_blue_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:yellow_glazed_terracotta" => { - Self::yellow_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:lime_glazed_terracotta" => { - Self::lime_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:pink_glazed_terracotta" => { - Self::pink_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:gray_glazed_terracotta" => { - Self::gray_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:light_gray_glazed_terracotta" => { - Self::light_gray_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:cyan_glazed_terracotta" => { - Self::cyan_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:purple_glazed_terracotta" => { - Self::purple_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:blue_glazed_terracotta" => { - Self::blue_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:brown_glazed_terracotta" => { - Self::brown_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:green_glazed_terracotta" => { - Self::green_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:red_glazed_terracotta" => { - Self::red_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:black_glazed_terracotta" => { - Self::black_glazed_terracotta_from_identifier_and_properties(properties) - } - "minecraft:white_concrete" => { - Self::white_concrete_from_identifier_and_properties(properties) - } - "minecraft:orange_concrete" => { - Self::orange_concrete_from_identifier_and_properties(properties) - } - "minecraft:magenta_concrete" => { - Self::magenta_concrete_from_identifier_and_properties(properties) - } - "minecraft:light_blue_concrete" => { - Self::light_blue_concrete_from_identifier_and_properties(properties) - } - "minecraft:yellow_concrete" => { - Self::yellow_concrete_from_identifier_and_properties(properties) - } - "minecraft:lime_concrete" => { - Self::lime_concrete_from_identifier_and_properties(properties) - } - "minecraft:pink_concrete" => { - Self::pink_concrete_from_identifier_and_properties(properties) - } - "minecraft:gray_concrete" => { - Self::gray_concrete_from_identifier_and_properties(properties) - } - "minecraft:light_gray_concrete" => { - Self::light_gray_concrete_from_identifier_and_properties(properties) - } - "minecraft:cyan_concrete" => { - Self::cyan_concrete_from_identifier_and_properties(properties) - } - "minecraft:purple_concrete" => { - Self::purple_concrete_from_identifier_and_properties(properties) - } - "minecraft:blue_concrete" => { - Self::blue_concrete_from_identifier_and_properties(properties) - } - "minecraft:brown_concrete" => { - Self::brown_concrete_from_identifier_and_properties(properties) - } - "minecraft:green_concrete" => { - Self::green_concrete_from_identifier_and_properties(properties) - } - "minecraft:red_concrete" => { - Self::red_concrete_from_identifier_and_properties(properties) - } - "minecraft:black_concrete" => { - Self::black_concrete_from_identifier_and_properties(properties) - } - "minecraft:white_concrete_powder" => { - Self::white_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:orange_concrete_powder" => { - Self::orange_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:magenta_concrete_powder" => { - Self::magenta_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:light_blue_concrete_powder" => { - Self::light_blue_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:yellow_concrete_powder" => { - Self::yellow_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:lime_concrete_powder" => { - Self::lime_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:pink_concrete_powder" => { - Self::pink_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:gray_concrete_powder" => { - Self::gray_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:light_gray_concrete_powder" => { - Self::light_gray_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:cyan_concrete_powder" => { - Self::cyan_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:purple_concrete_powder" => { - Self::purple_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:blue_concrete_powder" => { - Self::blue_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:brown_concrete_powder" => { - Self::brown_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:green_concrete_powder" => { - Self::green_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:red_concrete_powder" => { - Self::red_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:black_concrete_powder" => { - Self::black_concrete_powder_from_identifier_and_properties(properties) - } - "minecraft:kelp" => Self::kelp_from_identifier_and_properties(properties), - "minecraft:kelp_plant" => Self::kelp_plant_from_identifier_and_properties(properties), - "minecraft:dried_kelp_block" => { - Self::dried_kelp_block_from_identifier_and_properties(properties) - } - "minecraft:turtle_egg" => Self::turtle_egg_from_identifier_and_properties(properties), - "minecraft:dead_tube_coral_block" => { - Self::dead_tube_coral_block_from_identifier_and_properties(properties) - } - "minecraft:dead_brain_coral_block" => { - Self::dead_brain_coral_block_from_identifier_and_properties(properties) - } - "minecraft:dead_bubble_coral_block" => { - Self::dead_bubble_coral_block_from_identifier_and_properties(properties) - } - "minecraft:dead_fire_coral_block" => { - Self::dead_fire_coral_block_from_identifier_and_properties(properties) - } - "minecraft:dead_horn_coral_block" => { - Self::dead_horn_coral_block_from_identifier_and_properties(properties) - } - "minecraft:tube_coral_block" => { - Self::tube_coral_block_from_identifier_and_properties(properties) - } - "minecraft:brain_coral_block" => { - Self::brain_coral_block_from_identifier_and_properties(properties) - } - "minecraft:bubble_coral_block" => { - Self::bubble_coral_block_from_identifier_and_properties(properties) - } - "minecraft:fire_coral_block" => { - Self::fire_coral_block_from_identifier_and_properties(properties) - } - "minecraft:horn_coral_block" => { - Self::horn_coral_block_from_identifier_and_properties(properties) - } - "minecraft:dead_tube_coral" => { - Self::dead_tube_coral_from_identifier_and_properties(properties) - } - "minecraft:dead_brain_coral" => { - Self::dead_brain_coral_from_identifier_and_properties(properties) - } - "minecraft:dead_bubble_coral" => { - Self::dead_bubble_coral_from_identifier_and_properties(properties) - } - "minecraft:dead_fire_coral" => { - Self::dead_fire_coral_from_identifier_and_properties(properties) - } - "minecraft:dead_horn_coral" => { - Self::dead_horn_coral_from_identifier_and_properties(properties) - } - "minecraft:tube_coral" => Self::tube_coral_from_identifier_and_properties(properties), - "minecraft:brain_coral" => Self::brain_coral_from_identifier_and_properties(properties), - "minecraft:bubble_coral" => { - Self::bubble_coral_from_identifier_and_properties(properties) - } - "minecraft:fire_coral" => Self::fire_coral_from_identifier_and_properties(properties), - "minecraft:horn_coral" => Self::horn_coral_from_identifier_and_properties(properties), - "minecraft:dead_tube_coral_fan" => { - Self::dead_tube_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_brain_coral_fan" => { - Self::dead_brain_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_bubble_coral_fan" => { - Self::dead_bubble_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_fire_coral_fan" => { - Self::dead_fire_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_horn_coral_fan" => { - Self::dead_horn_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:tube_coral_fan" => { - Self::tube_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:brain_coral_fan" => { - Self::brain_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:bubble_coral_fan" => { - Self::bubble_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:fire_coral_fan" => { - Self::fire_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:horn_coral_fan" => { - Self::horn_coral_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_tube_coral_wall_fan" => { - Self::dead_tube_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_brain_coral_wall_fan" => { - Self::dead_brain_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_bubble_coral_wall_fan" => { - Self::dead_bubble_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_fire_coral_wall_fan" => { - Self::dead_fire_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:dead_horn_coral_wall_fan" => { - Self::dead_horn_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:tube_coral_wall_fan" => { - Self::tube_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:brain_coral_wall_fan" => { - Self::brain_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:bubble_coral_wall_fan" => { - Self::bubble_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:fire_coral_wall_fan" => { - Self::fire_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:horn_coral_wall_fan" => { - Self::horn_coral_wall_fan_from_identifier_and_properties(properties) - } - "minecraft:sea_pickle" => Self::sea_pickle_from_identifier_and_properties(properties), - "minecraft:blue_ice" => Self::blue_ice_from_identifier_and_properties(properties), - "minecraft:conduit" => Self::conduit_from_identifier_and_properties(properties), - "minecraft:bamboo_sapling" => { - Self::bamboo_sapling_from_identifier_and_properties(properties) - } - "minecraft:bamboo" => Self::bamboo_from_identifier_and_properties(properties), - "minecraft:potted_bamboo" => { - Self::potted_bamboo_from_identifier_and_properties(properties) - } - "minecraft:void_air" => Self::void_air_from_identifier_and_properties(properties), - "minecraft:cave_air" => Self::cave_air_from_identifier_and_properties(properties), - "minecraft:bubble_column" => { - Self::bubble_column_from_identifier_and_properties(properties) - } - "minecraft:polished_granite_stairs" => { - Self::polished_granite_stairs_from_identifier_and_properties(properties) - } - "minecraft:smooth_red_sandstone_stairs" => { - Self::smooth_red_sandstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:mossy_stone_brick_stairs" => { - Self::mossy_stone_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:polished_diorite_stairs" => { - Self::polished_diorite_stairs_from_identifier_and_properties(properties) - } - "minecraft:mossy_cobblestone_stairs" => { - Self::mossy_cobblestone_stairs_from_identifier_and_properties(properties) - } - "minecraft:end_stone_brick_stairs" => { - Self::end_stone_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:stone_stairs" => { - Self::stone_stairs_from_identifier_and_properties(properties) - } - "minecraft:smooth_sandstone_stairs" => { - Self::smooth_sandstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:smooth_quartz_stairs" => { - Self::smooth_quartz_stairs_from_identifier_and_properties(properties) - } - "minecraft:granite_stairs" => { - Self::granite_stairs_from_identifier_and_properties(properties) - } - "minecraft:andesite_stairs" => { - Self::andesite_stairs_from_identifier_and_properties(properties) - } - "minecraft:red_nether_brick_stairs" => { - Self::red_nether_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:polished_andesite_stairs" => { - Self::polished_andesite_stairs_from_identifier_and_properties(properties) - } - "minecraft:diorite_stairs" => { - Self::diorite_stairs_from_identifier_and_properties(properties) - } - "minecraft:polished_granite_slab" => { - Self::polished_granite_slab_from_identifier_and_properties(properties) - } - "minecraft:smooth_red_sandstone_slab" => { - Self::smooth_red_sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:mossy_stone_brick_slab" => { - Self::mossy_stone_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:polished_diorite_slab" => { - Self::polished_diorite_slab_from_identifier_and_properties(properties) - } - "minecraft:mossy_cobblestone_slab" => { - Self::mossy_cobblestone_slab_from_identifier_and_properties(properties) - } - "minecraft:end_stone_brick_slab" => { - Self::end_stone_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:smooth_sandstone_slab" => { - Self::smooth_sandstone_slab_from_identifier_and_properties(properties) - } - "minecraft:smooth_quartz_slab" => { - Self::smooth_quartz_slab_from_identifier_and_properties(properties) - } - "minecraft:granite_slab" => { - Self::granite_slab_from_identifier_and_properties(properties) - } - "minecraft:andesite_slab" => { - Self::andesite_slab_from_identifier_and_properties(properties) - } - "minecraft:red_nether_brick_slab" => { - Self::red_nether_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:polished_andesite_slab" => { - Self::polished_andesite_slab_from_identifier_and_properties(properties) - } - "minecraft:diorite_slab" => { - Self::diorite_slab_from_identifier_and_properties(properties) - } - "minecraft:brick_wall" => Self::brick_wall_from_identifier_and_properties(properties), - "minecraft:prismarine_wall" => { - Self::prismarine_wall_from_identifier_and_properties(properties) - } - "minecraft:red_sandstone_wall" => { - Self::red_sandstone_wall_from_identifier_and_properties(properties) - } - "minecraft:mossy_stone_brick_wall" => { - Self::mossy_stone_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:granite_wall" => { - Self::granite_wall_from_identifier_and_properties(properties) - } - "minecraft:stone_brick_wall" => { - Self::stone_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:nether_brick_wall" => { - Self::nether_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:andesite_wall" => { - Self::andesite_wall_from_identifier_and_properties(properties) - } - "minecraft:red_nether_brick_wall" => { - Self::red_nether_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:sandstone_wall" => { - Self::sandstone_wall_from_identifier_and_properties(properties) - } - "minecraft:end_stone_brick_wall" => { - Self::end_stone_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:diorite_wall" => { - Self::diorite_wall_from_identifier_and_properties(properties) - } - "minecraft:scaffolding" => Self::scaffolding_from_identifier_and_properties(properties), - "minecraft:loom" => Self::loom_from_identifier_and_properties(properties), - "minecraft:barrel" => Self::barrel_from_identifier_and_properties(properties), - "minecraft:smoker" => Self::smoker_from_identifier_and_properties(properties), - "minecraft:blast_furnace" => { - Self::blast_furnace_from_identifier_and_properties(properties) - } - "minecraft:cartography_table" => { - Self::cartography_table_from_identifier_and_properties(properties) - } - "minecraft:fletching_table" => { - Self::fletching_table_from_identifier_and_properties(properties) - } - "minecraft:grindstone" => Self::grindstone_from_identifier_and_properties(properties), - "minecraft:lectern" => Self::lectern_from_identifier_and_properties(properties), - "minecraft:smithing_table" => { - Self::smithing_table_from_identifier_and_properties(properties) - } - "minecraft:stonecutter" => Self::stonecutter_from_identifier_and_properties(properties), - "minecraft:bell" => Self::bell_from_identifier_and_properties(properties), - "minecraft:lantern" => Self::lantern_from_identifier_and_properties(properties), - "minecraft:soul_lantern" => { - Self::soul_lantern_from_identifier_and_properties(properties) - } - "minecraft:campfire" => Self::campfire_from_identifier_and_properties(properties), - "minecraft:soul_campfire" => { - Self::soul_campfire_from_identifier_and_properties(properties) - } - "minecraft:sweet_berry_bush" => { - Self::sweet_berry_bush_from_identifier_and_properties(properties) - } - "minecraft:warped_stem" => Self::warped_stem_from_identifier_and_properties(properties), - "minecraft:stripped_warped_stem" => { - Self::stripped_warped_stem_from_identifier_and_properties(properties) - } - "minecraft:warped_hyphae" => { - Self::warped_hyphae_from_identifier_and_properties(properties) - } - "minecraft:stripped_warped_hyphae" => { - Self::stripped_warped_hyphae_from_identifier_and_properties(properties) - } - "minecraft:warped_nylium" => { - Self::warped_nylium_from_identifier_and_properties(properties) - } - "minecraft:warped_fungus" => { - Self::warped_fungus_from_identifier_and_properties(properties) - } - "minecraft:warped_wart_block" => { - Self::warped_wart_block_from_identifier_and_properties(properties) - } - "minecraft:warped_roots" => { - Self::warped_roots_from_identifier_and_properties(properties) - } - "minecraft:nether_sprouts" => { - Self::nether_sprouts_from_identifier_and_properties(properties) - } - "minecraft:crimson_stem" => { - Self::crimson_stem_from_identifier_and_properties(properties) - } - "minecraft:stripped_crimson_stem" => { - Self::stripped_crimson_stem_from_identifier_and_properties(properties) - } - "minecraft:crimson_hyphae" => { - Self::crimson_hyphae_from_identifier_and_properties(properties) - } - "minecraft:stripped_crimson_hyphae" => { - Self::stripped_crimson_hyphae_from_identifier_and_properties(properties) - } - "minecraft:crimson_nylium" => { - Self::crimson_nylium_from_identifier_and_properties(properties) - } - "minecraft:crimson_fungus" => { - Self::crimson_fungus_from_identifier_and_properties(properties) - } - "minecraft:shroomlight" => Self::shroomlight_from_identifier_and_properties(properties), - "minecraft:weeping_vines" => { - Self::weeping_vines_from_identifier_and_properties(properties) - } - "minecraft:weeping_vines_plant" => { - Self::weeping_vines_plant_from_identifier_and_properties(properties) - } - "minecraft:twisting_vines" => { - Self::twisting_vines_from_identifier_and_properties(properties) - } - "minecraft:twisting_vines_plant" => { - Self::twisting_vines_plant_from_identifier_and_properties(properties) - } - "minecraft:crimson_roots" => { - Self::crimson_roots_from_identifier_and_properties(properties) - } - "minecraft:crimson_planks" => { - Self::crimson_planks_from_identifier_and_properties(properties) - } - "minecraft:warped_planks" => { - Self::warped_planks_from_identifier_and_properties(properties) - } - "minecraft:crimson_slab" => { - Self::crimson_slab_from_identifier_and_properties(properties) - } - "minecraft:warped_slab" => Self::warped_slab_from_identifier_and_properties(properties), - "minecraft:crimson_pressure_plate" => { - Self::crimson_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:warped_pressure_plate" => { - Self::warped_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:crimson_fence" => { - Self::crimson_fence_from_identifier_and_properties(properties) - } - "minecraft:warped_fence" => { - Self::warped_fence_from_identifier_and_properties(properties) - } - "minecraft:crimson_trapdoor" => { - Self::crimson_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:warped_trapdoor" => { - Self::warped_trapdoor_from_identifier_and_properties(properties) - } - "minecraft:crimson_fence_gate" => { - Self::crimson_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:warped_fence_gate" => { - Self::warped_fence_gate_from_identifier_and_properties(properties) - } - "minecraft:crimson_stairs" => { - Self::crimson_stairs_from_identifier_and_properties(properties) - } - "minecraft:warped_stairs" => { - Self::warped_stairs_from_identifier_and_properties(properties) - } - "minecraft:crimson_button" => { - Self::crimson_button_from_identifier_and_properties(properties) - } - "minecraft:warped_button" => { - Self::warped_button_from_identifier_and_properties(properties) - } - "minecraft:crimson_door" => { - Self::crimson_door_from_identifier_and_properties(properties) - } - "minecraft:warped_door" => Self::warped_door_from_identifier_and_properties(properties), - "minecraft:crimson_sign" => { - Self::crimson_sign_from_identifier_and_properties(properties) - } - "minecraft:warped_sign" => Self::warped_sign_from_identifier_and_properties(properties), - "minecraft:crimson_wall_sign" => { - Self::crimson_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:warped_wall_sign" => { - Self::warped_wall_sign_from_identifier_and_properties(properties) - } - "minecraft:structure_block" => { - Self::structure_block_from_identifier_and_properties(properties) - } - "minecraft:jigsaw" => Self::jigsaw_from_identifier_and_properties(properties), - "minecraft:composter" => Self::composter_from_identifier_and_properties(properties), - "minecraft:target" => Self::target_from_identifier_and_properties(properties), - "minecraft:bee_nest" => Self::bee_nest_from_identifier_and_properties(properties), - "minecraft:beehive" => Self::beehive_from_identifier_and_properties(properties), - "minecraft:honey_block" => Self::honey_block_from_identifier_and_properties(properties), - "minecraft:honeycomb_block" => { - Self::honeycomb_block_from_identifier_and_properties(properties) - } - "minecraft:netherite_block" => { - Self::netherite_block_from_identifier_and_properties(properties) - } - "minecraft:ancient_debris" => { - Self::ancient_debris_from_identifier_and_properties(properties) - } - "minecraft:crying_obsidian" => { - Self::crying_obsidian_from_identifier_and_properties(properties) - } - "minecraft:respawn_anchor" => { - Self::respawn_anchor_from_identifier_and_properties(properties) - } - "minecraft:potted_crimson_fungus" => { - Self::potted_crimson_fungus_from_identifier_and_properties(properties) - } - "minecraft:potted_warped_fungus" => { - Self::potted_warped_fungus_from_identifier_and_properties(properties) - } - "minecraft:potted_crimson_roots" => { - Self::potted_crimson_roots_from_identifier_and_properties(properties) - } - "minecraft:potted_warped_roots" => { - Self::potted_warped_roots_from_identifier_and_properties(properties) - } - "minecraft:lodestone" => Self::lodestone_from_identifier_and_properties(properties), - "minecraft:blackstone" => Self::blackstone_from_identifier_and_properties(properties), - "minecraft:blackstone_stairs" => { - Self::blackstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:blackstone_wall" => { - Self::blackstone_wall_from_identifier_and_properties(properties) - } - "minecraft:blackstone_slab" => { - Self::blackstone_slab_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone" => { - Self::polished_blackstone_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_bricks" => { - Self::polished_blackstone_bricks_from_identifier_and_properties(properties) - } - "minecraft:cracked_polished_blackstone_bricks" => { - Self::cracked_polished_blackstone_bricks_from_identifier_and_properties(properties) - } - "minecraft:chiseled_polished_blackstone" => { - Self::chiseled_polished_blackstone_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_brick_slab" => { - Self::polished_blackstone_brick_slab_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_brick_stairs" => { - Self::polished_blackstone_brick_stairs_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_brick_wall" => { - Self::polished_blackstone_brick_wall_from_identifier_and_properties(properties) - } - "minecraft:gilded_blackstone" => { - Self::gilded_blackstone_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_stairs" => { - Self::polished_blackstone_stairs_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_slab" => { - Self::polished_blackstone_slab_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_pressure_plate" => { - Self::polished_blackstone_pressure_plate_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_button" => { - Self::polished_blackstone_button_from_identifier_and_properties(properties) - } - "minecraft:polished_blackstone_wall" => { - Self::polished_blackstone_wall_from_identifier_and_properties(properties) - } - "minecraft:chiseled_nether_bricks" => { - Self::chiseled_nether_bricks_from_identifier_and_properties(properties) - } - "minecraft:cracked_nether_bricks" => { - Self::cracked_nether_bricks_from_identifier_and_properties(properties) - } - "minecraft:quartz_bricks" => { - Self::quartz_bricks_from_identifier_and_properties(properties) - } - _ => None, - } - } - fn air_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::air(); - Some(block) - } - fn stone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stone(); - Some(block) - } - fn granite_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::granite(); - Some(block) - } - fn polished_granite_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_granite(); - Some(block) - } - fn diorite_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::diorite(); - Some(block) - } - fn polished_diorite_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_diorite(); - Some(block) - } - fn andesite_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::andesite(); - Some(block) - } - fn polished_andesite_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_andesite(); - Some(block) - } - fn grass_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::grass_block(); - let snowy = map.get("snowy")?; - let snowy = bool::from_str(snowy).ok()?; - block.set_snowy(snowy); - Some(block) - } - fn dirt_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dirt(); - Some(block) - } - fn coarse_dirt_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::coarse_dirt(); - Some(block) - } - fn podzol_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::podzol(); - let snowy = map.get("snowy")?; - let snowy = bool::from_str(snowy).ok()?; - block.set_snowy(snowy); - Some(block) - } - fn cobblestone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cobblestone(); - Some(block) - } - fn oak_planks_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_planks(); - Some(block) - } - fn spruce_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_planks(); - Some(block) - } - fn birch_planks_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_planks(); - Some(block) - } - fn jungle_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_planks(); - Some(block) - } - fn acacia_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_planks(); - Some(block) - } - fn dark_oak_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_planks(); - Some(block) - } - fn oak_sapling_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn spruce_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn birch_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::birch_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn jungle_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn acacia_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn dark_oak_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_sapling(); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn bedrock_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bedrock(); - Some(block) - } - fn water_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::water(); - let water_level = map.get("level")?; - let water_level = { - let x = i32::from_str(water_level).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_water_level(water_level); - Some(block) - } - fn lava_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lava(); - let water_level = map.get("level")?; - let water_level = { - let x = i32::from_str(water_level).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_water_level(water_level); - Some(block) - } - fn sand_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sand(); - Some(block) - } - fn red_sand_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_sand(); - Some(block) - } - fn gravel_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gravel(); - Some(block) - } - fn gold_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gold_ore(); - Some(block) - } - fn iron_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::iron_ore(); - Some(block) - } - fn coal_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::coal_ore(); - Some(block) - } - fn nether_gold_ore_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_gold_ore(); - Some(block) - } - fn oak_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn spruce_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn birch_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn jungle_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn acacia_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn dark_oak_log_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dark_oak_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_spruce_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_spruce_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_birch_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_birch_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_jungle_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_jungle_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_acacia_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_acacia_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_dark_oak_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_dark_oak_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_oak_log_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_oak_log(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn oak_wood_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn spruce_wood_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn birch_wood_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn jungle_wood_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn acacia_wood_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn dark_oak_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_oak_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_oak_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_spruce_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_spruce_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_birch_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_birch_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_jungle_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_jungle_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_acacia_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_acacia_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_dark_oak_wood_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_dark_oak_wood(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn oak_leaves_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn spruce_leaves_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn birch_leaves_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn jungle_leaves_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn acacia_leaves_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn dark_oak_leaves_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_leaves(); - let distance_1_7 = map.get("distance")?; - let distance_1_7 = { - let x = i32::from_str(distance_1_7).ok()?; - if !(1i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_1_7(distance_1_7); - let persistent = map.get("persistent")?; - let persistent = bool::from_str(persistent).ok()?; - block.set_persistent(persistent); - Some(block) - } - fn sponge_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sponge(); - Some(block) - } - fn wet_sponge_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::wet_sponge(); - Some(block) - } - fn glass_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::glass(); - Some(block) - } - fn lapis_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lapis_ore(); - Some(block) - } - fn lapis_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lapis_block(); - Some(block) - } - fn dispenser_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dispenser(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let triggered = map.get("triggered")?; - let triggered = bool::from_str(triggered).ok()?; - block.set_triggered(triggered); - Some(block) - } - fn sandstone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sandstone(); - Some(block) - } - fn chiseled_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_sandstone(); - Some(block) - } - fn cut_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cut_sandstone(); - Some(block) - } - fn note_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::note_block(); - let instrument = map.get("instrument")?; - let instrument = Instrument::from_str(instrument).ok()?; - block.set_instrument(instrument); - let note = map.get("note")?; - let note = { - let x = i32::from_str(note).ok()?; - if !(0i32..=24i32).contains(&x) { - return None; - } - x - }; - block.set_note(note); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn white_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::white_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn orange_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::orange_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn magenta_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::magenta_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn light_blue_bed_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn yellow_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::yellow_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn lime_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lime_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn pink_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pink_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn gray_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gray_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn light_gray_bed_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn cyan_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cyan_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn purple_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::purple_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn blue_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn brown_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brown_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn green_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::green_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn red_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn black_bed_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::black_bed(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let occupied = map.get("occupied")?; - let occupied = bool::from_str(occupied).ok()?; - block.set_occupied(occupied); - let part = map.get("part")?; - let part = Part::from_str(part).ok()?; - block.set_part(part); - Some(block) - } - fn powered_rail_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::powered_rail(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let powered_rail_shape = map.get("shape")?; - let powered_rail_shape = PoweredRailShape::from_str(powered_rail_shape).ok()?; - block.set_powered_rail_shape(powered_rail_shape); - Some(block) - } - fn detector_rail_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::detector_rail(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let powered_rail_shape = map.get("shape")?; - let powered_rail_shape = PoweredRailShape::from_str(powered_rail_shape).ok()?; - block.set_powered_rail_shape(powered_rail_shape); - Some(block) - } - fn sticky_piston_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::sticky_piston(); - let extended = map.get("extended")?; - let extended = bool::from_str(extended).ok()?; - block.set_extended(extended); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn cobweb_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cobweb(); - Some(block) - } - fn grass_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::grass(); - Some(block) - } - fn fern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::fern(); - Some(block) - } - fn dead_bush_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dead_bush(); - Some(block) - } - fn seagrass_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::seagrass(); - Some(block) - } - fn tall_seagrass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::tall_seagrass(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn piston_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::piston(); - let extended = map.get("extended")?; - let extended = bool::from_str(extended).ok()?; - block.set_extended(extended); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn piston_head_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::piston_head(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let piston_kind = map.get("type")?; - let piston_kind = PistonKind::from_str(piston_kind).ok()?; - block.set_piston_kind(piston_kind); - let short = map.get("short")?; - let short = bool::from_str(short).ok()?; - block.set_short(short); - Some(block) - } - fn white_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::white_wool(); - Some(block) - } - fn orange_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::orange_wool(); - Some(block) - } - fn magenta_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::magenta_wool(); - Some(block) - } - fn light_blue_wool_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_wool(); - Some(block) - } - fn yellow_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::yellow_wool(); - Some(block) - } - fn lime_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lime_wool(); - Some(block) - } - fn pink_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pink_wool(); - Some(block) - } - fn gray_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gray_wool(); - Some(block) - } - fn light_gray_wool_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_wool(); - Some(block) - } - fn cyan_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cyan_wool(); - Some(block) - } - fn purple_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::purple_wool(); - Some(block) - } - fn blue_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_wool(); - Some(block) - } - fn brown_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brown_wool(); - Some(block) - } - fn green_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::green_wool(); - Some(block) - } - fn red_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_wool(); - Some(block) - } - fn black_wool_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::black_wool(); - Some(block) - } - fn moving_piston_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::moving_piston(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let piston_kind = map.get("type")?; - let piston_kind = PistonKind::from_str(piston_kind).ok()?; - block.set_piston_kind(piston_kind); - Some(block) - } - fn dandelion_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dandelion(); - Some(block) - } - fn poppy_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::poppy(); - Some(block) - } - fn blue_orchid_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_orchid(); - Some(block) - } - fn allium_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::allium(); - Some(block) - } - fn azure_bluet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::azure_bluet(); - Some(block) - } - fn red_tulip_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_tulip(); - Some(block) - } - fn orange_tulip_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::orange_tulip(); - Some(block) - } - fn white_tulip_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::white_tulip(); - Some(block) - } - fn pink_tulip_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pink_tulip(); - Some(block) - } - fn oxeye_daisy_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oxeye_daisy(); - Some(block) - } - fn cornflower_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cornflower(); - Some(block) - } - fn wither_rose_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::wither_rose(); - Some(block) - } - fn lily_of_the_valley_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lily_of_the_valley(); - Some(block) - } - fn brown_mushroom_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_mushroom(); - Some(block) - } - fn red_mushroom_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_mushroom(); - Some(block) - } - fn gold_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gold_block(); - Some(block) - } - fn iron_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::iron_block(); - Some(block) - } - fn bricks_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bricks(); - Some(block) - } - fn tnt_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::tnt(); - let unstable = map.get("unstable")?; - let unstable = bool::from_str(unstable).ok()?; - block.set_unstable(unstable); - Some(block) - } - fn bookshelf_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bookshelf(); - Some(block) - } - fn mossy_cobblestone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_cobblestone(); - Some(block) - } - fn obsidian_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::obsidian(); - Some(block) - } - fn torch_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::torch(); - Some(block) - } - fn wall_torch_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::wall_torch(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn fire_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::fire(); - let age_0_15 = map.get("age")?; - let age_0_15 = { - let x = i32::from_str(age_0_15).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_15(age_0_15); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn soul_fire_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::soul_fire(); - Some(block) - } - fn spawner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spawner(); - Some(block) - } - fn oak_stairs_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn chest_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::chest(); - let chest_kind = map.get("type")?; - let chest_kind = ChestKind::from_str(chest_kind).ok()?; - block.set_chest_kind(chest_kind); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn redstone_wire_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::redstone_wire(); - let east_wire = map.get("east")?; - let east_wire = EastWire::from_str(east_wire).ok()?; - block.set_east_wire(east_wire); - let north_wire = map.get("north")?; - let north_wire = NorthWire::from_str(north_wire).ok()?; - block.set_north_wire(north_wire); - let power = map.get("power")?; - let power = { - let x = i32::from_str(power).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_power(power); - let south_wire = map.get("south")?; - let south_wire = SouthWire::from_str(south_wire).ok()?; - block.set_south_wire(south_wire); - let west_wire = map.get("west")?; - let west_wire = WestWire::from_str(west_wire).ok()?; - block.set_west_wire(west_wire); - Some(block) - } - fn diamond_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::diamond_ore(); - Some(block) - } - fn diamond_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::diamond_block(); - Some(block) - } - fn crafting_table_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crafting_table(); - Some(block) - } - fn wheat_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::wheat(); - let age_0_7 = map.get("age")?; - let age_0_7 = { - let x = i32::from_str(age_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_7(age_0_7); - Some(block) - } - fn farmland_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::farmland(); - let moisture = map.get("moisture")?; - let moisture = { - let x = i32::from_str(moisture).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_moisture(moisture); - Some(block) - } - fn furnace_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::furnace(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn oak_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn spruce_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn birch_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn acacia_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn jungle_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_oak_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn oak_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn ladder_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::ladder(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn rail_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::rail(); - let rail_shape = map.get("shape")?; - let rail_shape = RailShape::from_str(rail_shape).ok()?; - block.set_rail_shape(rail_shape); - Some(block) - } - fn cobblestone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cobblestone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn oak_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::oak_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn spruce_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn birch_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::birch_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn acacia_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn jungle_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_oak_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn lever_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lever(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn stone_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stone_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn iron_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::iron_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn oak_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::oak_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn spruce_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn birch_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::birch_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn jungle_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn acacia_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn dark_oak_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn redstone_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::redstone_ore(); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn redstone_torch_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::redstone_torch(); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn redstone_wall_torch_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::redstone_wall_torch(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn stone_button_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stone_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn snow_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::snow(); - let layers = map.get("layers")?; - let layers = { - let x = i32::from_str(layers).ok()?; - if !(1i32..=8i32).contains(&x) { - return None; - } - x - }; - block.set_layers(layers); - Some(block) - } - fn ice_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::ice(); - Some(block) - } - fn snow_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::snow_block(); - Some(block) - } - fn cactus_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cactus(); - let age_0_15 = map.get("age")?; - let age_0_15 = { - let x = i32::from_str(age_0_15).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_15(age_0_15); - Some(block) - } - fn clay_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::clay(); - Some(block) - } - fn sugar_cane_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sugar_cane(); - let age_0_15 = map.get("age")?; - let age_0_15 = { - let x = i32::from_str(age_0_15).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_15(age_0_15); - Some(block) - } - fn jukebox_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jukebox(); - let has_record = map.get("has_record")?; - let has_record = bool::from_str(has_record).ok()?; - block.set_has_record(has_record); - Some(block) - } - fn oak_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn pumpkin_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pumpkin(); - Some(block) - } - fn netherrack_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::netherrack(); - Some(block) - } - fn soul_sand_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::soul_sand(); - Some(block) - } - fn soul_soil_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::soul_soil(); - Some(block) - } - fn basalt_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::basalt(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn polished_basalt_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_basalt(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn soul_torch_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::soul_torch(); - Some(block) - } - fn soul_wall_torch_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::soul_wall_torch(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn glowstone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::glowstone(); - Some(block) - } - fn nether_portal_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_portal(); - let axis_xz = map.get("axis")?; - let axis_xz = AxisXz::from_str(axis_xz).ok()?; - block.set_axis_xz(axis_xz); - Some(block) - } - fn carved_pumpkin_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::carved_pumpkin(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn jack_o_lantern_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jack_o_lantern(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn cake_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cake(); - let bites = map.get("bites")?; - let bites = { - let x = i32::from_str(bites).ok()?; - if !(0i32..=6i32).contains(&x) { - return None; - } - x - }; - block.set_bites(bites); - Some(block) - } - fn repeater_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::repeater(); - let delay = map.get("delay")?; - let delay = { - let x = i32::from_str(delay).ok()?; - if !(1i32..=4i32).contains(&x) { - return None; - } - x - }; - block.set_delay(delay); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let locked = map.get("locked")?; - let locked = bool::from_str(locked).ok()?; - block.set_locked(locked); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn white_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_stained_glass(); - Some(block) - } - fn orange_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_stained_glass(); - Some(block) - } - fn magenta_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_stained_glass(); - Some(block) - } - fn light_blue_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_stained_glass(); - Some(block) - } - fn yellow_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_stained_glass(); - Some(block) - } - fn lime_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_stained_glass(); - Some(block) - } - fn pink_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_stained_glass(); - Some(block) - } - fn gray_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_stained_glass(); - Some(block) - } - fn light_gray_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_stained_glass(); - Some(block) - } - fn cyan_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_stained_glass(); - Some(block) - } - fn purple_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_stained_glass(); - Some(block) - } - fn blue_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_stained_glass(); - Some(block) - } - fn brown_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_stained_glass(); - Some(block) - } - fn green_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_stained_glass(); - Some(block) - } - fn red_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_stained_glass(); - Some(block) - } - fn black_stained_glass_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_stained_glass(); - Some(block) - } - fn oak_trapdoor_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn spruce_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn birch_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::birch_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn jungle_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn acacia_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_oak_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn stone_bricks_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stone_bricks(); - Some(block) - } - fn mossy_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_stone_bricks(); - Some(block) - } - fn cracked_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cracked_stone_bricks(); - Some(block) - } - fn chiseled_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_stone_bricks(); - Some(block) - } - fn infested_stone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_stone(); - Some(block) - } - fn infested_cobblestone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_cobblestone(); - Some(block) - } - fn infested_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_stone_bricks(); - Some(block) - } - fn infested_mossy_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_mossy_stone_bricks(); - Some(block) - } - fn infested_cracked_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_cracked_stone_bricks(); - Some(block) - } - fn infested_chiseled_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::infested_chiseled_stone_bricks(); - Some(block) - } - fn brown_mushroom_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_mushroom_block(); - let down = map.get("down")?; - let down = bool::from_str(down).ok()?; - block.set_down(down); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn red_mushroom_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_mushroom_block(); - let down = map.get("down")?; - let down = bool::from_str(down).ok()?; - block.set_down(down); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn mushroom_stem_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mushroom_stem(); - let down = map.get("down")?; - let down = bool::from_str(down).ok()?; - block.set_down(down); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn iron_bars_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::iron_bars(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn chain_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::chain(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn glass_pane_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn melon_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::melon(); - Some(block) - } - fn attached_pumpkin_stem_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::attached_pumpkin_stem(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn attached_melon_stem_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::attached_melon_stem(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn pumpkin_stem_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pumpkin_stem(); - let age_0_7 = map.get("age")?; - let age_0_7 = { - let x = i32::from_str(age_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_7(age_0_7); - Some(block) - } - fn melon_stem_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::melon_stem(); - let age_0_7 = map.get("age")?; - let age_0_7 = { - let x = i32::from_str(age_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_7(age_0_7); - Some(block) - } - fn vine_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::vine(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn oak_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::oak_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn brick_stairs_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn stone_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stone_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn mycelium_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::mycelium(); - let snowy = map.get("snowy")?; - let snowy = bool::from_str(snowy).ok()?; - block.set_snowy(snowy); - Some(block) - } - fn lily_pad_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lily_pad(); - Some(block) - } - fn nether_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_bricks(); - Some(block) - } - fn nether_brick_fence_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_brick_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn nether_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn nether_wart_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::nether_wart(); - let age_0_3 = map.get("age")?; - let age_0_3 = { - let x = i32::from_str(age_0_3).ok()?; - if !(0i32..=3i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_3(age_0_3); - Some(block) - } - fn enchanting_table_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::enchanting_table(); - Some(block) - } - fn brewing_stand_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brewing_stand(); - let has_bottle_0 = map.get("has_bottle_0")?; - let has_bottle_0 = bool::from_str(has_bottle_0).ok()?; - block.set_has_bottle_0(has_bottle_0); - let has_bottle_1 = map.get("has_bottle_1")?; - let has_bottle_1 = bool::from_str(has_bottle_1).ok()?; - block.set_has_bottle_1(has_bottle_1); - let has_bottle_2 = map.get("has_bottle_2")?; - let has_bottle_2 = bool::from_str(has_bottle_2).ok()?; - block.set_has_bottle_2(has_bottle_2); - Some(block) - } - fn cauldron_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cauldron(); - let cauldron_level = map.get("level")?; - let cauldron_level = { - let x = i32::from_str(cauldron_level).ok()?; - if !(0i32..=3i32).contains(&x) { - return None; - } - x - }; - block.set_cauldron_level(cauldron_level); - Some(block) - } - fn end_portal_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::end_portal(); - Some(block) - } - fn end_portal_frame_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::end_portal_frame(); - let eye = map.get("eye")?; - let eye = bool::from_str(eye).ok()?; - block.set_eye(eye); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn end_stone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::end_stone(); - Some(block) - } - fn dragon_egg_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dragon_egg(); - Some(block) - } - fn redstone_lamp_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::redstone_lamp(); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn cocoa_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cocoa(); - let age_0_2 = map.get("age")?; - let age_0_2 = { - let x = i32::from_str(age_0_2).ok()?; - if !(0i32..=2i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_2(age_0_2); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn sandstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::sandstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn emerald_ore_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::emerald_ore(); - Some(block) - } - fn ender_chest_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::ender_chest(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn tripwire_hook_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::tripwire_hook(); - let attached = map.get("attached")?; - let attached = bool::from_str(attached).ok()?; - block.set_attached(attached); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn tripwire_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::tripwire(); - let attached = map.get("attached")?; - let attached = bool::from_str(attached).ok()?; - block.set_attached(attached); - let disarmed = map.get("disarmed")?; - let disarmed = bool::from_str(disarmed).ok()?; - block.set_disarmed(disarmed); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn emerald_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::emerald_block(); - Some(block) - } - fn spruce_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn birch_stairs_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn jungle_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn command_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::command_block(); - let conditional = map.get("conditional")?; - let conditional = bool::from_str(conditional).ok()?; - block.set_conditional(conditional); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn beacon_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::beacon(); - Some(block) - } - fn cobblestone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cobblestone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn mossy_cobblestone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_cobblestone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn flower_pot_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::flower_pot(); - Some(block) - } - fn potted_oak_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_oak_sapling(); - Some(block) - } - fn potted_spruce_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_spruce_sapling(); - Some(block) - } - fn potted_birch_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_birch_sapling(); - Some(block) - } - fn potted_jungle_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_jungle_sapling(); - Some(block) - } - fn potted_acacia_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_acacia_sapling(); - Some(block) - } - fn potted_dark_oak_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_dark_oak_sapling(); - Some(block) - } - fn potted_fern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::potted_fern(); - Some(block) - } - fn potted_dandelion_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_dandelion(); - Some(block) - } - fn potted_poppy_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::potted_poppy(); - Some(block) - } - fn potted_blue_orchid_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_blue_orchid(); - Some(block) - } - fn potted_allium_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_allium(); - Some(block) - } - fn potted_azure_bluet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_azure_bluet(); - Some(block) - } - fn potted_red_tulip_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_red_tulip(); - Some(block) - } - fn potted_orange_tulip_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_orange_tulip(); - Some(block) - } - fn potted_white_tulip_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_white_tulip(); - Some(block) - } - fn potted_pink_tulip_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_pink_tulip(); - Some(block) - } - fn potted_oxeye_daisy_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_oxeye_daisy(); - Some(block) - } - fn potted_cornflower_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_cornflower(); - Some(block) - } - fn potted_lily_of_the_valley_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_lily_of_the_valley(); - Some(block) - } - fn potted_wither_rose_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_wither_rose(); - Some(block) - } - fn potted_red_mushroom_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_red_mushroom(); - Some(block) - } - fn potted_brown_mushroom_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_brown_mushroom(); - Some(block) - } - fn potted_dead_bush_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_dead_bush(); - Some(block) - } - fn potted_cactus_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_cactus(); - Some(block) - } - fn carrots_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::carrots(); - let age_0_7 = map.get("age")?; - let age_0_7 = { - let x = i32::from_str(age_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_7(age_0_7); - Some(block) - } - fn potatoes_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::potatoes(); - let age_0_7 = map.get("age")?; - let age_0_7 = { - let x = i32::from_str(age_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_7(age_0_7); - Some(block) - } - fn oak_button_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn spruce_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn birch_button_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn jungle_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn acacia_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn dark_oak_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn skeleton_skull_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::skeleton_skull(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn skeleton_wall_skull_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::skeleton_wall_skull(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn wither_skeleton_skull_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::wither_skeleton_skull(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn wither_skeleton_wall_skull_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::wither_skeleton_wall_skull(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn zombie_head_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::zombie_head(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn zombie_wall_head_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::zombie_wall_head(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn player_head_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::player_head(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn player_wall_head_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::player_wall_head(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn creeper_head_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::creeper_head(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn creeper_wall_head_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::creeper_wall_head(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn dragon_head_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dragon_head(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn dragon_wall_head_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dragon_wall_head(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn anvil_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::anvil(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn chipped_anvil_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chipped_anvil(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn damaged_anvil_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::damaged_anvil(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn trapped_chest_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::trapped_chest(); - let chest_kind = map.get("type")?; - let chest_kind = ChestKind::from_str(chest_kind).ok()?; - block.set_chest_kind(chest_kind); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn light_weighted_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_weighted_pressure_plate(); - let power = map.get("power")?; - let power = { - let x = i32::from_str(power).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_power(power); - Some(block) - } - fn heavy_weighted_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::heavy_weighted_pressure_plate(); - let power = map.get("power")?; - let power = { - let x = i32::from_str(power).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_power(power); - Some(block) - } - fn comparator_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::comparator(); - let comparator_mode = map.get("mode")?; - let comparator_mode = ComparatorMode::from_str(comparator_mode).ok()?; - block.set_comparator_mode(comparator_mode); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn daylight_detector_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::daylight_detector(); - let inverted = map.get("inverted")?; - let inverted = bool::from_str(inverted).ok()?; - block.set_inverted(inverted); - let power = map.get("power")?; - let power = { - let x = i32::from_str(power).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_power(power); - Some(block) - } - fn redstone_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::redstone_block(); - Some(block) - } - fn nether_quartz_ore_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_quartz_ore(); - Some(block) - } - fn hopper_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::hopper(); - let enabled = map.get("enabled")?; - let enabled = bool::from_str(enabled).ok()?; - block.set_enabled(enabled); - let facing_cardinal_and_down = map.get("facing")?; - let facing_cardinal_and_down = - FacingCardinalAndDown::from_str(facing_cardinal_and_down).ok()?; - block.set_facing_cardinal_and_down(facing_cardinal_and_down); - Some(block) - } - fn quartz_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::quartz_block(); - Some(block) - } - fn chiseled_quartz_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_quartz_block(); - Some(block) - } - fn quartz_pillar_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::quartz_pillar(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn quartz_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::quartz_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn activator_rail_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::activator_rail(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let powered_rail_shape = map.get("shape")?; - let powered_rail_shape = PoweredRailShape::from_str(powered_rail_shape).ok()?; - block.set_powered_rail_shape(powered_rail_shape); - Some(block) - } - fn dropper_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::dropper(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let triggered = map.get("triggered")?; - let triggered = bool::from_str(triggered).ok()?; - block.set_triggered(triggered); - Some(block) - } - fn white_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_terracotta(); - Some(block) - } - fn orange_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_terracotta(); - Some(block) - } - fn magenta_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_terracotta(); - Some(block) - } - fn light_blue_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_terracotta(); - Some(block) - } - fn yellow_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_terracotta(); - Some(block) - } - fn lime_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_terracotta(); - Some(block) - } - fn pink_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_terracotta(); - Some(block) - } - fn gray_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_terracotta(); - Some(block) - } - fn light_gray_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_terracotta(); - Some(block) - } - fn cyan_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_terracotta(); - Some(block) - } - fn purple_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_terracotta(); - Some(block) - } - fn blue_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_terracotta(); - Some(block) - } - fn brown_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_terracotta(); - Some(block) - } - fn green_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_terracotta(); - Some(block) - } - fn red_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_terracotta(); - Some(block) - } - fn black_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_terracotta(); - Some(block) - } - fn white_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn orange_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn magenta_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn light_blue_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn yellow_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn lime_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn pink_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn gray_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn light_gray_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn cyan_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn purple_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn blue_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn brown_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn green_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn red_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn black_stained_glass_pane_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_stained_glass_pane(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn acacia_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_oak_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn slime_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::slime_block(); - Some(block) - } - fn barrier_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::barrier(); - Some(block) - } - fn iron_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::iron_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn prismarine_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::prismarine(); - Some(block) - } - fn prismarine_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_bricks(); - Some(block) - } - fn dark_prismarine_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_prismarine(); - Some(block) - } - fn prismarine_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn prismarine_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_prismarine_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_prismarine_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn prismarine_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn prismarine_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_prismarine_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_prismarine_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn sea_lantern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sea_lantern(); - Some(block) - } - fn hay_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::hay_block(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn white_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::white_carpet(); - Some(block) - } - fn orange_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_carpet(); - Some(block) - } - fn magenta_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_carpet(); - Some(block) - } - fn light_blue_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_carpet(); - Some(block) - } - fn yellow_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_carpet(); - Some(block) - } - fn lime_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lime_carpet(); - Some(block) - } - fn pink_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pink_carpet(); - Some(block) - } - fn gray_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gray_carpet(); - Some(block) - } - fn light_gray_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_carpet(); - Some(block) - } - fn cyan_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cyan_carpet(); - Some(block) - } - fn purple_carpet_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_carpet(); - Some(block) - } - fn blue_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_carpet(); - Some(block) - } - fn brown_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brown_carpet(); - Some(block) - } - fn green_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::green_carpet(); - Some(block) - } - fn red_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_carpet(); - Some(block) - } - fn black_carpet_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::black_carpet(); - Some(block) - } - fn terracotta_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::terracotta(); - Some(block) - } - fn coal_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::coal_block(); - Some(block) - } - fn packed_ice_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::packed_ice(); - Some(block) - } - fn sunflower_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sunflower(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn lilac_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lilac(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn rose_bush_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::rose_bush(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn peony_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::peony(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn tall_grass_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::tall_grass(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn large_fern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::large_fern(); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - Some(block) - } - fn white_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::white_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn orange_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn magenta_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn light_blue_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn yellow_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn lime_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lime_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn pink_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::pink_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn gray_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::gray_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn light_gray_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn cyan_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cyan_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn purple_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn blue_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn brown_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brown_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn green_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::green_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn red_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn black_banner_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::black_banner(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - Some(block) - } - fn white_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn orange_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn magenta_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn light_blue_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn yellow_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn lime_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn pink_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn gray_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn light_gray_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn cyan_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn purple_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn blue_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn brown_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn green_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn red_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn black_wall_banner_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_wall_banner(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn red_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_sandstone(); - Some(block) - } - fn chiseled_red_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_red_sandstone(); - Some(block) - } - fn cut_red_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cut_red_sandstone(); - Some(block) - } - fn red_sandstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_sandstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn oak_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::oak_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn spruce_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn birch_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn jungle_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn acacia_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dark_oak_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn stone_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_stone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_stone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn cut_sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cut_sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn petrified_oak_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::petrified_oak_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn cobblestone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cobblestone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn brick_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn stone_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stone_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn nether_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn quartz_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::quartz_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn red_sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn cut_red_sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cut_red_sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn purpur_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::purpur_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_stone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::smooth_stone(); - Some(block) - } - fn smooth_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_sandstone(); - Some(block) - } - fn smooth_quartz_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_quartz(); - Some(block) - } - fn smooth_red_sandstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_red_sandstone(); - Some(block) - } - fn spruce_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::spruce_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn birch_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::birch_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn jungle_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::jungle_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn acacia_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::acacia_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn dark_oak_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn spruce_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn birch_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn jungle_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn acacia_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn dark_oak_fence_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn spruce_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::spruce_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn birch_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::birch_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn jungle_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jungle_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn acacia_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::acacia_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn dark_oak_door_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dark_oak_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn end_rod_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::end_rod(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn chorus_plant_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::chorus_plant(); - let down = map.get("down")?; - let down = bool::from_str(down).ok()?; - block.set_down(down); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn chorus_flower_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chorus_flower(); - let age_0_5 = map.get("age")?; - let age_0_5 = { - let x = i32::from_str(age_0_5).ok()?; - if !(0i32..=5i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_5(age_0_5); - Some(block) - } - fn purpur_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::purpur_block(); - Some(block) - } - fn purpur_pillar_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purpur_pillar(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn purpur_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purpur_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn end_stone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::end_stone_bricks(); - Some(block) - } - fn beetroots_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::beetroots(); - let age_0_3 = map.get("age")?; - let age_0_3 = { - let x = i32::from_str(age_0_3).ok()?; - if !(0i32..=3i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_3(age_0_3); - Some(block) - } - fn grass_path_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::grass_path(); - Some(block) - } - fn end_gateway_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::end_gateway(); - Some(block) - } - fn repeating_command_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::repeating_command_block(); - let conditional = map.get("conditional")?; - let conditional = bool::from_str(conditional).ok()?; - block.set_conditional(conditional); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn chain_command_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chain_command_block(); - let conditional = map.get("conditional")?; - let conditional = bool::from_str(conditional).ok()?; - block.set_conditional(conditional); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn frosted_ice_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::frosted_ice(); - let age_0_3 = map.get("age")?; - let age_0_3 = { - let x = i32::from_str(age_0_3).ok()?; - if !(0i32..=3i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_3(age_0_3); - Some(block) - } - fn magma_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::magma_block(); - Some(block) - } - fn nether_wart_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_wart_block(); - Some(block) - } - fn red_nether_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_nether_bricks(); - Some(block) - } - fn bone_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bone_block(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn structure_void_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::structure_void(); - Some(block) - } - fn observer_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::observer(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn shulker_box_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn white_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn orange_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn magenta_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn light_blue_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn yellow_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn lime_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn pink_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn gray_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn light_gray_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn cyan_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn purple_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn blue_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn brown_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn green_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn red_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn black_shulker_box_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_shulker_box(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - Some(block) - } - fn white_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn orange_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn magenta_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn light_blue_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn yellow_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn lime_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn pink_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn gray_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn light_gray_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn cyan_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn purple_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn blue_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn brown_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn green_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn red_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn black_glazed_terracotta_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_glazed_terracotta(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn white_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_concrete(); - Some(block) - } - fn orange_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_concrete(); - Some(block) - } - fn magenta_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_concrete(); - Some(block) - } - fn light_blue_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_concrete(); - Some(block) - } - fn yellow_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_concrete(); - Some(block) - } - fn lime_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_concrete(); - Some(block) - } - fn pink_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_concrete(); - Some(block) - } - fn gray_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_concrete(); - Some(block) - } - fn light_gray_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_concrete(); - Some(block) - } - fn cyan_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_concrete(); - Some(block) - } - fn purple_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_concrete(); - Some(block) - } - fn blue_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_concrete(); - Some(block) - } - fn brown_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_concrete(); - Some(block) - } - fn green_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_concrete(); - Some(block) - } - fn red_concrete_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::red_concrete(); - Some(block) - } - fn black_concrete_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_concrete(); - Some(block) - } - fn white_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::white_concrete_powder(); - Some(block) - } - fn orange_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::orange_concrete_powder(); - Some(block) - } - fn magenta_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::magenta_concrete_powder(); - Some(block) - } - fn light_blue_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_blue_concrete_powder(); - Some(block) - } - fn yellow_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::yellow_concrete_powder(); - Some(block) - } - fn lime_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::lime_concrete_powder(); - Some(block) - } - fn pink_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::pink_concrete_powder(); - Some(block) - } - fn gray_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gray_concrete_powder(); - Some(block) - } - fn light_gray_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::light_gray_concrete_powder(); - Some(block) - } - fn cyan_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cyan_concrete_powder(); - Some(block) - } - fn purple_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::purple_concrete_powder(); - Some(block) - } - fn blue_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blue_concrete_powder(); - Some(block) - } - fn brown_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brown_concrete_powder(); - Some(block) - } - fn green_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::green_concrete_powder(); - Some(block) - } - fn red_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_concrete_powder(); - Some(block) - } - fn black_concrete_powder_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::black_concrete_powder(); - Some(block) - } - fn kelp_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::kelp(); - let age_0_25 = map.get("age")?; - let age_0_25 = { - let x = i32::from_str(age_0_25).ok()?; - if !(0i32..=25i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_25(age_0_25); - Some(block) - } - fn kelp_plant_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::kelp_plant(); - Some(block) - } - fn dried_kelp_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dried_kelp_block(); - Some(block) - } - fn turtle_egg_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::turtle_egg(); - let eggs = map.get("eggs")?; - let eggs = { - let x = i32::from_str(eggs).ok()?; - if !(1i32..=4i32).contains(&x) { - return None; - } - x - }; - block.set_eggs(eggs); - let hatch = map.get("hatch")?; - let hatch = { - let x = i32::from_str(hatch).ok()?; - if !(0i32..=2i32).contains(&x) { - return None; - } - x - }; - block.set_hatch(hatch); - Some(block) - } - fn dead_tube_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_tube_coral_block(); - Some(block) - } - fn dead_brain_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_brain_coral_block(); - Some(block) - } - fn dead_bubble_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_bubble_coral_block(); - Some(block) - } - fn dead_fire_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_fire_coral_block(); - Some(block) - } - fn dead_horn_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_horn_coral_block(); - Some(block) - } - fn tube_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::tube_coral_block(); - Some(block) - } - fn brain_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brain_coral_block(); - Some(block) - } - fn bubble_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::bubble_coral_block(); - Some(block) - } - fn fire_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::fire_coral_block(); - Some(block) - } - fn horn_coral_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::horn_coral_block(); - Some(block) - } - fn dead_tube_coral_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_tube_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_brain_coral_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_brain_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_bubble_coral_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_bubble_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_fire_coral_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_fire_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_horn_coral_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_horn_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn tube_coral_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::tube_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn brain_coral_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brain_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn bubble_coral_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bubble_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn fire_coral_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::fire_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn horn_coral_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::horn_coral(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_tube_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_tube_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_brain_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_brain_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_bubble_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_bubble_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_fire_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_fire_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_horn_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_horn_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn tube_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::tube_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn brain_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brain_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn bubble_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::bubble_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn fire_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::fire_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn horn_coral_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::horn_coral_fan(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_tube_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_tube_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_brain_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_brain_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_bubble_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_bubble_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_fire_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_fire_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn dead_horn_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::dead_horn_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn tube_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::tube_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn brain_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::brain_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn bubble_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::bubble_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn fire_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::fire_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn horn_coral_wall_fan_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::horn_coral_wall_fan(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn sea_pickle_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::sea_pickle(); - let pickles = map.get("pickles")?; - let pickles = { - let x = i32::from_str(pickles).ok()?; - if !(1i32..=4i32).contains(&x) { - return None; - } - x - }; - block.set_pickles(pickles); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn blue_ice_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blue_ice(); - Some(block) - } - fn conduit_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::conduit(); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn bamboo_sapling_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::bamboo_sapling(); - Some(block) - } - fn bamboo_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bamboo(); - let age_0_1 = map.get("age")?; - let age_0_1 = { - let x = i32::from_str(age_0_1).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_1(age_0_1); - let leaves = map.get("leaves")?; - let leaves = Leaves::from_str(leaves).ok()?; - block.set_leaves(leaves); - let stage = map.get("stage")?; - let stage = { - let x = i32::from_str(stage).ok()?; - if !(0i32..=1i32).contains(&x) { - return None; - } - x - }; - block.set_stage(stage); - Some(block) - } - fn potted_bamboo_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_bamboo(); - Some(block) - } - fn void_air_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::void_air(); - Some(block) - } - fn cave_air_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::cave_air(); - Some(block) - } - fn bubble_column_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::bubble_column(); - let drag = map.get("drag")?; - let drag = bool::from_str(drag).ok()?; - block.set_drag(drag); - Some(block) - } - fn polished_granite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_granite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_red_sandstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_red_sandstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn mossy_stone_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_stone_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_diorite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_diorite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn mossy_cobblestone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_cobblestone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn end_stone_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::end_stone_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn stone_stairs_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_sandstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_sandstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_quartz_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_quartz_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn granite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::granite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn andesite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::andesite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn red_nether_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_nether_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_andesite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_andesite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn diorite_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::diorite_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_granite_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_granite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_red_sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_red_sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn mossy_stone_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_stone_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_diorite_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_diorite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn mossy_cobblestone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_cobblestone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn end_stone_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::end_stone_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_sandstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_sandstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn smooth_quartz_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smooth_quartz_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn granite_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::granite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn andesite_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::andesite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn red_nether_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_nether_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_andesite_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_andesite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn diorite_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::diorite_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn brick_wall_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn prismarine_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::prismarine_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn red_sandstone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_sandstone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn mossy_stone_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::mossy_stone_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn granite_wall_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::granite_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn stone_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stone_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn nether_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn andesite_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::andesite_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn red_nether_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::red_nether_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn sandstone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::sandstone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn end_stone_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::end_stone_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn diorite_wall_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::diorite_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn scaffolding_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::scaffolding(); - let bottom = map.get("bottom")?; - let bottom = bool::from_str(bottom).ok()?; - block.set_bottom(bottom); - let distance_0_7 = map.get("distance")?; - let distance_0_7 = { - let x = i32::from_str(distance_0_7).ok()?; - if !(0i32..=7i32).contains(&x) { - return None; - } - x - }; - block.set_distance_0_7(distance_0_7); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn loom_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::loom(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn barrel_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::barrel(); - let facing_cubic = map.get("facing")?; - let facing_cubic = FacingCubic::from_str(facing_cubic).ok()?; - block.set_facing_cubic(facing_cubic); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - Some(block) - } - fn smoker_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::smoker(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn blast_furnace_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blast_furnace(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - Some(block) - } - fn cartography_table_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cartography_table(); - Some(block) - } - fn fletching_table_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::fletching_table(); - Some(block) - } - fn grindstone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::grindstone(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn lectern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lectern(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let has_book = map.get("has_book")?; - let has_book = bool::from_str(has_book).ok()?; - block.set_has_book(has_book); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn smithing_table_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::smithing_table(); - Some(block) - } - fn stonecutter_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::stonecutter(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - Some(block) - } - fn bell_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bell(); - let attachment = map.get("attachment")?; - let attachment = Attachment::from_str(attachment).ok()?; - block.set_attachment(attachment); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn lantern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lantern(); - let hanging = map.get("hanging")?; - let hanging = bool::from_str(hanging).ok()?; - block.set_hanging(hanging); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn soul_lantern_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::soul_lantern(); - let hanging = map.get("hanging")?; - let hanging = bool::from_str(hanging).ok()?; - block.set_hanging(hanging); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn campfire_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::campfire(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - let signal_fire = map.get("signal_fire")?; - let signal_fire = bool::from_str(signal_fire).ok()?; - block.set_signal_fire(signal_fire); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn soul_campfire_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::soul_campfire(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let lit = map.get("lit")?; - let lit = bool::from_str(lit).ok()?; - block.set_lit(lit); - let signal_fire = map.get("signal_fire")?; - let signal_fire = bool::from_str(signal_fire).ok()?; - block.set_signal_fire(signal_fire); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn sweet_berry_bush_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::sweet_berry_bush(); - let age_0_3 = map.get("age")?; - let age_0_3 = { - let x = i32::from_str(age_0_3).ok()?; - if !(0i32..=3i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_3(age_0_3); - Some(block) - } - fn warped_stem_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_stem(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_warped_stem_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_warped_stem(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn warped_hyphae_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_hyphae(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_warped_hyphae_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_warped_hyphae(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn warped_nylium_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_nylium(); - Some(block) - } - fn warped_fungus_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_fungus(); - Some(block) - } - fn warped_wart_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_wart_block(); - Some(block) - } - fn warped_roots_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_roots(); - Some(block) - } - fn nether_sprouts_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::nether_sprouts(); - Some(block) - } - fn crimson_stem_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::crimson_stem(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_crimson_stem_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_crimson_stem(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn crimson_hyphae_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_hyphae(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn stripped_crimson_hyphae_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::stripped_crimson_hyphae(); - let axis_xyz = map.get("axis")?; - let axis_xyz = AxisXyz::from_str(axis_xyz).ok()?; - block.set_axis_xyz(axis_xyz); - Some(block) - } - fn crimson_nylium_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_nylium(); - Some(block) - } - fn crimson_fungus_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_fungus(); - Some(block) - } - fn shroomlight_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::shroomlight(); - Some(block) - } - fn weeping_vines_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::weeping_vines(); - let age_0_25 = map.get("age")?; - let age_0_25 = { - let x = i32::from_str(age_0_25).ok()?; - if !(0i32..=25i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_25(age_0_25); - Some(block) - } - fn weeping_vines_plant_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::weeping_vines_plant(); - Some(block) - } - fn twisting_vines_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::twisting_vines(); - let age_0_25 = map.get("age")?; - let age_0_25 = { - let x = i32::from_str(age_0_25).ok()?; - if !(0i32..=25i32).contains(&x) { - return None; - } - x - }; - block.set_age_0_25(age_0_25); - Some(block) - } - fn twisting_vines_plant_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::twisting_vines_plant(); - Some(block) - } - fn crimson_roots_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_roots(); - Some(block) - } - fn crimson_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_planks(); - Some(block) - } - fn warped_planks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_planks(); - Some(block) - } - fn crimson_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::crimson_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn warped_slab_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn crimson_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn warped_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn crimson_fence_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn warped_fence_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_fence(); - let east_connected = map.get("east")?; - let east_connected = bool::from_str(east_connected).ok()?; - block.set_east_connected(east_connected); - let north_connected = map.get("north")?; - let north_connected = bool::from_str(north_connected).ok()?; - block.set_north_connected(north_connected); - let south_connected = map.get("south")?; - let south_connected = bool::from_str(south_connected).ok()?; - block.set_south_connected(south_connected); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_connected = map.get("west")?; - let west_connected = bool::from_str(west_connected).ok()?; - block.set_west_connected(west_connected); - Some(block) - } - fn crimson_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn warped_trapdoor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_trapdoor(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn crimson_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn warped_fence_gate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_fence_gate(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let in_wall = map.get("in_wall")?; - let in_wall = bool::from_str(in_wall).ok()?; - block.set_in_wall(in_wall); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn crimson_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn warped_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn crimson_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn warped_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn crimson_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::crimson_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn warped_door_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_door(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_upper_lower = map.get("half")?; - let half_upper_lower = HalfUpperLower::from_str(half_upper_lower).ok()?; - block.set_half_upper_lower(half_upper_lower); - let hinge = map.get("hinge")?; - let hinge = Hinge::from_str(hinge).ok()?; - block.set_hinge(hinge); - let open = map.get("open")?; - let open = bool::from_str(open).ok()?; - block.set_open(open); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn crimson_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::crimson_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn warped_sign_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::warped_sign(); - let rotation = map.get("rotation")?; - let rotation = { - let x = i32::from_str(rotation).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_rotation(rotation); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn crimson_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crimson_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn warped_wall_sign_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::warped_wall_sign(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn structure_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::structure_block(); - let structure_block_mode = map.get("mode")?; - let structure_block_mode = StructureBlockMode::from_str(structure_block_mode).ok()?; - block.set_structure_block_mode(structure_block_mode); - Some(block) - } - fn jigsaw_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::jigsaw(); - let orientation = map.get("orientation")?; - let orientation = Orientation::from_str(orientation).ok()?; - block.set_orientation(orientation); - Some(block) - } - fn composter_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::composter(); - let level_0_8 = map.get("level")?; - let level_0_8 = { - let x = i32::from_str(level_0_8).ok()?; - if !(0i32..=8i32).contains(&x) { - return None; - } - x - }; - block.set_level_0_8(level_0_8); - Some(block) - } - fn target_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::target(); - let power = map.get("power")?; - let power = { - let x = i32::from_str(power).ok()?; - if !(0i32..=15i32).contains(&x) { - return None; - } - x - }; - block.set_power(power); - Some(block) - } - fn bee_nest_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::bee_nest(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let honey_level = map.get("honey_level")?; - let honey_level = { - let x = i32::from_str(honey_level).ok()?; - if !(0i32..=5i32).contains(&x) { - return None; - } - x - }; - block.set_honey_level(honey_level); - Some(block) - } - fn beehive_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::beehive(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let honey_level = map.get("honey_level")?; - let honey_level = { - let x = i32::from_str(honey_level).ok()?; - if !(0i32..=5i32).contains(&x) { - return None; - } - x - }; - block.set_honey_level(honey_level); - Some(block) - } - fn honey_block_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::honey_block(); - Some(block) - } - fn honeycomb_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::honeycomb_block(); - Some(block) - } - fn netherite_block_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::netherite_block(); - Some(block) - } - fn ancient_debris_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::ancient_debris(); - Some(block) - } - fn crying_obsidian_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::crying_obsidian(); - Some(block) - } - fn respawn_anchor_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::respawn_anchor(); - let charges = map.get("charges")?; - let charges = { - let x = i32::from_str(charges).ok()?; - if !(0i32..=4i32).contains(&x) { - return None; - } - x - }; - block.set_charges(charges); - Some(block) - } - fn potted_crimson_fungus_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_crimson_fungus(); - Some(block) - } - fn potted_warped_fungus_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_warped_fungus(); - Some(block) - } - fn potted_crimson_roots_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_crimson_roots(); - Some(block) - } - fn potted_warped_roots_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::potted_warped_roots(); - Some(block) - } - fn lodestone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::lodestone(); - Some(block) - } - fn blackstone_from_identifier_and_properties(map: &BTreeMap) -> Option { - let mut block = BlockId::blackstone(); - Some(block) - } - fn blackstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blackstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn blackstone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blackstone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn blackstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::blackstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_blackstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone(); - Some(block) - } - fn polished_blackstone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_bricks(); - Some(block) - } - fn cracked_polished_blackstone_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cracked_polished_blackstone_bricks(); - Some(block) - } - fn chiseled_polished_blackstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_polished_blackstone(); - Some(block) - } - fn polished_blackstone_brick_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_brick_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_blackstone_brick_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_brick_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_blackstone_brick_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_brick_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn gilded_blackstone_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::gilded_blackstone(); - Some(block) - } - fn polished_blackstone_stairs_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_stairs(); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let half_top_bottom = map.get("half")?; - let half_top_bottom = HalfTopBottom::from_str(half_top_bottom).ok()?; - block.set_half_top_bottom(half_top_bottom); - let stairs_shape = map.get("shape")?; - let stairs_shape = StairsShape::from_str(stairs_shape).ok()?; - block.set_stairs_shape(stairs_shape); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_blackstone_slab_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_slab(); - let slab_kind = map.get("type")?; - let slab_kind = SlabKind::from_str(slab_kind).ok()?; - block.set_slab_kind(slab_kind); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - Some(block) - } - fn polished_blackstone_pressure_plate_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_pressure_plate(); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn polished_blackstone_button_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_button(); - let face = map.get("face")?; - let face = Face::from_str(face).ok()?; - block.set_face(face); - let facing_cardinal = map.get("facing")?; - let facing_cardinal = FacingCardinal::from_str(facing_cardinal).ok()?; - block.set_facing_cardinal(facing_cardinal); - let powered = map.get("powered")?; - let powered = bool::from_str(powered).ok()?; - block.set_powered(powered); - Some(block) - } - fn polished_blackstone_wall_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::polished_blackstone_wall(); - let east_nlt = map.get("east")?; - let east_nlt = EastNlt::from_str(east_nlt).ok()?; - block.set_east_nlt(east_nlt); - let north_nlt = map.get("north")?; - let north_nlt = NorthNlt::from_str(north_nlt).ok()?; - block.set_north_nlt(north_nlt); - let south_nlt = map.get("south")?; - let south_nlt = SouthNlt::from_str(south_nlt).ok()?; - block.set_south_nlt(south_nlt); - let up = map.get("up")?; - let up = bool::from_str(up).ok()?; - block.set_up(up); - let waterlogged = map.get("waterlogged")?; - let waterlogged = bool::from_str(waterlogged).ok()?; - block.set_waterlogged(waterlogged); - let west_nlt = map.get("west")?; - let west_nlt = WestNlt::from_str(west_nlt).ok()?; - block.set_west_nlt(west_nlt); - Some(block) - } - fn chiseled_nether_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::chiseled_nether_bricks(); - Some(block) - } - fn cracked_nether_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::cracked_nether_bricks(); - Some(block) - } - fn quartz_bricks_from_identifier_and_properties( - map: &BTreeMap, - ) -> Option { - let mut block = BlockId::quartz_bricks(); - Some(block) - } - #[doc = "Attempts to convert a block identifier to a block with default property values."] - pub fn from_identifier(identifier: &str) -> Option { - match identifier { - "minecraft:air" => Some(Self::air()), - "minecraft:stone" => Some(Self::stone()), - "minecraft:granite" => Some(Self::granite()), - "minecraft:polished_granite" => Some(Self::polished_granite()), - "minecraft:diorite" => Some(Self::diorite()), - "minecraft:polished_diorite" => Some(Self::polished_diorite()), - "minecraft:andesite" => Some(Self::andesite()), - "minecraft:polished_andesite" => Some(Self::polished_andesite()), - "minecraft:grass_block" => Some(Self::grass_block()), - "minecraft:dirt" => Some(Self::dirt()), - "minecraft:coarse_dirt" => Some(Self::coarse_dirt()), - "minecraft:podzol" => Some(Self::podzol()), - "minecraft:cobblestone" => Some(Self::cobblestone()), - "minecraft:oak_planks" => Some(Self::oak_planks()), - "minecraft:spruce_planks" => Some(Self::spruce_planks()), - "minecraft:birch_planks" => Some(Self::birch_planks()), - "minecraft:jungle_planks" => Some(Self::jungle_planks()), - "minecraft:acacia_planks" => Some(Self::acacia_planks()), - "minecraft:dark_oak_planks" => Some(Self::dark_oak_planks()), - "minecraft:oak_sapling" => Some(Self::oak_sapling()), - "minecraft:spruce_sapling" => Some(Self::spruce_sapling()), - "minecraft:birch_sapling" => Some(Self::birch_sapling()), - "minecraft:jungle_sapling" => Some(Self::jungle_sapling()), - "minecraft:acacia_sapling" => Some(Self::acacia_sapling()), - "minecraft:dark_oak_sapling" => Some(Self::dark_oak_sapling()), - "minecraft:bedrock" => Some(Self::bedrock()), - "minecraft:water" => Some(Self::water()), - "minecraft:lava" => Some(Self::lava()), - "minecraft:sand" => Some(Self::sand()), - "minecraft:red_sand" => Some(Self::red_sand()), - "minecraft:gravel" => Some(Self::gravel()), - "minecraft:gold_ore" => Some(Self::gold_ore()), - "minecraft:iron_ore" => Some(Self::iron_ore()), - "minecraft:coal_ore" => Some(Self::coal_ore()), - "minecraft:nether_gold_ore" => Some(Self::nether_gold_ore()), - "minecraft:oak_log" => Some(Self::oak_log()), - "minecraft:spruce_log" => Some(Self::spruce_log()), - "minecraft:birch_log" => Some(Self::birch_log()), - "minecraft:jungle_log" => Some(Self::jungle_log()), - "minecraft:acacia_log" => Some(Self::acacia_log()), - "minecraft:dark_oak_log" => Some(Self::dark_oak_log()), - "minecraft:stripped_spruce_log" => Some(Self::stripped_spruce_log()), - "minecraft:stripped_birch_log" => Some(Self::stripped_birch_log()), - "minecraft:stripped_jungle_log" => Some(Self::stripped_jungle_log()), - "minecraft:stripped_acacia_log" => Some(Self::stripped_acacia_log()), - "minecraft:stripped_dark_oak_log" => Some(Self::stripped_dark_oak_log()), - "minecraft:stripped_oak_log" => Some(Self::stripped_oak_log()), - "minecraft:oak_wood" => Some(Self::oak_wood()), - "minecraft:spruce_wood" => Some(Self::spruce_wood()), - "minecraft:birch_wood" => Some(Self::birch_wood()), - "minecraft:jungle_wood" => Some(Self::jungle_wood()), - "minecraft:acacia_wood" => Some(Self::acacia_wood()), - "minecraft:dark_oak_wood" => Some(Self::dark_oak_wood()), - "minecraft:stripped_oak_wood" => Some(Self::stripped_oak_wood()), - "minecraft:stripped_spruce_wood" => Some(Self::stripped_spruce_wood()), - "minecraft:stripped_birch_wood" => Some(Self::stripped_birch_wood()), - "minecraft:stripped_jungle_wood" => Some(Self::stripped_jungle_wood()), - "minecraft:stripped_acacia_wood" => Some(Self::stripped_acacia_wood()), - "minecraft:stripped_dark_oak_wood" => Some(Self::stripped_dark_oak_wood()), - "minecraft:oak_leaves" => Some(Self::oak_leaves()), - "minecraft:spruce_leaves" => Some(Self::spruce_leaves()), - "minecraft:birch_leaves" => Some(Self::birch_leaves()), - "minecraft:jungle_leaves" => Some(Self::jungle_leaves()), - "minecraft:acacia_leaves" => Some(Self::acacia_leaves()), - "minecraft:dark_oak_leaves" => Some(Self::dark_oak_leaves()), - "minecraft:sponge" => Some(Self::sponge()), - "minecraft:wet_sponge" => Some(Self::wet_sponge()), - "minecraft:glass" => Some(Self::glass()), - "minecraft:lapis_ore" => Some(Self::lapis_ore()), - "minecraft:lapis_block" => Some(Self::lapis_block()), - "minecraft:dispenser" => Some(Self::dispenser()), - "minecraft:sandstone" => Some(Self::sandstone()), - "minecraft:chiseled_sandstone" => Some(Self::chiseled_sandstone()), - "minecraft:cut_sandstone" => Some(Self::cut_sandstone()), - "minecraft:note_block" => Some(Self::note_block()), - "minecraft:white_bed" => Some(Self::white_bed()), - "minecraft:orange_bed" => Some(Self::orange_bed()), - "minecraft:magenta_bed" => Some(Self::magenta_bed()), - "minecraft:light_blue_bed" => Some(Self::light_blue_bed()), - "minecraft:yellow_bed" => Some(Self::yellow_bed()), - "minecraft:lime_bed" => Some(Self::lime_bed()), - "minecraft:pink_bed" => Some(Self::pink_bed()), - "minecraft:gray_bed" => Some(Self::gray_bed()), - "minecraft:light_gray_bed" => Some(Self::light_gray_bed()), - "minecraft:cyan_bed" => Some(Self::cyan_bed()), - "minecraft:purple_bed" => Some(Self::purple_bed()), - "minecraft:blue_bed" => Some(Self::blue_bed()), - "minecraft:brown_bed" => Some(Self::brown_bed()), - "minecraft:green_bed" => Some(Self::green_bed()), - "minecraft:red_bed" => Some(Self::red_bed()), - "minecraft:black_bed" => Some(Self::black_bed()), - "minecraft:powered_rail" => Some(Self::powered_rail()), - "minecraft:detector_rail" => Some(Self::detector_rail()), - "minecraft:sticky_piston" => Some(Self::sticky_piston()), - "minecraft:cobweb" => Some(Self::cobweb()), - "minecraft:grass" => Some(Self::grass()), - "minecraft:fern" => Some(Self::fern()), - "minecraft:dead_bush" => Some(Self::dead_bush()), - "minecraft:seagrass" => Some(Self::seagrass()), - "minecraft:tall_seagrass" => Some(Self::tall_seagrass()), - "minecraft:piston" => Some(Self::piston()), - "minecraft:piston_head" => Some(Self::piston_head()), - "minecraft:white_wool" => Some(Self::white_wool()), - "minecraft:orange_wool" => Some(Self::orange_wool()), - "minecraft:magenta_wool" => Some(Self::magenta_wool()), - "minecraft:light_blue_wool" => Some(Self::light_blue_wool()), - "minecraft:yellow_wool" => Some(Self::yellow_wool()), - "minecraft:lime_wool" => Some(Self::lime_wool()), - "minecraft:pink_wool" => Some(Self::pink_wool()), - "minecraft:gray_wool" => Some(Self::gray_wool()), - "minecraft:light_gray_wool" => Some(Self::light_gray_wool()), - "minecraft:cyan_wool" => Some(Self::cyan_wool()), - "minecraft:purple_wool" => Some(Self::purple_wool()), - "minecraft:blue_wool" => Some(Self::blue_wool()), - "minecraft:brown_wool" => Some(Self::brown_wool()), - "minecraft:green_wool" => Some(Self::green_wool()), - "minecraft:red_wool" => Some(Self::red_wool()), - "minecraft:black_wool" => Some(Self::black_wool()), - "minecraft:moving_piston" => Some(Self::moving_piston()), - "minecraft:dandelion" => Some(Self::dandelion()), - "minecraft:poppy" => Some(Self::poppy()), - "minecraft:blue_orchid" => Some(Self::blue_orchid()), - "minecraft:allium" => Some(Self::allium()), - "minecraft:azure_bluet" => Some(Self::azure_bluet()), - "minecraft:red_tulip" => Some(Self::red_tulip()), - "minecraft:orange_tulip" => Some(Self::orange_tulip()), - "minecraft:white_tulip" => Some(Self::white_tulip()), - "minecraft:pink_tulip" => Some(Self::pink_tulip()), - "minecraft:oxeye_daisy" => Some(Self::oxeye_daisy()), - "minecraft:cornflower" => Some(Self::cornflower()), - "minecraft:wither_rose" => Some(Self::wither_rose()), - "minecraft:lily_of_the_valley" => Some(Self::lily_of_the_valley()), - "minecraft:brown_mushroom" => Some(Self::brown_mushroom()), - "minecraft:red_mushroom" => Some(Self::red_mushroom()), - "minecraft:gold_block" => Some(Self::gold_block()), - "minecraft:iron_block" => Some(Self::iron_block()), - "minecraft:bricks" => Some(Self::bricks()), - "minecraft:tnt" => Some(Self::tnt()), - "minecraft:bookshelf" => Some(Self::bookshelf()), - "minecraft:mossy_cobblestone" => Some(Self::mossy_cobblestone()), - "minecraft:obsidian" => Some(Self::obsidian()), - "minecraft:torch" => Some(Self::torch()), - "minecraft:wall_torch" => Some(Self::wall_torch()), - "minecraft:fire" => Some(Self::fire()), - "minecraft:soul_fire" => Some(Self::soul_fire()), - "minecraft:spawner" => Some(Self::spawner()), - "minecraft:oak_stairs" => Some(Self::oak_stairs()), - "minecraft:chest" => Some(Self::chest()), - "minecraft:redstone_wire" => Some(Self::redstone_wire()), - "minecraft:diamond_ore" => Some(Self::diamond_ore()), - "minecraft:diamond_block" => Some(Self::diamond_block()), - "minecraft:crafting_table" => Some(Self::crafting_table()), - "minecraft:wheat" => Some(Self::wheat()), - "minecraft:farmland" => Some(Self::farmland()), - "minecraft:furnace" => Some(Self::furnace()), - "minecraft:oak_sign" => Some(Self::oak_sign()), - "minecraft:spruce_sign" => Some(Self::spruce_sign()), - "minecraft:birch_sign" => Some(Self::birch_sign()), - "minecraft:acacia_sign" => Some(Self::acacia_sign()), - "minecraft:jungle_sign" => Some(Self::jungle_sign()), - "minecraft:dark_oak_sign" => Some(Self::dark_oak_sign()), - "minecraft:oak_door" => Some(Self::oak_door()), - "minecraft:ladder" => Some(Self::ladder()), - "minecraft:rail" => Some(Self::rail()), - "minecraft:cobblestone_stairs" => Some(Self::cobblestone_stairs()), - "minecraft:oak_wall_sign" => Some(Self::oak_wall_sign()), - "minecraft:spruce_wall_sign" => Some(Self::spruce_wall_sign()), - "minecraft:birch_wall_sign" => Some(Self::birch_wall_sign()), - "minecraft:acacia_wall_sign" => Some(Self::acacia_wall_sign()), - "minecraft:jungle_wall_sign" => Some(Self::jungle_wall_sign()), - "minecraft:dark_oak_wall_sign" => Some(Self::dark_oak_wall_sign()), - "minecraft:lever" => Some(Self::lever()), - "minecraft:stone_pressure_plate" => Some(Self::stone_pressure_plate()), - "minecraft:iron_door" => Some(Self::iron_door()), - "minecraft:oak_pressure_plate" => Some(Self::oak_pressure_plate()), - "minecraft:spruce_pressure_plate" => Some(Self::spruce_pressure_plate()), - "minecraft:birch_pressure_plate" => Some(Self::birch_pressure_plate()), - "minecraft:jungle_pressure_plate" => Some(Self::jungle_pressure_plate()), - "minecraft:acacia_pressure_plate" => Some(Self::acacia_pressure_plate()), - "minecraft:dark_oak_pressure_plate" => Some(Self::dark_oak_pressure_plate()), - "minecraft:redstone_ore" => Some(Self::redstone_ore()), - "minecraft:redstone_torch" => Some(Self::redstone_torch()), - "minecraft:redstone_wall_torch" => Some(Self::redstone_wall_torch()), - "minecraft:stone_button" => Some(Self::stone_button()), - "minecraft:snow" => Some(Self::snow()), - "minecraft:ice" => Some(Self::ice()), - "minecraft:snow_block" => Some(Self::snow_block()), - "minecraft:cactus" => Some(Self::cactus()), - "minecraft:clay" => Some(Self::clay()), - "minecraft:sugar_cane" => Some(Self::sugar_cane()), - "minecraft:jukebox" => Some(Self::jukebox()), - "minecraft:oak_fence" => Some(Self::oak_fence()), - "minecraft:pumpkin" => Some(Self::pumpkin()), - "minecraft:netherrack" => Some(Self::netherrack()), - "minecraft:soul_sand" => Some(Self::soul_sand()), - "minecraft:soul_soil" => Some(Self::soul_soil()), - "minecraft:basalt" => Some(Self::basalt()), - "minecraft:polished_basalt" => Some(Self::polished_basalt()), - "minecraft:soul_torch" => Some(Self::soul_torch()), - "minecraft:soul_wall_torch" => Some(Self::soul_wall_torch()), - "minecraft:glowstone" => Some(Self::glowstone()), - "minecraft:nether_portal" => Some(Self::nether_portal()), - "minecraft:carved_pumpkin" => Some(Self::carved_pumpkin()), - "minecraft:jack_o_lantern" => Some(Self::jack_o_lantern()), - "minecraft:cake" => Some(Self::cake()), - "minecraft:repeater" => Some(Self::repeater()), - "minecraft:white_stained_glass" => Some(Self::white_stained_glass()), - "minecraft:orange_stained_glass" => Some(Self::orange_stained_glass()), - "minecraft:magenta_stained_glass" => Some(Self::magenta_stained_glass()), - "minecraft:light_blue_stained_glass" => Some(Self::light_blue_stained_glass()), - "minecraft:yellow_stained_glass" => Some(Self::yellow_stained_glass()), - "minecraft:lime_stained_glass" => Some(Self::lime_stained_glass()), - "minecraft:pink_stained_glass" => Some(Self::pink_stained_glass()), - "minecraft:gray_stained_glass" => Some(Self::gray_stained_glass()), - "minecraft:light_gray_stained_glass" => Some(Self::light_gray_stained_glass()), - "minecraft:cyan_stained_glass" => Some(Self::cyan_stained_glass()), - "minecraft:purple_stained_glass" => Some(Self::purple_stained_glass()), - "minecraft:blue_stained_glass" => Some(Self::blue_stained_glass()), - "minecraft:brown_stained_glass" => Some(Self::brown_stained_glass()), - "minecraft:green_stained_glass" => Some(Self::green_stained_glass()), - "minecraft:red_stained_glass" => Some(Self::red_stained_glass()), - "minecraft:black_stained_glass" => Some(Self::black_stained_glass()), - "minecraft:oak_trapdoor" => Some(Self::oak_trapdoor()), - "minecraft:spruce_trapdoor" => Some(Self::spruce_trapdoor()), - "minecraft:birch_trapdoor" => Some(Self::birch_trapdoor()), - "minecraft:jungle_trapdoor" => Some(Self::jungle_trapdoor()), - "minecraft:acacia_trapdoor" => Some(Self::acacia_trapdoor()), - "minecraft:dark_oak_trapdoor" => Some(Self::dark_oak_trapdoor()), - "minecraft:stone_bricks" => Some(Self::stone_bricks()), - "minecraft:mossy_stone_bricks" => Some(Self::mossy_stone_bricks()), - "minecraft:cracked_stone_bricks" => Some(Self::cracked_stone_bricks()), - "minecraft:chiseled_stone_bricks" => Some(Self::chiseled_stone_bricks()), - "minecraft:infested_stone" => Some(Self::infested_stone()), - "minecraft:infested_cobblestone" => Some(Self::infested_cobblestone()), - "minecraft:infested_stone_bricks" => Some(Self::infested_stone_bricks()), - "minecraft:infested_mossy_stone_bricks" => Some(Self::infested_mossy_stone_bricks()), - "minecraft:infested_cracked_stone_bricks" => { - Some(Self::infested_cracked_stone_bricks()) - } - "minecraft:infested_chiseled_stone_bricks" => { - Some(Self::infested_chiseled_stone_bricks()) - } - "minecraft:brown_mushroom_block" => Some(Self::brown_mushroom_block()), - "minecraft:red_mushroom_block" => Some(Self::red_mushroom_block()), - "minecraft:mushroom_stem" => Some(Self::mushroom_stem()), - "minecraft:iron_bars" => Some(Self::iron_bars()), - "minecraft:chain" => Some(Self::chain()), - "minecraft:glass_pane" => Some(Self::glass_pane()), - "minecraft:melon" => Some(Self::melon()), - "minecraft:attached_pumpkin_stem" => Some(Self::attached_pumpkin_stem()), - "minecraft:attached_melon_stem" => Some(Self::attached_melon_stem()), - "minecraft:pumpkin_stem" => Some(Self::pumpkin_stem()), - "minecraft:melon_stem" => Some(Self::melon_stem()), - "minecraft:vine" => Some(Self::vine()), - "minecraft:oak_fence_gate" => Some(Self::oak_fence_gate()), - "minecraft:brick_stairs" => Some(Self::brick_stairs()), - "minecraft:stone_brick_stairs" => Some(Self::stone_brick_stairs()), - "minecraft:mycelium" => Some(Self::mycelium()), - "minecraft:lily_pad" => Some(Self::lily_pad()), - "minecraft:nether_bricks" => Some(Self::nether_bricks()), - "minecraft:nether_brick_fence" => Some(Self::nether_brick_fence()), - "minecraft:nether_brick_stairs" => Some(Self::nether_brick_stairs()), - "minecraft:nether_wart" => Some(Self::nether_wart()), - "minecraft:enchanting_table" => Some(Self::enchanting_table()), - "minecraft:brewing_stand" => Some(Self::brewing_stand()), - "minecraft:cauldron" => Some(Self::cauldron()), - "minecraft:end_portal" => Some(Self::end_portal()), - "minecraft:end_portal_frame" => Some(Self::end_portal_frame()), - "minecraft:end_stone" => Some(Self::end_stone()), - "minecraft:dragon_egg" => Some(Self::dragon_egg()), - "minecraft:redstone_lamp" => Some(Self::redstone_lamp()), - "minecraft:cocoa" => Some(Self::cocoa()), - "minecraft:sandstone_stairs" => Some(Self::sandstone_stairs()), - "minecraft:emerald_ore" => Some(Self::emerald_ore()), - "minecraft:ender_chest" => Some(Self::ender_chest()), - "minecraft:tripwire_hook" => Some(Self::tripwire_hook()), - "minecraft:tripwire" => Some(Self::tripwire()), - "minecraft:emerald_block" => Some(Self::emerald_block()), - "minecraft:spruce_stairs" => Some(Self::spruce_stairs()), - "minecraft:birch_stairs" => Some(Self::birch_stairs()), - "minecraft:jungle_stairs" => Some(Self::jungle_stairs()), - "minecraft:command_block" => Some(Self::command_block()), - "minecraft:beacon" => Some(Self::beacon()), - "minecraft:cobblestone_wall" => Some(Self::cobblestone_wall()), - "minecraft:mossy_cobblestone_wall" => Some(Self::mossy_cobblestone_wall()), - "minecraft:flower_pot" => Some(Self::flower_pot()), - "minecraft:potted_oak_sapling" => Some(Self::potted_oak_sapling()), - "minecraft:potted_spruce_sapling" => Some(Self::potted_spruce_sapling()), - "minecraft:potted_birch_sapling" => Some(Self::potted_birch_sapling()), - "minecraft:potted_jungle_sapling" => Some(Self::potted_jungle_sapling()), - "minecraft:potted_acacia_sapling" => Some(Self::potted_acacia_sapling()), - "minecraft:potted_dark_oak_sapling" => Some(Self::potted_dark_oak_sapling()), - "minecraft:potted_fern" => Some(Self::potted_fern()), - "minecraft:potted_dandelion" => Some(Self::potted_dandelion()), - "minecraft:potted_poppy" => Some(Self::potted_poppy()), - "minecraft:potted_blue_orchid" => Some(Self::potted_blue_orchid()), - "minecraft:potted_allium" => Some(Self::potted_allium()), - "minecraft:potted_azure_bluet" => Some(Self::potted_azure_bluet()), - "minecraft:potted_red_tulip" => Some(Self::potted_red_tulip()), - "minecraft:potted_orange_tulip" => Some(Self::potted_orange_tulip()), - "minecraft:potted_white_tulip" => Some(Self::potted_white_tulip()), - "minecraft:potted_pink_tulip" => Some(Self::potted_pink_tulip()), - "minecraft:potted_oxeye_daisy" => Some(Self::potted_oxeye_daisy()), - "minecraft:potted_cornflower" => Some(Self::potted_cornflower()), - "minecraft:potted_lily_of_the_valley" => Some(Self::potted_lily_of_the_valley()), - "minecraft:potted_wither_rose" => Some(Self::potted_wither_rose()), - "minecraft:potted_red_mushroom" => Some(Self::potted_red_mushroom()), - "minecraft:potted_brown_mushroom" => Some(Self::potted_brown_mushroom()), - "minecraft:potted_dead_bush" => Some(Self::potted_dead_bush()), - "minecraft:potted_cactus" => Some(Self::potted_cactus()), - "minecraft:carrots" => Some(Self::carrots()), - "minecraft:potatoes" => Some(Self::potatoes()), - "minecraft:oak_button" => Some(Self::oak_button()), - "minecraft:spruce_button" => Some(Self::spruce_button()), - "minecraft:birch_button" => Some(Self::birch_button()), - "minecraft:jungle_button" => Some(Self::jungle_button()), - "minecraft:acacia_button" => Some(Self::acacia_button()), - "minecraft:dark_oak_button" => Some(Self::dark_oak_button()), - "minecraft:skeleton_skull" => Some(Self::skeleton_skull()), - "minecraft:skeleton_wall_skull" => Some(Self::skeleton_wall_skull()), - "minecraft:wither_skeleton_skull" => Some(Self::wither_skeleton_skull()), - "minecraft:wither_skeleton_wall_skull" => Some(Self::wither_skeleton_wall_skull()), - "minecraft:zombie_head" => Some(Self::zombie_head()), - "minecraft:zombie_wall_head" => Some(Self::zombie_wall_head()), - "minecraft:player_head" => Some(Self::player_head()), - "minecraft:player_wall_head" => Some(Self::player_wall_head()), - "minecraft:creeper_head" => Some(Self::creeper_head()), - "minecraft:creeper_wall_head" => Some(Self::creeper_wall_head()), - "minecraft:dragon_head" => Some(Self::dragon_head()), - "minecraft:dragon_wall_head" => Some(Self::dragon_wall_head()), - "minecraft:anvil" => Some(Self::anvil()), - "minecraft:chipped_anvil" => Some(Self::chipped_anvil()), - "minecraft:damaged_anvil" => Some(Self::damaged_anvil()), - "minecraft:trapped_chest" => Some(Self::trapped_chest()), - "minecraft:light_weighted_pressure_plate" => { - Some(Self::light_weighted_pressure_plate()) - } - "minecraft:heavy_weighted_pressure_plate" => { - Some(Self::heavy_weighted_pressure_plate()) - } - "minecraft:comparator" => Some(Self::comparator()), - "minecraft:daylight_detector" => Some(Self::daylight_detector()), - "minecraft:redstone_block" => Some(Self::redstone_block()), - "minecraft:nether_quartz_ore" => Some(Self::nether_quartz_ore()), - "minecraft:hopper" => Some(Self::hopper()), - "minecraft:quartz_block" => Some(Self::quartz_block()), - "minecraft:chiseled_quartz_block" => Some(Self::chiseled_quartz_block()), - "minecraft:quartz_pillar" => Some(Self::quartz_pillar()), - "minecraft:quartz_stairs" => Some(Self::quartz_stairs()), - "minecraft:activator_rail" => Some(Self::activator_rail()), - "minecraft:dropper" => Some(Self::dropper()), - "minecraft:white_terracotta" => Some(Self::white_terracotta()), - "minecraft:orange_terracotta" => Some(Self::orange_terracotta()), - "minecraft:magenta_terracotta" => Some(Self::magenta_terracotta()), - "minecraft:light_blue_terracotta" => Some(Self::light_blue_terracotta()), - "minecraft:yellow_terracotta" => Some(Self::yellow_terracotta()), - "minecraft:lime_terracotta" => Some(Self::lime_terracotta()), - "minecraft:pink_terracotta" => Some(Self::pink_terracotta()), - "minecraft:gray_terracotta" => Some(Self::gray_terracotta()), - "minecraft:light_gray_terracotta" => Some(Self::light_gray_terracotta()), - "minecraft:cyan_terracotta" => Some(Self::cyan_terracotta()), - "minecraft:purple_terracotta" => Some(Self::purple_terracotta()), - "minecraft:blue_terracotta" => Some(Self::blue_terracotta()), - "minecraft:brown_terracotta" => Some(Self::brown_terracotta()), - "minecraft:green_terracotta" => Some(Self::green_terracotta()), - "minecraft:red_terracotta" => Some(Self::red_terracotta()), - "minecraft:black_terracotta" => Some(Self::black_terracotta()), - "minecraft:white_stained_glass_pane" => Some(Self::white_stained_glass_pane()), - "minecraft:orange_stained_glass_pane" => Some(Self::orange_stained_glass_pane()), - "minecraft:magenta_stained_glass_pane" => Some(Self::magenta_stained_glass_pane()), - "minecraft:light_blue_stained_glass_pane" => { - Some(Self::light_blue_stained_glass_pane()) - } - "minecraft:yellow_stained_glass_pane" => Some(Self::yellow_stained_glass_pane()), - "minecraft:lime_stained_glass_pane" => Some(Self::lime_stained_glass_pane()), - "minecraft:pink_stained_glass_pane" => Some(Self::pink_stained_glass_pane()), - "minecraft:gray_stained_glass_pane" => Some(Self::gray_stained_glass_pane()), - "minecraft:light_gray_stained_glass_pane" => { - Some(Self::light_gray_stained_glass_pane()) - } - "minecraft:cyan_stained_glass_pane" => Some(Self::cyan_stained_glass_pane()), - "minecraft:purple_stained_glass_pane" => Some(Self::purple_stained_glass_pane()), - "minecraft:blue_stained_glass_pane" => Some(Self::blue_stained_glass_pane()), - "minecraft:brown_stained_glass_pane" => Some(Self::brown_stained_glass_pane()), - "minecraft:green_stained_glass_pane" => Some(Self::green_stained_glass_pane()), - "minecraft:red_stained_glass_pane" => Some(Self::red_stained_glass_pane()), - "minecraft:black_stained_glass_pane" => Some(Self::black_stained_glass_pane()), - "minecraft:acacia_stairs" => Some(Self::acacia_stairs()), - "minecraft:dark_oak_stairs" => Some(Self::dark_oak_stairs()), - "minecraft:slime_block" => Some(Self::slime_block()), - "minecraft:barrier" => Some(Self::barrier()), - "minecraft:iron_trapdoor" => Some(Self::iron_trapdoor()), - "minecraft:prismarine" => Some(Self::prismarine()), - "minecraft:prismarine_bricks" => Some(Self::prismarine_bricks()), - "minecraft:dark_prismarine" => Some(Self::dark_prismarine()), - "minecraft:prismarine_stairs" => Some(Self::prismarine_stairs()), - "minecraft:prismarine_brick_stairs" => Some(Self::prismarine_brick_stairs()), - "minecraft:dark_prismarine_stairs" => Some(Self::dark_prismarine_stairs()), - "minecraft:prismarine_slab" => Some(Self::prismarine_slab()), - "minecraft:prismarine_brick_slab" => Some(Self::prismarine_brick_slab()), - "minecraft:dark_prismarine_slab" => Some(Self::dark_prismarine_slab()), - "minecraft:sea_lantern" => Some(Self::sea_lantern()), - "minecraft:hay_block" => Some(Self::hay_block()), - "minecraft:white_carpet" => Some(Self::white_carpet()), - "minecraft:orange_carpet" => Some(Self::orange_carpet()), - "minecraft:magenta_carpet" => Some(Self::magenta_carpet()), - "minecraft:light_blue_carpet" => Some(Self::light_blue_carpet()), - "minecraft:yellow_carpet" => Some(Self::yellow_carpet()), - "minecraft:lime_carpet" => Some(Self::lime_carpet()), - "minecraft:pink_carpet" => Some(Self::pink_carpet()), - "minecraft:gray_carpet" => Some(Self::gray_carpet()), - "minecraft:light_gray_carpet" => Some(Self::light_gray_carpet()), - "minecraft:cyan_carpet" => Some(Self::cyan_carpet()), - "minecraft:purple_carpet" => Some(Self::purple_carpet()), - "minecraft:blue_carpet" => Some(Self::blue_carpet()), - "minecraft:brown_carpet" => Some(Self::brown_carpet()), - "minecraft:green_carpet" => Some(Self::green_carpet()), - "minecraft:red_carpet" => Some(Self::red_carpet()), - "minecraft:black_carpet" => Some(Self::black_carpet()), - "minecraft:terracotta" => Some(Self::terracotta()), - "minecraft:coal_block" => Some(Self::coal_block()), - "minecraft:packed_ice" => Some(Self::packed_ice()), - "minecraft:sunflower" => Some(Self::sunflower()), - "minecraft:lilac" => Some(Self::lilac()), - "minecraft:rose_bush" => Some(Self::rose_bush()), - "minecraft:peony" => Some(Self::peony()), - "minecraft:tall_grass" => Some(Self::tall_grass()), - "minecraft:large_fern" => Some(Self::large_fern()), - "minecraft:white_banner" => Some(Self::white_banner()), - "minecraft:orange_banner" => Some(Self::orange_banner()), - "minecraft:magenta_banner" => Some(Self::magenta_banner()), - "minecraft:light_blue_banner" => Some(Self::light_blue_banner()), - "minecraft:yellow_banner" => Some(Self::yellow_banner()), - "minecraft:lime_banner" => Some(Self::lime_banner()), - "minecraft:pink_banner" => Some(Self::pink_banner()), - "minecraft:gray_banner" => Some(Self::gray_banner()), - "minecraft:light_gray_banner" => Some(Self::light_gray_banner()), - "minecraft:cyan_banner" => Some(Self::cyan_banner()), - "minecraft:purple_banner" => Some(Self::purple_banner()), - "minecraft:blue_banner" => Some(Self::blue_banner()), - "minecraft:brown_banner" => Some(Self::brown_banner()), - "minecraft:green_banner" => Some(Self::green_banner()), - "minecraft:red_banner" => Some(Self::red_banner()), - "minecraft:black_banner" => Some(Self::black_banner()), - "minecraft:white_wall_banner" => Some(Self::white_wall_banner()), - "minecraft:orange_wall_banner" => Some(Self::orange_wall_banner()), - "minecraft:magenta_wall_banner" => Some(Self::magenta_wall_banner()), - "minecraft:light_blue_wall_banner" => Some(Self::light_blue_wall_banner()), - "minecraft:yellow_wall_banner" => Some(Self::yellow_wall_banner()), - "minecraft:lime_wall_banner" => Some(Self::lime_wall_banner()), - "minecraft:pink_wall_banner" => Some(Self::pink_wall_banner()), - "minecraft:gray_wall_banner" => Some(Self::gray_wall_banner()), - "minecraft:light_gray_wall_banner" => Some(Self::light_gray_wall_banner()), - "minecraft:cyan_wall_banner" => Some(Self::cyan_wall_banner()), - "minecraft:purple_wall_banner" => Some(Self::purple_wall_banner()), - "minecraft:blue_wall_banner" => Some(Self::blue_wall_banner()), - "minecraft:brown_wall_banner" => Some(Self::brown_wall_banner()), - "minecraft:green_wall_banner" => Some(Self::green_wall_banner()), - "minecraft:red_wall_banner" => Some(Self::red_wall_banner()), - "minecraft:black_wall_banner" => Some(Self::black_wall_banner()), - "minecraft:red_sandstone" => Some(Self::red_sandstone()), - "minecraft:chiseled_red_sandstone" => Some(Self::chiseled_red_sandstone()), - "minecraft:cut_red_sandstone" => Some(Self::cut_red_sandstone()), - "minecraft:red_sandstone_stairs" => Some(Self::red_sandstone_stairs()), - "minecraft:oak_slab" => Some(Self::oak_slab()), - "minecraft:spruce_slab" => Some(Self::spruce_slab()), - "minecraft:birch_slab" => Some(Self::birch_slab()), - "minecraft:jungle_slab" => Some(Self::jungle_slab()), - "minecraft:acacia_slab" => Some(Self::acacia_slab()), - "minecraft:dark_oak_slab" => Some(Self::dark_oak_slab()), - "minecraft:stone_slab" => Some(Self::stone_slab()), - "minecraft:smooth_stone_slab" => Some(Self::smooth_stone_slab()), - "minecraft:sandstone_slab" => Some(Self::sandstone_slab()), - "minecraft:cut_sandstone_slab" => Some(Self::cut_sandstone_slab()), - "minecraft:petrified_oak_slab" => Some(Self::petrified_oak_slab()), - "minecraft:cobblestone_slab" => Some(Self::cobblestone_slab()), - "minecraft:brick_slab" => Some(Self::brick_slab()), - "minecraft:stone_brick_slab" => Some(Self::stone_brick_slab()), - "minecraft:nether_brick_slab" => Some(Self::nether_brick_slab()), - "minecraft:quartz_slab" => Some(Self::quartz_slab()), - "minecraft:red_sandstone_slab" => Some(Self::red_sandstone_slab()), - "minecraft:cut_red_sandstone_slab" => Some(Self::cut_red_sandstone_slab()), - "minecraft:purpur_slab" => Some(Self::purpur_slab()), - "minecraft:smooth_stone" => Some(Self::smooth_stone()), - "minecraft:smooth_sandstone" => Some(Self::smooth_sandstone()), - "minecraft:smooth_quartz" => Some(Self::smooth_quartz()), - "minecraft:smooth_red_sandstone" => Some(Self::smooth_red_sandstone()), - "minecraft:spruce_fence_gate" => Some(Self::spruce_fence_gate()), - "minecraft:birch_fence_gate" => Some(Self::birch_fence_gate()), - "minecraft:jungle_fence_gate" => Some(Self::jungle_fence_gate()), - "minecraft:acacia_fence_gate" => Some(Self::acacia_fence_gate()), - "minecraft:dark_oak_fence_gate" => Some(Self::dark_oak_fence_gate()), - "minecraft:spruce_fence" => Some(Self::spruce_fence()), - "minecraft:birch_fence" => Some(Self::birch_fence()), - "minecraft:jungle_fence" => Some(Self::jungle_fence()), - "minecraft:acacia_fence" => Some(Self::acacia_fence()), - "minecraft:dark_oak_fence" => Some(Self::dark_oak_fence()), - "minecraft:spruce_door" => Some(Self::spruce_door()), - "minecraft:birch_door" => Some(Self::birch_door()), - "minecraft:jungle_door" => Some(Self::jungle_door()), - "minecraft:acacia_door" => Some(Self::acacia_door()), - "minecraft:dark_oak_door" => Some(Self::dark_oak_door()), - "minecraft:end_rod" => Some(Self::end_rod()), - "minecraft:chorus_plant" => Some(Self::chorus_plant()), - "minecraft:chorus_flower" => Some(Self::chorus_flower()), - "minecraft:purpur_block" => Some(Self::purpur_block()), - "minecraft:purpur_pillar" => Some(Self::purpur_pillar()), - "minecraft:purpur_stairs" => Some(Self::purpur_stairs()), - "minecraft:end_stone_bricks" => Some(Self::end_stone_bricks()), - "minecraft:beetroots" => Some(Self::beetroots()), - "minecraft:grass_path" => Some(Self::grass_path()), - "minecraft:end_gateway" => Some(Self::end_gateway()), - "minecraft:repeating_command_block" => Some(Self::repeating_command_block()), - "minecraft:chain_command_block" => Some(Self::chain_command_block()), - "minecraft:frosted_ice" => Some(Self::frosted_ice()), - "minecraft:magma_block" => Some(Self::magma_block()), - "minecraft:nether_wart_block" => Some(Self::nether_wart_block()), - "minecraft:red_nether_bricks" => Some(Self::red_nether_bricks()), - "minecraft:bone_block" => Some(Self::bone_block()), - "minecraft:structure_void" => Some(Self::structure_void()), - "minecraft:observer" => Some(Self::observer()), - "minecraft:shulker_box" => Some(Self::shulker_box()), - "minecraft:white_shulker_box" => Some(Self::white_shulker_box()), - "minecraft:orange_shulker_box" => Some(Self::orange_shulker_box()), - "minecraft:magenta_shulker_box" => Some(Self::magenta_shulker_box()), - "minecraft:light_blue_shulker_box" => Some(Self::light_blue_shulker_box()), - "minecraft:yellow_shulker_box" => Some(Self::yellow_shulker_box()), - "minecraft:lime_shulker_box" => Some(Self::lime_shulker_box()), - "minecraft:pink_shulker_box" => Some(Self::pink_shulker_box()), - "minecraft:gray_shulker_box" => Some(Self::gray_shulker_box()), - "minecraft:light_gray_shulker_box" => Some(Self::light_gray_shulker_box()), - "minecraft:cyan_shulker_box" => Some(Self::cyan_shulker_box()), - "minecraft:purple_shulker_box" => Some(Self::purple_shulker_box()), - "minecraft:blue_shulker_box" => Some(Self::blue_shulker_box()), - "minecraft:brown_shulker_box" => Some(Self::brown_shulker_box()), - "minecraft:green_shulker_box" => Some(Self::green_shulker_box()), - "minecraft:red_shulker_box" => Some(Self::red_shulker_box()), - "minecraft:black_shulker_box" => Some(Self::black_shulker_box()), - "minecraft:white_glazed_terracotta" => Some(Self::white_glazed_terracotta()), - "minecraft:orange_glazed_terracotta" => Some(Self::orange_glazed_terracotta()), - "minecraft:magenta_glazed_terracotta" => Some(Self::magenta_glazed_terracotta()), - "minecraft:light_blue_glazed_terracotta" => Some(Self::light_blue_glazed_terracotta()), - "minecraft:yellow_glazed_terracotta" => Some(Self::yellow_glazed_terracotta()), - "minecraft:lime_glazed_terracotta" => Some(Self::lime_glazed_terracotta()), - "minecraft:pink_glazed_terracotta" => Some(Self::pink_glazed_terracotta()), - "minecraft:gray_glazed_terracotta" => Some(Self::gray_glazed_terracotta()), - "minecraft:light_gray_glazed_terracotta" => Some(Self::light_gray_glazed_terracotta()), - "minecraft:cyan_glazed_terracotta" => Some(Self::cyan_glazed_terracotta()), - "minecraft:purple_glazed_terracotta" => Some(Self::purple_glazed_terracotta()), - "minecraft:blue_glazed_terracotta" => Some(Self::blue_glazed_terracotta()), - "minecraft:brown_glazed_terracotta" => Some(Self::brown_glazed_terracotta()), - "minecraft:green_glazed_terracotta" => Some(Self::green_glazed_terracotta()), - "minecraft:red_glazed_terracotta" => Some(Self::red_glazed_terracotta()), - "minecraft:black_glazed_terracotta" => Some(Self::black_glazed_terracotta()), - "minecraft:white_concrete" => Some(Self::white_concrete()), - "minecraft:orange_concrete" => Some(Self::orange_concrete()), - "minecraft:magenta_concrete" => Some(Self::magenta_concrete()), - "minecraft:light_blue_concrete" => Some(Self::light_blue_concrete()), - "minecraft:yellow_concrete" => Some(Self::yellow_concrete()), - "minecraft:lime_concrete" => Some(Self::lime_concrete()), - "minecraft:pink_concrete" => Some(Self::pink_concrete()), - "minecraft:gray_concrete" => Some(Self::gray_concrete()), - "minecraft:light_gray_concrete" => Some(Self::light_gray_concrete()), - "minecraft:cyan_concrete" => Some(Self::cyan_concrete()), - "minecraft:purple_concrete" => Some(Self::purple_concrete()), - "minecraft:blue_concrete" => Some(Self::blue_concrete()), - "minecraft:brown_concrete" => Some(Self::brown_concrete()), - "minecraft:green_concrete" => Some(Self::green_concrete()), - "minecraft:red_concrete" => Some(Self::red_concrete()), - "minecraft:black_concrete" => Some(Self::black_concrete()), - "minecraft:white_concrete_powder" => Some(Self::white_concrete_powder()), - "minecraft:orange_concrete_powder" => Some(Self::orange_concrete_powder()), - "minecraft:magenta_concrete_powder" => Some(Self::magenta_concrete_powder()), - "minecraft:light_blue_concrete_powder" => Some(Self::light_blue_concrete_powder()), - "minecraft:yellow_concrete_powder" => Some(Self::yellow_concrete_powder()), - "minecraft:lime_concrete_powder" => Some(Self::lime_concrete_powder()), - "minecraft:pink_concrete_powder" => Some(Self::pink_concrete_powder()), - "minecraft:gray_concrete_powder" => Some(Self::gray_concrete_powder()), - "minecraft:light_gray_concrete_powder" => Some(Self::light_gray_concrete_powder()), - "minecraft:cyan_concrete_powder" => Some(Self::cyan_concrete_powder()), - "minecraft:purple_concrete_powder" => Some(Self::purple_concrete_powder()), - "minecraft:blue_concrete_powder" => Some(Self::blue_concrete_powder()), - "minecraft:brown_concrete_powder" => Some(Self::brown_concrete_powder()), - "minecraft:green_concrete_powder" => Some(Self::green_concrete_powder()), - "minecraft:red_concrete_powder" => Some(Self::red_concrete_powder()), - "minecraft:black_concrete_powder" => Some(Self::black_concrete_powder()), - "minecraft:kelp" => Some(Self::kelp()), - "minecraft:kelp_plant" => Some(Self::kelp_plant()), - "minecraft:dried_kelp_block" => Some(Self::dried_kelp_block()), - "minecraft:turtle_egg" => Some(Self::turtle_egg()), - "minecraft:dead_tube_coral_block" => Some(Self::dead_tube_coral_block()), - "minecraft:dead_brain_coral_block" => Some(Self::dead_brain_coral_block()), - "minecraft:dead_bubble_coral_block" => Some(Self::dead_bubble_coral_block()), - "minecraft:dead_fire_coral_block" => Some(Self::dead_fire_coral_block()), - "minecraft:dead_horn_coral_block" => Some(Self::dead_horn_coral_block()), - "minecraft:tube_coral_block" => Some(Self::tube_coral_block()), - "minecraft:brain_coral_block" => Some(Self::brain_coral_block()), - "minecraft:bubble_coral_block" => Some(Self::bubble_coral_block()), - "minecraft:fire_coral_block" => Some(Self::fire_coral_block()), - "minecraft:horn_coral_block" => Some(Self::horn_coral_block()), - "minecraft:dead_tube_coral" => Some(Self::dead_tube_coral()), - "minecraft:dead_brain_coral" => Some(Self::dead_brain_coral()), - "minecraft:dead_bubble_coral" => Some(Self::dead_bubble_coral()), - "minecraft:dead_fire_coral" => Some(Self::dead_fire_coral()), - "minecraft:dead_horn_coral" => Some(Self::dead_horn_coral()), - "minecraft:tube_coral" => Some(Self::tube_coral()), - "minecraft:brain_coral" => Some(Self::brain_coral()), - "minecraft:bubble_coral" => Some(Self::bubble_coral()), - "minecraft:fire_coral" => Some(Self::fire_coral()), - "minecraft:horn_coral" => Some(Self::horn_coral()), - "minecraft:dead_tube_coral_fan" => Some(Self::dead_tube_coral_fan()), - "minecraft:dead_brain_coral_fan" => Some(Self::dead_brain_coral_fan()), - "minecraft:dead_bubble_coral_fan" => Some(Self::dead_bubble_coral_fan()), - "minecraft:dead_fire_coral_fan" => Some(Self::dead_fire_coral_fan()), - "minecraft:dead_horn_coral_fan" => Some(Self::dead_horn_coral_fan()), - "minecraft:tube_coral_fan" => Some(Self::tube_coral_fan()), - "minecraft:brain_coral_fan" => Some(Self::brain_coral_fan()), - "minecraft:bubble_coral_fan" => Some(Self::bubble_coral_fan()), - "minecraft:fire_coral_fan" => Some(Self::fire_coral_fan()), - "minecraft:horn_coral_fan" => Some(Self::horn_coral_fan()), - "minecraft:dead_tube_coral_wall_fan" => Some(Self::dead_tube_coral_wall_fan()), - "minecraft:dead_brain_coral_wall_fan" => Some(Self::dead_brain_coral_wall_fan()), - "minecraft:dead_bubble_coral_wall_fan" => Some(Self::dead_bubble_coral_wall_fan()), - "minecraft:dead_fire_coral_wall_fan" => Some(Self::dead_fire_coral_wall_fan()), - "minecraft:dead_horn_coral_wall_fan" => Some(Self::dead_horn_coral_wall_fan()), - "minecraft:tube_coral_wall_fan" => Some(Self::tube_coral_wall_fan()), - "minecraft:brain_coral_wall_fan" => Some(Self::brain_coral_wall_fan()), - "minecraft:bubble_coral_wall_fan" => Some(Self::bubble_coral_wall_fan()), - "minecraft:fire_coral_wall_fan" => Some(Self::fire_coral_wall_fan()), - "minecraft:horn_coral_wall_fan" => Some(Self::horn_coral_wall_fan()), - "minecraft:sea_pickle" => Some(Self::sea_pickle()), - "minecraft:blue_ice" => Some(Self::blue_ice()), - "minecraft:conduit" => Some(Self::conduit()), - "minecraft:bamboo_sapling" => Some(Self::bamboo_sapling()), - "minecraft:bamboo" => Some(Self::bamboo()), - "minecraft:potted_bamboo" => Some(Self::potted_bamboo()), - "minecraft:void_air" => Some(Self::void_air()), - "minecraft:cave_air" => Some(Self::cave_air()), - "minecraft:bubble_column" => Some(Self::bubble_column()), - "minecraft:polished_granite_stairs" => Some(Self::polished_granite_stairs()), - "minecraft:smooth_red_sandstone_stairs" => Some(Self::smooth_red_sandstone_stairs()), - "minecraft:mossy_stone_brick_stairs" => Some(Self::mossy_stone_brick_stairs()), - "minecraft:polished_diorite_stairs" => Some(Self::polished_diorite_stairs()), - "minecraft:mossy_cobblestone_stairs" => Some(Self::mossy_cobblestone_stairs()), - "minecraft:end_stone_brick_stairs" => Some(Self::end_stone_brick_stairs()), - "minecraft:stone_stairs" => Some(Self::stone_stairs()), - "minecraft:smooth_sandstone_stairs" => Some(Self::smooth_sandstone_stairs()), - "minecraft:smooth_quartz_stairs" => Some(Self::smooth_quartz_stairs()), - "minecraft:granite_stairs" => Some(Self::granite_stairs()), - "minecraft:andesite_stairs" => Some(Self::andesite_stairs()), - "minecraft:red_nether_brick_stairs" => Some(Self::red_nether_brick_stairs()), - "minecraft:polished_andesite_stairs" => Some(Self::polished_andesite_stairs()), - "minecraft:diorite_stairs" => Some(Self::diorite_stairs()), - "minecraft:polished_granite_slab" => Some(Self::polished_granite_slab()), - "minecraft:smooth_red_sandstone_slab" => Some(Self::smooth_red_sandstone_slab()), - "minecraft:mossy_stone_brick_slab" => Some(Self::mossy_stone_brick_slab()), - "minecraft:polished_diorite_slab" => Some(Self::polished_diorite_slab()), - "minecraft:mossy_cobblestone_slab" => Some(Self::mossy_cobblestone_slab()), - "minecraft:end_stone_brick_slab" => Some(Self::end_stone_brick_slab()), - "minecraft:smooth_sandstone_slab" => Some(Self::smooth_sandstone_slab()), - "minecraft:smooth_quartz_slab" => Some(Self::smooth_quartz_slab()), - "minecraft:granite_slab" => Some(Self::granite_slab()), - "minecraft:andesite_slab" => Some(Self::andesite_slab()), - "minecraft:red_nether_brick_slab" => Some(Self::red_nether_brick_slab()), - "minecraft:polished_andesite_slab" => Some(Self::polished_andesite_slab()), - "minecraft:diorite_slab" => Some(Self::diorite_slab()), - "minecraft:brick_wall" => Some(Self::brick_wall()), - "minecraft:prismarine_wall" => Some(Self::prismarine_wall()), - "minecraft:red_sandstone_wall" => Some(Self::red_sandstone_wall()), - "minecraft:mossy_stone_brick_wall" => Some(Self::mossy_stone_brick_wall()), - "minecraft:granite_wall" => Some(Self::granite_wall()), - "minecraft:stone_brick_wall" => Some(Self::stone_brick_wall()), - "minecraft:nether_brick_wall" => Some(Self::nether_brick_wall()), - "minecraft:andesite_wall" => Some(Self::andesite_wall()), - "minecraft:red_nether_brick_wall" => Some(Self::red_nether_brick_wall()), - "minecraft:sandstone_wall" => Some(Self::sandstone_wall()), - "minecraft:end_stone_brick_wall" => Some(Self::end_stone_brick_wall()), - "minecraft:diorite_wall" => Some(Self::diorite_wall()), - "minecraft:scaffolding" => Some(Self::scaffolding()), - "minecraft:loom" => Some(Self::loom()), - "minecraft:barrel" => Some(Self::barrel()), - "minecraft:smoker" => Some(Self::smoker()), - "minecraft:blast_furnace" => Some(Self::blast_furnace()), - "minecraft:cartography_table" => Some(Self::cartography_table()), - "minecraft:fletching_table" => Some(Self::fletching_table()), - "minecraft:grindstone" => Some(Self::grindstone()), - "minecraft:lectern" => Some(Self::lectern()), - "minecraft:smithing_table" => Some(Self::smithing_table()), - "minecraft:stonecutter" => Some(Self::stonecutter()), - "minecraft:bell" => Some(Self::bell()), - "minecraft:lantern" => Some(Self::lantern()), - "minecraft:soul_lantern" => Some(Self::soul_lantern()), - "minecraft:campfire" => Some(Self::campfire()), - "minecraft:soul_campfire" => Some(Self::soul_campfire()), - "minecraft:sweet_berry_bush" => Some(Self::sweet_berry_bush()), - "minecraft:warped_stem" => Some(Self::warped_stem()), - "minecraft:stripped_warped_stem" => Some(Self::stripped_warped_stem()), - "minecraft:warped_hyphae" => Some(Self::warped_hyphae()), - "minecraft:stripped_warped_hyphae" => Some(Self::stripped_warped_hyphae()), - "minecraft:warped_nylium" => Some(Self::warped_nylium()), - "minecraft:warped_fungus" => Some(Self::warped_fungus()), - "minecraft:warped_wart_block" => Some(Self::warped_wart_block()), - "minecraft:warped_roots" => Some(Self::warped_roots()), - "minecraft:nether_sprouts" => Some(Self::nether_sprouts()), - "minecraft:crimson_stem" => Some(Self::crimson_stem()), - "minecraft:stripped_crimson_stem" => Some(Self::stripped_crimson_stem()), - "minecraft:crimson_hyphae" => Some(Self::crimson_hyphae()), - "minecraft:stripped_crimson_hyphae" => Some(Self::stripped_crimson_hyphae()), - "minecraft:crimson_nylium" => Some(Self::crimson_nylium()), - "minecraft:crimson_fungus" => Some(Self::crimson_fungus()), - "minecraft:shroomlight" => Some(Self::shroomlight()), - "minecraft:weeping_vines" => Some(Self::weeping_vines()), - "minecraft:weeping_vines_plant" => Some(Self::weeping_vines_plant()), - "minecraft:twisting_vines" => Some(Self::twisting_vines()), - "minecraft:twisting_vines_plant" => Some(Self::twisting_vines_plant()), - "minecraft:crimson_roots" => Some(Self::crimson_roots()), - "minecraft:crimson_planks" => Some(Self::crimson_planks()), - "minecraft:warped_planks" => Some(Self::warped_planks()), - "minecraft:crimson_slab" => Some(Self::crimson_slab()), - "minecraft:warped_slab" => Some(Self::warped_slab()), - "minecraft:crimson_pressure_plate" => Some(Self::crimson_pressure_plate()), - "minecraft:warped_pressure_plate" => Some(Self::warped_pressure_plate()), - "minecraft:crimson_fence" => Some(Self::crimson_fence()), - "minecraft:warped_fence" => Some(Self::warped_fence()), - "minecraft:crimson_trapdoor" => Some(Self::crimson_trapdoor()), - "minecraft:warped_trapdoor" => Some(Self::warped_trapdoor()), - "minecraft:crimson_fence_gate" => Some(Self::crimson_fence_gate()), - "minecraft:warped_fence_gate" => Some(Self::warped_fence_gate()), - "minecraft:crimson_stairs" => Some(Self::crimson_stairs()), - "minecraft:warped_stairs" => Some(Self::warped_stairs()), - "minecraft:crimson_button" => Some(Self::crimson_button()), - "minecraft:warped_button" => Some(Self::warped_button()), - "minecraft:crimson_door" => Some(Self::crimson_door()), - "minecraft:warped_door" => Some(Self::warped_door()), - "minecraft:crimson_sign" => Some(Self::crimson_sign()), - "minecraft:warped_sign" => Some(Self::warped_sign()), - "minecraft:crimson_wall_sign" => Some(Self::crimson_wall_sign()), - "minecraft:warped_wall_sign" => Some(Self::warped_wall_sign()), - "minecraft:structure_block" => Some(Self::structure_block()), - "minecraft:jigsaw" => Some(Self::jigsaw()), - "minecraft:composter" => Some(Self::composter()), - "minecraft:target" => Some(Self::target()), - "minecraft:bee_nest" => Some(Self::bee_nest()), - "minecraft:beehive" => Some(Self::beehive()), - "minecraft:honey_block" => Some(Self::honey_block()), - "minecraft:honeycomb_block" => Some(Self::honeycomb_block()), - "minecraft:netherite_block" => Some(Self::netherite_block()), - "minecraft:ancient_debris" => Some(Self::ancient_debris()), - "minecraft:crying_obsidian" => Some(Self::crying_obsidian()), - "minecraft:respawn_anchor" => Some(Self::respawn_anchor()), - "minecraft:potted_crimson_fungus" => Some(Self::potted_crimson_fungus()), - "minecraft:potted_warped_fungus" => Some(Self::potted_warped_fungus()), - "minecraft:potted_crimson_roots" => Some(Self::potted_crimson_roots()), - "minecraft:potted_warped_roots" => Some(Self::potted_warped_roots()), - "minecraft:lodestone" => Some(Self::lodestone()), - "minecraft:blackstone" => Some(Self::blackstone()), - "minecraft:blackstone_stairs" => Some(Self::blackstone_stairs()), - "minecraft:blackstone_wall" => Some(Self::blackstone_wall()), - "minecraft:blackstone_slab" => Some(Self::blackstone_slab()), - "minecraft:polished_blackstone" => Some(Self::polished_blackstone()), - "minecraft:polished_blackstone_bricks" => Some(Self::polished_blackstone_bricks()), - "minecraft:cracked_polished_blackstone_bricks" => { - Some(Self::cracked_polished_blackstone_bricks()) - } - "minecraft:chiseled_polished_blackstone" => Some(Self::chiseled_polished_blackstone()), - "minecraft:polished_blackstone_brick_slab" => { - Some(Self::polished_blackstone_brick_slab()) - } - "minecraft:polished_blackstone_brick_stairs" => { - Some(Self::polished_blackstone_brick_stairs()) - } - "minecraft:polished_blackstone_brick_wall" => { - Some(Self::polished_blackstone_brick_wall()) - } - "minecraft:gilded_blackstone" => Some(Self::gilded_blackstone()), - "minecraft:polished_blackstone_stairs" => Some(Self::polished_blackstone_stairs()), - "minecraft:polished_blackstone_slab" => Some(Self::polished_blackstone_slab()), - "minecraft:polished_blackstone_pressure_plate" => { - Some(Self::polished_blackstone_pressure_plate()) - } - "minecraft:polished_blackstone_button" => Some(Self::polished_blackstone_button()), - "minecraft:polished_blackstone_wall" => Some(Self::polished_blackstone_wall()), - "minecraft:chiseled_nether_bricks" => Some(Self::chiseled_nether_bricks()), - "minecraft:cracked_nether_bricks" => Some(Self::cracked_nether_bricks()), - "minecraft:quartz_bricks" => Some(Self::quartz_bricks()), - _ => None, - } - } -} diff --git a/feather/blocks/src/generated/mod.rs b/feather/blocks/src/generated/mod.rs deleted file mode 100644 index 7f94368d3..000000000 --- a/feather/blocks/src/generated/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod block_fns; -mod properties; -pub mod table; diff --git a/feather/blocks/src/generated/properties.rs b/feather/blocks/src/generated/properties.rs deleted file mode 100644 index 2f3838a73..000000000 --- a/feather/blocks/src/generated/properties.rs +++ /dev/null @@ -1,1612 +0,0 @@ -use crate::{BlockId, BlockKind}; -impl BlockId { - #[doc = "Determines whether or not a block has the `age_0_1` property."] - pub fn has_age_0_1(self) -> bool { - match self.kind() { - BlockKind::Bamboo => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_15` property."] - pub fn has_age_0_15(self) -> bool { - match self.kind() { - BlockKind::Fire | BlockKind::Cactus | BlockKind::SugarCane => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_2` property."] - pub fn has_age_0_2(self) -> bool { - match self.kind() { - BlockKind::Cocoa => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_25` property."] - pub fn has_age_0_25(self) -> bool { - match self.kind() { - BlockKind::Kelp | BlockKind::WeepingVines | BlockKind::TwistingVines => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_3` property."] - pub fn has_age_0_3(self) -> bool { - match self.kind() { - BlockKind::NetherWart - | BlockKind::Beetroots - | BlockKind::FrostedIce - | BlockKind::SweetBerryBush => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_5` property."] - pub fn has_age_0_5(self) -> bool { - match self.kind() { - BlockKind::ChorusFlower => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `age_0_7` property."] - pub fn has_age_0_7(self) -> bool { - match self.kind() { - BlockKind::Wheat - | BlockKind::PumpkinStem - | BlockKind::MelonStem - | BlockKind::Carrots - | BlockKind::Potatoes => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `attached` property."] - pub fn has_attached(self) -> bool { - match self.kind() { - BlockKind::TripwireHook | BlockKind::Tripwire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `attachment` property."] - pub fn has_attachment(self) -> bool { - match self.kind() { - BlockKind::Bell => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `axis_xyz` property."] - pub fn has_axis_xyz(self) -> bool { - match self.kind() { - BlockKind::OakLog - | BlockKind::SpruceLog - | BlockKind::BirchLog - | BlockKind::JungleLog - | BlockKind::AcaciaLog - | BlockKind::DarkOakLog - | BlockKind::StrippedSpruceLog - | BlockKind::StrippedBirchLog - | BlockKind::StrippedJungleLog - | BlockKind::StrippedAcaciaLog - | BlockKind::StrippedDarkOakLog - | BlockKind::StrippedOakLog - | BlockKind::OakWood - | BlockKind::SpruceWood - | BlockKind::BirchWood - | BlockKind::JungleWood - | BlockKind::AcaciaWood - | BlockKind::DarkOakWood - | BlockKind::StrippedOakWood - | BlockKind::StrippedSpruceWood - | BlockKind::StrippedBirchWood - | BlockKind::StrippedJungleWood - | BlockKind::StrippedAcaciaWood - | BlockKind::StrippedDarkOakWood - | BlockKind::Basalt - | BlockKind::PolishedBasalt - | BlockKind::Chain - | BlockKind::QuartzPillar - | BlockKind::HayBlock - | BlockKind::PurpurPillar - | BlockKind::BoneBlock - | BlockKind::WarpedStem - | BlockKind::StrippedWarpedStem - | BlockKind::WarpedHyphae - | BlockKind::StrippedWarpedHyphae - | BlockKind::CrimsonStem - | BlockKind::StrippedCrimsonStem - | BlockKind::CrimsonHyphae - | BlockKind::StrippedCrimsonHyphae => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `axis_xz` property."] - pub fn has_axis_xz(self) -> bool { - match self.kind() { - BlockKind::NetherPortal => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `bites` property."] - pub fn has_bites(self) -> bool { - match self.kind() { - BlockKind::Cake => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `bottom` property."] - pub fn has_bottom(self) -> bool { - match self.kind() { - BlockKind::Scaffolding => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `cauldron_level` property."] - pub fn has_cauldron_level(self) -> bool { - match self.kind() { - BlockKind::Cauldron => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `charges` property."] - pub fn has_charges(self) -> bool { - match self.kind() { - BlockKind::RespawnAnchor => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `chest_kind` property."] - pub fn has_chest_kind(self) -> bool { - match self.kind() { - BlockKind::Chest | BlockKind::TrappedChest => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `comparator_mode` property."] - pub fn has_comparator_mode(self) -> bool { - match self.kind() { - BlockKind::Comparator => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `conditional` property."] - pub fn has_conditional(self) -> bool { - match self.kind() { - BlockKind::CommandBlock - | BlockKind::RepeatingCommandBlock - | BlockKind::ChainCommandBlock => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `delay` property."] - pub fn has_delay(self) -> bool { - match self.kind() { - BlockKind::Repeater => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `disarmed` property."] - pub fn has_disarmed(self) -> bool { - match self.kind() { - BlockKind::Tripwire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `distance_0_7` property."] - pub fn has_distance_0_7(self) -> bool { - match self.kind() { - BlockKind::Scaffolding => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `distance_1_7` property."] - pub fn has_distance_1_7(self) -> bool { - match self.kind() { - BlockKind::OakLeaves - | BlockKind::SpruceLeaves - | BlockKind::BirchLeaves - | BlockKind::JungleLeaves - | BlockKind::AcaciaLeaves - | BlockKind::DarkOakLeaves => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `down` property."] - pub fn has_down(self) -> bool { - match self.kind() { - BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::ChorusPlant => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `drag` property."] - pub fn has_drag(self) -> bool { - match self.kind() { - BlockKind::BubbleColumn => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `east_connected` property."] - pub fn has_east_connected(self) -> bool { - match self.kind() { - BlockKind::Fire - | BlockKind::OakFence - | BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::IronBars - | BlockKind::GlassPane - | BlockKind::Vine - | BlockKind::NetherBrickFence - | BlockKind::Tripwire - | BlockKind::WhiteStainedGlassPane - | BlockKind::OrangeStainedGlassPane - | BlockKind::MagentaStainedGlassPane - | BlockKind::LightBlueStainedGlassPane - | BlockKind::YellowStainedGlassPane - | BlockKind::LimeStainedGlassPane - | BlockKind::PinkStainedGlassPane - | BlockKind::GrayStainedGlassPane - | BlockKind::LightGrayStainedGlassPane - | BlockKind::CyanStainedGlassPane - | BlockKind::PurpleStainedGlassPane - | BlockKind::BlueStainedGlassPane - | BlockKind::BrownStainedGlassPane - | BlockKind::GreenStainedGlassPane - | BlockKind::RedStainedGlassPane - | BlockKind::BlackStainedGlassPane - | BlockKind::SpruceFence - | BlockKind::BirchFence - | BlockKind::JungleFence - | BlockKind::AcaciaFence - | BlockKind::DarkOakFence - | BlockKind::ChorusPlant - | BlockKind::CrimsonFence - | BlockKind::WarpedFence => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `east_nlt` property."] - pub fn has_east_nlt(self) -> bool { - match self.kind() { - BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::BlackstoneWall - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `east_wire` property."] - pub fn has_east_wire(self) -> bool { - match self.kind() { - BlockKind::RedstoneWire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `eggs` property."] - pub fn has_eggs(self) -> bool { - match self.kind() { - BlockKind::TurtleEgg => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `enabled` property."] - pub fn has_enabled(self) -> bool { - match self.kind() { - BlockKind::Hopper => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `extended` property."] - pub fn has_extended(self) -> bool { - match self.kind() { - BlockKind::StickyPiston | BlockKind::Piston => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `eye` property."] - pub fn has_eye(self) -> bool { - match self.kind() { - BlockKind::EndPortalFrame => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `face` property."] - pub fn has_face(self) -> bool { - match self.kind() { - BlockKind::Lever - | BlockKind::StoneButton - | BlockKind::OakButton - | BlockKind::SpruceButton - | BlockKind::BirchButton - | BlockKind::JungleButton - | BlockKind::AcaciaButton - | BlockKind::DarkOakButton - | BlockKind::Grindstone - | BlockKind::CrimsonButton - | BlockKind::WarpedButton - | BlockKind::PolishedBlackstoneButton => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `facing_cardinal` property."] - pub fn has_facing_cardinal(self) -> bool { - match self.kind() { - BlockKind::WhiteBed - | BlockKind::OrangeBed - | BlockKind::MagentaBed - | BlockKind::LightBlueBed - | BlockKind::YellowBed - | BlockKind::LimeBed - | BlockKind::PinkBed - | BlockKind::GrayBed - | BlockKind::LightGrayBed - | BlockKind::CyanBed - | BlockKind::PurpleBed - | BlockKind::BlueBed - | BlockKind::BrownBed - | BlockKind::GreenBed - | BlockKind::RedBed - | BlockKind::BlackBed - | BlockKind::WallTorch - | BlockKind::OakStairs - | BlockKind::Chest - | BlockKind::Furnace - | BlockKind::OakDoor - | BlockKind::Ladder - | BlockKind::CobblestoneStairs - | BlockKind::OakWallSign - | BlockKind::SpruceWallSign - | BlockKind::BirchWallSign - | BlockKind::AcaciaWallSign - | BlockKind::JungleWallSign - | BlockKind::DarkOakWallSign - | BlockKind::Lever - | BlockKind::IronDoor - | BlockKind::RedstoneWallTorch - | BlockKind::StoneButton - | BlockKind::SoulWallTorch - | BlockKind::CarvedPumpkin - | BlockKind::JackOLantern - | BlockKind::Repeater - | BlockKind::OakTrapdoor - | BlockKind::SpruceTrapdoor - | BlockKind::BirchTrapdoor - | BlockKind::JungleTrapdoor - | BlockKind::AcaciaTrapdoor - | BlockKind::DarkOakTrapdoor - | BlockKind::AttachedPumpkinStem - | BlockKind::AttachedMelonStem - | BlockKind::OakFenceGate - | BlockKind::BrickStairs - | BlockKind::StoneBrickStairs - | BlockKind::NetherBrickStairs - | BlockKind::EndPortalFrame - | BlockKind::Cocoa - | BlockKind::SandstoneStairs - | BlockKind::EnderChest - | BlockKind::TripwireHook - | BlockKind::SpruceStairs - | BlockKind::BirchStairs - | BlockKind::JungleStairs - | BlockKind::OakButton - | BlockKind::SpruceButton - | BlockKind::BirchButton - | BlockKind::JungleButton - | BlockKind::AcaciaButton - | BlockKind::DarkOakButton - | BlockKind::SkeletonWallSkull - | BlockKind::WitherSkeletonWallSkull - | BlockKind::ZombieWallHead - | BlockKind::PlayerWallHead - | BlockKind::CreeperWallHead - | BlockKind::DragonWallHead - | BlockKind::Anvil - | BlockKind::ChippedAnvil - | BlockKind::DamagedAnvil - | BlockKind::TrappedChest - | BlockKind::Comparator - | BlockKind::QuartzStairs - | BlockKind::AcaciaStairs - | BlockKind::DarkOakStairs - | BlockKind::IronTrapdoor - | BlockKind::PrismarineStairs - | BlockKind::PrismarineBrickStairs - | BlockKind::DarkPrismarineStairs - | BlockKind::WhiteWallBanner - | BlockKind::OrangeWallBanner - | BlockKind::MagentaWallBanner - | BlockKind::LightBlueWallBanner - | BlockKind::YellowWallBanner - | BlockKind::LimeWallBanner - | BlockKind::PinkWallBanner - | BlockKind::GrayWallBanner - | BlockKind::LightGrayWallBanner - | BlockKind::CyanWallBanner - | BlockKind::PurpleWallBanner - | BlockKind::BlueWallBanner - | BlockKind::BrownWallBanner - | BlockKind::GreenWallBanner - | BlockKind::RedWallBanner - | BlockKind::BlackWallBanner - | BlockKind::RedSandstoneStairs - | BlockKind::SpruceFenceGate - | BlockKind::BirchFenceGate - | BlockKind::JungleFenceGate - | BlockKind::AcaciaFenceGate - | BlockKind::DarkOakFenceGate - | BlockKind::SpruceDoor - | BlockKind::BirchDoor - | BlockKind::JungleDoor - | BlockKind::AcaciaDoor - | BlockKind::DarkOakDoor - | BlockKind::PurpurStairs - | BlockKind::WhiteGlazedTerracotta - | BlockKind::OrangeGlazedTerracotta - | BlockKind::MagentaGlazedTerracotta - | BlockKind::LightBlueGlazedTerracotta - | BlockKind::YellowGlazedTerracotta - | BlockKind::LimeGlazedTerracotta - | BlockKind::PinkGlazedTerracotta - | BlockKind::GrayGlazedTerracotta - | BlockKind::LightGrayGlazedTerracotta - | BlockKind::CyanGlazedTerracotta - | BlockKind::PurpleGlazedTerracotta - | BlockKind::BlueGlazedTerracotta - | BlockKind::BrownGlazedTerracotta - | BlockKind::GreenGlazedTerracotta - | BlockKind::RedGlazedTerracotta - | BlockKind::BlackGlazedTerracotta - | BlockKind::DeadTubeCoralWallFan - | BlockKind::DeadBrainCoralWallFan - | BlockKind::DeadBubbleCoralWallFan - | BlockKind::DeadFireCoralWallFan - | BlockKind::DeadHornCoralWallFan - | BlockKind::TubeCoralWallFan - | BlockKind::BrainCoralWallFan - | BlockKind::BubbleCoralWallFan - | BlockKind::FireCoralWallFan - | BlockKind::HornCoralWallFan - | BlockKind::PolishedGraniteStairs - | BlockKind::SmoothRedSandstoneStairs - | BlockKind::MossyStoneBrickStairs - | BlockKind::PolishedDioriteStairs - | BlockKind::MossyCobblestoneStairs - | BlockKind::EndStoneBrickStairs - | BlockKind::StoneStairs - | BlockKind::SmoothSandstoneStairs - | BlockKind::SmoothQuartzStairs - | BlockKind::GraniteStairs - | BlockKind::AndesiteStairs - | BlockKind::RedNetherBrickStairs - | BlockKind::PolishedAndesiteStairs - | BlockKind::DioriteStairs - | BlockKind::Loom - | BlockKind::Smoker - | BlockKind::BlastFurnace - | BlockKind::Grindstone - | BlockKind::Lectern - | BlockKind::Stonecutter - | BlockKind::Bell - | BlockKind::Campfire - | BlockKind::SoulCampfire - | BlockKind::CrimsonTrapdoor - | BlockKind::WarpedTrapdoor - | BlockKind::CrimsonFenceGate - | BlockKind::WarpedFenceGate - | BlockKind::CrimsonStairs - | BlockKind::WarpedStairs - | BlockKind::CrimsonButton - | BlockKind::WarpedButton - | BlockKind::CrimsonDoor - | BlockKind::WarpedDoor - | BlockKind::CrimsonWallSign - | BlockKind::WarpedWallSign - | BlockKind::BeeNest - | BlockKind::Beehive - | BlockKind::BlackstoneStairs - | BlockKind::PolishedBlackstoneBrickStairs - | BlockKind::PolishedBlackstoneStairs - | BlockKind::PolishedBlackstoneButton => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `facing_cardinal_and_down` property."] - pub fn has_facing_cardinal_and_down(self) -> bool { - match self.kind() { - BlockKind::Hopper => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `facing_cubic` property."] - pub fn has_facing_cubic(self) -> bool { - match self.kind() { - BlockKind::Dispenser - | BlockKind::StickyPiston - | BlockKind::Piston - | BlockKind::PistonHead - | BlockKind::MovingPiston - | BlockKind::CommandBlock - | BlockKind::Dropper - | BlockKind::EndRod - | BlockKind::RepeatingCommandBlock - | BlockKind::ChainCommandBlock - | BlockKind::Observer - | BlockKind::ShulkerBox - | BlockKind::WhiteShulkerBox - | BlockKind::OrangeShulkerBox - | BlockKind::MagentaShulkerBox - | BlockKind::LightBlueShulkerBox - | BlockKind::YellowShulkerBox - | BlockKind::LimeShulkerBox - | BlockKind::PinkShulkerBox - | BlockKind::GrayShulkerBox - | BlockKind::LightGrayShulkerBox - | BlockKind::CyanShulkerBox - | BlockKind::PurpleShulkerBox - | BlockKind::BlueShulkerBox - | BlockKind::BrownShulkerBox - | BlockKind::GreenShulkerBox - | BlockKind::RedShulkerBox - | BlockKind::BlackShulkerBox - | BlockKind::Barrel => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `half_top_bottom` property."] - pub fn has_half_top_bottom(self) -> bool { - match self.kind() { - BlockKind::OakStairs - | BlockKind::CobblestoneStairs - | BlockKind::OakTrapdoor - | BlockKind::SpruceTrapdoor - | BlockKind::BirchTrapdoor - | BlockKind::JungleTrapdoor - | BlockKind::AcaciaTrapdoor - | BlockKind::DarkOakTrapdoor - | BlockKind::BrickStairs - | BlockKind::StoneBrickStairs - | BlockKind::NetherBrickStairs - | BlockKind::SandstoneStairs - | BlockKind::SpruceStairs - | BlockKind::BirchStairs - | BlockKind::JungleStairs - | BlockKind::QuartzStairs - | BlockKind::AcaciaStairs - | BlockKind::DarkOakStairs - | BlockKind::IronTrapdoor - | BlockKind::PrismarineStairs - | BlockKind::PrismarineBrickStairs - | BlockKind::DarkPrismarineStairs - | BlockKind::RedSandstoneStairs - | BlockKind::PurpurStairs - | BlockKind::PolishedGraniteStairs - | BlockKind::SmoothRedSandstoneStairs - | BlockKind::MossyStoneBrickStairs - | BlockKind::PolishedDioriteStairs - | BlockKind::MossyCobblestoneStairs - | BlockKind::EndStoneBrickStairs - | BlockKind::StoneStairs - | BlockKind::SmoothSandstoneStairs - | BlockKind::SmoothQuartzStairs - | BlockKind::GraniteStairs - | BlockKind::AndesiteStairs - | BlockKind::RedNetherBrickStairs - | BlockKind::PolishedAndesiteStairs - | BlockKind::DioriteStairs - | BlockKind::CrimsonTrapdoor - | BlockKind::WarpedTrapdoor - | BlockKind::CrimsonStairs - | BlockKind::WarpedStairs - | BlockKind::BlackstoneStairs - | BlockKind::PolishedBlackstoneBrickStairs - | BlockKind::PolishedBlackstoneStairs => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `half_upper_lower` property."] - pub fn has_half_upper_lower(self) -> bool { - match self.kind() { - BlockKind::TallSeagrass - | BlockKind::OakDoor - | BlockKind::IronDoor - | BlockKind::Sunflower - | BlockKind::Lilac - | BlockKind::RoseBush - | BlockKind::Peony - | BlockKind::TallGrass - | BlockKind::LargeFern - | BlockKind::SpruceDoor - | BlockKind::BirchDoor - | BlockKind::JungleDoor - | BlockKind::AcaciaDoor - | BlockKind::DarkOakDoor - | BlockKind::CrimsonDoor - | BlockKind::WarpedDoor => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `hanging` property."] - pub fn has_hanging(self) -> bool { - match self.kind() { - BlockKind::Lantern | BlockKind::SoulLantern => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `has_book` property."] - pub fn has_has_book(self) -> bool { - match self.kind() { - BlockKind::Lectern => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `has_bottle_0` property."] - pub fn has_has_bottle_0(self) -> bool { - match self.kind() { - BlockKind::BrewingStand => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `has_bottle_1` property."] - pub fn has_has_bottle_1(self) -> bool { - match self.kind() { - BlockKind::BrewingStand => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `has_bottle_2` property."] - pub fn has_has_bottle_2(self) -> bool { - match self.kind() { - BlockKind::BrewingStand => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `has_record` property."] - pub fn has_has_record(self) -> bool { - match self.kind() { - BlockKind::Jukebox => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `hatch` property."] - pub fn has_hatch(self) -> bool { - match self.kind() { - BlockKind::TurtleEgg => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `hinge` property."] - pub fn has_hinge(self) -> bool { - match self.kind() { - BlockKind::OakDoor - | BlockKind::IronDoor - | BlockKind::SpruceDoor - | BlockKind::BirchDoor - | BlockKind::JungleDoor - | BlockKind::AcaciaDoor - | BlockKind::DarkOakDoor - | BlockKind::CrimsonDoor - | BlockKind::WarpedDoor => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `honey_level` property."] - pub fn has_honey_level(self) -> bool { - match self.kind() { - BlockKind::BeeNest | BlockKind::Beehive => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `in_wall` property."] - pub fn has_in_wall(self) -> bool { - match self.kind() { - BlockKind::OakFenceGate - | BlockKind::SpruceFenceGate - | BlockKind::BirchFenceGate - | BlockKind::JungleFenceGate - | BlockKind::AcaciaFenceGate - | BlockKind::DarkOakFenceGate - | BlockKind::CrimsonFenceGate - | BlockKind::WarpedFenceGate => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `instrument` property."] - pub fn has_instrument(self) -> bool { - match self.kind() { - BlockKind::NoteBlock => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `inverted` property."] - pub fn has_inverted(self) -> bool { - match self.kind() { - BlockKind::DaylightDetector => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `layers` property."] - pub fn has_layers(self) -> bool { - match self.kind() { - BlockKind::Snow => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `leaves` property."] - pub fn has_leaves(self) -> bool { - match self.kind() { - BlockKind::Bamboo => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `level_0_8` property."] - pub fn has_level_0_8(self) -> bool { - match self.kind() { - BlockKind::Composter => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `lit` property."] - pub fn has_lit(self) -> bool { - match self.kind() { - BlockKind::Furnace - | BlockKind::RedstoneOre - | BlockKind::RedstoneTorch - | BlockKind::RedstoneWallTorch - | BlockKind::RedstoneLamp - | BlockKind::Smoker - | BlockKind::BlastFurnace - | BlockKind::Campfire - | BlockKind::SoulCampfire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `locked` property."] - pub fn has_locked(self) -> bool { - match self.kind() { - BlockKind::Repeater => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `moisture` property."] - pub fn has_moisture(self) -> bool { - match self.kind() { - BlockKind::Farmland => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `north_connected` property."] - pub fn has_north_connected(self) -> bool { - match self.kind() { - BlockKind::Fire - | BlockKind::OakFence - | BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::IronBars - | BlockKind::GlassPane - | BlockKind::Vine - | BlockKind::NetherBrickFence - | BlockKind::Tripwire - | BlockKind::WhiteStainedGlassPane - | BlockKind::OrangeStainedGlassPane - | BlockKind::MagentaStainedGlassPane - | BlockKind::LightBlueStainedGlassPane - | BlockKind::YellowStainedGlassPane - | BlockKind::LimeStainedGlassPane - | BlockKind::PinkStainedGlassPane - | BlockKind::GrayStainedGlassPane - | BlockKind::LightGrayStainedGlassPane - | BlockKind::CyanStainedGlassPane - | BlockKind::PurpleStainedGlassPane - | BlockKind::BlueStainedGlassPane - | BlockKind::BrownStainedGlassPane - | BlockKind::GreenStainedGlassPane - | BlockKind::RedStainedGlassPane - | BlockKind::BlackStainedGlassPane - | BlockKind::SpruceFence - | BlockKind::BirchFence - | BlockKind::JungleFence - | BlockKind::AcaciaFence - | BlockKind::DarkOakFence - | BlockKind::ChorusPlant - | BlockKind::CrimsonFence - | BlockKind::WarpedFence => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `north_nlt` property."] - pub fn has_north_nlt(self) -> bool { - match self.kind() { - BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::BlackstoneWall - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `north_wire` property."] - pub fn has_north_wire(self) -> bool { - match self.kind() { - BlockKind::RedstoneWire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `note` property."] - pub fn has_note(self) -> bool { - match self.kind() { - BlockKind::NoteBlock => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `occupied` property."] - pub fn has_occupied(self) -> bool { - match self.kind() { - BlockKind::WhiteBed - | BlockKind::OrangeBed - | BlockKind::MagentaBed - | BlockKind::LightBlueBed - | BlockKind::YellowBed - | BlockKind::LimeBed - | BlockKind::PinkBed - | BlockKind::GrayBed - | BlockKind::LightGrayBed - | BlockKind::CyanBed - | BlockKind::PurpleBed - | BlockKind::BlueBed - | BlockKind::BrownBed - | BlockKind::GreenBed - | BlockKind::RedBed - | BlockKind::BlackBed => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `open` property."] - pub fn has_open(self) -> bool { - match self.kind() { - BlockKind::OakDoor - | BlockKind::IronDoor - | BlockKind::OakTrapdoor - | BlockKind::SpruceTrapdoor - | BlockKind::BirchTrapdoor - | BlockKind::JungleTrapdoor - | BlockKind::AcaciaTrapdoor - | BlockKind::DarkOakTrapdoor - | BlockKind::OakFenceGate - | BlockKind::IronTrapdoor - | BlockKind::SpruceFenceGate - | BlockKind::BirchFenceGate - | BlockKind::JungleFenceGate - | BlockKind::AcaciaFenceGate - | BlockKind::DarkOakFenceGate - | BlockKind::SpruceDoor - | BlockKind::BirchDoor - | BlockKind::JungleDoor - | BlockKind::AcaciaDoor - | BlockKind::DarkOakDoor - | BlockKind::Barrel - | BlockKind::CrimsonTrapdoor - | BlockKind::WarpedTrapdoor - | BlockKind::CrimsonFenceGate - | BlockKind::WarpedFenceGate - | BlockKind::CrimsonDoor - | BlockKind::WarpedDoor => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `orientation` property."] - pub fn has_orientation(self) -> bool { - match self.kind() { - BlockKind::Jigsaw => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `part` property."] - pub fn has_part(self) -> bool { - match self.kind() { - BlockKind::WhiteBed - | BlockKind::OrangeBed - | BlockKind::MagentaBed - | BlockKind::LightBlueBed - | BlockKind::YellowBed - | BlockKind::LimeBed - | BlockKind::PinkBed - | BlockKind::GrayBed - | BlockKind::LightGrayBed - | BlockKind::CyanBed - | BlockKind::PurpleBed - | BlockKind::BlueBed - | BlockKind::BrownBed - | BlockKind::GreenBed - | BlockKind::RedBed - | BlockKind::BlackBed => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `persistent` property."] - pub fn has_persistent(self) -> bool { - match self.kind() { - BlockKind::OakLeaves - | BlockKind::SpruceLeaves - | BlockKind::BirchLeaves - | BlockKind::JungleLeaves - | BlockKind::AcaciaLeaves - | BlockKind::DarkOakLeaves => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `pickles` property."] - pub fn has_pickles(self) -> bool { - match self.kind() { - BlockKind::SeaPickle => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `piston_kind` property."] - pub fn has_piston_kind(self) -> bool { - match self.kind() { - BlockKind::PistonHead | BlockKind::MovingPiston => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `power` property."] - pub fn has_power(self) -> bool { - match self.kind() { - BlockKind::RedstoneWire - | BlockKind::LightWeightedPressurePlate - | BlockKind::HeavyWeightedPressurePlate - | BlockKind::DaylightDetector - | BlockKind::Target => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `powered` property."] - pub fn has_powered(self) -> bool { - match self.kind() { - BlockKind::NoteBlock - | BlockKind::PoweredRail - | BlockKind::DetectorRail - | BlockKind::OakDoor - | BlockKind::Lever - | BlockKind::StonePressurePlate - | BlockKind::IronDoor - | BlockKind::OakPressurePlate - | BlockKind::SprucePressurePlate - | BlockKind::BirchPressurePlate - | BlockKind::JunglePressurePlate - | BlockKind::AcaciaPressurePlate - | BlockKind::DarkOakPressurePlate - | BlockKind::StoneButton - | BlockKind::Repeater - | BlockKind::OakTrapdoor - | BlockKind::SpruceTrapdoor - | BlockKind::BirchTrapdoor - | BlockKind::JungleTrapdoor - | BlockKind::AcaciaTrapdoor - | BlockKind::DarkOakTrapdoor - | BlockKind::OakFenceGate - | BlockKind::TripwireHook - | BlockKind::Tripwire - | BlockKind::OakButton - | BlockKind::SpruceButton - | BlockKind::BirchButton - | BlockKind::JungleButton - | BlockKind::AcaciaButton - | BlockKind::DarkOakButton - | BlockKind::Comparator - | BlockKind::ActivatorRail - | BlockKind::IronTrapdoor - | BlockKind::SpruceFenceGate - | BlockKind::BirchFenceGate - | BlockKind::JungleFenceGate - | BlockKind::AcaciaFenceGate - | BlockKind::DarkOakFenceGate - | BlockKind::SpruceDoor - | BlockKind::BirchDoor - | BlockKind::JungleDoor - | BlockKind::AcaciaDoor - | BlockKind::DarkOakDoor - | BlockKind::Observer - | BlockKind::Lectern - | BlockKind::Bell - | BlockKind::CrimsonPressurePlate - | BlockKind::WarpedPressurePlate - | BlockKind::CrimsonTrapdoor - | BlockKind::WarpedTrapdoor - | BlockKind::CrimsonFenceGate - | BlockKind::WarpedFenceGate - | BlockKind::CrimsonButton - | BlockKind::WarpedButton - | BlockKind::CrimsonDoor - | BlockKind::WarpedDoor - | BlockKind::PolishedBlackstonePressurePlate - | BlockKind::PolishedBlackstoneButton => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `powered_rail_shape` property."] - pub fn has_powered_rail_shape(self) -> bool { - match self.kind() { - BlockKind::PoweredRail | BlockKind::DetectorRail | BlockKind::ActivatorRail => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `rail_shape` property."] - pub fn has_rail_shape(self) -> bool { - match self.kind() { - BlockKind::Rail => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `rotation` property."] - pub fn has_rotation(self) -> bool { - match self.kind() { - BlockKind::OakSign - | BlockKind::SpruceSign - | BlockKind::BirchSign - | BlockKind::AcaciaSign - | BlockKind::JungleSign - | BlockKind::DarkOakSign - | BlockKind::SkeletonSkull - | BlockKind::WitherSkeletonSkull - | BlockKind::ZombieHead - | BlockKind::PlayerHead - | BlockKind::CreeperHead - | BlockKind::DragonHead - | BlockKind::WhiteBanner - | BlockKind::OrangeBanner - | BlockKind::MagentaBanner - | BlockKind::LightBlueBanner - | BlockKind::YellowBanner - | BlockKind::LimeBanner - | BlockKind::PinkBanner - | BlockKind::GrayBanner - | BlockKind::LightGrayBanner - | BlockKind::CyanBanner - | BlockKind::PurpleBanner - | BlockKind::BlueBanner - | BlockKind::BrownBanner - | BlockKind::GreenBanner - | BlockKind::RedBanner - | BlockKind::BlackBanner - | BlockKind::CrimsonSign - | BlockKind::WarpedSign => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `short` property."] - pub fn has_short(self) -> bool { - match self.kind() { - BlockKind::PistonHead => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `signal_fire` property."] - pub fn has_signal_fire(self) -> bool { - match self.kind() { - BlockKind::Campfire | BlockKind::SoulCampfire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `slab_kind` property."] - pub fn has_slab_kind(self) -> bool { - match self.kind() { - BlockKind::PrismarineSlab - | BlockKind::PrismarineBrickSlab - | BlockKind::DarkPrismarineSlab - | BlockKind::OakSlab - | BlockKind::SpruceSlab - | BlockKind::BirchSlab - | BlockKind::JungleSlab - | BlockKind::AcaciaSlab - | BlockKind::DarkOakSlab - | BlockKind::StoneSlab - | BlockKind::SmoothStoneSlab - | BlockKind::SandstoneSlab - | BlockKind::CutSandstoneSlab - | BlockKind::PetrifiedOakSlab - | BlockKind::CobblestoneSlab - | BlockKind::BrickSlab - | BlockKind::StoneBrickSlab - | BlockKind::NetherBrickSlab - | BlockKind::QuartzSlab - | BlockKind::RedSandstoneSlab - | BlockKind::CutRedSandstoneSlab - | BlockKind::PurpurSlab - | BlockKind::PolishedGraniteSlab - | BlockKind::SmoothRedSandstoneSlab - | BlockKind::MossyStoneBrickSlab - | BlockKind::PolishedDioriteSlab - | BlockKind::MossyCobblestoneSlab - | BlockKind::EndStoneBrickSlab - | BlockKind::SmoothSandstoneSlab - | BlockKind::SmoothQuartzSlab - | BlockKind::GraniteSlab - | BlockKind::AndesiteSlab - | BlockKind::RedNetherBrickSlab - | BlockKind::PolishedAndesiteSlab - | BlockKind::DioriteSlab - | BlockKind::CrimsonSlab - | BlockKind::WarpedSlab - | BlockKind::BlackstoneSlab - | BlockKind::PolishedBlackstoneBrickSlab - | BlockKind::PolishedBlackstoneSlab => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `snowy` property."] - pub fn has_snowy(self) -> bool { - match self.kind() { - BlockKind::GrassBlock | BlockKind::Podzol | BlockKind::Mycelium => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `south_connected` property."] - pub fn has_south_connected(self) -> bool { - match self.kind() { - BlockKind::Fire - | BlockKind::OakFence - | BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::IronBars - | BlockKind::GlassPane - | BlockKind::Vine - | BlockKind::NetherBrickFence - | BlockKind::Tripwire - | BlockKind::WhiteStainedGlassPane - | BlockKind::OrangeStainedGlassPane - | BlockKind::MagentaStainedGlassPane - | BlockKind::LightBlueStainedGlassPane - | BlockKind::YellowStainedGlassPane - | BlockKind::LimeStainedGlassPane - | BlockKind::PinkStainedGlassPane - | BlockKind::GrayStainedGlassPane - | BlockKind::LightGrayStainedGlassPane - | BlockKind::CyanStainedGlassPane - | BlockKind::PurpleStainedGlassPane - | BlockKind::BlueStainedGlassPane - | BlockKind::BrownStainedGlassPane - | BlockKind::GreenStainedGlassPane - | BlockKind::RedStainedGlassPane - | BlockKind::BlackStainedGlassPane - | BlockKind::SpruceFence - | BlockKind::BirchFence - | BlockKind::JungleFence - | BlockKind::AcaciaFence - | BlockKind::DarkOakFence - | BlockKind::ChorusPlant - | BlockKind::CrimsonFence - | BlockKind::WarpedFence => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `south_nlt` property."] - pub fn has_south_nlt(self) -> bool { - match self.kind() { - BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::BlackstoneWall - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `south_wire` property."] - pub fn has_south_wire(self) -> bool { - match self.kind() { - BlockKind::RedstoneWire => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `stage` property."] - pub fn has_stage(self) -> bool { - match self.kind() { - BlockKind::OakSapling - | BlockKind::SpruceSapling - | BlockKind::BirchSapling - | BlockKind::JungleSapling - | BlockKind::AcaciaSapling - | BlockKind::DarkOakSapling - | BlockKind::Bamboo => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `stairs_shape` property."] - pub fn has_stairs_shape(self) -> bool { - match self.kind() { - BlockKind::OakStairs - | BlockKind::CobblestoneStairs - | BlockKind::BrickStairs - | BlockKind::StoneBrickStairs - | BlockKind::NetherBrickStairs - | BlockKind::SandstoneStairs - | BlockKind::SpruceStairs - | BlockKind::BirchStairs - | BlockKind::JungleStairs - | BlockKind::QuartzStairs - | BlockKind::AcaciaStairs - | BlockKind::DarkOakStairs - | BlockKind::PrismarineStairs - | BlockKind::PrismarineBrickStairs - | BlockKind::DarkPrismarineStairs - | BlockKind::RedSandstoneStairs - | BlockKind::PurpurStairs - | BlockKind::PolishedGraniteStairs - | BlockKind::SmoothRedSandstoneStairs - | BlockKind::MossyStoneBrickStairs - | BlockKind::PolishedDioriteStairs - | BlockKind::MossyCobblestoneStairs - | BlockKind::EndStoneBrickStairs - | BlockKind::StoneStairs - | BlockKind::SmoothSandstoneStairs - | BlockKind::SmoothQuartzStairs - | BlockKind::GraniteStairs - | BlockKind::AndesiteStairs - | BlockKind::RedNetherBrickStairs - | BlockKind::PolishedAndesiteStairs - | BlockKind::DioriteStairs - | BlockKind::CrimsonStairs - | BlockKind::WarpedStairs - | BlockKind::BlackstoneStairs - | BlockKind::PolishedBlackstoneBrickStairs - | BlockKind::PolishedBlackstoneStairs => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `structure_block_mode` property."] - pub fn has_structure_block_mode(self) -> bool { - match self.kind() { - BlockKind::StructureBlock => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `triggered` property."] - pub fn has_triggered(self) -> bool { - match self.kind() { - BlockKind::Dispenser | BlockKind::Dropper => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `unstable` property."] - pub fn has_unstable(self) -> bool { - match self.kind() { - BlockKind::Tnt => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `up` property."] - pub fn has_up(self) -> bool { - match self.kind() { - BlockKind::Fire - | BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::Vine - | BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::ChorusPlant - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::BlackstoneWall - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `water_level` property."] - pub fn has_water_level(self) -> bool { - match self.kind() { - BlockKind::Water | BlockKind::Lava => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `waterlogged` property."] - pub fn has_waterlogged(self) -> bool { - match self.kind() { - BlockKind::OakStairs - | BlockKind::Chest - | BlockKind::OakSign - | BlockKind::SpruceSign - | BlockKind::BirchSign - | BlockKind::AcaciaSign - | BlockKind::JungleSign - | BlockKind::DarkOakSign - | BlockKind::Ladder - | BlockKind::CobblestoneStairs - | BlockKind::OakWallSign - | BlockKind::SpruceWallSign - | BlockKind::BirchWallSign - | BlockKind::AcaciaWallSign - | BlockKind::JungleWallSign - | BlockKind::DarkOakWallSign - | BlockKind::OakFence - | BlockKind::OakTrapdoor - | BlockKind::SpruceTrapdoor - | BlockKind::BirchTrapdoor - | BlockKind::JungleTrapdoor - | BlockKind::AcaciaTrapdoor - | BlockKind::DarkOakTrapdoor - | BlockKind::IronBars - | BlockKind::Chain - | BlockKind::GlassPane - | BlockKind::BrickStairs - | BlockKind::StoneBrickStairs - | BlockKind::NetherBrickFence - | BlockKind::NetherBrickStairs - | BlockKind::SandstoneStairs - | BlockKind::EnderChest - | BlockKind::SpruceStairs - | BlockKind::BirchStairs - | BlockKind::JungleStairs - | BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::TrappedChest - | BlockKind::QuartzStairs - | BlockKind::WhiteStainedGlassPane - | BlockKind::OrangeStainedGlassPane - | BlockKind::MagentaStainedGlassPane - | BlockKind::LightBlueStainedGlassPane - | BlockKind::YellowStainedGlassPane - | BlockKind::LimeStainedGlassPane - | BlockKind::PinkStainedGlassPane - | BlockKind::GrayStainedGlassPane - | BlockKind::LightGrayStainedGlassPane - | BlockKind::CyanStainedGlassPane - | BlockKind::PurpleStainedGlassPane - | BlockKind::BlueStainedGlassPane - | BlockKind::BrownStainedGlassPane - | BlockKind::GreenStainedGlassPane - | BlockKind::RedStainedGlassPane - | BlockKind::BlackStainedGlassPane - | BlockKind::AcaciaStairs - | BlockKind::DarkOakStairs - | BlockKind::IronTrapdoor - | BlockKind::PrismarineStairs - | BlockKind::PrismarineBrickStairs - | BlockKind::DarkPrismarineStairs - | BlockKind::PrismarineSlab - | BlockKind::PrismarineBrickSlab - | BlockKind::DarkPrismarineSlab - | BlockKind::RedSandstoneStairs - | BlockKind::OakSlab - | BlockKind::SpruceSlab - | BlockKind::BirchSlab - | BlockKind::JungleSlab - | BlockKind::AcaciaSlab - | BlockKind::DarkOakSlab - | BlockKind::StoneSlab - | BlockKind::SmoothStoneSlab - | BlockKind::SandstoneSlab - | BlockKind::CutSandstoneSlab - | BlockKind::PetrifiedOakSlab - | BlockKind::CobblestoneSlab - | BlockKind::BrickSlab - | BlockKind::StoneBrickSlab - | BlockKind::NetherBrickSlab - | BlockKind::QuartzSlab - | BlockKind::RedSandstoneSlab - | BlockKind::CutRedSandstoneSlab - | BlockKind::PurpurSlab - | BlockKind::SpruceFence - | BlockKind::BirchFence - | BlockKind::JungleFence - | BlockKind::AcaciaFence - | BlockKind::DarkOakFence - | BlockKind::PurpurStairs - | BlockKind::DeadTubeCoral - | BlockKind::DeadBrainCoral - | BlockKind::DeadBubbleCoral - | BlockKind::DeadFireCoral - | BlockKind::DeadHornCoral - | BlockKind::TubeCoral - | BlockKind::BrainCoral - | BlockKind::BubbleCoral - | BlockKind::FireCoral - | BlockKind::HornCoral - | BlockKind::DeadTubeCoralFan - | BlockKind::DeadBrainCoralFan - | BlockKind::DeadBubbleCoralFan - | BlockKind::DeadFireCoralFan - | BlockKind::DeadHornCoralFan - | BlockKind::TubeCoralFan - | BlockKind::BrainCoralFan - | BlockKind::BubbleCoralFan - | BlockKind::FireCoralFan - | BlockKind::HornCoralFan - | BlockKind::DeadTubeCoralWallFan - | BlockKind::DeadBrainCoralWallFan - | BlockKind::DeadBubbleCoralWallFan - | BlockKind::DeadFireCoralWallFan - | BlockKind::DeadHornCoralWallFan - | BlockKind::TubeCoralWallFan - | BlockKind::BrainCoralWallFan - | BlockKind::BubbleCoralWallFan - | BlockKind::FireCoralWallFan - | BlockKind::HornCoralWallFan - | BlockKind::SeaPickle - | BlockKind::Conduit - | BlockKind::PolishedGraniteStairs - | BlockKind::SmoothRedSandstoneStairs - | BlockKind::MossyStoneBrickStairs - | BlockKind::PolishedDioriteStairs - | BlockKind::MossyCobblestoneStairs - | BlockKind::EndStoneBrickStairs - | BlockKind::StoneStairs - | BlockKind::SmoothSandstoneStairs - | BlockKind::SmoothQuartzStairs - | BlockKind::GraniteStairs - | BlockKind::AndesiteStairs - | BlockKind::RedNetherBrickStairs - | BlockKind::PolishedAndesiteStairs - | BlockKind::DioriteStairs - | BlockKind::PolishedGraniteSlab - | BlockKind::SmoothRedSandstoneSlab - | BlockKind::MossyStoneBrickSlab - | BlockKind::PolishedDioriteSlab - | BlockKind::MossyCobblestoneSlab - | BlockKind::EndStoneBrickSlab - | BlockKind::SmoothSandstoneSlab - | BlockKind::SmoothQuartzSlab - | BlockKind::GraniteSlab - | BlockKind::AndesiteSlab - | BlockKind::RedNetherBrickSlab - | BlockKind::PolishedAndesiteSlab - | BlockKind::DioriteSlab - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::Scaffolding - | BlockKind::Lantern - | BlockKind::SoulLantern - | BlockKind::Campfire - | BlockKind::SoulCampfire - | BlockKind::CrimsonSlab - | BlockKind::WarpedSlab - | BlockKind::CrimsonFence - | BlockKind::WarpedFence - | BlockKind::CrimsonTrapdoor - | BlockKind::WarpedTrapdoor - | BlockKind::CrimsonStairs - | BlockKind::WarpedStairs - | BlockKind::CrimsonSign - | BlockKind::WarpedSign - | BlockKind::CrimsonWallSign - | BlockKind::WarpedWallSign - | BlockKind::BlackstoneStairs - | BlockKind::BlackstoneWall - | BlockKind::BlackstoneSlab - | BlockKind::PolishedBlackstoneBrickSlab - | BlockKind::PolishedBlackstoneBrickStairs - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneStairs - | BlockKind::PolishedBlackstoneSlab - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `west_connected` property."] - pub fn has_west_connected(self) -> bool { - match self.kind() { - BlockKind::Fire - | BlockKind::OakFence - | BlockKind::BrownMushroomBlock - | BlockKind::RedMushroomBlock - | BlockKind::MushroomStem - | BlockKind::IronBars - | BlockKind::GlassPane - | BlockKind::Vine - | BlockKind::NetherBrickFence - | BlockKind::Tripwire - | BlockKind::WhiteStainedGlassPane - | BlockKind::OrangeStainedGlassPane - | BlockKind::MagentaStainedGlassPane - | BlockKind::LightBlueStainedGlassPane - | BlockKind::YellowStainedGlassPane - | BlockKind::LimeStainedGlassPane - | BlockKind::PinkStainedGlassPane - | BlockKind::GrayStainedGlassPane - | BlockKind::LightGrayStainedGlassPane - | BlockKind::CyanStainedGlassPane - | BlockKind::PurpleStainedGlassPane - | BlockKind::BlueStainedGlassPane - | BlockKind::BrownStainedGlassPane - | BlockKind::GreenStainedGlassPane - | BlockKind::RedStainedGlassPane - | BlockKind::BlackStainedGlassPane - | BlockKind::SpruceFence - | BlockKind::BirchFence - | BlockKind::JungleFence - | BlockKind::AcaciaFence - | BlockKind::DarkOakFence - | BlockKind::ChorusPlant - | BlockKind::CrimsonFence - | BlockKind::WarpedFence => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `west_nlt` property."] - pub fn has_west_nlt(self) -> bool { - match self.kind() { - BlockKind::CobblestoneWall - | BlockKind::MossyCobblestoneWall - | BlockKind::BrickWall - | BlockKind::PrismarineWall - | BlockKind::RedSandstoneWall - | BlockKind::MossyStoneBrickWall - | BlockKind::GraniteWall - | BlockKind::StoneBrickWall - | BlockKind::NetherBrickWall - | BlockKind::AndesiteWall - | BlockKind::RedNetherBrickWall - | BlockKind::SandstoneWall - | BlockKind::EndStoneBrickWall - | BlockKind::DioriteWall - | BlockKind::BlackstoneWall - | BlockKind::PolishedBlackstoneBrickWall - | BlockKind::PolishedBlackstoneWall => true, - _ => false, - } - } - #[doc = "Determines whether or not a block has the `west_wire` property."] - pub fn has_west_wire(self) -> bool { - match self.kind() { - BlockKind::RedstoneWire => true, - _ => false, - } - } -} diff --git a/feather/blocks/src/generated/table.dat b/feather/blocks/src/generated/table.dat deleted file mode 100644 index 9033f810e..000000000 Binary files a/feather/blocks/src/generated/table.dat and /dev/null differ diff --git a/feather/blocks/src/generated/table.rs b/feather/blocks/src/generated/table.rs deleted file mode 100644 index ea078a60b..000000000 --- a/feather/blocks/src/generated/table.rs +++ /dev/null @@ -1,3180 +0,0 @@ -use crate::BlockKind; -use serde::Deserialize; -use std::convert::TryFrom; -use std::str::FromStr; -#[derive(Debug, Deserialize)] -pub struct BlockTable { - age_0_1: Vec<(u16, u16)>, - age_0_15: Vec<(u16, u16)>, - age_0_2: Vec<(u16, u16)>, - age_0_25: Vec<(u16, u16)>, - age_0_3: Vec<(u16, u16)>, - age_0_5: Vec<(u16, u16)>, - age_0_7: Vec<(u16, u16)>, - attached: Vec<(u16, u16)>, - attachment: Vec<(u16, u16)>, - axis_xyz: Vec<(u16, u16)>, - axis_xz: Vec<(u16, u16)>, - bites: Vec<(u16, u16)>, - bottom: Vec<(u16, u16)>, - cauldron_level: Vec<(u16, u16)>, - charges: Vec<(u16, u16)>, - chest_kind: Vec<(u16, u16)>, - comparator_mode: Vec<(u16, u16)>, - conditional: Vec<(u16, u16)>, - delay: Vec<(u16, u16)>, - disarmed: Vec<(u16, u16)>, - distance_0_7: Vec<(u16, u16)>, - distance_1_7: Vec<(u16, u16)>, - down: Vec<(u16, u16)>, - drag: Vec<(u16, u16)>, - east_connected: Vec<(u16, u16)>, - east_nlt: Vec<(u16, u16)>, - east_wire: Vec<(u16, u16)>, - eggs: Vec<(u16, u16)>, - enabled: Vec<(u16, u16)>, - extended: Vec<(u16, u16)>, - eye: Vec<(u16, u16)>, - face: Vec<(u16, u16)>, - facing_cardinal: Vec<(u16, u16)>, - facing_cardinal_and_down: Vec<(u16, u16)>, - facing_cubic: Vec<(u16, u16)>, - half_top_bottom: Vec<(u16, u16)>, - half_upper_lower: Vec<(u16, u16)>, - hanging: Vec<(u16, u16)>, - has_book: Vec<(u16, u16)>, - has_bottle_0: Vec<(u16, u16)>, - has_bottle_1: Vec<(u16, u16)>, - has_bottle_2: Vec<(u16, u16)>, - has_record: Vec<(u16, u16)>, - hatch: Vec<(u16, u16)>, - hinge: Vec<(u16, u16)>, - honey_level: Vec<(u16, u16)>, - in_wall: Vec<(u16, u16)>, - instrument: Vec<(u16, u16)>, - inverted: Vec<(u16, u16)>, - layers: Vec<(u16, u16)>, - leaves: Vec<(u16, u16)>, - level_0_8: Vec<(u16, u16)>, - lit: Vec<(u16, u16)>, - locked: Vec<(u16, u16)>, - moisture: Vec<(u16, u16)>, - north_connected: Vec<(u16, u16)>, - north_nlt: Vec<(u16, u16)>, - north_wire: Vec<(u16, u16)>, - note: Vec<(u16, u16)>, - occupied: Vec<(u16, u16)>, - open: Vec<(u16, u16)>, - orientation: Vec<(u16, u16)>, - part: Vec<(u16, u16)>, - persistent: Vec<(u16, u16)>, - pickles: Vec<(u16, u16)>, - piston_kind: Vec<(u16, u16)>, - power: Vec<(u16, u16)>, - powered: Vec<(u16, u16)>, - powered_rail_shape: Vec<(u16, u16)>, - rail_shape: Vec<(u16, u16)>, - rotation: Vec<(u16, u16)>, - short: Vec<(u16, u16)>, - signal_fire: Vec<(u16, u16)>, - slab_kind: Vec<(u16, u16)>, - snowy: Vec<(u16, u16)>, - south_connected: Vec<(u16, u16)>, - south_nlt: Vec<(u16, u16)>, - south_wire: Vec<(u16, u16)>, - stage: Vec<(u16, u16)>, - stairs_shape: Vec<(u16, u16)>, - structure_block_mode: Vec<(u16, u16)>, - triggered: Vec<(u16, u16)>, - unstable: Vec<(u16, u16)>, - up: Vec<(u16, u16)>, - water_level: Vec<(u16, u16)>, - waterlogged: Vec<(u16, u16)>, - west_connected: Vec<(u16, u16)>, - west_nlt: Vec<(u16, u16)>, - west_wire: Vec<(u16, u16)>, -} -impl BlockTable { - #[doc = "Retrieves the `age_0_1` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_1(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_1[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_1` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_1(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_1[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_15` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_15(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_15[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_15` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_15(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_15[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_2` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_2(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_2[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_2` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_2(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_2[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_25` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_25(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_25[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_25` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_25(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_25[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_3` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_3(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_3[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_3` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_3(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_3[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_5` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_5(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_5[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_5` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_5(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_5[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `age_0_7` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn age_0_7(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.age_0_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `age_0_7` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_age_0_7(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.age_0_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `attached` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn attached(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.attached[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `attached` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_attached(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.attached[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `attachment` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn attachment(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.attachment[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Attachment::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `attachment` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_attachment(&self, kind: BlockKind, state: u16, value: Attachment) -> Option { - let (offset_coefficient, stride) = self.attachment[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `axis_xyz` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn axis_xyz(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.axis_xyz[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(AxisXyz::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `axis_xyz` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_axis_xyz(&self, kind: BlockKind, state: u16, value: AxisXyz) -> Option { - let (offset_coefficient, stride) = self.axis_xyz[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `axis_xz` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn axis_xz(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.axis_xz[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(AxisXz::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `axis_xz` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_axis_xz(&self, kind: BlockKind, state: u16, value: AxisXz) -> Option { - let (offset_coefficient, stride) = self.axis_xz[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `bites` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn bites(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.bites[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `bites` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_bites(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.bites[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `bottom` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn bottom(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.bottom[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `bottom` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_bottom(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.bottom[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `cauldron_level` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn cauldron_level(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.cauldron_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `cauldron_level` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_cauldron_level(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.cauldron_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `charges` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn charges(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.charges[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `charges` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_charges(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.charges[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `chest_kind` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn chest_kind(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.chest_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(ChestKind::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `chest_kind` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_chest_kind(&self, kind: BlockKind, state: u16, value: ChestKind) -> Option { - let (offset_coefficient, stride) = self.chest_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `comparator_mode` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn comparator_mode(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.comparator_mode[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(ComparatorMode::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `comparator_mode` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_comparator_mode( - &self, - kind: BlockKind, - state: u16, - value: ComparatorMode, - ) -> Option { - let (offset_coefficient, stride) = self.comparator_mode[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `conditional` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn conditional(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.conditional[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `conditional` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_conditional(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.conditional[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `delay` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn delay(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.delay[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 1i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `delay` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_delay(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.delay[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 1u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `disarmed` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn disarmed(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.disarmed[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `disarmed` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_disarmed(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.disarmed[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `distance_0_7` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn distance_0_7(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.distance_0_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `distance_0_7` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_distance_0_7(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.distance_0_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `distance_1_7` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn distance_1_7(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.distance_1_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 1i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `distance_1_7` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_distance_1_7(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.distance_1_7[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 1u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `down` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn down(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.down[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `down` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_down(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.down[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `drag` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn drag(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.drag[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `drag` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_drag(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.drag[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `east_connected` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn east_connected(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.east_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `east_connected` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_east_connected(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.east_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `east_nlt` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn east_nlt(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.east_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(EastNlt::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `east_nlt` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_east_nlt(&self, kind: BlockKind, state: u16, value: EastNlt) -> Option { - let (offset_coefficient, stride) = self.east_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `east_wire` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn east_wire(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.east_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(EastWire::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `east_wire` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_east_wire(&self, kind: BlockKind, state: u16, value: EastWire) -> Option { - let (offset_coefficient, stride) = self.east_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `eggs` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn eggs(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.eggs[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 1i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `eggs` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_eggs(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.eggs[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 1u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `enabled` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn enabled(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.enabled[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `enabled` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_enabled(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.enabled[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `extended` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn extended(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.extended[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `extended` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_extended(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.extended[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `eye` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn eye(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.eye[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `eye` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_eye(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.eye[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `face` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn face(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.face[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Face::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `face` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_face(&self, kind: BlockKind, state: u16, value: Face) -> Option { - let (offset_coefficient, stride) = self.face[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `facing_cardinal` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn facing_cardinal(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.facing_cardinal[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(FacingCardinal::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `facing_cardinal` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_facing_cardinal( - &self, - kind: BlockKind, - state: u16, - value: FacingCardinal, - ) -> Option { - let (offset_coefficient, stride) = self.facing_cardinal[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `facing_cardinal_and_down` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn facing_cardinal_and_down( - &self, - kind: BlockKind, - state: u16, - ) -> Option { - let (offset_coefficient, stride) = self.facing_cardinal_and_down[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(FacingCardinalAndDown::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `facing_cardinal_and_down` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_facing_cardinal_and_down( - &self, - kind: BlockKind, - state: u16, - value: FacingCardinalAndDown, - ) -> Option { - let (offset_coefficient, stride) = self.facing_cardinal_and_down[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `facing_cubic` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn facing_cubic(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.facing_cubic[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(FacingCubic::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `facing_cubic` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_facing_cubic(&self, kind: BlockKind, state: u16, value: FacingCubic) -> Option { - let (offset_coefficient, stride) = self.facing_cubic[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `half_top_bottom` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn half_top_bottom(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.half_top_bottom[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(HalfTopBottom::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `half_top_bottom` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_half_top_bottom( - &self, - kind: BlockKind, - state: u16, - value: HalfTopBottom, - ) -> Option { - let (offset_coefficient, stride) = self.half_top_bottom[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `half_upper_lower` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn half_upper_lower(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.half_upper_lower[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(HalfUpperLower::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `half_upper_lower` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_half_upper_lower( - &self, - kind: BlockKind, - state: u16, - value: HalfUpperLower, - ) -> Option { - let (offset_coefficient, stride) = self.half_upper_lower[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `hanging` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn hanging(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.hanging[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `hanging` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_hanging(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.hanging[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `has_book` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn has_book(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.has_book[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `has_book` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_has_book(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.has_book[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `has_bottle_0` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn has_bottle_0(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.has_bottle_0[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `has_bottle_0` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_has_bottle_0(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.has_bottle_0[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `has_bottle_1` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn has_bottle_1(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.has_bottle_1[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `has_bottle_1` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_has_bottle_1(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.has_bottle_1[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `has_bottle_2` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn has_bottle_2(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.has_bottle_2[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `has_bottle_2` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_has_bottle_2(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.has_bottle_2[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `has_record` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn has_record(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.has_record[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `has_record` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_has_record(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.has_record[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `hatch` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn hatch(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.hatch[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `hatch` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_hatch(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.hatch[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `hinge` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn hinge(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.hinge[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Hinge::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `hinge` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_hinge(&self, kind: BlockKind, state: u16, value: Hinge) -> Option { - let (offset_coefficient, stride) = self.hinge[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `honey_level` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn honey_level(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.honey_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `honey_level` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_honey_level(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.honey_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `in_wall` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn in_wall(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.in_wall[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `in_wall` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_in_wall(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.in_wall[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `instrument` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn instrument(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.instrument[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Instrument::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `instrument` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_instrument(&self, kind: BlockKind, state: u16, value: Instrument) -> Option { - let (offset_coefficient, stride) = self.instrument[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `inverted` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn inverted(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.inverted[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `inverted` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_inverted(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.inverted[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `layers` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn layers(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.layers[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 1i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `layers` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_layers(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.layers[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 1u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `leaves` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn leaves(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.leaves[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Leaves::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `leaves` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_leaves(&self, kind: BlockKind, state: u16, value: Leaves) -> Option { - let (offset_coefficient, stride) = self.leaves[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `level_0_8` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn level_0_8(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.level_0_8[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `level_0_8` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_level_0_8(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.level_0_8[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `lit` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn lit(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.lit[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `lit` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_lit(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.lit[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `locked` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn locked(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.locked[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `locked` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_locked(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.locked[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `moisture` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn moisture(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.moisture[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `moisture` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_moisture(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.moisture[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `north_connected` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn north_connected(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.north_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `north_connected` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_north_connected(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.north_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `north_nlt` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn north_nlt(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.north_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(NorthNlt::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `north_nlt` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_north_nlt(&self, kind: BlockKind, state: u16, value: NorthNlt) -> Option { - let (offset_coefficient, stride) = self.north_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `north_wire` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn north_wire(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.north_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(NorthWire::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `north_wire` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_north_wire(&self, kind: BlockKind, state: u16, value: NorthWire) -> Option { - let (offset_coefficient, stride) = self.north_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `note` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn note(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.note[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `note` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_note(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.note[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `occupied` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn occupied(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.occupied[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `occupied` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_occupied(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.occupied[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `open` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn open(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.open[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `open` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_open(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.open[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `orientation` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn orientation(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.orientation[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Orientation::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `orientation` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_orientation(&self, kind: BlockKind, state: u16, value: Orientation) -> Option { - let (offset_coefficient, stride) = self.orientation[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `part` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn part(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.part[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(Part::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `part` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_part(&self, kind: BlockKind, state: u16, value: Part) -> Option { - let (offset_coefficient, stride) = self.part[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `persistent` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn persistent(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.persistent[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `persistent` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_persistent(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.persistent[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `pickles` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn pickles(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.pickles[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 1i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `pickles` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_pickles(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.pickles[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 1u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `piston_kind` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn piston_kind(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.piston_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(PistonKind::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `piston_kind` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_piston_kind(&self, kind: BlockKind, state: u16, value: PistonKind) -> Option { - let (offset_coefficient, stride) = self.piston_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `power` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn power(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.power[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `power` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_power(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.power[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `powered` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn powered(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.powered[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `powered` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_powered(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.powered[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `powered_rail_shape` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn powered_rail_shape(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.powered_rail_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(PoweredRailShape::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `powered_rail_shape` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_powered_rail_shape( - &self, - kind: BlockKind, - state: u16, - value: PoweredRailShape, - ) -> Option { - let (offset_coefficient, stride) = self.powered_rail_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `rail_shape` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn rail_shape(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.rail_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(RailShape::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `rail_shape` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_rail_shape(&self, kind: BlockKind, state: u16, value: RailShape) -> Option { - let (offset_coefficient, stride) = self.rail_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `rotation` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn rotation(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.rotation[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `rotation` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_rotation(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.rotation[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `short` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn short(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.short[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `short` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_short(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.short[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `signal_fire` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn signal_fire(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.signal_fire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `signal_fire` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_signal_fire(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.signal_fire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `slab_kind` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn slab_kind(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.slab_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(SlabKind::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `slab_kind` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_slab_kind(&self, kind: BlockKind, state: u16, value: SlabKind) -> Option { - let (offset_coefficient, stride) = self.slab_kind[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `snowy` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn snowy(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.snowy[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `snowy` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_snowy(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.snowy[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `south_connected` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn south_connected(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.south_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `south_connected` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_south_connected(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.south_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `south_nlt` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn south_nlt(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.south_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(SouthNlt::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `south_nlt` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_south_nlt(&self, kind: BlockKind, state: u16, value: SouthNlt) -> Option { - let (offset_coefficient, stride) = self.south_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `south_wire` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn south_wire(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.south_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(SouthWire::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `south_wire` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_south_wire(&self, kind: BlockKind, state: u16, value: SouthWire) -> Option { - let (offset_coefficient, stride) = self.south_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `stage` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn stage(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.stage[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `stage` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_stage(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.stage[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `stairs_shape` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn stairs_shape(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.stairs_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(StairsShape::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `stairs_shape` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_stairs_shape(&self, kind: BlockKind, state: u16, value: StairsShape) -> Option { - let (offset_coefficient, stride) = self.stairs_shape[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `structure_block_mode` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn structure_block_mode(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.structure_block_mode[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(StructureBlockMode::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `structure_block_mode` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_structure_block_mode( - &self, - kind: BlockKind, - state: u16, - value: StructureBlockMode, - ) -> Option { - let (offset_coefficient, stride) = self.structure_block_mode[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `triggered` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn triggered(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.triggered[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `triggered` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_triggered(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.triggered[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `unstable` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn unstable(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.unstable[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `unstable` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_unstable(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.unstable[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `up` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn up(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.up[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `up` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_up(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.up[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `water_level` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn water_level(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.water_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some({ x as i32 + 0i32 }) - } - #[doc = "Updates the state value for the given block kind such that its `water_level` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_water_level(&self, kind: BlockKind, state: u16, value: i32) -> Option { - let (offset_coefficient, stride) = self.water_level[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 - 0u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `waterlogged` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn waterlogged(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.waterlogged[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `waterlogged` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_waterlogged(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.waterlogged[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `west_connected` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn west_connected(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.west_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(if x == 0 { false } else { true }) - } - #[doc = "Updates the state value for the given block kind such that its `west_connected` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_west_connected(&self, kind: BlockKind, state: u16, value: bool) -> Option { - let (offset_coefficient, stride) = self.west_connected[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `west_nlt` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn west_nlt(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.west_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(WestNlt::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `west_nlt` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_west_nlt(&self, kind: BlockKind, state: u16, value: WestNlt) -> Option { - let (offset_coefficient, stride) = self.west_nlt[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } - #[doc = "Retrieves the `west_wire` value for the given block kind with the given state value.\n Returns the value of the property, or `None` if it does not exist."] - pub fn west_wire(&self, kind: BlockKind, state: u16) -> Option { - let (offset_coefficient, stride) = self.west_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let x = crate::n_dimensional_index(state, offset_coefficient, stride); - Some(WestWire::try_from(x).expect("invalid block state")) - } - #[doc = "Updates the state value for the given block kind such that its `west_wire` value is updated. Returns the new state,\n or `None` if the block does not have this property."] - pub fn set_west_wire(&self, kind: BlockKind, state: u16, value: WestWire) -> Option { - let (offset_coefficient, stride) = self.west_wire[kind as u16 as usize]; - if offset_coefficient == 0 { - return None; - } - let old = crate::n_dimensional_index(state, offset_coefficient, stride) as i32; - let new = ({ value as u16 } as i32 - old) * stride as i32 + state as i32; - Some(new as u16) - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Attachment { - Floor, - Ceiling, - SingleWall, - DoubleWall, -} -impl TryFrom for Attachment { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Attachment::Floor), - 1u16 => Ok(Attachment::Ceiling), - 2u16 => Ok(Attachment::SingleWall), - 3u16 => Ok(Attachment::DoubleWall), - x => Err(anyhow::anyhow!("invalid value {} for Attachment", x)), - } - } -} -impl FromStr for Attachment { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "floor" => Ok(Attachment::Floor), - "ceiling" => Ok(Attachment::Ceiling), - "single_wall" => Ok(Attachment::SingleWall), - "double_wall" => Ok(Attachment::DoubleWall), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(Attachment) - )), - } - } -} -impl Attachment { - pub fn as_str(self) -> &'static str { - match self { - Attachment::Floor => "floor", - Attachment::Ceiling => "ceiling", - Attachment::SingleWall => "single_wall", - Attachment::DoubleWall => "double_wall", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum AxisXyz { - X, - Y, - Z, -} -impl TryFrom for AxisXyz { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(AxisXyz::X), - 1u16 => Ok(AxisXyz::Y), - 2u16 => Ok(AxisXyz::Z), - x => Err(anyhow::anyhow!("invalid value {} for AxisXyz", x)), - } - } -} -impl FromStr for AxisXyz { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "x" => Ok(AxisXyz::X), - "y" => Ok(AxisXyz::Y), - "z" => Ok(AxisXyz::Z), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(AxisXyz))), - } - } -} -impl AxisXyz { - pub fn as_str(self) -> &'static str { - match self { - AxisXyz::X => "x", - AxisXyz::Y => "y", - AxisXyz::Z => "z", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum AxisXz { - X, - Z, -} -impl TryFrom for AxisXz { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(AxisXz::X), - 1u16 => Ok(AxisXz::Z), - x => Err(anyhow::anyhow!("invalid value {} for AxisXz", x)), - } - } -} -impl FromStr for AxisXz { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "x" => Ok(AxisXz::X), - "z" => Ok(AxisXz::Z), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(AxisXz))), - } - } -} -impl AxisXz { - pub fn as_str(self) -> &'static str { - match self { - AxisXz::X => "x", - AxisXz::Z => "z", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum ChestKind { - Single, - Left, - Right, -} -impl TryFrom for ChestKind { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(ChestKind::Single), - 1u16 => Ok(ChestKind::Left), - 2u16 => Ok(ChestKind::Right), - x => Err(anyhow::anyhow!("invalid value {} for ChestKind", x)), - } - } -} -impl FromStr for ChestKind { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "single" => Ok(ChestKind::Single), - "left" => Ok(ChestKind::Left), - "right" => Ok(ChestKind::Right), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(ChestKind) - )), - } - } -} -impl ChestKind { - pub fn as_str(self) -> &'static str { - match self { - ChestKind::Single => "single", - ChestKind::Left => "left", - ChestKind::Right => "right", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum ComparatorMode { - Compare, - Subtract, -} -impl TryFrom for ComparatorMode { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(ComparatorMode::Compare), - 1u16 => Ok(ComparatorMode::Subtract), - x => Err(anyhow::anyhow!("invalid value {} for ComparatorMode", x)), - } - } -} -impl FromStr for ComparatorMode { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "compare" => Ok(ComparatorMode::Compare), - "subtract" => Ok(ComparatorMode::Subtract), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(ComparatorMode) - )), - } - } -} -impl ComparatorMode { - pub fn as_str(self) -> &'static str { - match self { - ComparatorMode::Compare => "compare", - ComparatorMode::Subtract => "subtract", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum EastNlt { - None, - Low, - Tall, -} -impl TryFrom for EastNlt { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(EastNlt::None), - 1u16 => Ok(EastNlt::Low), - 2u16 => Ok(EastNlt::Tall), - x => Err(anyhow::anyhow!("invalid value {} for EastNlt", x)), - } - } -} -impl FromStr for EastNlt { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "none" => Ok(EastNlt::None), - "low" => Ok(EastNlt::Low), - "tall" => Ok(EastNlt::Tall), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(EastNlt))), - } - } -} -impl EastNlt { - pub fn as_str(self) -> &'static str { - match self { - EastNlt::None => "none", - EastNlt::Low => "low", - EastNlt::Tall => "tall", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum EastWire { - Up, - Side, - None, -} -impl TryFrom for EastWire { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(EastWire::Up), - 1u16 => Ok(EastWire::Side), - 2u16 => Ok(EastWire::None), - x => Err(anyhow::anyhow!("invalid value {} for EastWire", x)), - } - } -} -impl FromStr for EastWire { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "up" => Ok(EastWire::Up), - "side" => Ok(EastWire::Side), - "none" => Ok(EastWire::None), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(EastWire) - )), - } - } -} -impl EastWire { - pub fn as_str(self) -> &'static str { - match self { - EastWire::Up => "up", - EastWire::Side => "side", - EastWire::None => "none", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Face { - Floor, - Wall, - Ceiling, -} -impl TryFrom for Face { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Face::Floor), - 1u16 => Ok(Face::Wall), - 2u16 => Ok(Face::Ceiling), - x => Err(anyhow::anyhow!("invalid value {} for Face", x)), - } - } -} -impl FromStr for Face { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "floor" => Ok(Face::Floor), - "wall" => Ok(Face::Wall), - "ceiling" => Ok(Face::Ceiling), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(Face))), - } - } -} -impl Face { - pub fn as_str(self) -> &'static str { - match self { - Face::Floor => "floor", - Face::Wall => "wall", - Face::Ceiling => "ceiling", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum FacingCardinal { - North, - South, - West, - East, -} -impl TryFrom for FacingCardinal { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(FacingCardinal::North), - 1u16 => Ok(FacingCardinal::South), - 2u16 => Ok(FacingCardinal::West), - 3u16 => Ok(FacingCardinal::East), - x => Err(anyhow::anyhow!("invalid value {} for FacingCardinal", x)), - } - } -} -impl FromStr for FacingCardinal { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "north" => Ok(FacingCardinal::North), - "south" => Ok(FacingCardinal::South), - "west" => Ok(FacingCardinal::West), - "east" => Ok(FacingCardinal::East), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(FacingCardinal) - )), - } - } -} -impl FacingCardinal { - pub fn as_str(self) -> &'static str { - match self { - FacingCardinal::North => "north", - FacingCardinal::South => "south", - FacingCardinal::West => "west", - FacingCardinal::East => "east", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum FacingCardinalAndDown { - Down, - North, - South, - West, - East, -} -impl TryFrom for FacingCardinalAndDown { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(FacingCardinalAndDown::Down), - 1u16 => Ok(FacingCardinalAndDown::North), - 2u16 => Ok(FacingCardinalAndDown::South), - 3u16 => Ok(FacingCardinalAndDown::West), - 4u16 => Ok(FacingCardinalAndDown::East), - x => Err(anyhow::anyhow!( - "invalid value {} for FacingCardinalAndDown", - x - )), - } - } -} -impl FromStr for FacingCardinalAndDown { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "down" => Ok(FacingCardinalAndDown::Down), - "north" => Ok(FacingCardinalAndDown::North), - "south" => Ok(FacingCardinalAndDown::South), - "west" => Ok(FacingCardinalAndDown::West), - "east" => Ok(FacingCardinalAndDown::East), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(FacingCardinalAndDown) - )), - } - } -} -impl FacingCardinalAndDown { - pub fn as_str(self) -> &'static str { - match self { - FacingCardinalAndDown::Down => "down", - FacingCardinalAndDown::North => "north", - FacingCardinalAndDown::South => "south", - FacingCardinalAndDown::West => "west", - FacingCardinalAndDown::East => "east", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum FacingCubic { - North, - East, - South, - West, - Up, - Down, -} -impl TryFrom for FacingCubic { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(FacingCubic::North), - 1u16 => Ok(FacingCubic::East), - 2u16 => Ok(FacingCubic::South), - 3u16 => Ok(FacingCubic::West), - 4u16 => Ok(FacingCubic::Up), - 5u16 => Ok(FacingCubic::Down), - x => Err(anyhow::anyhow!("invalid value {} for FacingCubic", x)), - } - } -} -impl FromStr for FacingCubic { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "north" => Ok(FacingCubic::North), - "east" => Ok(FacingCubic::East), - "south" => Ok(FacingCubic::South), - "west" => Ok(FacingCubic::West), - "up" => Ok(FacingCubic::Up), - "down" => Ok(FacingCubic::Down), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(FacingCubic) - )), - } - } -} -impl FacingCubic { - pub fn as_str(self) -> &'static str { - match self { - FacingCubic::North => "north", - FacingCubic::East => "east", - FacingCubic::South => "south", - FacingCubic::West => "west", - FacingCubic::Up => "up", - FacingCubic::Down => "down", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum HalfTopBottom { - Top, - Bottom, -} -impl TryFrom for HalfTopBottom { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(HalfTopBottom::Top), - 1u16 => Ok(HalfTopBottom::Bottom), - x => Err(anyhow::anyhow!("invalid value {} for HalfTopBottom", x)), - } - } -} -impl FromStr for HalfTopBottom { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "top" => Ok(HalfTopBottom::Top), - "bottom" => Ok(HalfTopBottom::Bottom), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(HalfTopBottom) - )), - } - } -} -impl HalfTopBottom { - pub fn as_str(self) -> &'static str { - match self { - HalfTopBottom::Top => "top", - HalfTopBottom::Bottom => "bottom", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum HalfUpperLower { - Upper, - Lower, -} -impl TryFrom for HalfUpperLower { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(HalfUpperLower::Upper), - 1u16 => Ok(HalfUpperLower::Lower), - x => Err(anyhow::anyhow!("invalid value {} for HalfUpperLower", x)), - } - } -} -impl FromStr for HalfUpperLower { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "upper" => Ok(HalfUpperLower::Upper), - "lower" => Ok(HalfUpperLower::Lower), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(HalfUpperLower) - )), - } - } -} -impl HalfUpperLower { - pub fn as_str(self) -> &'static str { - match self { - HalfUpperLower::Upper => "upper", - HalfUpperLower::Lower => "lower", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Hinge { - Left, - Right, -} -impl TryFrom for Hinge { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Hinge::Left), - 1u16 => Ok(Hinge::Right), - x => Err(anyhow::anyhow!("invalid value {} for Hinge", x)), - } - } -} -impl FromStr for Hinge { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "left" => Ok(Hinge::Left), - "right" => Ok(Hinge::Right), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(Hinge))), - } - } -} -impl Hinge { - pub fn as_str(self) -> &'static str { - match self { - Hinge::Left => "left", - Hinge::Right => "right", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Instrument { - Harp, - Basedrum, - Snare, - Hat, - Bass, - Flute, - Bell, - Guitar, - Chime, - Xylophone, - IronXylophone, - CowBell, - Didgeridoo, - Bit, - Banjo, - Pling, -} -impl TryFrom for Instrument { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Instrument::Harp), - 1u16 => Ok(Instrument::Basedrum), - 2u16 => Ok(Instrument::Snare), - 3u16 => Ok(Instrument::Hat), - 4u16 => Ok(Instrument::Bass), - 5u16 => Ok(Instrument::Flute), - 6u16 => Ok(Instrument::Bell), - 7u16 => Ok(Instrument::Guitar), - 8u16 => Ok(Instrument::Chime), - 9u16 => Ok(Instrument::Xylophone), - 10u16 => Ok(Instrument::IronXylophone), - 11u16 => Ok(Instrument::CowBell), - 12u16 => Ok(Instrument::Didgeridoo), - 13u16 => Ok(Instrument::Bit), - 14u16 => Ok(Instrument::Banjo), - 15u16 => Ok(Instrument::Pling), - x => Err(anyhow::anyhow!("invalid value {} for Instrument", x)), - } - } -} -impl FromStr for Instrument { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "harp" => Ok(Instrument::Harp), - "basedrum" => Ok(Instrument::Basedrum), - "snare" => Ok(Instrument::Snare), - "hat" => Ok(Instrument::Hat), - "bass" => Ok(Instrument::Bass), - "flute" => Ok(Instrument::Flute), - "bell" => Ok(Instrument::Bell), - "guitar" => Ok(Instrument::Guitar), - "chime" => Ok(Instrument::Chime), - "xylophone" => Ok(Instrument::Xylophone), - "iron_xylophone" => Ok(Instrument::IronXylophone), - "cow_bell" => Ok(Instrument::CowBell), - "didgeridoo" => Ok(Instrument::Didgeridoo), - "bit" => Ok(Instrument::Bit), - "banjo" => Ok(Instrument::Banjo), - "pling" => Ok(Instrument::Pling), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(Instrument) - )), - } - } -} -impl Instrument { - pub fn as_str(self) -> &'static str { - match self { - Instrument::Harp => "harp", - Instrument::Basedrum => "basedrum", - Instrument::Snare => "snare", - Instrument::Hat => "hat", - Instrument::Bass => "bass", - Instrument::Flute => "flute", - Instrument::Bell => "bell", - Instrument::Guitar => "guitar", - Instrument::Chime => "chime", - Instrument::Xylophone => "xylophone", - Instrument::IronXylophone => "iron_xylophone", - Instrument::CowBell => "cow_bell", - Instrument::Didgeridoo => "didgeridoo", - Instrument::Bit => "bit", - Instrument::Banjo => "banjo", - Instrument::Pling => "pling", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Leaves { - None, - Small, - Large, -} -impl TryFrom for Leaves { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Leaves::None), - 1u16 => Ok(Leaves::Small), - 2u16 => Ok(Leaves::Large), - x => Err(anyhow::anyhow!("invalid value {} for Leaves", x)), - } - } -} -impl FromStr for Leaves { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "none" => Ok(Leaves::None), - "small" => Ok(Leaves::Small), - "large" => Ok(Leaves::Large), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(Leaves))), - } - } -} -impl Leaves { - pub fn as_str(self) -> &'static str { - match self { - Leaves::None => "none", - Leaves::Small => "small", - Leaves::Large => "large", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum NorthNlt { - None, - Low, - Tall, -} -impl TryFrom for NorthNlt { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(NorthNlt::None), - 1u16 => Ok(NorthNlt::Low), - 2u16 => Ok(NorthNlt::Tall), - x => Err(anyhow::anyhow!("invalid value {} for NorthNlt", x)), - } - } -} -impl FromStr for NorthNlt { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "none" => Ok(NorthNlt::None), - "low" => Ok(NorthNlt::Low), - "tall" => Ok(NorthNlt::Tall), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(NorthNlt) - )), - } - } -} -impl NorthNlt { - pub fn as_str(self) -> &'static str { - match self { - NorthNlt::None => "none", - NorthNlt::Low => "low", - NorthNlt::Tall => "tall", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum NorthWire { - Up, - Side, - None, -} -impl TryFrom for NorthWire { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(NorthWire::Up), - 1u16 => Ok(NorthWire::Side), - 2u16 => Ok(NorthWire::None), - x => Err(anyhow::anyhow!("invalid value {} for NorthWire", x)), - } - } -} -impl FromStr for NorthWire { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "up" => Ok(NorthWire::Up), - "side" => Ok(NorthWire::Side), - "none" => Ok(NorthWire::None), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(NorthWire) - )), - } - } -} -impl NorthWire { - pub fn as_str(self) -> &'static str { - match self { - NorthWire::Up => "up", - NorthWire::Side => "side", - NorthWire::None => "none", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Orientation { - DownEast, - DownNorth, - DownSouth, - DownWest, - UpEast, - UpNorth, - UpSouth, - UpWest, - WestUp, - EastUp, - NorthUp, - SouthUp, -} -impl TryFrom for Orientation { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Orientation::DownEast), - 1u16 => Ok(Orientation::DownNorth), - 2u16 => Ok(Orientation::DownSouth), - 3u16 => Ok(Orientation::DownWest), - 4u16 => Ok(Orientation::UpEast), - 5u16 => Ok(Orientation::UpNorth), - 6u16 => Ok(Orientation::UpSouth), - 7u16 => Ok(Orientation::UpWest), - 8u16 => Ok(Orientation::WestUp), - 9u16 => Ok(Orientation::EastUp), - 10u16 => Ok(Orientation::NorthUp), - 11u16 => Ok(Orientation::SouthUp), - x => Err(anyhow::anyhow!("invalid value {} for Orientation", x)), - } - } -} -impl FromStr for Orientation { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "down_east" => Ok(Orientation::DownEast), - "down_north" => Ok(Orientation::DownNorth), - "down_south" => Ok(Orientation::DownSouth), - "down_west" => Ok(Orientation::DownWest), - "up_east" => Ok(Orientation::UpEast), - "up_north" => Ok(Orientation::UpNorth), - "up_south" => Ok(Orientation::UpSouth), - "up_west" => Ok(Orientation::UpWest), - "west_up" => Ok(Orientation::WestUp), - "east_up" => Ok(Orientation::EastUp), - "north_up" => Ok(Orientation::NorthUp), - "south_up" => Ok(Orientation::SouthUp), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(Orientation) - )), - } - } -} -impl Orientation { - pub fn as_str(self) -> &'static str { - match self { - Orientation::DownEast => "down_east", - Orientation::DownNorth => "down_north", - Orientation::DownSouth => "down_south", - Orientation::DownWest => "down_west", - Orientation::UpEast => "up_east", - Orientation::UpNorth => "up_north", - Orientation::UpSouth => "up_south", - Orientation::UpWest => "up_west", - Orientation::WestUp => "west_up", - Orientation::EastUp => "east_up", - Orientation::NorthUp => "north_up", - Orientation::SouthUp => "south_up", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum Part { - Head, - Foot, -} -impl TryFrom for Part { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(Part::Head), - 1u16 => Ok(Part::Foot), - x => Err(anyhow::anyhow!("invalid value {} for Part", x)), - } - } -} -impl FromStr for Part { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "head" => Ok(Part::Head), - "foot" => Ok(Part::Foot), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(Part))), - } - } -} -impl Part { - pub fn as_str(self) -> &'static str { - match self { - Part::Head => "head", - Part::Foot => "foot", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum PistonKind { - Normal, - Sticky, -} -impl TryFrom for PistonKind { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(PistonKind::Normal), - 1u16 => Ok(PistonKind::Sticky), - x => Err(anyhow::anyhow!("invalid value {} for PistonKind", x)), - } - } -} -impl FromStr for PistonKind { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "normal" => Ok(PistonKind::Normal), - "sticky" => Ok(PistonKind::Sticky), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(PistonKind) - )), - } - } -} -impl PistonKind { - pub fn as_str(self) -> &'static str { - match self { - PistonKind::Normal => "normal", - PistonKind::Sticky => "sticky", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum PoweredRailShape { - NorthSouth, - EastWest, - AscendingEast, - AscendingWest, - AscendingNorth, - AscendingSouth, -} -impl TryFrom for PoweredRailShape { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(PoweredRailShape::NorthSouth), - 1u16 => Ok(PoweredRailShape::EastWest), - 2u16 => Ok(PoweredRailShape::AscendingEast), - 3u16 => Ok(PoweredRailShape::AscendingWest), - 4u16 => Ok(PoweredRailShape::AscendingNorth), - 5u16 => Ok(PoweredRailShape::AscendingSouth), - x => Err(anyhow::anyhow!("invalid value {} for PoweredRailShape", x)), - } - } -} -impl FromStr for PoweredRailShape { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "north_south" => Ok(PoweredRailShape::NorthSouth), - "east_west" => Ok(PoweredRailShape::EastWest), - "ascending_east" => Ok(PoweredRailShape::AscendingEast), - "ascending_west" => Ok(PoweredRailShape::AscendingWest), - "ascending_north" => Ok(PoweredRailShape::AscendingNorth), - "ascending_south" => Ok(PoweredRailShape::AscendingSouth), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(PoweredRailShape) - )), - } - } -} -impl PoweredRailShape { - pub fn as_str(self) -> &'static str { - match self { - PoweredRailShape::NorthSouth => "north_south", - PoweredRailShape::EastWest => "east_west", - PoweredRailShape::AscendingEast => "ascending_east", - PoweredRailShape::AscendingWest => "ascending_west", - PoweredRailShape::AscendingNorth => "ascending_north", - PoweredRailShape::AscendingSouth => "ascending_south", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum RailShape { - NorthSouth, - EastWest, - AscendingEast, - AscendingWest, - AscendingNorth, - AscendingSouth, - SouthEast, - SouthWest, - NorthWest, - NorthEast, -} -impl TryFrom for RailShape { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(RailShape::NorthSouth), - 1u16 => Ok(RailShape::EastWest), - 2u16 => Ok(RailShape::AscendingEast), - 3u16 => Ok(RailShape::AscendingWest), - 4u16 => Ok(RailShape::AscendingNorth), - 5u16 => Ok(RailShape::AscendingSouth), - 6u16 => Ok(RailShape::SouthEast), - 7u16 => Ok(RailShape::SouthWest), - 8u16 => Ok(RailShape::NorthWest), - 9u16 => Ok(RailShape::NorthEast), - x => Err(anyhow::anyhow!("invalid value {} for RailShape", x)), - } - } -} -impl FromStr for RailShape { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "north_south" => Ok(RailShape::NorthSouth), - "east_west" => Ok(RailShape::EastWest), - "ascending_east" => Ok(RailShape::AscendingEast), - "ascending_west" => Ok(RailShape::AscendingWest), - "ascending_north" => Ok(RailShape::AscendingNorth), - "ascending_south" => Ok(RailShape::AscendingSouth), - "south_east" => Ok(RailShape::SouthEast), - "south_west" => Ok(RailShape::SouthWest), - "north_west" => Ok(RailShape::NorthWest), - "north_east" => Ok(RailShape::NorthEast), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(RailShape) - )), - } - } -} -impl RailShape { - pub fn as_str(self) -> &'static str { - match self { - RailShape::NorthSouth => "north_south", - RailShape::EastWest => "east_west", - RailShape::AscendingEast => "ascending_east", - RailShape::AscendingWest => "ascending_west", - RailShape::AscendingNorth => "ascending_north", - RailShape::AscendingSouth => "ascending_south", - RailShape::SouthEast => "south_east", - RailShape::SouthWest => "south_west", - RailShape::NorthWest => "north_west", - RailShape::NorthEast => "north_east", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum SlabKind { - Top, - Bottom, - Double, -} -impl TryFrom for SlabKind { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(SlabKind::Top), - 1u16 => Ok(SlabKind::Bottom), - 2u16 => Ok(SlabKind::Double), - x => Err(anyhow::anyhow!("invalid value {} for SlabKind", x)), - } - } -} -impl FromStr for SlabKind { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "top" => Ok(SlabKind::Top), - "bottom" => Ok(SlabKind::Bottom), - "double" => Ok(SlabKind::Double), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(SlabKind) - )), - } - } -} -impl SlabKind { - pub fn as_str(self) -> &'static str { - match self { - SlabKind::Top => "top", - SlabKind::Bottom => "bottom", - SlabKind::Double => "double", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum SouthNlt { - None, - Low, - Tall, -} -impl TryFrom for SouthNlt { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(SouthNlt::None), - 1u16 => Ok(SouthNlt::Low), - 2u16 => Ok(SouthNlt::Tall), - x => Err(anyhow::anyhow!("invalid value {} for SouthNlt", x)), - } - } -} -impl FromStr for SouthNlt { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "none" => Ok(SouthNlt::None), - "low" => Ok(SouthNlt::Low), - "tall" => Ok(SouthNlt::Tall), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(SouthNlt) - )), - } - } -} -impl SouthNlt { - pub fn as_str(self) -> &'static str { - match self { - SouthNlt::None => "none", - SouthNlt::Low => "low", - SouthNlt::Tall => "tall", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum SouthWire { - Up, - Side, - None, -} -impl TryFrom for SouthWire { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(SouthWire::Up), - 1u16 => Ok(SouthWire::Side), - 2u16 => Ok(SouthWire::None), - x => Err(anyhow::anyhow!("invalid value {} for SouthWire", x)), - } - } -} -impl FromStr for SouthWire { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "up" => Ok(SouthWire::Up), - "side" => Ok(SouthWire::Side), - "none" => Ok(SouthWire::None), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(SouthWire) - )), - } - } -} -impl SouthWire { - pub fn as_str(self) -> &'static str { - match self { - SouthWire::Up => "up", - SouthWire::Side => "side", - SouthWire::None => "none", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum StairsShape { - Straight, - InnerLeft, - InnerRight, - OuterLeft, - OuterRight, -} -impl TryFrom for StairsShape { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(StairsShape::Straight), - 1u16 => Ok(StairsShape::InnerLeft), - 2u16 => Ok(StairsShape::InnerRight), - 3u16 => Ok(StairsShape::OuterLeft), - 4u16 => Ok(StairsShape::OuterRight), - x => Err(anyhow::anyhow!("invalid value {} for StairsShape", x)), - } - } -} -impl FromStr for StairsShape { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "straight" => Ok(StairsShape::Straight), - "inner_left" => Ok(StairsShape::InnerLeft), - "inner_right" => Ok(StairsShape::InnerRight), - "outer_left" => Ok(StairsShape::OuterLeft), - "outer_right" => Ok(StairsShape::OuterRight), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(StairsShape) - )), - } - } -} -impl StairsShape { - pub fn as_str(self) -> &'static str { - match self { - StairsShape::Straight => "straight", - StairsShape::InnerLeft => "inner_left", - StairsShape::InnerRight => "inner_right", - StairsShape::OuterLeft => "outer_left", - StairsShape::OuterRight => "outer_right", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum StructureBlockMode { - Save, - Load, - Corner, - Data, -} -impl TryFrom for StructureBlockMode { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(StructureBlockMode::Save), - 1u16 => Ok(StructureBlockMode::Load), - 2u16 => Ok(StructureBlockMode::Corner), - 3u16 => Ok(StructureBlockMode::Data), - x => Err(anyhow::anyhow!( - "invalid value {} for StructureBlockMode", - x - )), - } - } -} -impl FromStr for StructureBlockMode { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "save" => Ok(StructureBlockMode::Save), - "load" => Ok(StructureBlockMode::Load), - "corner" => Ok(StructureBlockMode::Corner), - "data" => Ok(StructureBlockMode::Data), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(StructureBlockMode) - )), - } - } -} -impl StructureBlockMode { - pub fn as_str(self) -> &'static str { - match self { - StructureBlockMode::Save => "save", - StructureBlockMode::Load => "load", - StructureBlockMode::Corner => "corner", - StructureBlockMode::Data => "data", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum WestNlt { - None, - Low, - Tall, -} -impl TryFrom for WestNlt { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(WestNlt::None), - 1u16 => Ok(WestNlt::Low), - 2u16 => Ok(WestNlt::Tall), - x => Err(anyhow::anyhow!("invalid value {} for WestNlt", x)), - } - } -} -impl FromStr for WestNlt { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "none" => Ok(WestNlt::None), - "low" => Ok(WestNlt::Low), - "tall" => Ok(WestNlt::Tall), - _ => Err(anyhow::anyhow!("invalid value for {}", stringify!(WestNlt))), - } - } -} -impl WestNlt { - pub fn as_str(self) -> &'static str { - match self { - WestNlt::None => "none", - WestNlt::Low => "low", - WestNlt::Tall => "tall", - } - } -} -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(u16)] -pub enum WestWire { - Up, - Side, - None, -} -impl TryFrom for WestWire { - type Error = anyhow::Error; - fn try_from(value: u16) -> anyhow::Result { - match value { - 0u16 => Ok(WestWire::Up), - 1u16 => Ok(WestWire::Side), - 2u16 => Ok(WestWire::None), - x => Err(anyhow::anyhow!("invalid value {} for WestWire", x)), - } - } -} -impl FromStr for WestWire { - type Err = anyhow::Error; - fn from_str(s: &str) -> anyhow::Result { - match s { - "up" => Ok(WestWire::Up), - "side" => Ok(WestWire::Side), - "none" => Ok(WestWire::None), - _ => Err(anyhow::anyhow!( - "invalid value for {}", - stringify!(WestWire) - )), - } - } -} -impl WestWire { - pub fn as_str(self) -> &'static str { - match self { - WestWire::Up => "up", - WestWire::Side => "side", - WestWire::None => "none", - } - } -} diff --git a/feather/blocks/src/generated/vanilla_ids.dat b/feather/blocks/src/generated/vanilla_ids.dat deleted file mode 100644 index fd1c60abd..000000000 Binary files a/feather/blocks/src/generated/vanilla_ids.dat and /dev/null differ diff --git a/feather/blocks/src/lib.rs b/feather/blocks/src/lib.rs deleted file mode 100644 index f8cf91187..000000000 --- a/feather/blocks/src/lib.rs +++ /dev/null @@ -1,229 +0,0 @@ -pub use libcraft_blocks::{BlockKind, SimplifiedBlockKind}; -use num_traits::FromPrimitive; -use std::convert::TryFrom; -use thiserror::Error; - -pub mod categories; -mod directions; -#[allow(warnings)] -#[allow(clippy::all)] -mod generated; -mod wall_blocks; - -static BLOCK_TABLE: Lazy = Lazy::new(|| { - let bytes = include_bytes!("generated/table.dat"); - bincode::deserialize(bytes).expect("failed to deserialize generated block table (bincode)") -}); - -static VANILLA_ID_TABLE: Lazy>> = Lazy::new(|| { - let bytes = include_bytes!("generated/vanilla_ids.dat"); - bincode::deserialize(bytes).expect("failed to deserialize generated vanilla ID table (bincode)") -}); - -pub const HIGHEST_ID: u16 = 17111; - -static FROM_VANILLA_ID_TABLE: Lazy> = Lazy::new(|| { - let mut res = vec![BlockId::default(); u16::max_value() as usize]; - - for (kind_id, ids) in VANILLA_ID_TABLE.iter().enumerate() { - let kind = BlockKind::from_u16(kind_id as u16).expect("invalid block kind ID"); - - for (state, id) in ids.iter().enumerate() { - res[*id as usize] = BlockId { - state: state as u16, - kind, - }; - } - } - - debug_assert!((1..=HIGHEST_ID).all(|id| res[id as usize] != BlockId::default())); - // Verify distinction - if cfg!(debug_assertions) { - let mut known_blocks = HashSet::with_capacity(HIGHEST_ID as usize); - assert!((1..=HIGHEST_ID).all(|id| known_blocks.insert(res[id as usize]))); - } - - res -}); - -/// Can be called at startup to pre-initialize the global block table. -pub fn init() { - Lazy::force(&FROM_VANILLA_ID_TABLE); - Lazy::force(&BLOCK_TABLE); -} - -use once_cell::sync::Lazy; - -pub use crate::generated::table::*; - -use std::collections::HashSet; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub struct BlockId { - kind: BlockKind, - state: u16, -} - -impl Default for BlockId { - fn default() -> Self { - BlockId { - kind: BlockKind::Air, - state: 0, - } - } -} - -impl BlockId { - /// Returns the kind of this block. - pub fn kind(self) -> BlockKind { - self.kind - } - - /// Returns the simplified kind of this block. - /// This is an arbitrary manual mapping that aims to condense the different - /// vanilla block kinds which have only minor differences (e.g. different colored beds) - /// and is mainly intended to make `match`ing on the block type easier. - /// This mapping in no way stable right now. - pub fn simplified_kind(self) -> SimplifiedBlockKind { - self.kind.simplified_kind() - } - - /// Returns the vanilla state ID for this block. - pub fn vanilla_id(self) -> u16 { - VANILLA_ID_TABLE[self.kind as u16 as usize][self.state as usize] - } - - /* - /// Returns the vanilla fluid ID for this block in case it is a fluid. - /// The fluid ID is used in the Tags packet. - pub fn vanilla_fluid_id(self) -> Option { - if self.is_fluid() { - match (self.kind(), self.water_level().unwrap()) { - // could be swapped? - (BlockKind::Water, 0) => Some(2), // stationary water - (BlockKind::Water, _) => Some(1), // flowing water - // tested those - (BlockKind::Lava, 0) => Some(4), // stationary lava - (BlockKind::Lava, _) => Some(3), // flowing lava - _ => unreachable!(), - } - } else { - None - } - } - */ - - /// Returns the block corresponding to the given vanilla ID. - /// - /// (Invalid IDs currently return `BlockId::air()`). - pub fn from_vanilla_id(id: u16) -> Self { - FROM_VANILLA_ID_TABLE[id as usize] - } -} - -impl From for u32 { - fn from(id: BlockId) -> Self { - ((id.kind as u32) << 16) | id.state as u32 - } -} - -#[derive(Debug, Error)] -pub enum BlockIdFromU32Error { - #[error("invalid block kind ID {0}")] - InvalidKind(u16), - #[error("invalid block state ID {0} for kind {1:?}")] - InvalidState(u16, BlockKind), -} - -impl TryFrom for BlockId { - type Error = BlockIdFromU32Error; - - fn try_from(value: u32) -> Result { - let kind_id = (value >> 16) as u16; - let kind = BlockKind::from_u16(kind_id).ok_or(BlockIdFromU32Error::InvalidKind(kind_id))?; - - let state = (value | ((1 << 16) - 1)) as u16; - - // TODO: verify state - Ok(BlockId { kind, state }) - } -} - -// This is where the magic happens. -pub(crate) fn n_dimensional_index(state: u16, offset_coefficient: u16, stride: u16) -> u16 { - (state % offset_coefficient) / stride -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn instrument() { - let mut block = BlockId { - kind: BlockKind::NoteBlock, - state: 0, - }; - assert!(block.instrument().is_some()); - - block.set_instrument(Instrument::Basedrum); - assert_eq!(block.instrument(), Some(Instrument::Basedrum)); - } - - #[test] - fn highest_id() { - assert_eq!( - HIGHEST_ID, - *VANILLA_ID_TABLE.last().unwrap().last().unwrap() - ) - } - - #[test] - fn vanilla_ids() { - let block = BlockId::rose_bush().with_half_upper_lower(HalfUpperLower::Lower); - - assert_eq!(block.vanilla_id(), 7894); // will have to be changed whenever we update to a newer MC version - assert_eq!(BlockId::from_vanilla_id(block.vanilla_id()), block); - - let block = - BlockId::structure_block().with_structure_block_mode(StructureBlockMode::Corner); - - assert_eq!(block.vanilla_id(), 15745); - assert_eq!(BlockId::from_vanilla_id(block.vanilla_id()), block); - - let mut block = BlockId::redstone_wire(); - block.set_power(2); - block.set_south_wire(SouthWire::Side); - block.set_west_wire(WestWire::Side); - block.set_east_wire(EastWire::Side); - block.set_north_wire(NorthWire::Up); - - assert_eq!(block.power(), Some(2)); - assert_eq!(block.south_wire(), Some(SouthWire::Side)); - assert_eq!(block.west_wire(), Some(WestWire::Side)); - assert_eq!(block.east_wire(), Some(EastWire::Side)); - assert_eq!(block.north_wire(), Some(NorthWire::Up)); - - assert_eq!(block.vanilla_id(), 2512); - assert_eq!(BlockId::from_vanilla_id(block.vanilla_id()), block); - } - - #[test] - fn vanilla_ids_roundtrip() { - for id in 0..8598 { - assert_eq!(BlockId::from_vanilla_id(id).vanilla_id(), id); - - if id != 0 { - assert_ne!(BlockId::from_vanilla_id(id), BlockId::air()); - } - } - } - - #[test] - fn property_starting_at_1() { - let block = BlockId::snow().with_layers(1); - - assert_eq!(block.layers(), Some(1)); - assert_eq!(block.to_properties_map()["layers"], "1"); - } -} diff --git a/feather/blocks/src/wall_blocks.rs b/feather/blocks/src/wall_blocks.rs deleted file mode 100644 index 268f31781..000000000 --- a/feather/blocks/src/wall_blocks.rs +++ /dev/null @@ -1,41 +0,0 @@ -use crate::{BlockId, BlockKind}; - -impl BlockId { - pub fn to_wall_block(self) -> Option { - match self.kind() { - BlockKind::Torch => Some(BlockId::wall_torch()), - BlockKind::RedstoneTorch => Some(BlockId::redstone_wall_torch()), - BlockKind::OakSign => Some(BlockId::oak_wall_sign()), - BlockKind::SpruceSign => Some(BlockId::spruce_wall_sign()), - BlockKind::AcaciaSign => Some(BlockId::acacia_wall_sign()), - BlockKind::BirchSign => Some(BlockId::birch_wall_sign()), - BlockKind::CrimsonSign => Some(BlockId::crimson_wall_sign()), - BlockKind::DarkOakSign => Some(BlockId::dark_oak_wall_sign()), - BlockKind::JungleSign => Some(BlockId::jungle_wall_sign()), - BlockKind::WarpedSign => Some(BlockId::warped_wall_sign()), - BlockKind::SkeletonSkull => Some(BlockId::skeleton_wall_skull()), - BlockKind::WitherSkeletonSkull => Some(BlockId::wither_skeleton_wall_skull()), - BlockKind::ZombieHead => Some(BlockId::zombie_wall_head()), - BlockKind::CreeperHead => Some(BlockId::creeper_wall_head()), - BlockKind::PlayerHead => Some(BlockId::player_wall_head()), - BlockKind::DragonHead => Some(BlockId::dragon_wall_head()), - BlockKind::WhiteBanner => Some(BlockId::white_wall_banner()), - BlockKind::OrangeBanner => Some(BlockId::orange_wall_banner()), - BlockKind::MagentaBanner => Some(BlockId::magenta_wall_banner()), - BlockKind::LightBlueBanner => Some(BlockId::light_blue_wall_banner()), - BlockKind::YellowBanner => Some(BlockId::yellow_wall_banner()), - BlockKind::LimeBanner => Some(BlockId::lime_wall_banner()), - BlockKind::PinkBanner => Some(BlockId::pink_wall_banner()), - BlockKind::GrayBanner => Some(BlockId::gray_wall_banner()), - BlockKind::LightGrayBanner => Some(BlockId::light_gray_wall_banner()), - BlockKind::CyanBanner => Some(BlockId::cyan_wall_banner()), - BlockKind::PurpleBanner => Some(BlockId::purple_wall_banner()), - BlockKind::BlueBanner => Some(BlockId::blue_wall_banner()), - BlockKind::BrownBanner => Some(BlockId::brown_wall_banner()), - BlockKind::GreenBanner => Some(BlockId::green_wall_banner()), - BlockKind::RedBanner => Some(BlockId::red_wall_banner()), - BlockKind::BlackBanner => Some(BlockId::black_wall_banner()), - _ => None, - } - } -} diff --git a/feather/common/Cargo.toml b/feather/common/Cargo.toml index a371549d5..ed3428847 100644 --- a/feather/common/Cargo.toml +++ b/feather/common/Cargo.toml @@ -1,26 +1,27 @@ [package] name = "feather-common" version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" [dependencies] ahash = "0.7" anyhow = "1" -base = { path = "../base", package = "feather-base" } -blocks = { path = "../blocks", package = "feather-blocks" } -ecs = { path = "../ecs", package = "feather-ecs" } +derive_more = "0.99" flume = "0.10" itertools = "0.10" +libcraft = { path = "../../libcraft" } log = "0.4" -parking_lot = "0.11" -quill-common = { path = "../../quill/common" } -smartstring = "0.2" +num_cpus = "1" +parking_lot = "0.12" +quill = { path = "../../quill" } +rand = "0.8" +serde = { version = "1", features = [ "derive" ] } +smartstring = "1" +tokio = "1" +toml = "0.5" utils = { path = "../utils", package = "feather-utils" } uuid = { version = "0.8", features = [ "v4" ] } -libcraft-core = { path = "../../libcraft/core" } -libcraft-inventory = { path = "../../libcraft/inventory" } -libcraft-items = { path = "../../libcraft/items" } -rayon = "1.5" +vane = { path = "../../vane" } worldgen = { path = "../worldgen", package = "feather-worldgen" } -rand = "0.8" \ No newline at end of file +vek = "0.14" diff --git a/feather/common/src/block/mod.rs b/feather/common/src/block/mod.rs new file mode 100644 index 000000000..2658af39d --- /dev/null +++ b/feather/common/src/block/mod.rs @@ -0,0 +1,12 @@ +use vane::SystemExecutor; + +use crate::Game; + +pub mod placement; +pub mod update; +pub mod util; +pub mod wall; + +pub fn register(systems: &mut SystemExecutor) { + systems.add_system(update::block_update); +} diff --git a/feather/common/src/block/placement.rs b/feather/common/src/block/placement.rs new file mode 100644 index 000000000..e05a745e3 --- /dev/null +++ b/feather/common/src/block/placement.rs @@ -0,0 +1,605 @@ +use std::convert::TryInto; + +use super::util::AdjacentBlockHelper; +use super::wall::update_wall_connections; +use crate::events::BlockChangeEvent; +use crate::Game; +use libcraft::block::{AttachedFace, BedPart, BlockHalf, DoorHinge, SlabType}; +use libcraft::blocks::SimplifiedBlockKind; +use libcraft::{BlockFace, BlockKind, BlockPosition, BlockState, Item, ItemStack, Position, Vec3d}; +use quill::block_data::{ + Bed, Campfire, Directional, Door, FaceAttachable, Orientable, Slab, Waterlogged, +}; +use quill::components::{EntityKindComponent, EntityPosition}; +use quill::events::BlockPlacementEvent; +use quill::InventorySlot; +use quill::World; +use vek::Rect3; + +/// Check if the block has a bed portion that can be placed placed in the world. `None` means that while the block has a head, it cannot be placed +fn should_place_bed_head( + world: &dyn World, + block: BlockState, + placement_pos: BlockPosition, +) -> Option { + if bed_head(block).is_none() { + return Some(false); + } + if world + .adjacent_block(placement_pos, block.data_as::()?.facing())? + .is_replaceable() + { + Some(true) + } else { + None + } +} +/// Check if the block has an upper half that can be placed in the world. `None` means that while the block has an upper half, it cannot be placed +fn should_place_upper_half( + world: &dyn World, + block: BlockState, + placement_pos: BlockPosition, +) -> Option { + if top_half(block).is_none() { + return Some(false); + } + if world.block_at(placement_pos.up()).ok()?.is_replaceable() { + Some(true) + } else { + None + } +} +/// Check if the block collides with any entity. +fn entity_collisions_ok(game: &Game, placement_pos: BlockPosition) -> bool { + !game + .chunk_entities + .entities_in_chunk(placement_pos.chunk()) + .iter() + .any(|&entity| { + let entity_position = game.ecs.get::(entity).unwrap().0; + let _entity_kind = game.ecs.get::(entity).unwrap().0; + let block_rect: Rect3 = vek::Rect3 { + x: placement_pos.x.into(), + y: placement_pos.y.into(), + z: placement_pos.z.into(), + w: 1.0, + h: 1.0, + d: 1.0, + }; + + // TODO use entity-specific bounding box + let mut entity_rect = Rect3 { + x: 0., + y: 0., + z: 0., + w: 0.5, + h: 2.0, + d: 0.5, + }; + entity_rect.x = entity_position.x - (entity_rect.w / 2.0); + entity_rect.y = entity_position.y; + entity_rect.z = entity_position.z - (entity_rect.d / 2.0); + + block_rect.collides_with_rect3(entity_rect) + }) +} +/// Place multiple blocks and generate corresponding events. +fn multi_place( + world: &mut dyn World, + placements: &[(BlockState, BlockPosition)], + event_buffer: &mut Vec, +) { + for &(block, pos) in placements { + event_buffer.push(BlockChangeEvent::single( + pos.try_into().expect("valid block positions only"), + world.id(), + )); + world + .set_block_at(pos, block) + .expect("block has to be loaded"); + } +} +/// Try placing the block by merging (=placing to the same position as the target block). Includes merging slabs, waterlogging and replacing blocks like grass. +/// Only one of the following conditions can be met at a time, so short-circuiting is ok. +/// The combinations include top slab & bottom slab, waterloggable block & water and any block & a replaceable block +fn basic_place(block: &mut BlockState, target_block: BlockState, face: BlockFace) -> bool { + merge_slabs_in_place(block, target_block, face) + || waterlog(block, target_block) + || can_replace(*block, target_block) +} +/// Check if `block` can replace `target`. +fn can_replace(block: BlockState, target: BlockState) -> bool { + (block.kind() != target.kind()) && target.is_replaceable() +} +/// Blocks get changed if they are getting waterlogged or when they are slabs turning into full blocks. +/// Blocks get replaced in-place when possible, while changing an adjacent block has a lower priority. +pub fn place_block( + game: &Game, + world: &mut dyn World, + player_pos: Position, + mut block: BlockState, + placement: &BlockPlacementEvent, + light_level: u8, + event_buffer: &mut Vec, +) -> Option<()> { + let target1 = placement.location; + let target_block1 = world.block_at(target1).ok()?; + let target2 = target1.adjacent(placement.face); + let target_block2 = world.block_at(target2); + // Cannot build on air + if target_block1.kind().is_air() { + return None; + } + let player_dir_ordered = ordered_directions(player_pos.direction()); + slab_to_place(&mut block, target_block1, placement); + // Select where to place the block + let target = if basic_place(&mut block, target_block1, placement.face) { + target1 + } else if basic_place(&mut block, target_block2.ok()?, placement.face) { + target2 + } else { + // Cannot place block + return None; + }; + set_face(&mut block, &player_dir_ordered, placement); + // rotate_8dir(&mut block, player_pos.yaw); + door_hinge(&mut block, target, &placement.cursor_position, world); + if !entity_collisions_ok(game, target) + || !(&*world).check_block_stability(block, target, light_level)? + { + return None; + } + let primary_placement = (block, target); + if should_place_upper_half(world, block, target)? { + let top_block = + block.with_data(block.data_as::().unwrap().with_half(BlockHalf::Upper)); + let secondary_placement = (top_block, target.up()); + multi_place( + world, + &[primary_placement, secondary_placement], + event_buffer, + ) + } else if should_place_bed_head(world, block, target)? { + let face = block.data_as::().unwrap().facing(); + let secondary_placement = ( + block.with_data(block.data_as::().unwrap().with_part(BedPart::Head)), + target.adjacent(face), + ); + multi_place( + world, + &[primary_placement, secondary_placement], + event_buffer, + ) + } else { + multi_place(world, &[primary_placement], event_buffer); + }; + update_wall_connections(world, target).unwrap(); + Some(()) +} +/// Sets the hinge position on a door block. The door attempts to connect to other doors first, then to solid blocks. Otherwise, the hinge position is determined by the click position. +#[allow(clippy::float_cmp)] +fn door_hinge( + block: &mut BlockState, + pos: BlockPosition, + cursor_pos: &[f32], + world: &dyn World, +) -> Option<()> { + if let Some(facing) = block.data_as::().map(|dir| dir.facing()) { + let left = facing.left(); + let right = facing.right(); + let lb = world.adjacent_block(pos, left)?; + let rb = world.adjacent_block(pos, right)?; + + if let Some(door) = block.data_as::() { + if lb.kind() == block.kind() { + block.set_data(door.with_hinge(DoorHinge::Right)); + return Some(()); + } else if rb.kind() == block.kind() { + block.set_data(door.with_hinge(DoorHinge::Left)); + return Some(()); + } + + let lt = world.adjacent_block(pos.up(), left)?; + let rt = world.adjacent_block(pos.up(), right)?; + let solid_left = is_block_solid(lb) || is_block_solid(lt); + let solid_right = is_block_solid(rb) || is_block_solid(rt); + if solid_left && !solid_right { + block.set_data(door.with_hinge(DoorHinge::Left)); + return Some(()); + } + if solid_right && !solid_left { + block.set_data(door.with_hinge(DoorHinge::Right)); + return Some(()); + } + let relevant_axis = match facing { + BlockFace::North => cursor_pos[0], + BlockFace::South => 1.0 - cursor_pos[0], + BlockFace::West => 1.0 - cursor_pos[2], + BlockFace::East => cursor_pos[2], + _ => unreachable!(), + }; + let hinge = if relevant_axis < 0.5 { + DoorHinge::Left + } else { + DoorHinge::Right + }; + block.set_data(door.with_hinge(hinge)); + } + + Some(()) + } else { + None + } +} + +fn is_block_solid(block: BlockState) -> bool { + block.kind().solid() + && !matches!( + block.data_as::().map(|s| s.slab_type()), + Some(SlabType::Bottom) | Some(SlabType::Top) + ) +} + +/// Gets the top half of the block. Works with doors, flowers, tall grass etc. +fn top_half(block: BlockState) -> Option { + if let Some(door) = block.data_as::() { + Some(block.with_data(door.with_half(BlockHalf::Upper))) + } else { + None + } +} + +/// If applicable, this function returns a matching bed head to its foot part. +fn bed_head(block: BlockState) -> Option { + if let Some(bed) = block.data_as::() { + Some(block.with_data(bed.with_part(BedPart::Head))) + } else { + None + } +} + +/* +/// If applicable, rotates 8-directional blocks like banners and signs. The yaw is a property of the placing entity. +fn rotate_8dir(block: &mut BlockState, yaw: f32) { + if let Some(mut rot) = block.data_as::() { + + } + block.set_rotation(((yaw + 180.0) / 22.5).round() as i32); +} +*/ + +/// Orders all the cubic directions(`FacingCubic`) by how well they represent the direction. +pub fn ordered_directions(direction: Vec3d) -> [BlockFace; 6] { + let x_dir = if direction[0] > 0.0 { + BlockFace::East + } else { + BlockFace::West + }; + let y_dir = if direction[1] > 0.0 { + BlockFace::Top + } else { + BlockFace::Bottom + }; + let z_dir = if direction[2] > 0.0 { + BlockFace::South + } else { + BlockFace::North + }; + let abs_x = direction[0].abs(); + let abs_y = direction[1].abs(); + let abs_z = direction[2].abs(); + let t = match (abs_x > abs_y, abs_y > abs_z, abs_z > abs_x) { + (true, true, true) => unreachable!(), + (true, true, false) => [x_dir, y_dir, z_dir], // 2 1 0 + (true, false, true) => [z_dir, x_dir, y_dir], // 1 0 2 + (true, false, false) => [x_dir, z_dir, y_dir], // 2 0 1 + (false, true, true) => [y_dir, z_dir, x_dir], // 0 2 1 + (false, true, false) => [y_dir, x_dir, z_dir], // 1 2 0 + (false, false, true) => [z_dir, y_dir, x_dir], // 0 1 2 + (false, false, false) => unreachable!(), + }; + [ + t[0], + t[1], + t[2], + t[2].opposite(), + t[1].opposite(), + t[0].opposite(), + ] +} + +// Attempts to merge the two blocks, in place. +fn merge_slabs_in_place(block: &mut BlockState, target: BlockState, face: BlockFace) -> bool { + if block.kind() != target.kind() { + return false; + } + let opt = match block + .data_as::() + .and_then(|s1| target.data_as::().map(move |s2| (s1, s2))) + { + Some((slab, target_slab)) => match (slab.slab_type(), target_slab.slab_type()) { + (SlabType::Top, SlabType::Bottom) if face == BlockFace::Top => { + Some(block.with_data(slab.with_slab_type(SlabType::Double))) + } + (SlabType::Bottom, SlabType::Top) if face == BlockFace::Bottom => { + Some(block.with_data(slab.with_slab_type(SlabType::Double))) + } + + _ => None, + }, + _ => None, + }; + *block = opt.unwrap_or(*block); + opt.is_some() +} +/// Determine what kind of slab to place. Returns `true` if the slab +/// placed would be merged with the other slab. +/// `try_merge_slabs` should always succeed if this function returns `true`. +#[allow(clippy::float_cmp)] +fn slab_to_place( + block: &mut BlockState, + target: BlockState, + placement: &BlockPlacementEvent, +) -> bool { + if let Some(mut slab) = target.data_as::() { + let k = slab.slab_type(); + let (slab_kind, place_adjacent) = match placement.cursor_position[1] { + y if y == 0.5 => { + if block.kind() != target.kind() { + match k { + SlabType::Top => (SlabType::Top, false), + SlabType::Bottom => (SlabType::Bottom, false), + SlabType::Double => return false, + } + } else { + match k { + SlabType::Top => (SlabType::Bottom, true), + SlabType::Bottom => (SlabType::Top, true), + SlabType::Double => return false, + } + } + } + y if y == 0.0 => (SlabType::Top, false), + y if matches!(placement.face, BlockFace::Top) || y == 1.0 => (SlabType::Bottom, false), + y if y < 0.5 => (SlabType::Bottom, false), + y if y < 1.0 => (SlabType::Top, false), + _ => return false, + }; + slab.set_slab_type(slab_kind); + block.set_data(slab); + place_adjacent + } else { + false + } +} + +/// This function determines the result of combining the 2 blocks. If one is water and the other is waterloggable, the target is waterlogged. Has no effect otherwise. +fn waterlog(target_block: &mut BlockState, to_place: BlockState) -> bool { + // Select the non-water block or return + let mut waterloggable = if matches!(target_block.kind(), BlockKind::Water) { + to_place + } else if matches!(to_place.kind(), BlockKind::Water) { + *target_block + } else { + return false; + }; + // Refuse to waterlog double slabs and blocks that are already waterlogged + if let Some(slab) = waterloggable.data_as::() { + if slab.slab_type() == SlabType::Double { + return false; + } + } + if let Some(mut waterlogged) = waterloggable.data_as::() { + if waterlogged.waterlogged() { + return false; + } + + waterlogged.set_waterlogged(true); + waterloggable.set_data(waterlogged); + if let Some(campfire) = target_block.data_as::() { + target_block.set_data(campfire.with_lit(false)); + } + true + } else { + false + } +} + +/// Checks if the block facing is relative to the player. If this function returns `false`, the block facing is determined by the face of the block this one was placed on. +fn is_player_relative(kind: SimplifiedBlockKind) -> bool { + use SimplifiedBlockKind::*; + matches!( + kind, + Dispenser + | StickyPiston + | Piston + | CommandBlock + | Observer + | Dropper + | Furnace + | Smoker + | Chest + | TrappedChest + | BlastFurnace + | CarvedPumpkin + | JackOLantern + | BeeNest + | Beehive + | EndPortalFrame + | Anvil + | EnderChest + | Bed + | Loom + | Banner + | Sign + | FenceGate + | Repeater + | Comparator + | Lectern + | Rail + | PoweredRail + | ActivatorRail + | DetectorRail + | Stonecutter + | WoodenDoor + | IronDoor + | WarpedDoor + | CrimsonDoor + | Stairs + ) +} + +/// Checks if the block is to be placed with an opposite facing relative to the player. +fn is_reverse_placed(kind: SimplifiedBlockKind) -> bool { + use SimplifiedBlockKind::*; + matches!( + kind, + Observer | Bed | FenceGate | WoodenDoor | IronDoor | WarpedDoor | CrimsonDoor | Stairs + ) +} + +/// Changes the block facing as necessary. This includes calling `make_wall_block`, +/// determining how the block is placed, setting its +/// facing, cubic, cardinal, cardinal&down, top/bottom and the xyz axis. +/// Blocks have only one of these orientations. +fn set_face( + block: &mut BlockState, + player_directions: &[BlockFace], + placement: &BlockPlacementEvent, +) { + if !matches!(placement.face, BlockFace::Top) { + make_wall_block(block); + } + let player_relative = is_player_relative(block.simplified_kind()); + let facing = match player_relative { + true => player_directions[0].opposite(), + false => placement.face, + }; + let facing = if is_reverse_placed(block.simplified_kind()) { + facing.opposite() + } else { + facing + }; + if let Some(attach) = block.data_as::() { + block.set_data(attach.with_attached_face(match placement.face { + BlockFace::Bottom => AttachedFace::Ceiling, + BlockFace::Top => AttachedFace::Floor, + BlockFace::North => AttachedFace::Wall, + BlockFace::South => AttachedFace::Wall, + BlockFace::West => AttachedFace::Wall, + BlockFace::East => AttachedFace::Wall, + })); + } + + let facing_cardinal = facing.to_cardinal().unwrap_or_else(|| { + if player_relative { + if is_reverse_placed(block.simplified_kind()) { + player_directions[1] + } else { + player_directions[1].opposite() + } + .to_cardinal() + .unwrap() + } else { + player_directions[0] + .to_cardinal() + .unwrap_or_else(|| player_directions[1].to_cardinal().unwrap()) + } + }); + if let Some(mut dir) = block.data_as::() { + if !dir.valid_facing().contains(&BlockFace::Top) { + block.set_data(dir.with_facing(match block.simplified_kind() { + SimplifiedBlockKind::Anvil => facing_cardinal.left(), + _ => facing_cardinal, + })); + } else { + dir.set_facing(facing); + } + } + + if let Some(orient) = block.data_as::() { + block.set_data(orient.with_axis(facing.axis())); + } + + if let Some(door) = block.data_as::() { + block.set_data(door.with_half(match placement.face { + BlockFace::Top => BlockHalf::Lower, + BlockFace::Bottom => BlockHalf::Upper, + _ => match placement.cursor_position[1] { + y if y <= 0.5 => BlockHalf::Lower, + _ => BlockHalf::Upper, + }, + })); + } +} + +/// If possible, turns a free standing block to its wall mounted counterpart, as they are considered different. This applies to torches, signs and banners. +fn make_wall_block(block: &mut BlockState) { + *block = match block.kind() { + BlockKind::Torch => BlockState::new(BlockKind::WallTorch), + BlockKind::RedstoneTorch => BlockState::new(BlockKind::RedstoneWallTorch), + BlockKind::SoulTorch => BlockState::new(BlockKind::SoulWallTorch), + BlockKind::OakSign => BlockState::new(BlockKind::OakWallSign), + BlockKind::BirchSign => BlockState::new(BlockKind::BirchWallSign), + BlockKind::AcaciaSign => BlockState::new(BlockKind::AcaciaWallSign), + BlockKind::JungleSign => BlockState::new(BlockKind::JungleWallSign), + BlockKind::SpruceSign => BlockState::new(BlockKind::SpruceWallSign), + BlockKind::WarpedSign => BlockState::new(BlockKind::WarpedWallSign), + BlockKind::CrimsonSign => BlockState::new(BlockKind::CrimsonWallSign), + BlockKind::DarkOakSign => BlockState::new(BlockKind::DarkOakWallSign), + BlockKind::RedBanner => BlockState::new(BlockKind::RedWallBanner), + BlockKind::BlueBanner => BlockState::new(BlockKind::BlueWallBanner), + BlockKind::CyanBanner => BlockState::new(BlockKind::CyanWallBanner), + BlockKind::GrayBanner => BlockState::new(BlockKind::GrayWallBanner), + BlockKind::LimeBanner => BlockState::new(BlockKind::LimeWallBanner), + BlockKind::PinkBanner => BlockState::new(BlockKind::PinkWallBanner), + BlockKind::BlackBanner => BlockState::new(BlockKind::BlackWallBanner), + BlockKind::BrownBanner => BlockState::new(BlockKind::BrownWallBanner), + BlockKind::GreenBanner => BlockState::new(BlockKind::GreenWallBanner), + BlockKind::WhiteBanner => BlockState::new(BlockKind::WhiteWallBanner), + BlockKind::OrangeBanner => BlockState::new(BlockKind::OrangeWallBanner), + BlockKind::PurpleBanner => BlockState::new(BlockKind::PurpleWallBanner), + BlockKind::YellowBanner => BlockState::new(BlockKind::YellowWallBanner), + BlockKind::MagentaBanner => BlockState::new(BlockKind::MagentaWallBanner), + BlockKind::LightBlueBanner => BlockState::new(BlockKind::LightBlueWallBanner), + BlockKind::LightGrayBanner => BlockState::new(BlockKind::LightGrayWallBanner), + _ => *block, + }; +} + +/// Attempts to convert an item to its placeable counterpart. Buckets to their respective contents, redstone dust to redstone wire and string to tripwire +pub fn item_to_block(item: Item) -> Option { + Some(match item { + Item::WaterBucket => BlockState::new(BlockKind::Water), + Item::LavaBucket => BlockState::new(BlockKind::Lava), + Item::Redstone => BlockState::new(BlockKind::RedstoneWire), + Item::FlintAndSteel => BlockState::new(BlockKind::Fire), + Item::String => BlockState::new(BlockKind::Tripwire), + i => { + let mut name = "minecraft:".to_owned(); + name.push_str(i.name()); + BlockState::new(BlockKind::from_namespaced_id(&name)?) + } + }) +} + +/// Reduces the amount of items in a slot. Full buckets are emptied instead. There are no checks if the item can be placed. +pub fn decrease_slot(slot: &mut InventorySlot) { + match slot.item_kind().unwrap() { + Item::WaterBucket | Item::LavaBucket => { + *slot = InventorySlot::Filled(ItemStack::new(Item::Bucket, 1).unwrap()) + } + Item::FlintAndSteel => { + if match slot { + InventorySlot::Filled(f) => f.damage(1), + InventorySlot::Empty => unreachable!(), + } { + *slot = InventorySlot::Empty + } + } + _ => { + // Can always take at least one + let _ = slot.try_take(1); + } + } +} diff --git a/feather/common/src/block/update.rs b/feather/common/src/block/update.rs new file mode 100644 index 000000000..c9d596c5d --- /dev/null +++ b/feather/common/src/block/update.rs @@ -0,0 +1,31 @@ +use libcraft::BlockFace; +use libcraft::BlockPosition; +use vane::SysResult; + +use crate::{events::BlockChangeEvent, Game}; + +use super::wall::update_wall_connections; + +pub fn block_update(game: &mut Game) -> SysResult { + for (_, event) in game.ecs.query::<&BlockChangeEvent>().iter() { + let mut world = game.world_mut(event.world())?; + for pos in event.iter_changed_blocks().map(Into::::into) { + for adjacent in [ + BlockFace::East, + BlockFace::West, + BlockFace::North, + BlockFace::South, + BlockFace::Bottom, + ] + .iter() + .map(|&d| [pos.adjacent(d), pos.adjacent(BlockFace::Bottom).adjacent(d)]) + .flatten() + { + if update_wall_connections(&mut *world, adjacent).is_none() { + continue; + } + } + } + } + Ok(()) +} diff --git a/feather/common/src/block/util.rs b/feather/common/src/block/util.rs new file mode 100644 index 000000000..b7522d06e --- /dev/null +++ b/feather/common/src/block/util.rs @@ -0,0 +1,220 @@ +use libcraft::{ + block::AttachedFace, blocks::SupportType, BlockFace, BlockKind, BlockPosition, BlockState, +}; +use quill::World; + +use quill::block_data::{Directional, FaceAttachable, Waterlogged}; + +/// Trait that implements helper function for adjacency. This is an extension to `World` that tries to keep this utility logic away from the main implementation +pub trait AdjacentBlockHelper { + fn adjacent_block(&self, pos: BlockPosition, dir: BlockFace) -> Option; + + fn set_block_adjacent_facing( + &self, + pos: BlockPosition, + block: BlockState, + dir: BlockFace, + ) -> bool; + + fn check_block_stability( + &self, + block: BlockState, + pos: BlockPosition, + light_level: u8, + ) -> Option; +} + +impl<'a> AdjacentBlockHelper for &'a dyn World { + fn adjacent_block(&self, pos: BlockPosition, face: BlockFace) -> Option { + self.block_at(pos.adjacent(face)).ok() + } + + fn set_block_adjacent_facing( + &self, + pos: BlockPosition, + block: BlockState, + dir: BlockFace, + ) -> bool { + self.set_block_at(pos.adjacent(dir), block).is_ok() + } + + fn check_block_stability( + &self, + block: BlockState, + pos: BlockPosition, + light_level: u8, + ) -> Option { + use libcraft::blocks::SimplifiedBlockKind::*; + let support_type = match block.support_type() { + Some(s) => s, + None => return Some(true), + }; + let block_under = self.block_at(pos.down()).ok(); + let block_up = self.block_at(pos.up()).ok(); + let block_facing = block + .data_as::() + .map(|f| self.adjacent_block(pos, f.facing())) + .flatten(); + let is_supported = match support_type { + SupportType::OnSolid => block_under?.kind().solid(), + SupportType::OnDesertBlocks => matches!( + block_under?.simplified_kind(), + Sand | RedSand | Dirt | CoarseDirt | Podzol + ), + SupportType::OnDirtBlocks => matches!( + block_under?.simplified_kind(), + Dirt | GrassBlock | CoarseDirt | Podzol | Farmland + ), + SupportType::OnFarmland => block_under?.simplified_kind() == Farmland, + SupportType::OnSoulSand => block_under?.simplified_kind() == SoulSand, + SupportType::OnWater => block_under?.simplified_kind() == Water, + SupportType::FacingSolid => block_facing?.kind().solid(), + SupportType::FacingJungleWood => matches!( + block_facing?.kind(), + BlockKind::JungleLog + | BlockKind::StrippedJungleLog + | BlockKind::JungleWood + | BlockKind::StrippedJungleWood + ), + SupportType::OnOrFacingSolid => self + .block_at( + pos.adjacent(match block.data_as::()?.attached_face() { + AttachedFace::Floor => BlockFace::Bottom, + AttachedFace::Wall => block.data_as::()?.facing().opposite(), + AttachedFace::Ceiling => BlockFace::Top, + }), + ) + .ok()? + .kind() + .solid(), + SupportType::CactusLike => { + matches!(block_under?.simplified_kind(), Sand | RedSand | Cactus) && { + let mut ok = true; + for face in [ + BlockFace::North, + BlockFace::South, + BlockFace::West, + BlockFace::East, + ] { + let block = self.block_at(pos.adjacent(face)).ok()?; + ok &= !block.kind().solid() && block.simplified_kind() != Cactus + } + ok + } + } + SupportType::ChorusFlowerLike => { + let neighbours = [ + BlockFace::North, + BlockFace::South, + BlockFace::West, + BlockFace::East, + ] + .iter() + .filter_map(|&face| self.block_at(pos.adjacent(face)).ok()) + .map(BlockState::simplified_kind); + neighbours.clone().filter(|&e| e == Air).count() == 3 + && neighbours.filter(|&e| e == EndStone).count() == 1 + || matches!(block_under?.simplified_kind(), EndStone | ChorusPlant) + } + SupportType::ChorusPlantLike => { + let n = [ + BlockFace::North, + BlockFace::South, + BlockFace::West, + BlockFace::East, + ]; + let horizontal = n + .iter() + .filter_map(|&f| self.block_at(pos.adjacent(f)).ok()) + .map(BlockState::simplified_kind); + let horizontal_down = n + .iter() + .filter_map(|&f| self.block_at(pos.down().adjacent(f)).ok()) + .map(BlockState::simplified_kind); + if horizontal.clone().count() != 4 || horizontal_down.clone().count() != 4 { + return None; + } + let has_horizontal = horizontal.clone().any(|b| b == ChorusPlant); + let has_vertical = + matches!(block_up?.simplified_kind(), ChorusPlant | ChorusFlower); + let is_connected = horizontal + .zip(horizontal_down) + .any(|(h, hd)| h == ChorusPlant && matches!(hd, ChorusPlant | EndStone)); + is_connected && !(has_vertical && has_horizontal && !block_under?.kind().is_air()) + } + SupportType::MushroomLike => block_under?.kind().solid() && light_level < 13, + SupportType::SnowLike => { + block_under?.kind().solid() + && !matches!(block_under?.simplified_kind(), Ice | PackedIce) + } + SupportType::SugarCaneLike => { + matches!( + block_under?.simplified_kind(), + Grass | Dirt | CoarseDirt | Podzol | Sand | RedSand | SugarCane + ) && { + let mut ok = false; + for face in [ + BlockFace::North, + BlockFace::South, + BlockFace::West, + BlockFace::East, + ] { + let block = self.block_at(pos.down().adjacent(face)).ok()?; + ok |= matches!(block.simplified_kind(), FrostedIce | Water); + ok |= block + .data_as::() + .map(|w| w.waterlogged()) + .unwrap_or(false); + } + ok + } + } + SupportType::TripwireHookLike => { + block_facing?.kind().solid() + && !matches!(block_facing?.simplified_kind(), RedstoneBlock | Observer) + } + SupportType::VineLike => { + matches!(self.block_at(pos.up()).ok()?.simplified_kind(), Vine) || { + let mut ok = false; + for face in [ + BlockFace::North, + BlockFace::South, + BlockFace::West, + BlockFace::East, + BlockFace::Top, + ] { + let block = self.block_at(pos.down().adjacent(face)).ok()?; + ok |= block.kind().solid(); + } + ok + } + } + }; + Some(is_supported) + } +} + +/// Checks if the block is a wall. `SimplifiedBlockKind` does not have a common type for walls at this time, making this function neccessary. +pub fn is_wall(block: BlockState) -> bool { + use libcraft::blocks::SimplifiedBlockKind::*; + matches!( + block.simplified_kind(), + BrickWall + | PrismarineWall + | RedSandstoneWall + | MossyStoneBrickWall + | GraniteWall + | StoneBrickWall + | NetherBrickWall + | AndesiteWall + | RedNetherBrickWall + | SandstoneWall + | EndStoneBrickWall + | DioriteWall + | CobblestoneWall + | MossyCobblestoneWall + | BlackstoneWall + | PolishedBlackstoneBrickWall + | PolishedBlackstoneWall + ) +} diff --git a/feather/common/src/block/wall.rs b/feather/common/src/block/wall.rs new file mode 100644 index 000000000..0e3ad7944 --- /dev/null +++ b/feather/common/src/block/wall.rs @@ -0,0 +1,188 @@ +use libcraft::BlockPosition; +use quill::World; + +/// General function that connects all walls, fences, glass panes, iron bars and tripwires and then lowers fence gates to fit into walls. +pub fn update_wall_connections(_world: &mut dyn World, _pos: BlockPosition) -> Option<()> { + /* lower_fence_gate(world, pos)?; + connect_neighbours_and_up(world, pos) */ + Some(()) +} +/* +/// Check if this block is a wall/iron bars/glass pane. If true, the block can connect to any other block that satisfies this predicate. +pub fn is_wall_compatible(block: BlockState) -> bool { + use libcraft::blocks::SimplifiedBlockKind::*; + is_wall(block) || matches!(block.simplified_kind(), GlassPane | IronBars) +} +fn adjacent_or_default( + world: &World, + pos: BlockPosition, + face: BlockFace, + default: BlockState, +) -> BlockState { + world.adjacent_block(pos, face).unwrap_or(default) +} +/// Checks if this block is a `FenceGate` and has one of its connecting side on the given `BlockFace` +fn gate_connects_to_face(block: BlockState, face: BlockFace) -> bool { + use BlockFace::*; + block.simplified_kind() == SimplifiedBlockKind::FenceGate + && matches!( + (face, block.facing_cardinal().unwrap()), + (East | West, FacingCardinal::North | FacingCardinal::South) + | (North | South, FacingCardinal::East | FacingCardinal::West) + ) +} + +/// Uses the appropriate `BlockId::set_#####_connected` function, depending on the given `BlockFace` +fn set_face_connected(block: &mut BlockId, face: BlockFace, connected: bool) -> bool { + use BlockFace::*; + match face { + Bottom | Top => false, + East => block.set_east_connected(connected), + West => block.set_west_connected(connected), + North => block.set_north_connected(connected), + South => block.set_south_connected(connected), + } +} +/// Uses the appropriate `BlockId::set_#####_nlt` function, depending on the given `BlockFace`. The given `Nlt` is automatically converted. +fn set_face_nlt(block: &mut BlockId, face: BlockFace, nlt: Nlt) -> bool { + use BlockFace::*; + match face { + Bottom | Top => false, + East => block.set_east_nlt(nlt.into()), + West => block.set_west_nlt(nlt.into()), + North => block.set_north_nlt(nlt.into()), + South => block.set_south_nlt(nlt.into()), + } +} +/// Checks whether the block is a wall and connected to the given `BlockFace` +fn is_nlt_connected(block: BlockId, face: BlockFace) -> Option { + use BlockFace::*; + let f = |n: Nlt| matches!(n, Nlt::Low | Nlt::Tall); + match face { + Bottom | Top => None, + East => block.east_nlt().map(|n| f(n.into())), + West => block.west_nlt().map(|n| f(n.into())), + North => block.north_nlt().map(|n| f(n.into())), + South => block.south_nlt().map(|n| f(n.into())), + } +} +/// Checks if the block is connected to the given `BlockFace` +fn is_face_connected(block: BlockId, face: BlockFace) -> Option { + use BlockFace::*; + match face { + Bottom | Top => Some(false), + East => block.east_connected(), + West => block.west_connected(), + North => block.north_connected(), + South => block.south_connected(), + } +} + +/// If called on a position containing a `FenceGate`, checks whether the block connects to a wall. If true, this lowers the gate by setting its `in_wall` property to true. +pub fn lower_fence_gate(world: &mut World, pos: BlockPosition) -> Option<()> { + let mut block = world.block_at(pos)?; + if block.simplified_kind() != SimplifiedBlockKind::FenceGate { + return Some(()); + } + let left = block.facing_cardinal().unwrap().left(); + let right = left.opposite(); + // Check if neighbouring block is a wall + let predicate = |fc| { + is_wall( + world + .adjacent_block_cardinal(pos, fc) + .unwrap_or_else(BlockId::air), + ) + }; + // One wall is enough to lower the fence gate + block.set_in_wall(predicate(left) || predicate(right)); + world.set_block_at(pos, block); + Some(()) +} + +pub fn connect_neighbours_and_up(world: &mut World, pos: BlockPosition) -> Option<()> { + use base::SimplifiedBlockKind::*; + let mut block = world.block_at(pos)?; + let up = adjacent_or_default(world, pos, BlockFace::Top, BlockId::air()); + let (mut east_connected, mut west_connected, mut north_connected, mut south_connected) = + (false, false, false, false); + // Iterate over cardinal directions + for (block_face, connected_flag) in [ + (BlockFace::East, &mut east_connected), + (BlockFace::West, &mut west_connected), + (BlockFace::North, &mut north_connected), + (BlockFace::South, &mut south_connected), + ] { + let facing = adjacent_or_default(world, pos, block_face, BlockId::air()); + // Walls and fences connect to opaque blocks. + *connected_flag |= is_wall_compatible(block) && facing.is_opaque(); + *connected_flag |= block.simplified_kind() == Fence && facing.is_opaque(); + // Walls, glass panes and iron bars all connect to one another. + *connected_flag |= is_wall_compatible(block) && is_wall_compatible(facing); + // Walls and fences connect to fence gates. + *connected_flag |= is_wall(block) && gate_connects_to_face(facing, block_face); + *connected_flag |= + block.simplified_kind() == Fence && gate_connects_to_face(facing, block_face); + // Blocks connect to those of the same kind. This handles tripwires and fences. + *connected_flag |= facing.simplified_kind() == block.simplified_kind(); + + if is_wall(block) { + // Wall connections are `Tall` when the block above then is opaque or has a connection in the same direction + let tall_wall_connection = is_face_connected(up, block_face).unwrap_or(false) + || is_nlt_connected(up, block_face).unwrap_or(false) + || gate_connects_to_face(up, block_face) + || up.is_opaque(); + let connection_type = if *connected_flag && tall_wall_connection { + Nlt::Tall + } else if *connected_flag { + Nlt::Low + } else { + Nlt::None + }; + set_face_nlt(&mut block, block_face, connection_type); + } else { + set_face_connected(&mut block, block_face, *connected_flag); + } + } + if is_wall(block) { + // Wall crossings always have a tall post + let up_from_wall_cross = (east_connected ^ west_connected) + || (north_connected ^ south_connected) + || !(east_connected || west_connected || north_connected || south_connected); + // Tall wall posts propagate downward + let up_has_up = up.up().unwrap_or(false); + // Walls always have a tall post when ending + let this_ends = [ + (BlockFace::East, east_connected), + (BlockFace::West, west_connected), + (BlockFace::North, north_connected), + (BlockFace::South, south_connected), + ] + .iter() + .any(|&(f, con)| { + con && !is_nlt_connected(block, f) + .or_else(|| is_face_connected(block, f)) + .unwrap_or(true) + }); + + // Check if there is a wall/fence/etc ending above + let up_ends = [ + (BlockFace::East, east_connected), + (BlockFace::West, west_connected), + (BlockFace::North, north_connected), + (BlockFace::South, south_connected), + ] + .iter() + .any(|&(f, con)| { + con && !is_nlt_connected(up, f) + .or_else(|| is_face_connected(up, f)) + .unwrap_or(true) + }); + // TODO: Query this property at runtime because it is a tag. + let wall_post_override = false; + block.set_up(up_from_wall_cross || up_has_up || this_ends || up_ends || wall_post_override); + } + world.set_block_at(pos, block); + Some(()) +} +*/ diff --git a/feather/common/src/chunk/cache.rs b/feather/common/src/chunk/cache.rs deleted file mode 100644 index c07908968..000000000 --- a/feather/common/src/chunk/cache.rs +++ /dev/null @@ -1,152 +0,0 @@ -use std::{ - collections::VecDeque, - sync::Arc, - time::{Duration, Instant}, -}; - -use ahash::AHashMap; -use base::{ChunkHandle, ChunkPosition}; - -#[cfg(not(test))] -const CACHE_TIME: Duration = Duration::from_secs(30); -#[cfg(test)] -const CACHE_TIME: Duration = Duration::from_millis(500); - -/// This struct contains chunks that were unloaded but remain in memory in case they are needed. -#[derive(Default)] -pub struct ChunkCache { - map: AHashMap, // expire time + handle - unload_queue: VecDeque, -} -impl ChunkCache { - pub fn new() -> Self { - Self { - map: AHashMap::new(), - unload_queue: VecDeque::new(), - } - } - /// Purges all unused chunk handles. Handles that exist elswhere in the memory are not removed. - pub fn purge_unused(&mut self) { - let mut to_remove: Vec = vec![]; - for (pos, (_, arc)) in self.map.iter() { - if Arc::strong_count(arc) == 1 { - to_remove.push(*pos) - } - } - for i in to_remove { - self.map.remove(&i); - } - } - /// Purges all chunk handles in the cache, including those that exist elswhere. - pub fn purge_all(&mut self) { - self.map.clear(); - self.unload_queue.clear(); - } - fn ref_count(&self, pos: &ChunkPosition) -> Option { - self.map.get(pos).map(|(_, arc)| Arc::strong_count(arc)) - } - /// Purges all chunks that have been in unused the cache for longer than `CACHE_TIME`. Refreshes this timer for chunks that are in use at the moment. - pub fn purge_old_unused(&mut self) { - while let Some(&pos) = self.unload_queue.get(0) { - if !self.contains(&pos) { - // Might be caused by a manual purge - self.unload_queue.pop_front(); - continue; - } - if self.map.get(&pos).unwrap().0 > Instant::now() { - // Subsequent entries are 'scheduled' for later - break; - } - self.unload_queue.pop_front(); - if self.ref_count(&pos).unwrap() > 1 { - // Another copy of this handle already exists - self.unload_queue.push_back(pos); - self.map.entry(pos).and_modify(|(time, _)| { - *time = Instant::now() + CACHE_TIME; - }); - } else { - self.map.remove_entry(&pos); - } - } - } - /// Returns whether the chunk at the position is cached. - pub fn contains(&self, pos: &ChunkPosition) -> bool { - self.map.contains_key(pos) - } - /// Inserts a chunk handle into the cache, returning the previous handle if there was one. - pub fn insert(&mut self, pos: ChunkPosition, handle: ChunkHandle) -> Option { - self.unload_queue.push_back(pos); - self.map - .insert(pos, (Instant::now() + CACHE_TIME, handle)) - .map(|(_, handle)| handle) - } - /// Inserts a chunk handle into the cache. Reads the chunk's position by locking it. Blocks. - pub fn insert_read_pos(&mut self, handle: ChunkHandle) -> Option { - let pos = handle.read().position(); - self.insert(pos, handle) - } - /// Removes the chunk handle at the given position, returning the handle if it was cached. - pub fn remove(&mut self, pos: ChunkPosition) -> Option { - self.map.remove(&pos).map(|(_, handle)| handle) - } - /// Returns the chunk handle at the given position, if there was one. - pub fn get(&mut self, pos: ChunkPosition) -> Option { - self.map.get(&pos).map(|(_, handle)| handle.clone()) - } - pub fn len(&self) -> usize { - self.map.len() - } - pub fn is_empty(&self) -> bool { - self.map.is_empty() - } -} - -#[cfg(test)] -mod tests { - use std::{sync::Arc, thread::sleep}; - - use base::{Chunk, ChunkHandle, ChunkLock, ChunkPosition}; - - use super::{ChunkCache, CACHE_TIME}; - - #[test] - fn purge_unused() { - let mut cache = ChunkCache::new(); - let mut stored_handles: Vec = vec![]; - let mut used_count = 0; - for i in 0..100 { - let handle = Arc::new(ChunkLock::new(Chunk::new(ChunkPosition::new(i, 0)), false)); - if rand::random::() { - // clone this handle and pretend it is used - used_count += 1; - stored_handles.push(handle.clone()); - } - assert!(cache.insert_read_pos(handle).is_none()); - } - assert_eq!(cache.len(), 100); - cache.purge_unused(); - assert_eq!(cache.len(), used_count); - } - #[test] - fn purge_old_unused() { - let mut cache = ChunkCache::new(); - let mut stored_handles: Vec = vec![]; - let mut used_count = 0; - for i in 0..100 { - let handle = Arc::new(ChunkLock::new(Chunk::new(ChunkPosition::new(i, 0)), false)); - if rand::random::() { - // clone this handle and pretend it is used - used_count += 1; - stored_handles.push(handle.clone()); - } - assert!(cache.insert_read_pos(handle).is_none()); - } - cache.purge_old_unused(); - assert_eq!(cache.len(), 100); - sleep(CACHE_TIME); - sleep(CACHE_TIME); - assert_eq!(cache.len(), 100); - cache.purge_old_unused(); - assert_eq!(cache.len(), used_count); - } -} diff --git a/feather/common/src/chunk/entities.rs b/feather/common/src/chunk/entities.rs index 02a2b0db4..c5a9ed10b 100644 --- a/feather/common/src/chunk/entities.rs +++ b/feather/common/src/chunk/entities.rs @@ -1,8 +1,11 @@ use ahash::AHashMap; -use base::{ChunkPosition, Position}; -use ecs::{Entity, SysResult, SystemExecutor}; -use quill_common::events::{EntityCreateEvent, EntityRemoveEvent}; +use libcraft::ChunkPosition; +use quill::{ + components::{EntityChunk, EntityPosition}, + events::{EntityCreateEvent, EntityRemoveEvent}, +}; use utils::vec_remove_item; +use vane::{Entity, SysResult, SystemExecutor}; use crate::{events::ChunkCrossEvent, Game}; @@ -50,22 +53,24 @@ impl ChunkEntities { fn update_chunk_entities(game: &mut Game) -> SysResult { // Entities that have crossed chunks let mut events = Vec::new(); - for (entity, (old_chunk, &position)) in - game.ecs.query::<(&mut ChunkPosition, &Position)>().iter() + for (entity, (mut old_chunk, position)) in game + .ecs + .query::<(&mut EntityChunk, &EntityPosition)>() + .iter() { let new_chunk = position.chunk(); - if position.chunk() != *old_chunk { + if position.chunk() != **old_chunk { game.chunk_entities - .update(entity, Some(*old_chunk), new_chunk); + .update(entity, Some(**old_chunk), new_chunk); events.push(( entity, ChunkCrossEvent { - old_chunk: *old_chunk, + old_chunk: **old_chunk, new_chunk, }, )); - *old_chunk = new_chunk; + old_chunk.0 = new_chunk; } } for (entity, event) in events { @@ -74,7 +79,10 @@ fn update_chunk_entities(game: &mut Game) -> SysResult { // Entities that have been created let mut insertions = Vec::new(); - for (entity, (_event, &position)) in game.ecs.query::<(&EntityCreateEvent, &Position)>().iter() + for (entity, (_event, position)) in game + .ecs + .query::<(&EntityCreateEvent, &EntityPosition)>() + .iter() { let chunk = position.chunk(); game.chunk_entities.update(entity, None, chunk); @@ -82,16 +90,16 @@ fn update_chunk_entities(game: &mut Game) -> SysResult { } // Add ChunkPosition component to new entities for (entity, chunk) in insertions { - game.ecs.insert(entity, chunk)?; + game.ecs.insert(entity, EntityChunk(chunk))?; } // Entities that have been destroyed - for (entity, (_event, &chunk)) in game + for (entity, (_event, chunk)) in game .ecs - .query::<(&EntityRemoveEvent, &ChunkPosition)>() + .query::<(&EntityRemoveEvent, &EntityChunk)>() .iter() { - game.chunk_entities.remove_entity(entity, chunk); + game.chunk_entities.remove_entity(entity, **chunk); } Ok(()) diff --git a/feather/common/src/chunk/loading.rs b/feather/common/src/chunk/loading.rs deleted file mode 100644 index 7e52d37fa..000000000 --- a/feather/common/src/chunk/loading.rs +++ /dev/null @@ -1,175 +0,0 @@ -//! Chunk loading and unloading based on player `View`s. - -use std::{ - collections::VecDeque, - mem, - time::{Duration, Instant}, -}; - -use ahash::AHashMap; -use base::ChunkPosition; -use ecs::{Entity, SysResult, SystemExecutor}; -use quill_common::events::EntityRemoveEvent; -use utils::vec_remove_item; - -use crate::{chunk::worker::LoadRequest, events::ViewUpdateEvent, Game}; - -pub fn register(game: &mut Game, systems: &mut SystemExecutor) { - game.insert_resource(ChunkLoadState::default()); - systems - .group::() - .add_system(remove_dead_entities) - .add_system(update_tickets_for_players) - .add_system(unload_chunks) - .add_system(load_chunks); -} - -/// Amount of time to wait after a chunk has -/// no tickets until it is unloaded. -const UNLOAD_DELAY: Duration = Duration::from_secs(10); - -#[derive(Default)] -struct ChunkLoadState { - /// Chunks that have been queued for unloading. - chunk_unload_queue: VecDeque, - - chunk_tickets: ChunkTickets, -} - -impl ChunkLoadState { - pub fn remove_ticket(&mut self, chunk: ChunkPosition, ticket: Ticket) { - self.chunk_tickets.remove_ticket(chunk, ticket); - - // If this was the last ticket, then queue the chunk to be - // unloaded. - if self.chunk_tickets.num_tickets(chunk) == 0 { - self.chunk_tickets.remove_chunk(chunk); - self.chunk_unload_queue - .push_back(QueuedChunkUnload::new(chunk)); - } - } -} - -#[derive(Copy, Clone, Debug)] -struct QueuedChunkUnload { - pos: ChunkPosition, - /// Time after which the chunk should be unloaded. - unload_at_time: Instant, -} - -impl QueuedChunkUnload { - pub fn new(pos: ChunkPosition) -> Self { - Self { - pos, - unload_at_time: Instant::now() + UNLOAD_DELAY, - } - } -} - -/// Maintains a list of "tickets" for each loaded chunk. -/// A chunk is queued for unloading when it has no more tickets. -#[derive(Default)] -struct ChunkTickets { - tickets: AHashMap>, - by_entity: AHashMap>, -} - -impl ChunkTickets { - pub fn insert_ticket(&mut self, chunk: ChunkPosition, ticket: Ticket) { - self.tickets.entry(chunk).or_default().push(ticket); - self.by_entity.entry(ticket).or_default().push(chunk); - } - - pub fn remove_ticket(&mut self, chunk: ChunkPosition, ticket: Ticket) { - if let Some(vec) = self.tickets.get_mut(&chunk) { - vec_remove_item(vec, &ticket); - } - vec_remove_item(self.by_entity.get_mut(&ticket).unwrap(), &chunk); - } - - pub fn num_tickets(&self, chunk: ChunkPosition) -> usize { - match self.tickets.get(&chunk) { - Some(vec) => vec.len(), - None => 0, - } - } - - pub fn take_entity_tickets(&mut self, ticket: Ticket) -> Vec { - self.by_entity - .get_mut(&ticket) - .map(mem::take) - .unwrap_or_default() - } - - pub fn remove_chunk(&mut self, pos: ChunkPosition) { - self.tickets.remove(&pos); - } -} - -/// ID of a chunk ticket that keeps a chunk loaded. -/// -/// Currently just represents an entity, the player -/// that is keeping this chunk loaded. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -struct Ticket(Entity); - -/// System to populate chunk tickets based on players' views. -fn update_tickets_for_players(game: &mut Game, state: &mut ChunkLoadState) -> SysResult { - for (player, event) in game.ecs.query::<&ViewUpdateEvent>().iter() { - let player_ticket = Ticket(player); - - // Remove old tickets - for &old_chunk in &event.old_chunks { - state.remove_ticket(old_chunk, player_ticket); - } - - // Create new tickets - for &new_chunk in &event.new_chunks { - state.chunk_tickets.insert_ticket(new_chunk, player_ticket); - - // Load if needed - if !game.world.is_chunk_loaded(new_chunk) && !game.world.is_chunk_loading(new_chunk) { - game.world.queue_chunk_load(LoadRequest { pos: new_chunk }); - } - } - } - Ok(()) -} - -/// System to unload chunks from the `ChunkUnloadQueue`. -fn unload_chunks(game: &mut Game, state: &mut ChunkLoadState) -> SysResult { - while let Some(&unload) = state.chunk_unload_queue.get(0) { - if unload.unload_at_time > Instant::now() { - // None of the remaining chunks in the queue are - // ready for unloading, because the queue is ordered - // by time. - break; - } - - state.chunk_unload_queue.pop_front(); - - // If the chunk has acquired new tickets, then abort unloading it. - if state.chunk_tickets.num_tickets(unload.pos) > 0 { - continue; - } - - game.world.unload_chunk(unload.pos)?; - } - game.world.cache.purge_unused(); - Ok(()) -} - -fn remove_dead_entities(game: &mut Game, state: &mut ChunkLoadState) -> SysResult { - for (entity, _event) in game.ecs.query::<&EntityRemoveEvent>().iter() { - let entity_ticket = Ticket(entity); - for chunk in state.chunk_tickets.take_entity_tickets(entity_ticket) { - state.remove_ticket(chunk, entity_ticket); - } - } - Ok(()) -} - -/// System to call `World::load_chunks` each tick -fn load_chunks(game: &mut Game, _state: &mut ChunkLoadState) -> SysResult { - game.world.load_chunks(&mut game.ecs) -} diff --git a/feather/common/src/chunk/mod.rs b/feather/common/src/chunk/mod.rs index e1c180383..0b8f0b5a5 100644 --- a/feather/common/src/chunk/mod.rs +++ b/feather/common/src/chunk/mod.rs @@ -1,4 +1 @@ -pub mod cache; pub mod entities; -pub mod loading; -pub mod worker; diff --git a/feather/common/src/chunk/worker.rs b/feather/common/src/chunk/worker.rs deleted file mode 100644 index 85f4d7229..000000000 --- a/feather/common/src/chunk/worker.rs +++ /dev/null @@ -1,115 +0,0 @@ -use std::{path::PathBuf, sync::Arc}; - -use anyhow::bail; -use base::{ - anvil::{block_entity::BlockEntityData, entity::EntityData}, - Chunk, ChunkHandle, ChunkPosition, -}; -use flume::{Receiver, Sender}; -use worldgen::WorldGenerator; - -use crate::region_worker::RegionWorker; - -#[derive(Debug)] -pub struct LoadRequest { - pub pos: ChunkPosition, -} -#[derive(Debug)] -pub struct LoadedChunk { - pub pos: ChunkPosition, - pub chunk: Chunk, -} - -#[derive(Debug)] -#[allow(clippy::large_enum_variant)] -pub enum ChunkLoadResult { - /// The chunk does not exist in this source. - Missing(ChunkPosition), - /// An error occurred while loading the chunk. - Error(anyhow::Error), - /// Successfully loaded the chunk. - Loaded(LoadedChunk), -} - -#[derive(Debug)] -pub struct SaveRequest { - pub pos: ChunkPosition, - pub chunk: ChunkHandle, - pub entities: Vec, - pub block_entities: Vec, -} - -#[derive(Debug)] -#[allow(clippy::large_enum_variant)] -pub enum WorkerRequest { - Load(LoadRequest), - Save(SaveRequest), -} -pub struct ChunkWorker { - generator: Arc, - send_req: Sender, - send_gen: Sender, - recv_gen: Receiver, // Chunk generation should be infallible. - recv_load: Receiver, -} - -impl ChunkWorker { - pub fn new(world_dir: impl Into, generator: Arc) -> Self { - let (send_req, recv_req) = flume::unbounded(); - let (send_gen, recv_gen) = flume::unbounded(); - let (region_worker, recv_load) = RegionWorker::new(world_dir.into(), recv_req); - region_worker.start(); - Self { - generator, - send_req, - send_gen, - recv_gen, - recv_load, - } - } - pub fn queue_load(&mut self, request: LoadRequest) { - self.send_req.send(WorkerRequest::Load(request)).unwrap() - } - - /// Helper function for poll_loaded_chunk. Attemts to receive a freshly generated chunk. - /// Function signature identical to that of poll_loaded_chunk for ease of use. - fn try_recv_gen(&mut self) -> Result, anyhow::Error> { - match self.recv_gen.try_recv() { - Ok(l) => Ok(Some(l)), - Err(e) => match e { - flume::TryRecvError::Empty => Ok(None), - flume::TryRecvError::Disconnected => bail!("chunkgen channel died"), - }, - } - } - pub fn poll_loaded_chunk(&mut self) -> Result, anyhow::Error> { - match self.recv_load.try_recv() { - Ok(answer) => { - match answer { - // RegionWorker answered - ChunkLoadResult::Missing(pos) => { - // chunk does not exist, queue it for generation - let send_gen = self.send_gen.clone(); - let gen = self.generator.clone(); - rayon::spawn(move || { - // spawn task to generate chunk - let chunk = gen.generate_chunk(pos); - send_gen.send(LoadedChunk { pos, chunk }).unwrap() - }); - self.try_recv_gen() // check for generated chunks - } - ChunkLoadResult::Error(e) => Err(e), - ChunkLoadResult::Loaded(l) => Ok(Some(l)), - } - } - Err(e) => match e { - flume::TryRecvError::Empty => self.try_recv_gen(), // check for generated chunks - flume::TryRecvError::Disconnected => bail!("RegionWorker died"), - }, - } - } - - pub fn queue_chunk_save(&mut self, req: SaveRequest) { - self.send_req.send(WorkerRequest::Save(req)).unwrap() - } -} diff --git a/feather/common/src/entities.rs b/feather/common/src/entities.rs index 3fa7663fd..dda356c97 100644 --- a/feather/common/src/entities.rs +++ b/feather/common/src/entities.rs @@ -1,21 +1,16 @@ -//! Entity implementations. -//! -//! Each entity should be implemented in a submodule of this module. -//! It should export a `build_default(&mut EntityBuilder)` function to -//! add default components for that entity. - -use ecs::EntityBuilder; -use quill_common::{components::OnGround, entity_init::EntityInit}; +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::{EntityUuid, OnGround}; use uuid::Uuid; - -/// Adds default components shared between all entities. +use vane::EntityBuilder; +#[doc = "Adds default components shared between all entities."] fn build_default(builder: &mut EntityBuilder) { - builder.add(Uuid::new_v4()).add(OnGround(true)); + builder.add(EntityUuid(Uuid::new_v4())).add(OnGround(true)); } - pub mod area_effect_cloud; pub mod armor_stand; pub mod arrow; +pub mod axolotl; pub mod bat; pub mod bee; pub mod blaze; @@ -52,6 +47,9 @@ pub mod fox; pub mod furnace_minecart; pub mod ghast; pub mod giant; +pub mod glow_item_frame; +pub mod glow_squid; +pub mod goat; pub mod guardian; pub mod hoglin; pub mod hopper_minecart; @@ -66,6 +64,7 @@ pub mod lightning_bolt; pub mod llama; pub mod llama_spit; pub mod magma_cube; +pub mod marker; pub mod minecart; pub mod mooshroom; pub mod mule; @@ -121,116 +120,120 @@ pub mod zombie; pub mod zombie_horse; pub mod zombie_villager; pub mod zombified_piglin; - -pub fn add_entity_components(builder: &mut EntityBuilder, init: &EntityInit) { - match init { - EntityInit::AreaEffectCloud => area_effect_cloud::build_default(builder), - EntityInit::ArmorStand => armor_stand::build_default(builder), - EntityInit::Arrow => arrow::build_default(builder), - EntityInit::Bat => bat::build_default(builder), - EntityInit::Bee => bee::build_default(builder), - EntityInit::Blaze => blaze::build_default(builder), - EntityInit::Boat => boat::build_default(builder), - EntityInit::Cat => cat::build_default(builder), - EntityInit::CaveSpider => cave_spider::build_default(builder), - EntityInit::Chicken => chicken::build_default(builder), - EntityInit::Cod => cod::build_default(builder), - EntityInit::Cow => cow::build_default(builder), - EntityInit::Creeper => creeper::build_default(builder), - EntityInit::Dolphin => dolphin::build_default(builder), - EntityInit::Donkey => donkey::build_default(builder), - EntityInit::DragonFireball => dragon_fireball::build_default(builder), - EntityInit::Drowned => drowned::build_default(builder), - EntityInit::ElderGuardian => elder_guardian::build_default(builder), - EntityInit::EndCrystal => end_crystal::build_default(builder), - EntityInit::EnderDragon => ender_dragon::build_default(builder), - EntityInit::Enderman => enderman::build_default(builder), - EntityInit::Endermite => endermite::build_default(builder), - EntityInit::Evoker => evoker::build_default(builder), - EntityInit::EvokerFangs => evoker_fangs::build_default(builder), - EntityInit::ExperienceOrb => experience_orb::build_default(builder), - EntityInit::EyeOfEnder => eye_of_ender::build_default(builder), - EntityInit::FallingBlock => falling_block::build_default(builder), - EntityInit::FireworkRocket => firework_rocket::build_default(builder), - EntityInit::Fox => fox::build_default(builder), - EntityInit::Ghast => ghast::build_default(builder), - EntityInit::Giant => giant::build_default(builder), - EntityInit::Guardian => guardian::build_default(builder), - EntityInit::Hoglin => hoglin::build_default(builder), - EntityInit::Horse => horse::build_default(builder), - EntityInit::Husk => husk::build_default(builder), - EntityInit::Illusioner => illusioner::build_default(builder), - EntityInit::IronGolem => iron_golem::build_default(builder), - EntityInit::Item => item::build_default(builder), - EntityInit::ItemFrame => item_frame::build_default(builder), - EntityInit::Fireball => fireball::build_default(builder), - EntityInit::LeashKnot => leash_knot::build_default(builder), - EntityInit::LightningBolt => lightning_bolt::build_default(builder), - EntityInit::Llama => llama::build_default(builder), - EntityInit::LlamaSpit => llama_spit::build_default(builder), - EntityInit::MagmaCube => magma_cube::build_default(builder), - EntityInit::Minecart => minecart::build_default(builder), - EntityInit::ChestMinecart => chest_minecart::build_default(builder), - EntityInit::CommandBlockMinecart => command_block_minecart::build_default(builder), - EntityInit::FurnaceMinecart => furnace_minecart::build_default(builder), - EntityInit::HopperMinecart => hopper_minecart::build_default(builder), - EntityInit::SpawnerMinecart => spawner_minecart::build_default(builder), - EntityInit::TntMinecart => tnt_minecart::build_default(builder), - EntityInit::Mule => mule::build_default(builder), - EntityInit::Mooshroom => mooshroom::build_default(builder), - EntityInit::Ocelot => ocelot::build_default(builder), - EntityInit::Painting => painting::build_default(builder), - EntityInit::Panda => panda::build_default(builder), - EntityInit::Parrot => parrot::build_default(builder), - EntityInit::Phantom => phantom::build_default(builder), - EntityInit::Pig => pig::build_default(builder), - EntityInit::Piglin => piglin::build_default(builder), - EntityInit::PiglinBrute => piglin_brute::build_default(builder), - EntityInit::Pillager => pillager::build_default(builder), - EntityInit::PolarBear => polar_bear::build_default(builder), - EntityInit::Tnt => tnt::build_default(builder), - EntityInit::Pufferfish => pufferfish::build_default(builder), - EntityInit::Rabbit => rabbit::build_default(builder), - EntityInit::Ravager => ravager::build_default(builder), - EntityInit::Salmon => salmon::build_default(builder), - EntityInit::Sheep => sheep::build_default(builder), - EntityInit::Shulker => shulker::build_default(builder), - EntityInit::ShulkerBullet => shulker_bullet::build_default(builder), - EntityInit::Silverfish => silverfish::build_default(builder), - EntityInit::Skeleton => skeleton::build_default(builder), - EntityInit::SkeletonHorse => skeleton_horse::build_default(builder), - EntityInit::Slime => slime::build_default(builder), - EntityInit::SmallFireball => small_fireball::build_default(builder), - EntityInit::SnowGolem => snow_golem::build_default(builder), - EntityInit::Snowball => snowball::build_default(builder), - EntityInit::SpectralArrow => spectral_arrow::build_default(builder), - EntityInit::Spider => spider::build_default(builder), - EntityInit::Squid => squid::build_default(builder), - EntityInit::Stray => stray::build_default(builder), - EntityInit::Strider => strider::build_default(builder), - EntityInit::Egg => egg::build_default(builder), - EntityInit::EnderPearl => ender_pearl::build_default(builder), - EntityInit::ExperienceBottle => experience_bottle::build_default(builder), - EntityInit::Potion => potion::build_default(builder), - EntityInit::Trident => trident::build_default(builder), - EntityInit::TraderLlama => trader_llama::build_default(builder), - EntityInit::TropicalFish => tropical_fish::build_default(builder), - EntityInit::Turtle => turtle::build_default(builder), - EntityInit::Vex => vex::build_default(builder), - EntityInit::Villager => villager::build_default(builder), - EntityInit::Vindicator => vindicator::build_default(builder), - EntityInit::WanderingTrader => wandering_trader::build_default(builder), - EntityInit::Witch => witch::build_default(builder), - EntityInit::Wither => wither::build_default(builder), - EntityInit::WitherSkeleton => wither_skeleton::build_default(builder), - EntityInit::WitherSkull => wither_skull::build_default(builder), - EntityInit::Wolf => wolf::build_default(builder), - EntityInit::Zoglin => zoglin::build_default(builder), - EntityInit::Zombie => zombie::build_default(builder), - EntityInit::ZombieHorse => zombie_horse::build_default(builder), - EntityInit::ZombieVillager => zombie_villager::build_default(builder), - EntityInit::ZombifiedPiglin => zombified_piglin::build_default(builder), - EntityInit::Player => player::build_default(builder), - EntityInit::FishingBobber => fishing_bobber::build_default(builder), +pub fn add_entity_components(builder: &mut EntityBuilder, kind: EntityKind) { + match kind { + EntityKind::AreaEffectCloud => area_effect_cloud::build_default(builder), + EntityKind::ArmorStand => armor_stand::build_default(builder), + EntityKind::Arrow => arrow::build_default(builder), + EntityKind::Axolotl => axolotl::build_default(builder), + EntityKind::Bat => bat::build_default(builder), + EntityKind::Bee => bee::build_default(builder), + EntityKind::Blaze => blaze::build_default(builder), + EntityKind::Boat => boat::build_default(builder), + EntityKind::Cat => cat::build_default(builder), + EntityKind::CaveSpider => cave_spider::build_default(builder), + EntityKind::Chicken => chicken::build_default(builder), + EntityKind::Cod => cod::build_default(builder), + EntityKind::Cow => cow::build_default(builder), + EntityKind::Creeper => creeper::build_default(builder), + EntityKind::Dolphin => dolphin::build_default(builder), + EntityKind::Donkey => donkey::build_default(builder), + EntityKind::DragonFireball => dragon_fireball::build_default(builder), + EntityKind::Drowned => drowned::build_default(builder), + EntityKind::ElderGuardian => elder_guardian::build_default(builder), + EntityKind::EndCrystal => end_crystal::build_default(builder), + EntityKind::EnderDragon => ender_dragon::build_default(builder), + EntityKind::Enderman => enderman::build_default(builder), + EntityKind::Endermite => endermite::build_default(builder), + EntityKind::Evoker => evoker::build_default(builder), + EntityKind::EvokerFangs => evoker_fangs::build_default(builder), + EntityKind::ExperienceOrb => experience_orb::build_default(builder), + EntityKind::EyeOfEnder => eye_of_ender::build_default(builder), + EntityKind::FallingBlock => falling_block::build_default(builder), + EntityKind::FireworkRocket => firework_rocket::build_default(builder), + EntityKind::Fox => fox::build_default(builder), + EntityKind::Ghast => ghast::build_default(builder), + EntityKind::Giant => giant::build_default(builder), + EntityKind::GlowItemFrame => glow_item_frame::build_default(builder), + EntityKind::GlowSquid => glow_squid::build_default(builder), + EntityKind::Goat => goat::build_default(builder), + EntityKind::Guardian => guardian::build_default(builder), + EntityKind::Hoglin => hoglin::build_default(builder), + EntityKind::Horse => horse::build_default(builder), + EntityKind::Husk => husk::build_default(builder), + EntityKind::Illusioner => illusioner::build_default(builder), + EntityKind::IronGolem => iron_golem::build_default(builder), + EntityKind::Item => item::build_default(builder), + EntityKind::ItemFrame => item_frame::build_default(builder), + EntityKind::Fireball => fireball::build_default(builder), + EntityKind::LeashKnot => leash_knot::build_default(builder), + EntityKind::LightningBolt => lightning_bolt::build_default(builder), + EntityKind::Llama => llama::build_default(builder), + EntityKind::LlamaSpit => llama_spit::build_default(builder), + EntityKind::MagmaCube => magma_cube::build_default(builder), + EntityKind::Marker => marker::build_default(builder), + EntityKind::Minecart => minecart::build_default(builder), + EntityKind::ChestMinecart => chest_minecart::build_default(builder), + EntityKind::CommandBlockMinecart => command_block_minecart::build_default(builder), + EntityKind::FurnaceMinecart => furnace_minecart::build_default(builder), + EntityKind::HopperMinecart => hopper_minecart::build_default(builder), + EntityKind::SpawnerMinecart => spawner_minecart::build_default(builder), + EntityKind::TntMinecart => tnt_minecart::build_default(builder), + EntityKind::Mule => mule::build_default(builder), + EntityKind::Mooshroom => mooshroom::build_default(builder), + EntityKind::Ocelot => ocelot::build_default(builder), + EntityKind::Painting => painting::build_default(builder), + EntityKind::Panda => panda::build_default(builder), + EntityKind::Parrot => parrot::build_default(builder), + EntityKind::Phantom => phantom::build_default(builder), + EntityKind::Pig => pig::build_default(builder), + EntityKind::Piglin => piglin::build_default(builder), + EntityKind::PiglinBrute => piglin_brute::build_default(builder), + EntityKind::Pillager => pillager::build_default(builder), + EntityKind::PolarBear => polar_bear::build_default(builder), + EntityKind::Tnt => tnt::build_default(builder), + EntityKind::Pufferfish => pufferfish::build_default(builder), + EntityKind::Rabbit => rabbit::build_default(builder), + EntityKind::Ravager => ravager::build_default(builder), + EntityKind::Salmon => salmon::build_default(builder), + EntityKind::Sheep => sheep::build_default(builder), + EntityKind::Shulker => shulker::build_default(builder), + EntityKind::ShulkerBullet => shulker_bullet::build_default(builder), + EntityKind::Silverfish => silverfish::build_default(builder), + EntityKind::Skeleton => skeleton::build_default(builder), + EntityKind::SkeletonHorse => skeleton_horse::build_default(builder), + EntityKind::Slime => slime::build_default(builder), + EntityKind::SmallFireball => small_fireball::build_default(builder), + EntityKind::SnowGolem => snow_golem::build_default(builder), + EntityKind::Snowball => snowball::build_default(builder), + EntityKind::SpectralArrow => spectral_arrow::build_default(builder), + EntityKind::Spider => spider::build_default(builder), + EntityKind::Squid => squid::build_default(builder), + EntityKind::Stray => stray::build_default(builder), + EntityKind::Strider => strider::build_default(builder), + EntityKind::Egg => egg::build_default(builder), + EntityKind::EnderPearl => ender_pearl::build_default(builder), + EntityKind::ExperienceBottle => experience_bottle::build_default(builder), + EntityKind::Potion => potion::build_default(builder), + EntityKind::Trident => trident::build_default(builder), + EntityKind::TraderLlama => trader_llama::build_default(builder), + EntityKind::TropicalFish => tropical_fish::build_default(builder), + EntityKind::Turtle => turtle::build_default(builder), + EntityKind::Vex => vex::build_default(builder), + EntityKind::Villager => villager::build_default(builder), + EntityKind::Vindicator => vindicator::build_default(builder), + EntityKind::WanderingTrader => wandering_trader::build_default(builder), + EntityKind::Witch => witch::build_default(builder), + EntityKind::Wither => wither::build_default(builder), + EntityKind::WitherSkeleton => wither_skeleton::build_default(builder), + EntityKind::WitherSkull => wither_skull::build_default(builder), + EntityKind::Wolf => wolf::build_default(builder), + EntityKind::Zoglin => zoglin::build_default(builder), + EntityKind::Zombie => zombie::build_default(builder), + EntityKind::ZombieHorse => zombie_horse::build_default(builder), + EntityKind::ZombieVillager => zombie_villager::build_default(builder), + EntityKind::ZombifiedPiglin => zombified_piglin::build_default(builder), + EntityKind::Player => player::build_default(builder), + EntityKind::FishingBobber => fishing_bobber::build_default(builder), } } diff --git a/feather/common/src/entities/area_effect_cloud.rs b/feather/common/src/entities/area_effect_cloud.rs index 974b31a69..aa920865a 100644 --- a/feather/common/src/entities/area_effect_cloud.rs +++ b/feather/common/src/entities/area_effect_cloud.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::AreaEffectCloud; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::AreaEffectCloud; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(AreaEffectCloud) - .add(EntityKind::AreaEffectCloud); + .add(EntityKindComponent(EntityKind::AreaEffectCloud)); } diff --git a/feather/common/src/entities/armor_stand.rs b/feather/common/src/entities/armor_stand.rs index 95cdee704..fdc31e609 100644 --- a/feather/common/src/entities/armor_stand.rs +++ b/feather/common/src/entities/armor_stand.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ArmorStand; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ArmorStand; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ArmorStand).add(EntityKind::ArmorStand); + builder + .add(ArmorStand) + .add(EntityKindComponent(EntityKind::ArmorStand)); } diff --git a/feather/common/src/entities/arrow.rs b/feather/common/src/entities/arrow.rs index 9c15209e5..bff6938e5 100644 --- a/feather/common/src/entities/arrow.rs +++ b/feather/common/src/entities/arrow.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Arrow; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Arrow; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Arrow).add(EntityKind::Arrow); + builder + .add(Arrow) + .add(EntityKindComponent(EntityKind::Arrow)); } diff --git a/feather/common/src/entities/axolotl.rs b/feather/common/src/entities/axolotl.rs new file mode 100644 index 000000000..f723eea25 --- /dev/null +++ b/feather/common/src/entities/axolotl.rs @@ -0,0 +1,11 @@ +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Axolotl; +use vane::EntityBuilder; +pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder + .add(Axolotl) + .add(EntityKindComponent(EntityKind::Axolotl)); +} diff --git a/feather/common/src/entities/bat.rs b/feather/common/src/entities/bat.rs index f222c3e21..ef13793bf 100644 --- a/feather/common/src/entities/bat.rs +++ b/feather/common/src/entities/bat.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Bat; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Bat; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Bat).add(EntityKind::Bat); + builder.add(Bat).add(EntityKindComponent(EntityKind::Bat)); } diff --git a/feather/common/src/entities/bee.rs b/feather/common/src/entities/bee.rs index d72385897..f608f6bcd 100644 --- a/feather/common/src/entities/bee.rs +++ b/feather/common/src/entities/bee.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Bee; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Bee; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Bee).add(EntityKind::Bee); + builder.add(Bee).add(EntityKindComponent(EntityKind::Bee)); } diff --git a/feather/common/src/entities/blaze.rs b/feather/common/src/entities/blaze.rs index 8345ca50b..0e983dc1e 100644 --- a/feather/common/src/entities/blaze.rs +++ b/feather/common/src/entities/blaze.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Blaze; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Blaze; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Blaze).add(EntityKind::Blaze); + builder + .add(Blaze) + .add(EntityKindComponent(EntityKind::Blaze)); } diff --git a/feather/common/src/entities/boat.rs b/feather/common/src/entities/boat.rs index 74798544b..3f3c22af5 100644 --- a/feather/common/src/entities/boat.rs +++ b/feather/common/src/entities/boat.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Boat; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Boat; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Boat).add(EntityKind::Boat); + builder.add(Boat).add(EntityKindComponent(EntityKind::Boat)); } diff --git a/feather/common/src/entities/cat.rs b/feather/common/src/entities/cat.rs index 0d046eb71..c04f815e9 100644 --- a/feather/common/src/entities/cat.rs +++ b/feather/common/src/entities/cat.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Cat; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Cat; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Cat).add(EntityKind::Cat); + builder.add(Cat).add(EntityKindComponent(EntityKind::Cat)); } diff --git a/feather/common/src/entities/cave_spider.rs b/feather/common/src/entities/cave_spider.rs index ef2f5079e..d22d580b5 100644 --- a/feather/common/src/entities/cave_spider.rs +++ b/feather/common/src/entities/cave_spider.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::CaveSpider; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::CaveSpider; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(CaveSpider).add(EntityKind::CaveSpider); + builder + .add(CaveSpider) + .add(EntityKindComponent(EntityKind::CaveSpider)); } diff --git a/feather/common/src/entities/chest_minecart.rs b/feather/common/src/entities/chest_minecart.rs index 814cc3a15..469b09b6f 100644 --- a/feather/common/src/entities/chest_minecart.rs +++ b/feather/common/src/entities/chest_minecart.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ChestMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ChestMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ChestMinecart).add(EntityKind::ChestMinecart); + builder + .add(ChestMinecart) + .add(EntityKindComponent(EntityKind::ChestMinecart)); } diff --git a/feather/common/src/entities/chicken.rs b/feather/common/src/entities/chicken.rs index acad9f090..8af562fbc 100644 --- a/feather/common/src/entities/chicken.rs +++ b/feather/common/src/entities/chicken.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Chicken; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Chicken; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Chicken).add(EntityKind::Chicken); + builder + .add(Chicken) + .add(EntityKindComponent(EntityKind::Chicken)); } diff --git a/feather/common/src/entities/cod.rs b/feather/common/src/entities/cod.rs index f00ab6ced..c3f414f73 100644 --- a/feather/common/src/entities/cod.rs +++ b/feather/common/src/entities/cod.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Cod; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Cod; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Cod).add(EntityKind::Cod); + builder.add(Cod).add(EntityKindComponent(EntityKind::Cod)); } diff --git a/feather/common/src/entities/command_block_minecart.rs b/feather/common/src/entities/command_block_minecart.rs index 7ee4cf12d..49fbdca01 100644 --- a/feather/common/src/entities/command_block_minecart.rs +++ b/feather/common/src/entities/command_block_minecart.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::CommandBlockMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::CommandBlockMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(CommandBlockMinecart) - .add(EntityKind::CommandBlockMinecart); + .add(EntityKindComponent(EntityKind::CommandBlockMinecart)); } diff --git a/feather/common/src/entities/cow.rs b/feather/common/src/entities/cow.rs index 0819836c1..250cdb7d4 100644 --- a/feather/common/src/entities/cow.rs +++ b/feather/common/src/entities/cow.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Cow; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Cow; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Cow).add(EntityKind::Cow); + builder.add(Cow).add(EntityKindComponent(EntityKind::Cow)); } diff --git a/feather/common/src/entities/creeper.rs b/feather/common/src/entities/creeper.rs index 31c416ef2..e2a76df48 100644 --- a/feather/common/src/entities/creeper.rs +++ b/feather/common/src/entities/creeper.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Creeper; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Creeper; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Creeper).add(EntityKind::Creeper); + builder + .add(Creeper) + .add(EntityKindComponent(EntityKind::Creeper)); } diff --git a/feather/common/src/entities/dolphin.rs b/feather/common/src/entities/dolphin.rs index ace8dc2d0..45148c8d9 100644 --- a/feather/common/src/entities/dolphin.rs +++ b/feather/common/src/entities/dolphin.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Dolphin; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Dolphin; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Dolphin).add(EntityKind::Dolphin); + builder + .add(Dolphin) + .add(EntityKindComponent(EntityKind::Dolphin)); } diff --git a/feather/common/src/entities/donkey.rs b/feather/common/src/entities/donkey.rs index e58b5cd26..5a485e9a3 100644 --- a/feather/common/src/entities/donkey.rs +++ b/feather/common/src/entities/donkey.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Donkey; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Donkey; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Donkey).add(EntityKind::Donkey); + builder + .add(Donkey) + .add(EntityKindComponent(EntityKind::Donkey)); } diff --git a/feather/common/src/entities/dragon_fireball.rs b/feather/common/src/entities/dragon_fireball.rs index 63c4121c7..10346565e 100644 --- a/feather/common/src/entities/dragon_fireball.rs +++ b/feather/common/src/entities/dragon_fireball.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::DragonFireball; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::DragonFireball; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(DragonFireball).add(EntityKind::DragonFireball); + builder + .add(DragonFireball) + .add(EntityKindComponent(EntityKind::DragonFireball)); } diff --git a/feather/common/src/entities/drowned.rs b/feather/common/src/entities/drowned.rs index c91618ce1..5a53110c2 100644 --- a/feather/common/src/entities/drowned.rs +++ b/feather/common/src/entities/drowned.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Drowned; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Drowned; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Drowned).add(EntityKind::Drowned); + builder + .add(Drowned) + .add(EntityKindComponent(EntityKind::Drowned)); } diff --git a/feather/common/src/entities/egg.rs b/feather/common/src/entities/egg.rs index f5ae44457..6c8c446ab 100644 --- a/feather/common/src/entities/egg.rs +++ b/feather/common/src/entities/egg.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Egg; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Egg; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Egg).add(EntityKind::Egg); + builder.add(Egg).add(EntityKindComponent(EntityKind::Egg)); } diff --git a/feather/common/src/entities/elder_guardian.rs b/feather/common/src/entities/elder_guardian.rs index b5a642bc9..c27a7904c 100644 --- a/feather/common/src/entities/elder_guardian.rs +++ b/feather/common/src/entities/elder_guardian.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ElderGuardian; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ElderGuardian; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ElderGuardian).add(EntityKind::ElderGuardian); + builder + .add(ElderGuardian) + .add(EntityKindComponent(EntityKind::ElderGuardian)); } diff --git a/feather/common/src/entities/end_crystal.rs b/feather/common/src/entities/end_crystal.rs index 84849f55b..cb76126f3 100644 --- a/feather/common/src/entities/end_crystal.rs +++ b/feather/common/src/entities/end_crystal.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::EndCrystal; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::EndCrystal; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(EndCrystal).add(EntityKind::EndCrystal); + builder + .add(EndCrystal) + .add(EntityKindComponent(EntityKind::EndCrystal)); } diff --git a/feather/common/src/entities/ender_dragon.rs b/feather/common/src/entities/ender_dragon.rs index ef6680a7c..9ed81da74 100644 --- a/feather/common/src/entities/ender_dragon.rs +++ b/feather/common/src/entities/ender_dragon.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::EnderDragon; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::EnderDragon; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(EnderDragon).add(EntityKind::EnderDragon); + builder + .add(EnderDragon) + .add(EntityKindComponent(EntityKind::EnderDragon)); } diff --git a/feather/common/src/entities/ender_pearl.rs b/feather/common/src/entities/ender_pearl.rs index ab1a2e7d2..346f30a3a 100644 --- a/feather/common/src/entities/ender_pearl.rs +++ b/feather/common/src/entities/ender_pearl.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::EnderPearl; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::EnderPearl; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(EnderPearl).add(EntityKind::EnderPearl); + builder + .add(EnderPearl) + .add(EntityKindComponent(EntityKind::EnderPearl)); } diff --git a/feather/common/src/entities/enderman.rs b/feather/common/src/entities/enderman.rs index 833c752b9..2c0486c11 100644 --- a/feather/common/src/entities/enderman.rs +++ b/feather/common/src/entities/enderman.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Enderman; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Enderman; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Enderman).add(EntityKind::Enderman); + builder + .add(Enderman) + .add(EntityKindComponent(EntityKind::Enderman)); } diff --git a/feather/common/src/entities/endermite.rs b/feather/common/src/entities/endermite.rs index 1676d2014..d0095c281 100644 --- a/feather/common/src/entities/endermite.rs +++ b/feather/common/src/entities/endermite.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Endermite; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Endermite; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Endermite).add(EntityKind::Endermite); + builder + .add(Endermite) + .add(EntityKindComponent(EntityKind::Endermite)); } diff --git a/feather/common/src/entities/evoker.rs b/feather/common/src/entities/evoker.rs index ee2f9d38f..f82b92862 100644 --- a/feather/common/src/entities/evoker.rs +++ b/feather/common/src/entities/evoker.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Evoker; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Evoker; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Evoker).add(EntityKind::Evoker); + builder + .add(Evoker) + .add(EntityKindComponent(EntityKind::Evoker)); } diff --git a/feather/common/src/entities/evoker_fangs.rs b/feather/common/src/entities/evoker_fangs.rs index 52a94c63b..66a206efb 100644 --- a/feather/common/src/entities/evoker_fangs.rs +++ b/feather/common/src/entities/evoker_fangs.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::EvokerFangs; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::EvokerFangs; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(EvokerFangs).add(EntityKind::EvokerFangs); + builder + .add(EvokerFangs) + .add(EntityKindComponent(EntityKind::EvokerFangs)); } diff --git a/feather/common/src/entities/experience_bottle.rs b/feather/common/src/entities/experience_bottle.rs index eb984d54f..261aa422d 100644 --- a/feather/common/src/entities/experience_bottle.rs +++ b/feather/common/src/entities/experience_bottle.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ExperienceBottle; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ExperienceBottle; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(ExperienceBottle) - .add(EntityKind::ExperienceBottle); + .add(EntityKindComponent(EntityKind::ExperienceBottle)); } diff --git a/feather/common/src/entities/experience_orb.rs b/feather/common/src/entities/experience_orb.rs index 0c696cfb6..cda4d4a61 100644 --- a/feather/common/src/entities/experience_orb.rs +++ b/feather/common/src/entities/experience_orb.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ExperienceOrb; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ExperienceOrb; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ExperienceOrb).add(EntityKind::ExperienceOrb); + builder + .add(ExperienceOrb) + .add(EntityKindComponent(EntityKind::ExperienceOrb)); } diff --git a/feather/common/src/entities/eye_of_ender.rs b/feather/common/src/entities/eye_of_ender.rs index 6d6a9eb99..fd0d00e1b 100644 --- a/feather/common/src/entities/eye_of_ender.rs +++ b/feather/common/src/entities/eye_of_ender.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::EyeOfEnder; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::EyeOfEnder; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(EyeOfEnder).add(EntityKind::EyeOfEnder); + builder + .add(EyeOfEnder) + .add(EntityKindComponent(EntityKind::EyeOfEnder)); } diff --git a/feather/common/src/entities/falling_block.rs b/feather/common/src/entities/falling_block.rs index 64eba2aa9..2d21542b0 100644 --- a/feather/common/src/entities/falling_block.rs +++ b/feather/common/src/entities/falling_block.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::FallingBlock; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::FallingBlock; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(FallingBlock).add(EntityKind::FallingBlock); + builder + .add(FallingBlock) + .add(EntityKindComponent(EntityKind::FallingBlock)); } diff --git a/feather/common/src/entities/fireball.rs b/feather/common/src/entities/fireball.rs index 232684802..9d748a919 100644 --- a/feather/common/src/entities/fireball.rs +++ b/feather/common/src/entities/fireball.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Fireball; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Fireball; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Fireball).add(EntityKind::Fireball); + builder + .add(Fireball) + .add(EntityKindComponent(EntityKind::Fireball)); } diff --git a/feather/common/src/entities/firework_rocket.rs b/feather/common/src/entities/firework_rocket.rs index c3992dce8..f7fed7fe6 100644 --- a/feather/common/src/entities/firework_rocket.rs +++ b/feather/common/src/entities/firework_rocket.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::FireworkRocket; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::FireworkRocket; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(FireworkRocket).add(EntityKind::FireworkRocket); + builder + .add(FireworkRocket) + .add(EntityKindComponent(EntityKind::FireworkRocket)); } diff --git a/feather/common/src/entities/fishing_bobber.rs b/feather/common/src/entities/fishing_bobber.rs index 036d7afcc..b51bfe243 100644 --- a/feather/common/src/entities/fishing_bobber.rs +++ b/feather/common/src/entities/fishing_bobber.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::FishingBobber; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::FishingBobber; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(FishingBobber).add(EntityKind::FishingBobber); + builder + .add(FishingBobber) + .add(EntityKindComponent(EntityKind::FishingBobber)); } diff --git a/feather/common/src/entities/fox.rs b/feather/common/src/entities/fox.rs index 2267ab1e2..28555ad78 100644 --- a/feather/common/src/entities/fox.rs +++ b/feather/common/src/entities/fox.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Fox; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Fox; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Fox).add(EntityKind::Fox); + builder.add(Fox).add(EntityKindComponent(EntityKind::Fox)); } diff --git a/feather/common/src/entities/furnace_minecart.rs b/feather/common/src/entities/furnace_minecart.rs index d56fa0efc..e7a7209d3 100644 --- a/feather/common/src/entities/furnace_minecart.rs +++ b/feather/common/src/entities/furnace_minecart.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::FurnaceMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::FurnaceMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(FurnaceMinecart) - .add(EntityKind::FurnaceMinecart); + .add(EntityKindComponent(EntityKind::FurnaceMinecart)); } diff --git a/feather/common/src/entities/ghast.rs b/feather/common/src/entities/ghast.rs index 687175afa..a0a4b1245 100644 --- a/feather/common/src/entities/ghast.rs +++ b/feather/common/src/entities/ghast.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Ghast; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Ghast; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Ghast).add(EntityKind::Ghast); + builder + .add(Ghast) + .add(EntityKindComponent(EntityKind::Ghast)); } diff --git a/feather/common/src/entities/giant.rs b/feather/common/src/entities/giant.rs index 11290d1d1..3a6cf6ba1 100644 --- a/feather/common/src/entities/giant.rs +++ b/feather/common/src/entities/giant.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Giant; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Giant; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Giant).add(EntityKind::Giant); + builder + .add(Giant) + .add(EntityKindComponent(EntityKind::Giant)); } diff --git a/feather/common/src/entities/glow_item_frame.rs b/feather/common/src/entities/glow_item_frame.rs new file mode 100644 index 000000000..86da867ce --- /dev/null +++ b/feather/common/src/entities/glow_item_frame.rs @@ -0,0 +1,11 @@ +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::GlowItemFrame; +use vane::EntityBuilder; +pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder + .add(GlowItemFrame) + .add(EntityKindComponent(EntityKind::GlowItemFrame)); +} diff --git a/feather/common/src/entities/glow_squid.rs b/feather/common/src/entities/glow_squid.rs new file mode 100644 index 000000000..71b1bfb45 --- /dev/null +++ b/feather/common/src/entities/glow_squid.rs @@ -0,0 +1,11 @@ +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::GlowSquid; +use vane::EntityBuilder; +pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder + .add(GlowSquid) + .add(EntityKindComponent(EntityKind::GlowSquid)); +} diff --git a/feather/common/src/entities/goat.rs b/feather/common/src/entities/goat.rs new file mode 100644 index 000000000..6d4075830 --- /dev/null +++ b/feather/common/src/entities/goat.rs @@ -0,0 +1,9 @@ +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Goat; +use vane::EntityBuilder; +pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder.add(Goat).add(EntityKindComponent(EntityKind::Goat)); +} diff --git a/feather/common/src/entities/guardian.rs b/feather/common/src/entities/guardian.rs index 04289c4bb..feb5b115a 100644 --- a/feather/common/src/entities/guardian.rs +++ b/feather/common/src/entities/guardian.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Guardian; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Guardian; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Guardian).add(EntityKind::Guardian); + builder + .add(Guardian) + .add(EntityKindComponent(EntityKind::Guardian)); } diff --git a/feather/common/src/entities/hoglin.rs b/feather/common/src/entities/hoglin.rs index 1be5d1dad..78876bb6e 100644 --- a/feather/common/src/entities/hoglin.rs +++ b/feather/common/src/entities/hoglin.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Hoglin; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Hoglin; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Hoglin).add(EntityKind::Hoglin); + builder + .add(Hoglin) + .add(EntityKindComponent(EntityKind::Hoglin)); } diff --git a/feather/common/src/entities/hopper_minecart.rs b/feather/common/src/entities/hopper_minecart.rs index 8cf8455fc..33af33d91 100644 --- a/feather/common/src/entities/hopper_minecart.rs +++ b/feather/common/src/entities/hopper_minecart.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::HopperMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::HopperMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(HopperMinecart).add(EntityKind::HopperMinecart); + builder + .add(HopperMinecart) + .add(EntityKindComponent(EntityKind::HopperMinecart)); } diff --git a/feather/common/src/entities/horse.rs b/feather/common/src/entities/horse.rs index 25dc48d44..cd9fa1ace 100644 --- a/feather/common/src/entities/horse.rs +++ b/feather/common/src/entities/horse.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Horse; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Horse; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Horse).add(EntityKind::Horse); + builder + .add(Horse) + .add(EntityKindComponent(EntityKind::Horse)); } diff --git a/feather/common/src/entities/husk.rs b/feather/common/src/entities/husk.rs index dc276d868..4eda27b3d 100644 --- a/feather/common/src/entities/husk.rs +++ b/feather/common/src/entities/husk.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Husk; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Husk; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Husk).add(EntityKind::Husk); + builder.add(Husk).add(EntityKindComponent(EntityKind::Husk)); } diff --git a/feather/common/src/entities/illusioner.rs b/feather/common/src/entities/illusioner.rs index f188f09fb..81334923f 100644 --- a/feather/common/src/entities/illusioner.rs +++ b/feather/common/src/entities/illusioner.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Illusioner; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Illusioner; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Illusioner).add(EntityKind::Illusioner); + builder + .add(Illusioner) + .add(EntityKindComponent(EntityKind::Illusioner)); } diff --git a/feather/common/src/entities/iron_golem.rs b/feather/common/src/entities/iron_golem.rs index ca0c91c9b..b3b763d31 100644 --- a/feather/common/src/entities/iron_golem.rs +++ b/feather/common/src/entities/iron_golem.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::IronGolem; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::IronGolem; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(IronGolem).add(EntityKind::IronGolem); + builder + .add(IronGolem) + .add(EntityKindComponent(EntityKind::IronGolem)); } diff --git a/feather/common/src/entities/item.rs b/feather/common/src/entities/item.rs index 7fe8f4b44..466769119 100644 --- a/feather/common/src/entities/item.rs +++ b/feather/common/src/entities/item.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Item; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Item; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Item).add(EntityKind::Item); + builder.add(Item).add(EntityKindComponent(EntityKind::Item)); } diff --git a/feather/common/src/entities/item_frame.rs b/feather/common/src/entities/item_frame.rs index cbcac743f..5eadae8fe 100644 --- a/feather/common/src/entities/item_frame.rs +++ b/feather/common/src/entities/item_frame.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ItemFrame; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ItemFrame; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ItemFrame).add(EntityKind::ItemFrame); + builder + .add(ItemFrame) + .add(EntityKindComponent(EntityKind::ItemFrame)); } diff --git a/feather/common/src/entities/leash_knot.rs b/feather/common/src/entities/leash_knot.rs index 554df1092..027683627 100644 --- a/feather/common/src/entities/leash_knot.rs +++ b/feather/common/src/entities/leash_knot.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::LeashKnot; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::LeashKnot; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(LeashKnot).add(EntityKind::LeashKnot); + builder + .add(LeashKnot) + .add(EntityKindComponent(EntityKind::LeashKnot)); } diff --git a/feather/common/src/entities/lightning_bolt.rs b/feather/common/src/entities/lightning_bolt.rs index 6127c561d..aad2adf00 100644 --- a/feather/common/src/entities/lightning_bolt.rs +++ b/feather/common/src/entities/lightning_bolt.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::LightningBolt; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::LightningBolt; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(LightningBolt).add(EntityKind::LightningBolt); + builder + .add(LightningBolt) + .add(EntityKindComponent(EntityKind::LightningBolt)); } diff --git a/feather/common/src/entities/llama.rs b/feather/common/src/entities/llama.rs index 5929eed9d..49577cd73 100644 --- a/feather/common/src/entities/llama.rs +++ b/feather/common/src/entities/llama.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Llama; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Llama; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Llama).add(EntityKind::Llama); + builder + .add(Llama) + .add(EntityKindComponent(EntityKind::Llama)); } diff --git a/feather/common/src/entities/llama_spit.rs b/feather/common/src/entities/llama_spit.rs index 562a3a8be..553526ea7 100644 --- a/feather/common/src/entities/llama_spit.rs +++ b/feather/common/src/entities/llama_spit.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::LlamaSpit; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::LlamaSpit; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(LlamaSpit).add(EntityKind::LlamaSpit); + builder + .add(LlamaSpit) + .add(EntityKindComponent(EntityKind::LlamaSpit)); } diff --git a/feather/common/src/entities/magma_cube.rs b/feather/common/src/entities/magma_cube.rs index 61831dab9..467594436 100644 --- a/feather/common/src/entities/magma_cube.rs +++ b/feather/common/src/entities/magma_cube.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::MagmaCube; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::MagmaCube; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(MagmaCube).add(EntityKind::MagmaCube); + builder + .add(MagmaCube) + .add(EntityKindComponent(EntityKind::MagmaCube)); } diff --git a/feather/common/src/entities/marker.rs b/feather/common/src/entities/marker.rs new file mode 100644 index 000000000..a12f27438 --- /dev/null +++ b/feather/common/src/entities/marker.rs @@ -0,0 +1,11 @@ +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Marker; +use vane::EntityBuilder; +pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder + .add(Marker) + .add(EntityKindComponent(EntityKind::Marker)); +} diff --git a/feather/common/src/entities/minecart.rs b/feather/common/src/entities/minecart.rs index f28ed8687..f2e9aeb6f 100644 --- a/feather/common/src/entities/minecart.rs +++ b/feather/common/src/entities/minecart.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Minecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Minecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Minecart).add(EntityKind::Minecart); + builder + .add(Minecart) + .add(EntityKindComponent(EntityKind::Minecart)); } diff --git a/feather/common/src/entities/mooshroom.rs b/feather/common/src/entities/mooshroom.rs index 984f2c913..bcfb7ddc3 100644 --- a/feather/common/src/entities/mooshroom.rs +++ b/feather/common/src/entities/mooshroom.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Mooshroom; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Mooshroom; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Mooshroom).add(EntityKind::Mooshroom); + builder + .add(Mooshroom) + .add(EntityKindComponent(EntityKind::Mooshroom)); } diff --git a/feather/common/src/entities/mule.rs b/feather/common/src/entities/mule.rs index 342387ebc..eb838fd03 100644 --- a/feather/common/src/entities/mule.rs +++ b/feather/common/src/entities/mule.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Mule; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Mule; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Mule).add(EntityKind::Mule); + builder.add(Mule).add(EntityKindComponent(EntityKind::Mule)); } diff --git a/feather/common/src/entities/ocelot.rs b/feather/common/src/entities/ocelot.rs index 0e1d4c528..0f3ff057f 100644 --- a/feather/common/src/entities/ocelot.rs +++ b/feather/common/src/entities/ocelot.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Ocelot; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Ocelot; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Ocelot).add(EntityKind::Ocelot); + builder + .add(Ocelot) + .add(EntityKindComponent(EntityKind::Ocelot)); } diff --git a/feather/common/src/entities/painting.rs b/feather/common/src/entities/painting.rs index 1eaaf6117..293f532fa 100644 --- a/feather/common/src/entities/painting.rs +++ b/feather/common/src/entities/painting.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Painting; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Painting; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Painting).add(EntityKind::Painting); + builder + .add(Painting) + .add(EntityKindComponent(EntityKind::Painting)); } diff --git a/feather/common/src/entities/panda.rs b/feather/common/src/entities/panda.rs index c63b7e116..92c316dd8 100644 --- a/feather/common/src/entities/panda.rs +++ b/feather/common/src/entities/panda.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Panda; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Panda; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Panda).add(EntityKind::Panda); + builder + .add(Panda) + .add(EntityKindComponent(EntityKind::Panda)); } diff --git a/feather/common/src/entities/parrot.rs b/feather/common/src/entities/parrot.rs index 919865d45..cf4af5d18 100644 --- a/feather/common/src/entities/parrot.rs +++ b/feather/common/src/entities/parrot.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Parrot; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Parrot; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Parrot).add(EntityKind::Parrot); + builder + .add(Parrot) + .add(EntityKindComponent(EntityKind::Parrot)); } diff --git a/feather/common/src/entities/phantom.rs b/feather/common/src/entities/phantom.rs index 4339412d7..06f5e0765 100644 --- a/feather/common/src/entities/phantom.rs +++ b/feather/common/src/entities/phantom.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Phantom; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Phantom; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Phantom).add(EntityKind::Phantom); + builder + .add(Phantom) + .add(EntityKindComponent(EntityKind::Phantom)); } diff --git a/feather/common/src/entities/pig.rs b/feather/common/src/entities/pig.rs index 210cf2c0a..883c939dc 100644 --- a/feather/common/src/entities/pig.rs +++ b/feather/common/src/entities/pig.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Pig; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Pig; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Pig).add(EntityKind::Pig); + builder.add(Pig).add(EntityKindComponent(EntityKind::Pig)); } diff --git a/feather/common/src/entities/piglin.rs b/feather/common/src/entities/piglin.rs index 3c759c2e5..6efdbe9ae 100644 --- a/feather/common/src/entities/piglin.rs +++ b/feather/common/src/entities/piglin.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Piglin; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Piglin; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Piglin).add(EntityKind::Piglin); + builder + .add(Piglin) + .add(EntityKindComponent(EntityKind::Piglin)); } diff --git a/feather/common/src/entities/piglin_brute.rs b/feather/common/src/entities/piglin_brute.rs index b9d371464..1a5f92020 100644 --- a/feather/common/src/entities/piglin_brute.rs +++ b/feather/common/src/entities/piglin_brute.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::PiglinBrute; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::PiglinBrute; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(PiglinBrute).add(EntityKind::PiglinBrute); + builder + .add(PiglinBrute) + .add(EntityKindComponent(EntityKind::PiglinBrute)); } diff --git a/feather/common/src/entities/pillager.rs b/feather/common/src/entities/pillager.rs index 3e76f800b..60feef7d3 100644 --- a/feather/common/src/entities/pillager.rs +++ b/feather/common/src/entities/pillager.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Pillager; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Pillager; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Pillager).add(EntityKind::Pillager); + builder + .add(Pillager) + .add(EntityKindComponent(EntityKind::Pillager)); } diff --git a/feather/common/src/entities/player.rs b/feather/common/src/entities/player.rs index a8cc7443a..c6ea45280 100644 --- a/feather/common/src/entities/player.rs +++ b/feather/common/src/entities/player.rs @@ -1,10 +1,15 @@ use anyhow::bail; -use base::EntityKind; -use ecs::{EntityBuilder, SysResult}; -use quill_common::{ - components::{CreativeFlying, Sneaking, Sprinting}, +use libcraft::{EntityKind, ProfileProperty}; +use quill::{ + components::{CreativeFlying, EntityKindComponent, Sneaking, Sprinting}, entities::Player, }; +use vane::{Component, EntityBuilder, SysResult}; + +#[derive(Debug)] +pub struct PlayerProfile(pub Vec); + +impl Component for PlayerProfile {} pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); @@ -13,13 +18,15 @@ pub fn build_default(builder: &mut EntityBuilder) { .add(CreativeFlying(false)) .add(Sneaking(false)) .add(Sprinting(false)) - .add(EntityKind::Player); + .add(EntityKindComponent(EntityKind::Player)); } /// The hotbar slot a player's cursor is currently on #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct HotbarSlot(usize); +impl Component for HotbarSlot {} + impl HotbarSlot { pub fn new(id: usize) -> Self { Self(id) diff --git a/feather/common/src/entities/polar_bear.rs b/feather/common/src/entities/polar_bear.rs index 532bf6791..38430aa51 100644 --- a/feather/common/src/entities/polar_bear.rs +++ b/feather/common/src/entities/polar_bear.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::PolarBear; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::PolarBear; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(PolarBear).add(EntityKind::PolarBear); + builder + .add(PolarBear) + .add(EntityKindComponent(EntityKind::PolarBear)); } diff --git a/feather/common/src/entities/potion.rs b/feather/common/src/entities/potion.rs index cccf07566..8595cb741 100644 --- a/feather/common/src/entities/potion.rs +++ b/feather/common/src/entities/potion.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Potion; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Potion; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Potion).add(EntityKind::Potion); + builder + .add(Potion) + .add(EntityKindComponent(EntityKind::Potion)); } diff --git a/feather/common/src/entities/pufferfish.rs b/feather/common/src/entities/pufferfish.rs index 65c67a85a..df3e3ab30 100644 --- a/feather/common/src/entities/pufferfish.rs +++ b/feather/common/src/entities/pufferfish.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Pufferfish; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Pufferfish; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Pufferfish).add(EntityKind::Pufferfish); + builder + .add(Pufferfish) + .add(EntityKindComponent(EntityKind::Pufferfish)); } diff --git a/feather/common/src/entities/rabbit.rs b/feather/common/src/entities/rabbit.rs index 4b2582fb0..e2f42bb4a 100644 --- a/feather/common/src/entities/rabbit.rs +++ b/feather/common/src/entities/rabbit.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Rabbit; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Rabbit; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Rabbit).add(EntityKind::Rabbit); + builder + .add(Rabbit) + .add(EntityKindComponent(EntityKind::Rabbit)); } diff --git a/feather/common/src/entities/ravager.rs b/feather/common/src/entities/ravager.rs index e0d574c73..e46486467 100644 --- a/feather/common/src/entities/ravager.rs +++ b/feather/common/src/entities/ravager.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Ravager; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Ravager; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Ravager).add(EntityKind::Ravager); + builder + .add(Ravager) + .add(EntityKindComponent(EntityKind::Ravager)); } diff --git a/feather/common/src/entities/salmon.rs b/feather/common/src/entities/salmon.rs index 178ef9d21..2e7222a53 100644 --- a/feather/common/src/entities/salmon.rs +++ b/feather/common/src/entities/salmon.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Salmon; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Salmon; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Salmon).add(EntityKind::Salmon); + builder + .add(Salmon) + .add(EntityKindComponent(EntityKind::Salmon)); } diff --git a/feather/common/src/entities/sheep.rs b/feather/common/src/entities/sheep.rs index d0ca5449d..16dcb4ddb 100644 --- a/feather/common/src/entities/sheep.rs +++ b/feather/common/src/entities/sheep.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Sheep; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Sheep; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Sheep).add(EntityKind::Sheep); + builder + .add(Sheep) + .add(EntityKindComponent(EntityKind::Sheep)); } diff --git a/feather/common/src/entities/shulker.rs b/feather/common/src/entities/shulker.rs index 9643d8e29..134ec95cb 100644 --- a/feather/common/src/entities/shulker.rs +++ b/feather/common/src/entities/shulker.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Shulker; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Shulker; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Shulker).add(EntityKind::Shulker); + builder + .add(Shulker) + .add(EntityKindComponent(EntityKind::Shulker)); } diff --git a/feather/common/src/entities/shulker_bullet.rs b/feather/common/src/entities/shulker_bullet.rs index 796b272b2..e6285b331 100644 --- a/feather/common/src/entities/shulker_bullet.rs +++ b/feather/common/src/entities/shulker_bullet.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ShulkerBullet; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ShulkerBullet; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ShulkerBullet).add(EntityKind::ShulkerBullet); + builder + .add(ShulkerBullet) + .add(EntityKindComponent(EntityKind::ShulkerBullet)); } diff --git a/feather/common/src/entities/silverfish.rs b/feather/common/src/entities/silverfish.rs index ab6e939ab..2cf269b55 100644 --- a/feather/common/src/entities/silverfish.rs +++ b/feather/common/src/entities/silverfish.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Silverfish; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Silverfish; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Silverfish).add(EntityKind::Silverfish); + builder + .add(Silverfish) + .add(EntityKindComponent(EntityKind::Silverfish)); } diff --git a/feather/common/src/entities/skeleton.rs b/feather/common/src/entities/skeleton.rs index 6f72c12b3..ffd1d4466 100644 --- a/feather/common/src/entities/skeleton.rs +++ b/feather/common/src/entities/skeleton.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Skeleton; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Skeleton; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Skeleton).add(EntityKind::Skeleton); + builder + .add(Skeleton) + .add(EntityKindComponent(EntityKind::Skeleton)); } diff --git a/feather/common/src/entities/skeleton_horse.rs b/feather/common/src/entities/skeleton_horse.rs index cf8a2c96e..634d914ac 100644 --- a/feather/common/src/entities/skeleton_horse.rs +++ b/feather/common/src/entities/skeleton_horse.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::SkeletonHorse; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::SkeletonHorse; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(SkeletonHorse).add(EntityKind::SkeletonHorse); + builder + .add(SkeletonHorse) + .add(EntityKindComponent(EntityKind::SkeletonHorse)); } diff --git a/feather/common/src/entities/slime.rs b/feather/common/src/entities/slime.rs index 809221504..1e5819fb8 100644 --- a/feather/common/src/entities/slime.rs +++ b/feather/common/src/entities/slime.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Slime; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Slime; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Slime).add(EntityKind::Slime); + builder + .add(Slime) + .add(EntityKindComponent(EntityKind::Slime)); } diff --git a/feather/common/src/entities/small_fireball.rs b/feather/common/src/entities/small_fireball.rs index f3eac8f9a..d2799c266 100644 --- a/feather/common/src/entities/small_fireball.rs +++ b/feather/common/src/entities/small_fireball.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::SmallFireball; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::SmallFireball; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(SmallFireball).add(EntityKind::SmallFireball); + builder + .add(SmallFireball) + .add(EntityKindComponent(EntityKind::SmallFireball)); } diff --git a/feather/common/src/entities/snow_golem.rs b/feather/common/src/entities/snow_golem.rs index 01193a73e..625804581 100644 --- a/feather/common/src/entities/snow_golem.rs +++ b/feather/common/src/entities/snow_golem.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::SnowGolem; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::SnowGolem; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(SnowGolem).add(EntityKind::SnowGolem); + builder + .add(SnowGolem) + .add(EntityKindComponent(EntityKind::SnowGolem)); } diff --git a/feather/common/src/entities/snowball.rs b/feather/common/src/entities/snowball.rs index f5bafff66..172efb4c3 100644 --- a/feather/common/src/entities/snowball.rs +++ b/feather/common/src/entities/snowball.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Snowball; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Snowball; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Snowball).add(EntityKind::Snowball); + builder + .add(Snowball) + .add(EntityKindComponent(EntityKind::Snowball)); } diff --git a/feather/common/src/entities/spawner_minecart.rs b/feather/common/src/entities/spawner_minecart.rs index 550ccde67..892a53b81 100644 --- a/feather/common/src/entities/spawner_minecart.rs +++ b/feather/common/src/entities/spawner_minecart.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::SpawnerMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::SpawnerMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(SpawnerMinecart) - .add(EntityKind::SpawnerMinecart); + .add(EntityKindComponent(EntityKind::SpawnerMinecart)); } diff --git a/feather/common/src/entities/spectral_arrow.rs b/feather/common/src/entities/spectral_arrow.rs index adc604636..81fb2a1af 100644 --- a/feather/common/src/entities/spectral_arrow.rs +++ b/feather/common/src/entities/spectral_arrow.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::SpectralArrow; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::SpectralArrow; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(SpectralArrow).add(EntityKind::SpectralArrow); + builder + .add(SpectralArrow) + .add(EntityKindComponent(EntityKind::SpectralArrow)); } diff --git a/feather/common/src/entities/spider.rs b/feather/common/src/entities/spider.rs index 9f1a6c688..6655cb225 100644 --- a/feather/common/src/entities/spider.rs +++ b/feather/common/src/entities/spider.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Spider; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Spider; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Spider).add(EntityKind::Spider); + builder + .add(Spider) + .add(EntityKindComponent(EntityKind::Spider)); } diff --git a/feather/common/src/entities/squid.rs b/feather/common/src/entities/squid.rs index 8743b62a1..9c96bbe59 100644 --- a/feather/common/src/entities/squid.rs +++ b/feather/common/src/entities/squid.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Squid; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Squid; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Squid).add(EntityKind::Squid); + builder + .add(Squid) + .add(EntityKindComponent(EntityKind::Squid)); } diff --git a/feather/common/src/entities/stray.rs b/feather/common/src/entities/stray.rs index dd38847aa..1cdaf3a6f 100644 --- a/feather/common/src/entities/stray.rs +++ b/feather/common/src/entities/stray.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Stray; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Stray; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Stray).add(EntityKind::Stray); + builder + .add(Stray) + .add(EntityKindComponent(EntityKind::Stray)); } diff --git a/feather/common/src/entities/strider.rs b/feather/common/src/entities/strider.rs index b94f79706..29dc51b8f 100644 --- a/feather/common/src/entities/strider.rs +++ b/feather/common/src/entities/strider.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Strider; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Strider; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Strider).add(EntityKind::Strider); + builder + .add(Strider) + .add(EntityKindComponent(EntityKind::Strider)); } diff --git a/feather/common/src/entities/tnt.rs b/feather/common/src/entities/tnt.rs index 8adefb369..9fa0dbd23 100644 --- a/feather/common/src/entities/tnt.rs +++ b/feather/common/src/entities/tnt.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Tnt; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Tnt; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Tnt).add(EntityKind::Tnt); + builder.add(Tnt).add(EntityKindComponent(EntityKind::Tnt)); } diff --git a/feather/common/src/entities/tnt_minecart.rs b/feather/common/src/entities/tnt_minecart.rs index 77b2bca36..db674ba20 100644 --- a/feather/common/src/entities/tnt_minecart.rs +++ b/feather/common/src/entities/tnt_minecart.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::TntMinecart; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::TntMinecart; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(TntMinecart).add(EntityKind::TntMinecart); + builder + .add(TntMinecart) + .add(EntityKindComponent(EntityKind::TntMinecart)); } diff --git a/feather/common/src/entities/trader_llama.rs b/feather/common/src/entities/trader_llama.rs index 58e0310a4..d2fd6286d 100644 --- a/feather/common/src/entities/trader_llama.rs +++ b/feather/common/src/entities/trader_llama.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::TraderLlama; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::TraderLlama; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(TraderLlama).add(EntityKind::TraderLlama); + builder + .add(TraderLlama) + .add(EntityKindComponent(EntityKind::TraderLlama)); } diff --git a/feather/common/src/entities/trident.rs b/feather/common/src/entities/trident.rs index b5a9a2bfa..1d5932fe8 100644 --- a/feather/common/src/entities/trident.rs +++ b/feather/common/src/entities/trident.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Trident; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Trident; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Trident).add(EntityKind::Trident); + builder + .add(Trident) + .add(EntityKindComponent(EntityKind::Trident)); } diff --git a/feather/common/src/entities/tropical_fish.rs b/feather/common/src/entities/tropical_fish.rs index 381e50aa0..0b7a1be9c 100644 --- a/feather/common/src/entities/tropical_fish.rs +++ b/feather/common/src/entities/tropical_fish.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::TropicalFish; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::TropicalFish; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(TropicalFish).add(EntityKind::TropicalFish); + builder + .add(TropicalFish) + .add(EntityKindComponent(EntityKind::TropicalFish)); } diff --git a/feather/common/src/entities/turtle.rs b/feather/common/src/entities/turtle.rs index 16c776443..a6c99a1bf 100644 --- a/feather/common/src/entities/turtle.rs +++ b/feather/common/src/entities/turtle.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Turtle; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Turtle; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Turtle).add(EntityKind::Turtle); + builder + .add(Turtle) + .add(EntityKindComponent(EntityKind::Turtle)); } diff --git a/feather/common/src/entities/vex.rs b/feather/common/src/entities/vex.rs index 3a92f1cdf..9fa9bfc20 100644 --- a/feather/common/src/entities/vex.rs +++ b/feather/common/src/entities/vex.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Vex; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Vex; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Vex).add(EntityKind::Vex); + builder.add(Vex).add(EntityKindComponent(EntityKind::Vex)); } diff --git a/feather/common/src/entities/villager.rs b/feather/common/src/entities/villager.rs index 5db272b24..3ab8b7436 100644 --- a/feather/common/src/entities/villager.rs +++ b/feather/common/src/entities/villager.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Villager; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Villager; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Villager).add(EntityKind::Villager); + builder + .add(Villager) + .add(EntityKindComponent(EntityKind::Villager)); } diff --git a/feather/common/src/entities/vindicator.rs b/feather/common/src/entities/vindicator.rs index fff0ea097..ce58f4d23 100644 --- a/feather/common/src/entities/vindicator.rs +++ b/feather/common/src/entities/vindicator.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Vindicator; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Vindicator; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Vindicator).add(EntityKind::Vindicator); + builder + .add(Vindicator) + .add(EntityKindComponent(EntityKind::Vindicator)); } diff --git a/feather/common/src/entities/wandering_trader.rs b/feather/common/src/entities/wandering_trader.rs index db57b88c1..39146b2f2 100644 --- a/feather/common/src/entities/wandering_trader.rs +++ b/feather/common/src/entities/wandering_trader.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::WanderingTrader; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::WanderingTrader; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(WanderingTrader) - .add(EntityKind::WanderingTrader); + .add(EntityKindComponent(EntityKind::WanderingTrader)); } diff --git a/feather/common/src/entities/witch.rs b/feather/common/src/entities/witch.rs index a3161895a..5eefdb1dd 100644 --- a/feather/common/src/entities/witch.rs +++ b/feather/common/src/entities/witch.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Witch; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Witch; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Witch).add(EntityKind::Witch); + builder + .add(Witch) + .add(EntityKindComponent(EntityKind::Witch)); } diff --git a/feather/common/src/entities/wither.rs b/feather/common/src/entities/wither.rs index 02fa1fe78..d1d61ddd6 100644 --- a/feather/common/src/entities/wither.rs +++ b/feather/common/src/entities/wither.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Wither; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Wither; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Wither).add(EntityKind::Wither); + builder + .add(Wither) + .add(EntityKindComponent(EntityKind::Wither)); } diff --git a/feather/common/src/entities/wither_skeleton.rs b/feather/common/src/entities/wither_skeleton.rs index 085b9e280..4eb55991e 100644 --- a/feather/common/src/entities/wither_skeleton.rs +++ b/feather/common/src/entities/wither_skeleton.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::WitherSkeleton; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::WitherSkeleton; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(WitherSkeleton).add(EntityKind::WitherSkeleton); + builder + .add(WitherSkeleton) + .add(EntityKindComponent(EntityKind::WitherSkeleton)); } diff --git a/feather/common/src/entities/wither_skull.rs b/feather/common/src/entities/wither_skull.rs index 59b871555..d4836c9ed 100644 --- a/feather/common/src/entities/wither_skull.rs +++ b/feather/common/src/entities/wither_skull.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::WitherSkull; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::WitherSkull; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(WitherSkull).add(EntityKind::WitherSkull); + builder + .add(WitherSkull) + .add(EntityKindComponent(EntityKind::WitherSkull)); } diff --git a/feather/common/src/entities/wolf.rs b/feather/common/src/entities/wolf.rs index cc07cb7db..f44f3a46b 100644 --- a/feather/common/src/entities/wolf.rs +++ b/feather/common/src/entities/wolf.rs @@ -1,8 +1,9 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Wolf; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Wolf; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Wolf).add(EntityKind::Wolf); + builder.add(Wolf).add(EntityKindComponent(EntityKind::Wolf)); } diff --git a/feather/common/src/entities/zoglin.rs b/feather/common/src/entities/zoglin.rs index 79d6ab4e5..51ac52514 100644 --- a/feather/common/src/entities/zoglin.rs +++ b/feather/common/src/entities/zoglin.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Zoglin; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Zoglin; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Zoglin).add(EntityKind::Zoglin); + builder + .add(Zoglin) + .add(EntityKindComponent(EntityKind::Zoglin)); } diff --git a/feather/common/src/entities/zombie.rs b/feather/common/src/entities/zombie.rs index eeb456878..a2dbe8432 100644 --- a/feather/common/src/entities/zombie.rs +++ b/feather/common/src/entities/zombie.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::Zombie; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::Zombie; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(Zombie).add(EntityKind::Zombie); + builder + .add(Zombie) + .add(EntityKindComponent(EntityKind::Zombie)); } diff --git a/feather/common/src/entities/zombie_horse.rs b/feather/common/src/entities/zombie_horse.rs index 44a7e0919..3e4ab6547 100644 --- a/feather/common/src/entities/zombie_horse.rs +++ b/feather/common/src/entities/zombie_horse.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ZombieHorse; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ZombieHorse; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ZombieHorse).add(EntityKind::ZombieHorse); + builder + .add(ZombieHorse) + .add(EntityKindComponent(EntityKind::ZombieHorse)); } diff --git a/feather/common/src/entities/zombie_villager.rs b/feather/common/src/entities/zombie_villager.rs index 29ae9d02c..c17f0b2fb 100644 --- a/feather/common/src/entities/zombie_villager.rs +++ b/feather/common/src/entities/zombie_villager.rs @@ -1,8 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ZombieVillager; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ZombieVillager; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); - builder.add(ZombieVillager).add(EntityKind::ZombieVillager); + builder + .add(ZombieVillager) + .add(EntityKindComponent(EntityKind::ZombieVillager)); } diff --git a/feather/common/src/entities/zombified_piglin.rs b/feather/common/src/entities/zombified_piglin.rs index 83b300f7b..9799a231e 100644 --- a/feather/common/src/entities/zombified_piglin.rs +++ b/feather/common/src/entities/zombified_piglin.rs @@ -1,10 +1,11 @@ -use base::EntityKind; -use ecs::EntityBuilder; -use quill_common::entities::ZombifiedPiglin; - +// This file is @generated. Please do not edit. +use libcraft::EntityKind; +use quill::components::EntityKindComponent; +use quill::entities::ZombifiedPiglin; +use vane::EntityBuilder; pub fn build_default(builder: &mut EntityBuilder) { super::build_default(builder); builder .add(ZombifiedPiglin) - .add(EntityKind::ZombifiedPiglin); + .add(EntityKindComponent(EntityKind::ZombifiedPiglin)); } diff --git a/feather/common/src/entity/player.rs b/feather/common/src/entity/player.rs deleted file mode 100644 index 605fa6769..000000000 --- a/feather/common/src/entity/player.rs +++ /dev/null @@ -1,10 +0,0 @@ -use base::EntityKind; -use ecs::EntityBuilder; - -/// Marker component. Indicates that an entity is a player. -pub struct Player; - -/// Fills an `EntityBuilder` with components for a player. -pub fn build(builder: &mut EntityBuilder) -> &mut EntityBuilder { - builder.add(Player).add(EntityKind::Player) -} diff --git a/feather/common/src/events.rs b/feather/common/src/events.rs index 114540089..ac6d74dad 100644 --- a/feather/common/src/events.rs +++ b/feather/common/src/events.rs @@ -1,12 +1,15 @@ -use base::{ChunkHandle, ChunkPosition}; - use crate::view::View; -mod block_change; -mod plugin_message; +use quill::{ChunkPosition, WorldId}; pub use block_change::BlockChangeEvent; pub use plugin_message::PluginMessageEvent; +use vane::Component; + +mod block_change; +mod plugin_message; + +pub use quill::events::{EntityCreateEvent, EntityRemoveEvent}; /// Event triggered when a player changes their `View`, /// meaning they crossed into a new chunk. @@ -19,15 +22,22 @@ pub struct ViewUpdateEvent { pub new_chunks: Vec, /// Chunks that are in `old_view` but not in `new_view` pub old_chunks: Vec, + + pub new_world: WorldId, + pub old_world: WorldId, } +impl Component for ViewUpdateEvent {} + impl ViewUpdateEvent { - pub fn new(old_view: View, new_view: View) -> Self { + pub fn new(old_view: &View, new_view: &View) -> Self { let mut this = Self { - old_view, - new_view, - new_chunks: new_view.difference(old_view).collect(), - old_chunks: old_view.difference(new_view).collect(), + old_view: old_view.clone(), + new_view: new_view.clone(), + new_chunks: new_view.difference(old_view), + old_chunks: old_view.difference(new_view), + new_world: new_view.world(), + old_world: old_view.world(), }; this.new_chunks .sort_unstable_by_key(|chunk| chunk.distance_squared_to(new_view.center())); @@ -46,15 +56,18 @@ pub struct ChunkCrossEvent { pub new_chunk: ChunkPosition, } -/// Triggered when a chunk is loaded. -#[derive(Debug)] -pub struct ChunkLoadEvent { - pub position: ChunkPosition, - pub chunk: ChunkHandle, -} +impl Component for ChunkCrossEvent {} /// Triggered when an error occurs while loading a chunk. #[derive(Debug)] pub struct ChunkLoadFailEvent { pub position: ChunkPosition, } + +impl Component for ChunkLoadFailEvent {} + +/// Triggered when a player joins, changes dimension and respawns after death +#[derive(Debug)] +pub struct PlayerRespawnEvent; + +impl Component for PlayerRespawnEvent {} diff --git a/feather/common/src/events/block_change.rs b/feather/common/src/events/block_change.rs index bb92ba52d..d1d098056 100644 --- a/feather/common/src/events/block_change.rs +++ b/feather/common/src/events/block_change.rs @@ -1,34 +1,47 @@ use std::{convert::TryInto, iter}; -use base::{ +use itertools::Either; +use libcraft::{ chunk::{SECTION_HEIGHT, SECTION_VOLUME}, BlockPosition, ChunkPosition, ValidBlockPosition, }; -use itertools::Either; +use quill::WorldId; +use vane::Component; /// Event triggered when one or more blocks are changed. /// /// This event can efficiently store bulk block updates -/// using a variety of different representations. Cloning -/// is cheap as it is, at worst, cloning an `Arc`. +/// using a variety of different representations. #[derive(Debug, Clone)] pub struct BlockChangeEvent { changes: BlockChanges, + world: WorldId, } +impl Component for BlockChangeEvent {} + impl BlockChangeEvent { /// Creates an event affecting a single block. - pub fn single(pos: ValidBlockPosition) -> Self { + pub fn single(pos: ValidBlockPosition, world: WorldId) -> Self { Self { changes: BlockChanges::Single { pos }, + world, } } + pub fn try_single>( + pos: T, + world: WorldId, + ) -> Result { + Ok(Self::single(pos.try_into()?, world)) + } + /// Creates an event corresponding to a block update /// that fills an entire chunk section with the same block. - pub fn fill_chunk_section(chunk: ChunkPosition, section: u32) -> Self { + pub fn fill_chunk_section(chunk: ChunkPosition, section: u32, world: WorldId) -> Self { Self { changes: BlockChanges::FillChunkSection { chunk, section }, + world, } } @@ -67,6 +80,10 @@ impl BlockChangeEvent { } } } + + pub fn world(&self) -> WorldId { + self.world + } } fn iter_section_blocks( @@ -97,14 +114,14 @@ enum BlockChanges { #[cfg(test)] mod tests { use ahash::AHashSet; - use base::chunk::SECTION_VOLUME; + use vane::Entity; use super::*; #[test] fn create_single() { let pos = BlockPosition::new(5, 64, 9).try_into().unwrap(); - let event = BlockChangeEvent::single(pos); + let event = BlockChangeEvent::single(pos, WorldId::new_random()); assert_eq!(event.count(), 1); assert_eq!(event.iter_changed_blocks().collect::>(), vec![pos]); assert_eq!( @@ -117,7 +134,7 @@ mod tests { fn create_chunk_section_fill() { let chunk = ChunkPosition::new(10, 15); let section_y = 5; - let event = BlockChangeEvent::fill_chunk_section(chunk, section_y); + let event = BlockChangeEvent::fill_chunk_section(chunk, section_y, WorldId::new_random()); assert_eq!(event.count(), SECTION_VOLUME); assert_eq!(event.iter_changed_blocks().count(), SECTION_VOLUME); assert_eq!( diff --git a/feather/common/src/events/plugin_message.rs b/feather/common/src/events/plugin_message.rs index b648ae375..263bcb2a1 100644 --- a/feather/common/src/events/plugin_message.rs +++ b/feather/common/src/events/plugin_message.rs @@ -1,5 +1,9 @@ +use vane::Component; + #[derive(Debug)] pub struct PluginMessageEvent { pub channel: String, pub data: Vec, } + +impl Component for PluginMessageEvent {} diff --git a/feather/common/src/game.rs b/feather/common/src/game.rs index 64e6bf87d..542b0ce28 100644 --- a/feather/common/src/game.rs +++ b/feather/common/src/game.rs @@ -1,43 +1,45 @@ +use std::cell::{Ref, RefMut}; use std::{cell::RefCell, mem, rc::Rc, sync::Arc}; -use base::{BlockId, ChunkPosition, Position, Text, Title, ValidBlockPosition}; -use ecs::{ - Ecs, Entity, EntityBuilder, HasEcs, HasResources, NoSuchEntity, Resources, SysResult, +use ahash::AHashMap; +use libcraft::EntityKind; +use libcraft::{Position, Text, Title}; +use quill::chat::{ChatKind, ChatMessage}; +use quill::components::EntityPosition; +use quill::entities::Player; +use quill::events::{EntityCreateEvent, EntityRemoveEvent, PlayerJoinEvent}; +use quill::game::{WorldGeneratorFactoryNotFound, WorldNotFound, WorldSourceFactoryNotFound}; +use quill::saveload::worldgen::WorldGeneratorFactory; +use quill::saveload::WorldSourceFactory; +use quill::threadpool::ThreadPool; +use quill::world::WorldDescriptor; +use quill::{ChatBox, World as _, WorldId}; +use tokio::runtime::{self, Runtime}; +use vane::{ + Entities, Entity, EntityBuilder, EntityDead, HasEntities, HasResources, Resources, SysResult, SystemExecutor, }; -use quill_common::events::{EntityCreateEvent, EntityRemoveEvent, PlayerJoinEvent}; -use quill_common::{entities::Player, entity_init::EntityInit}; - -use crate::{ - chat::{ChatKind, ChatMessage}, - chunk::entities::ChunkEntities, - events::BlockChangeEvent, - ChatBox, World, -}; -type EntitySpawnCallback = Box; +use crate::chunk::entities::ChunkEntities; +use crate::events::PlayerRespawnEvent; +use crate::world::World; + +type EntitySpawnCallback = Box; /// Stores the entire state of a Minecraft game. /// /// This contains: /// * A [`World`](crate::World) containing chunks and blocks. -/// * An [`Ecs`](ecs::Ecs) containing entities. -/// * A [`Resources`](ecs::Resources) containing additional, user-defined data. +/// * An [`Ecs`](vane::Ecs) containing entities. +/// * A [`Resources`](vane::Resources) containing additional, user-defined data. /// * A [`SystemExecutor`] to run systems. /// /// `feather-common` provides `Game` methods for actions such /// as "drop item" or "kill entity." These high-level methods /// should be preferred over raw interaction with the ECS. pub struct Game { - /// Contains chunks and blocks. - /// - /// NB: use methods on `Game` to update - /// blocks, not direct methods on `World`. - /// The `Game` methods will automatically - /// trigger the necessary `BlockChangeEvent`s. - pub world: World, /// Contains entities, including players. - pub ecs: Ecs, + pub ecs: Entities, /// Contains systems. pub system_executor: Rc>>, @@ -52,35 +54,55 @@ pub struct Game { /// Total ticks elapsed since the server started. pub tick_count: u64, + world_source_factories: AHashMap>, + world_generator_factories: AHashMap>, + + worlds: AHashMap>, + default_world: WorldId, + entity_spawn_callbacks: Vec, entity_builder: EntityBuilder, + + /// The Tokio runtime shared by the server and all plugins. + runtime: Runtime, + + compute_pool: ThreadPool, } impl Default for Game { fn default() -> Self { - Self::new() + Self::new( + runtime::Builder::new_current_thread() + .build() + .expect("failed to initialize default Tokio runtime"), + ) } } impl Game { /// Creates a new, empty `Game`. - pub fn new() -> Self { + pub fn new(runtime: Runtime) -> Self { Self { - world: World::new(), - ecs: Ecs::new(), + ecs: Entities::new(), system_executor: Rc::new(RefCell::new(SystemExecutor::new())), resources: Arc::new(Resources::new()), chunk_entities: ChunkEntities::default(), tick_count: 0, + world_source_factories: AHashMap::new(), + world_generator_factories: AHashMap::new(), + worlds: AHashMap::new(), + default_world: WorldId::new_random(), // needs to be set entity_spawn_callbacks: Vec::new(), entity_builder: EntityBuilder::new(), + runtime, + compute_pool: ThreadPool::new("compute", num_cpus::get()), } } /// Inserts a new resource. /// - /// An existing resource with type `T` is overriden. + /// An existing resource with type `T` is overridden. /// /// # Panics /// Panics if any resources are currently borrowed. @@ -100,7 +122,7 @@ impl Game { /// before they are built. pub fn add_entity_spawn_callback( &mut self, - callback: impl FnMut(&mut EntityBuilder, &EntityInit) + 'static, + callback: impl FnMut(&mut EntityBuilder, EntityKind) + 'static, ) { self.entity_spawn_callbacks.push(Box::new(callback)); } @@ -113,18 +135,18 @@ impl Game { /// Creates an entity builder with the default components /// for an entity of type `init`. - pub fn create_entity_builder(&mut self, position: Position, init: EntityInit) -> EntityBuilder { + pub fn create_entity_builder(&mut self, position: Position, kind: EntityKind) -> EntityBuilder { let mut builder = mem::take(&mut self.entity_builder); - builder.add(position); - self.invoke_entity_spawn_callbacks(&mut builder, init); + builder.add(EntityPosition(position)); + self.invoke_entity_spawn_callbacks(&mut builder, kind); builder } - /// Spawns an entity and returns its [`Entity`](ecs::Entity) handle. + /// Spawns an entity and returns its [`Entity`](vane::Entity) handle. /// /// Also triggers necessary events, like `EntitySpawnEvent` and `PlayerJoinEvent`. pub fn spawn_entity(&mut self, mut builder: EntityBuilder) -> Entity { - let entity = self.ecs.spawn(builder.build()); + let entity = self.ecs.spawn_builder(&mut builder); self.entity_builder = builder; self.trigger_entity_spawn_events(entity); @@ -132,10 +154,10 @@ impl Game { entity } - fn invoke_entity_spawn_callbacks(&mut self, builder: &mut EntityBuilder, init: EntityInit) { + fn invoke_entity_spawn_callbacks(&mut self, builder: &mut EntityBuilder, kind: EntityKind) { let mut callbacks = mem::take(&mut self.entity_spawn_callbacks); for callback in &mut callbacks { - callback(builder, &init); + callback(builder, kind); } self.entity_spawn_callbacks = callbacks; } @@ -144,16 +166,19 @@ impl Game { self.ecs .insert_entity_event(entity, EntityCreateEvent) .unwrap(); - if self.ecs.get::(entity).is_ok() { + if self.ecs.has::(entity) { self.ecs .insert_entity_event(entity, PlayerJoinEvent) .unwrap(); + self.ecs + .insert_entity_event(entity, PlayerRespawnEvent) + .unwrap(); } } /// Causes the given entity to be removed on the next tick. /// In the meantime, triggers `EntityRemoveEvent`. - pub fn remove_entity(&mut self, entity: Entity) -> Result<(), NoSuchEntity> { + pub fn remove_entity(&mut self, entity: Entity) -> Result<(), EntityDead> { self.ecs.defer_despawn(entity); self.ecs.insert_entity_event(entity, EntityRemoveEvent) } @@ -162,7 +187,7 @@ impl Game { /// a `ChatBox` component (usually just players). pub fn broadcast_chat(&self, kind: ChatKind, message: impl Into) { let message = message.into(); - for (_, mailbox) in self.ecs.query::<&mut ChatBox>().iter() { + for (_, mut mailbox) in self.ecs.query::<&mut ChatBox>().iter() { mailbox.send(ChatMessage::new(kind, message.clone())); } } @@ -181,54 +206,145 @@ impl Game { Ok(()) } - /// Gets the block at the given position. - pub fn block(&self, pos: ValidBlockPosition) -> Option { - self.world.block_at(pos) + pub fn default_world(&self) -> Ref { + ::default_world(self) } - /// Sets the block at the given position. - /// - /// Triggers necessary `BlockChangeEvent`s. - pub fn set_block(&mut self, pos: ValidBlockPosition, block: BlockId) -> bool { - let was_successful = self.world.set_block_at(pos, block); - if was_successful { - self.ecs.insert_event(BlockChangeEvent::single(pos)); - } - was_successful + pub fn default_world_mut(&self) -> RefMut { + ::default_world_mut(self) } - /// Fills the given chunk section (16x16x16 blocks). - /// - /// All blocks in the chunk section are overwritten with `block`. - pub fn fill_chunk_section( + pub fn default_world_id(&self) -> WorldId { + ::default_world_id(self) + } + + pub fn world(&self, id: WorldId) -> Result, WorldNotFound> { + ::world(self, id) + } + + pub fn world_mut(&self, id: WorldId) -> Result, WorldNotFound> { + ::world_mut(self, id) + } + + pub fn worlds_mut(&self) -> impl Iterator> + '_ { + self.worlds.values().map(RefCell::borrow_mut) + } +} + +impl quill::Game for Game { + fn ecs(&self) -> &Entities { + &self.ecs + } + + fn ecs_mut(&mut self) -> &mut Entities { + &mut self.ecs + } + + fn resources(&self) -> &Resources { + &self.resources + } + + fn resources_mut(&mut self) -> &mut Resources { + Arc::get_mut(&mut self.resources) + .expect("attempted to mutate Resources while a resource is borrowed") + } + + fn create_world(&mut self, desc: WorldDescriptor) { + log::info!( + "Created world '{}'", + desc.name.clone().unwrap_or_else(|| desc.id.to_string()) + ); + let world = World::new(desc, self); + self.worlds.insert(world.id(), RefCell::new(world)); + } + + fn register_world_source_factory(&mut self, name: &str, factory: Box) { + self.world_source_factories.insert(name.to_owned(), factory); + } + + fn register_world_generator_factory( &mut self, - chunk_pos: ChunkPosition, - section_y: usize, - block: BlockId, - ) -> bool { - let mut chunk = match self.world.chunk_map().chunk_at_mut(chunk_pos) { - Some(chunk) => chunk, - None => return false, - }; - - let was_successful = chunk.fill_section(section_y + 1, block); - - if !was_successful { - return false; - } + name: &str, + factory: Box, + ) { + self.world_generator_factories + .insert(name.to_owned(), factory); + } + + fn world_source_factory( + &self, + name: &str, + ) -> Result<&dyn WorldSourceFactory, WorldSourceFactoryNotFound> { + self.world_source_factories + .get(name) + .ok_or_else(|| WorldSourceFactoryNotFound(name.to_owned())) + .map(|b| &**b) + } + + fn world_generator_factory( + &self, + name: &str, + ) -> Result<&dyn WorldGeneratorFactory, WorldGeneratorFactoryNotFound> { + self.world_generator_factories + .get(name) + .ok_or_else(|| WorldGeneratorFactoryNotFound(name.to_owned())) + .map(|b| &**b) + } + + fn remove_world(&mut self, id: WorldId) -> Result<(), WorldNotFound> { + self.worlds + .remove(&id) + .map(|_| ()) + .ok_or_else(|| WorldNotFound(id)) + } + + fn world(&self, id: WorldId) -> Result, WorldNotFound> { + Ok(Ref::map( + self.worlds + .get(&id) + .ok_or_else(|| WorldNotFound(id))? + .borrow(), + |world| world, + )) + } + + fn world_mut(&self, id: WorldId) -> Result, WorldNotFound> { + Ok(RefMut::map( + self.worlds + .get(&id) + .ok_or_else(|| WorldNotFound(id))? + .borrow_mut(), + |world| world, + )) + } - self.ecs.insert_event(BlockChangeEvent::fill_chunk_section( - chunk_pos, - section_y as u32, - )); + fn set_default_world(&mut self, id: WorldId) { + assert!( + self.worlds.contains_key(&id), + "tried to set default world to world ID {}, which does not exist", + id + ); + self.default_world = id; + } + + fn default_world_id(&self) -> WorldId { + self.default_world + } + + fn spawn_entity(&mut self, builder: EntityBuilder) -> Entity { + Game::spawn_entity(self, builder) + } + + fn queue_remove_entity(&mut self, entity: Entity) { + self.remove_entity(entity).ok(); + } - true + fn tokio_runtime(&self) -> runtime::Handle { + self.runtime.handle().clone() } - /// Breaks the block at the given position, propagating any - /// necessary block updates. - pub fn break_block(&mut self, pos: ValidBlockPosition) -> bool { - self.set_block(pos, BlockId::air()) + fn compute_pool(&self) -> &quill::threadpool::ThreadPool { + &self.compute_pool } } @@ -238,12 +354,12 @@ impl HasResources for Game { } } -impl HasEcs for Game { - fn ecs(&self) -> &Ecs { +impl HasEntities for Game { + fn entities(&self) -> &Entities { &self.ecs } - fn ecs_mut(&mut self) -> &mut Ecs { + fn entities_mut(&mut self) -> &mut Entities { &mut self.ecs } } diff --git a/feather/common/src/interactable.rs b/feather/common/src/interactable.rs index 59966a2bc..4bb69bff8 100644 --- a/feather/common/src/interactable.rs +++ b/feather/common/src/interactable.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use blocks::BlockKind; +use libcraft::BlockKind; use crate::Game; diff --git a/feather/common/src/lib.rs b/feather/common/src/lib.rs index 9f9e7348a..262321df2 100644 --- a/feather/common/src/lib.rs +++ b/feather/common/src/lib.rs @@ -6,8 +6,8 @@ #![allow(clippy::unnecessary_wraps)] // systems are required to return Results mod game; -use ecs::SystemExecutor; -pub use game::Game; +use quill::Game as _; +use vane::SystemExecutor; mod tick_loop; pub use tick_loop::TickLoop; @@ -15,29 +15,40 @@ pub use tick_loop::TickLoop; pub mod view; pub mod window; -pub use window::Window; +pub use window::PlayerWindow; pub mod events; pub mod chunk; -mod region_worker; pub mod world; -pub use world::World; - -pub mod chat; -pub use chat::ChatBox; pub mod entities; pub mod interactable; +pub mod block; +pub mod world_sources; + +pub use game::Game; +pub use world::World; +use world_sources::worldgen::SuperflatWorldGeneratorFactory; + /// Registers gameplay systems with the given `Game` and `SystemExecutor`. pub fn register(game: &mut Game, systems: &mut SystemExecutor) { view::register(game, systems); - chunk::loading::register(game, systems); chunk::entities::register(systems); interactable::register(game); + world::systems::register(game, systems); + block::register(systems); game.add_entity_spawn_callback(entities::add_entity_components); + + game.register_world_source_factory( + "worldgen", + Box::new(world_sources::worldgen::WorldgenWorldSourceFactory), + ); + game.register_world_source_factory("empty", Box::new(world_sources::EmptyWorldSourceFactory)); + + game.register_world_generator_factory("flat", Box::new(SuperflatWorldGeneratorFactory)); } diff --git a/feather/common/src/region_worker.rs b/feather/common/src/region_worker.rs index dac33c985..350fc5615 100644 --- a/feather/common/src/region_worker.rs +++ b/feather/common/src/region_worker.rs @@ -1,3 +1,4 @@ +use std::sync::Arc; use std::{ collections::hash_map::Entry, path::PathBuf, @@ -5,11 +6,13 @@ use std::{ }; use ahash::AHashMap; -use base::anvil::{ +use flume::{Receiver, Sender}; +use libcraft::anvil::{ self, region::{RegionHandle, RegionPosition}, }; -use flume::{Receiver, Sender}; +use libcraft::biome::BiomeList; +use libcraft::WorldHeight; use crate::chunk::worker::{ChunkLoadResult, LoadRequest, LoadedChunk, SaveRequest, WorkerRequest}; @@ -40,12 +43,16 @@ pub struct RegionWorker { world_dir: PathBuf, region_files: AHashMap, last_cache_update: Instant, + world_height: WorldHeight, + biomes: Arc, } impl RegionWorker { pub fn new( world_dir: PathBuf, request_receiver: Receiver, + world_height: WorldHeight, + biomes: Arc, ) -> (Self, Receiver) { let (result_sender, result_receiver) = flume::bounded(256); ( @@ -55,6 +62,8 @@ impl RegionWorker { world_dir, region_files: AHashMap::new(), last_cache_update: Instant::now(), + world_height, + biomes, }, result_receiver, ) @@ -87,10 +96,12 @@ impl RegionWorker { fn save_chunk(&mut self, req: SaveRequest) -> anyhow::Result<()> { let reg_pos = RegionPosition::from_chunk(req.pos); + let biomes = Arc::clone(&self.biomes); let handle = &mut match self.region_file_handle(reg_pos) { Some(h) => h, None => { - let new_handle = anvil::region::create_region(&self.world_dir, reg_pos)?; + let new_handle = + anvil::region::create_region(&self.world_dir, reg_pos, self.world_height)?; self.region_files .insert(reg_pos, OpenRegionFile::new(new_handle)); self.region_file_handle(reg_pos).unwrap() @@ -101,6 +112,7 @@ impl RegionWorker { &req.chunk.read(), &req.entities[..], &req.block_entities[..], + &*biomes, )?; Ok(()) } @@ -112,13 +124,14 @@ impl RegionWorker { fn get_chunk_load_result(&mut self, req: LoadRequest) -> ChunkLoadResult { let pos = req.pos; + let biomes = Arc::clone(&self.biomes); let region = RegionPosition::from_chunk(pos); let file = match self.region_file_handle(region) { Some(file) => file, None => return ChunkLoadResult::Missing(pos), }; - let chunk = match file.handle.load_chunk(pos) { + let chunk = match file.handle.load_chunk(pos, &*biomes) { Ok((chunk, _, _)) => chunk, Err(e) => match e { anvil::region::Error::ChunkNotExist => return ChunkLoadResult::Missing(pos), @@ -135,7 +148,11 @@ impl RegionWorker { match self.region_files.entry(region) { Entry::Occupied(e) => Some(e.into_mut()), Entry::Vacant(e) => { - let handle = base::anvil::region::load_region(&self.world_dir, region); + let handle = libcraft::anvil::region::load_region( + &self.world_dir, + region, + self.world_height, + ); if let Ok(handle) = handle { Some(e.insert(OpenRegionFile::new(handle))) } else { diff --git a/feather/common/src/tick_loop.rs b/feather/common/src/tick_loop.rs index 8709087c7..09dc74c37 100644 --- a/feather/common/src/tick_loop.rs +++ b/feather/common/src/tick_loop.rs @@ -1,6 +1,6 @@ use std::time::Instant; -use base::TICK_DURATION; +use libcraft::TICK_DURATION; /// Utility to invoke a function in a tick loop, once /// every 50ms. diff --git a/feather/common/src/view.rs b/feather/common/src/view.rs index 52c404f5b..a15b8fbc8 100644 --- a/feather/common/src/view.rs +++ b/feather/common/src/view.rs @@ -1,9 +1,12 @@ -use ahash::AHashSet; -use base::{ChunkPosition, Position}; -use ecs::{SysResult, SystemExecutor}; +use ahash::{AHashMap, AHashSet}; use itertools::Either; -use quill_common::components::Name; -use quill_common::events::PlayerJoinEvent; +use libcraft::ChunkPosition; +use quill::components::EntityWorld; +use quill::components::{EntityPosition, Name}; +use quill::events::PlayerJoinEvent; +use quill::world::ChunkTicket; +use quill::WorldId; +use vane::{Component, SysResult, SystemExecutor}; use crate::{events::ViewUpdateEvent, Game}; @@ -11,20 +14,23 @@ use crate::{events::ViewUpdateEvent, Game}; pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { systems .add_system(update_player_views) - .add_system(update_view_on_join); + .add_system(update_view_on_join) + .add_system(update_tickets_for_players); } /// Updates players' views when they change chunks. fn update_player_views(game: &mut Game) -> SysResult { let mut events = Vec::new(); - for (player, (view, &position, name)) in - game.ecs.query::<(&mut View, &Position, &Name)>().iter() + for (player, (mut view, position, name, world)) in game + .ecs + .query::<(&mut View, &EntityPosition, &Name, &EntityWorld)>() + .iter() { if position.chunk() != view.center() { - let old_view = *view; - let new_view = View::new(position.chunk(), old_view.view_distance); + let old_view = view.clone(); + let new_view = View::new(position.chunk(), old_view.view_distance, world.0); - let event = ViewUpdateEvent::new(old_view, new_view); + let event = ViewUpdateEvent::new(&old_view, &new_view); events.push((player, event)); *view = new_view; @@ -41,38 +47,76 @@ fn update_player_views(game: &mut Game) -> SysResult { /// Triggers a ViewUpdateEvent when a player joins the game. fn update_view_on_join(game: &mut Game) -> SysResult { let mut events = Vec::new(); - for (player, (&view, name, _)) in game.ecs.query::<(&View, &Name, &PlayerJoinEvent)>().iter() { - let event = ViewUpdateEvent::new(View::empty(), view); + for (player, (view, name, world, _)) in game + .ecs + .query::<(&View, &Name, &EntityWorld, &PlayerJoinEvent)>() + .iter() + { + let event = ViewUpdateEvent::new(&View::empty(world.0), &view); events.push((player, event)); log::trace!("View of {} has been updated (player joined)", name); } for (player, event) in events { game.ecs.insert_entity_event(player, event)?; + game.ecs.insert(player, PlayerChunkTickets::default())?; + } + Ok(()) +} + +#[derive(Default)] +struct PlayerChunkTickets { + map: AHashMap, +} + +impl Component for PlayerChunkTickets {} + +fn update_tickets_for_players(game: &mut Game) -> SysResult { + for (_, (event, mut chunk_tickets, world_id)) in game + .ecs + .query::<(&ViewUpdateEvent, &mut PlayerChunkTickets, &EntityWorld)>() + .iter() + { + // Remove old tickets + for old_chunk in &event.old_chunks { + // Dropping the ticket automatically removes it from the world + chunk_tickets.map.remove(old_chunk); + } + + // Create new tickets + let mut world = game.world_mut(world_id.0)?; + for &new_chunk in &event.new_chunks { + let ticket = world.create_chunk_ticket(new_chunk); + chunk_tickets.map.insert(new_chunk, ticket); + } } Ok(()) } /// The view of a player, representing the set of chunks /// within their view distance. -#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug)] pub struct View { center: ChunkPosition, view_distance: u32, + world: WorldId, } +impl Component for View {} + impl View { /// Creates a `View` from a center chunk (the position of the player) /// and the view distance. - pub fn new(center: ChunkPosition, view_distance: u32) -> Self { + pub fn new(center: ChunkPosition, view_distance: u32, world: WorldId) -> Self { Self { center, view_distance, + world, } } /// Gets the empty view, i.e., the view containing no chunks. - pub fn empty() -> Self { - Self::new(ChunkPosition::new(0, 0), 0) + pub fn empty(world: WorldId) -> Self { + Self::new(ChunkPosition::new(0, 0), 0, world) } /// Determines whether this is the empty view. @@ -97,7 +141,7 @@ impl View { } /// Iterates over chunks visible to the player. - pub fn iter(self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator { if self.is_empty() { Either::Left(std::iter::empty()) } else { @@ -111,15 +155,15 @@ impl View { } /// Returns the set of chunks that are in `self` but not in `other`. - pub fn difference(self, other: View) -> impl Iterator { - // PERF: consider analytical approach instead of sets - let self_chunks: AHashSet<_> = self.iter().collect(); - let other_chunks: AHashSet<_> = other.iter().collect(); - self_chunks - .difference(&other_chunks) - .copied() - .collect::>() - .into_iter() + pub fn difference(&self, other: &View) -> Vec { + if self.world != other.world { + self.iter().collect() + } else { + // PERF: consider analytical approach instead of sets + let self_chunks: AHashSet<_> = self.iter().collect(); + let other_chunks: AHashSet<_> = other.iter().collect(); + self_chunks.difference(&other_chunks).copied().collect() + } } /// Determines whether the given chunk is visible. @@ -143,21 +187,27 @@ impl View { /// Returns the minimum X chunk coordinate. pub fn min_x(&self) -> i32 { - self.center.x - self.view_distance as i32 + // I don't know why but it's loading a 3x3 area with view_distance=2, + // there should be a better way to fix this + self.center.x - self.view_distance as i32 - 1 } /// Returns the minimum Z coordinate. pub fn min_z(&self) -> i32 { - self.center.z - self.view_distance as i32 + self.center.z - self.view_distance as i32 - 1 } /// Returns the maximum X coordinate. pub fn max_x(&self) -> i32 { - self.center.x + self.view_distance as i32 + self.center.x + self.view_distance as i32 + 1 } /// Returns the maximum Z coordinate. pub fn max_z(&self) -> i32 { - self.center.z + self.view_distance as i32 + self.center.z + self.view_distance as i32 + 1 + } + + pub fn world(&self) -> WorldId { + self.world } } diff --git a/feather/common/src/window.rs b/feather/common/src/window.rs index ba41b6381..a1994b908 100644 --- a/feather/common/src/window.rs +++ b/feather/common/src/window.rs @@ -1,14 +1,14 @@ +use std::cell::{Ref, RefMut}; use std::mem; use anyhow::{anyhow, bail}; -use base::{Area, Item}; +use libcraft::{Area, Item}; -use ecs::SysResult; -pub use libcraft_inventory::Window as BackingWindow; -use libcraft_inventory::WindowError; -use libcraft_items::InventorySlot::{self, Empty}; -use parking_lot::MutexGuard; +pub use libcraft::inventory::Window as BackingWindow; +use libcraft::inventory::WindowError; +use libcraft::items::InventorySlot::{self, Empty}; +use vane::{Component, SysResult}; /// A player's window. Wraps one or more inventories and handles /// conversion between protocol and slot indices. @@ -16,7 +16,7 @@ use parking_lot::MutexGuard; /// Also provides high-level methods to interact with the inventory, /// like [`Window::right_click`], [`Window::shift_click`], etc. #[derive(Debug)] -pub struct Window { +pub struct PlayerWindow { /// The backing window (contains the `Inventory`s) inner: BackingWindow, /// The item currently held by the player's cursor. @@ -25,7 +25,9 @@ pub struct Window { paint_state: Option, } -impl Window { +impl Component for PlayerWindow {} + +impl PlayerWindow { /// Creates a window from the backing window representation. pub fn new(inner: BackingWindow) -> Self { Self { @@ -37,7 +39,7 @@ impl Window { /// Left-click a slot in the window. pub fn left_click(&mut self, slot: usize) -> SysResult { - let slot = &mut *self.inner.item(slot)?; + let slot = &mut *self.inner.item_mut(slot)?; let cursor_slot = &mut self.cursor_item; // Cases: @@ -56,7 +58,7 @@ impl Window { /// Right-clicks a slot in the window. pub fn right_click(&mut self, slot_index: usize) -> SysResult { - let slot = &mut *self.inner.item(slot_index)?; + let slot = &mut *self.inner.item_mut(slot_index)?; let cursor_slot = &mut self.cursor_item; // Cases: @@ -88,7 +90,7 @@ impl Window { pub fn shift_click(&mut self, slot: usize) -> SysResult { // If we are shift clicking on a empty slot, then nothing happens. { - let slot_inventory = &mut *self.inner.item(slot)?; + let slot_inventory = &mut *self.inner.item_mut(slot)?; if slot_inventory.is_empty() { // Shift clicking on a empty inventory slot does nothing. return Ok(()); @@ -98,31 +100,31 @@ impl Window { match &self.inner { BackingWindow::Player { player: _ } => self.shift_click_in_player_window(slot), - BackingWindow::Generic9x1 { + BackingWindow::Generic9X1 { block: _, player: _, } - | BackingWindow::Generic9x2 { + | BackingWindow::Generic9X2 { block: _, player: _, } - | BackingWindow::Generic9x3 { + | BackingWindow::Generic9X3 { block: _, player: _, } - | BackingWindow::Generic9x4 { + | BackingWindow::Generic9X4 { block: _, player: _, } - | BackingWindow::Generic9x5 { + | BackingWindow::Generic9X5 { block: _, player: _, } - | BackingWindow::Generic3x3 { + | BackingWindow::Generic3X3 { block: _, player: _, } - | BackingWindow::Generic9x6 { + | BackingWindow::Generic9X6 { left_chest: _, right_chest: _, player: _, @@ -196,7 +198,7 @@ impl Window { } fn shift_click_in_player_window(&mut self, slot: usize) -> SysResult { - let slot_item = &mut *self.inner.item(slot)?; + let slot_item = &mut *self.inner.item_mut(slot)?; let (inventory, slot_area, _) = self.inner.index_to_slot(slot).unwrap(); let areas_to_try = [ @@ -216,7 +218,7 @@ impl Window { // Find slot with same type first let mut i = 0; - while let Some(mut stack) = inventory.item(area, i) { + while let Some(mut stack) = inventory.item_mut(area, i) { if slot_item.is_mergable(&stack) && stack.is_filled() { stack.merge(slot_item); } @@ -236,7 +238,7 @@ impl Window { // If we still haven't moved all the items, transfer to any empty space let mut i = 0; - while let Some(mut stack) = inventory.item(area, i) { + while let Some(mut stack) = inventory.item_mut(area, i) { if stack.is_empty() { stack.merge(slot_item); } @@ -349,10 +351,19 @@ impl Window { &self.cursor_item } - pub fn item(&self, index: usize) -> Result, WindowError> { + /// Sets the item currently held in the cursor. + pub fn set_cursor_item(&mut self, item: InventorySlot) { + self.cursor_item = item; + } + + pub fn item(&self, index: usize) -> Result, WindowError> { self.inner.item(index) } + pub fn item_mut(&self, index: usize) -> Result, WindowError> { + self.inner.item_mut(index) + } + /// Sets an [`InventorySlot`] at the index. /// # Error /// Returns an error if the index is [`WindowError::OutOfBounds`] @@ -487,7 +498,7 @@ impl PaintState { Ok(()) } - pub fn finish(self, window: &mut Window) -> SysResult { + pub fn finish(self, window: &mut PlayerWindow) -> SysResult { match self.mouse { Mouse::Left => self.handle_left_drag(window), Mouse::Right => self.handle_right_drag(window), @@ -499,7 +510,7 @@ impl PaintState { Splits cursor items evenly into every selected slot. Remainder of even split ends up in `window.cursor_item`. */ - fn handle_left_drag(&self, window: &mut Window) { + fn handle_left_drag(&self, window: &mut PlayerWindow) { // If the cursor has no item then there are no items to share. if window.cursor_item().is_empty() { return; @@ -529,9 +540,9 @@ impl PaintState { } /// Tries to move items_per_slot items from cursor to the slots that can contain the item - fn move_items_into_slots(&self, window: &mut Window, items_per_slot: u32) { + fn move_items_into_slots(&self, window: &mut PlayerWindow, items_per_slot: u32) { for s in &self.slots { - let slot = &mut *window.inner.item(*s).unwrap(); + let slot = &mut *window.inner.item_mut(*s).unwrap(); if !slot.is_mergable(window.cursor_item()) { continue; } @@ -543,7 +554,7 @@ impl PaintState { } } - fn handle_right_drag(&self, window: &mut Window) { + fn handle_right_drag(&self, window: &mut PlayerWindow) { self.move_items_into_slots(window, 1) } } @@ -556,7 +567,7 @@ enum Mouse { #[cfg(test)] mod tests { - use base::{Inventory, Item, ItemStack}; + use libcraft::{Inventory, Item, ItemStack}; use super::*; @@ -666,7 +677,7 @@ mod tests { } *inventory.item(Area::Storage, 0).unwrap() = InventorySlot::Filled(ItemStack::new(Item::AcaciaSign, 1).unwrap()); - let mut window = Window::new(BackingWindow::Player { + let mut window = PlayerWindow::new(BackingWindow::Player { player: inventory.new_handle(), }); let index = window @@ -689,7 +700,7 @@ mod tests { *inventory.item(Area::Storage, 3).unwrap() = InventorySlot::Filled(ItemStack::new(Item::Stone, 7).unwrap()); - let mut window = Window::new(BackingWindow::Player { + let mut window = PlayerWindow::new(BackingWindow::Player { player: inventory.new_handle(), }); @@ -719,7 +730,7 @@ mod tests { let inventory = Inventory::player(); *inventory.item(Area::Storage, 3).unwrap() = InventorySlot::Filled(ItemStack::new(Item::Stone, 7).unwrap()); - let mut window = Window::new(BackingWindow::Player { + let mut window = PlayerWindow::new(BackingWindow::Player { player: inventory.new_handle(), }); @@ -801,8 +812,8 @@ mod tests { assert_eq!(window.cursor_item, InventorySlot::Empty); } - fn window() -> Window { - Window::new(BackingWindow::Player { + fn window() -> PlayerWindow { + PlayerWindow::new(BackingWindow::Player { player: Inventory::player(), }) } diff --git a/feather/common/src/world.rs b/feather/common/src/world.rs index f82ffc427..556467d1b 100644 --- a/feather/common/src/world.rs +++ b/feather/common/src/world.rs @@ -1,283 +1,459 @@ -use std::{path::PathBuf, sync::Arc}; - -use ahash::{AHashMap, AHashSet}; -use parking_lot::{RwLockReadGuard, RwLockWriteGuard}; -use uuid::Uuid; - -use base::anvil::player::PlayerData; -use base::{ - BlockPosition, Chunk, ChunkHandle, ChunkLock, ChunkPosition, ValidBlockPosition, CHUNK_HEIGHT, +use std::{ + cell::RefCell, + collections::VecDeque, + sync::Arc, + time::{Duration, Instant}, }; -use blocks::BlockId; -use ecs::{Ecs, SysResult}; -use worldgen::{ComposableGenerator, WorldGenerator}; -use crate::{ - chunk::cache::ChunkCache, - chunk::worker::{ChunkWorker, LoadRequest, SaveRequest}, +use ahash::AHashSet; +use libcraft::{ + dimension::DimensionInfo, BlockPosition, BlockState, Chunk, ChunkPosition, WorldHeight, +}; +use quill::{ events::ChunkLoadEvent, + saveload::{ChunkLoadError, StoredChunk, WorldSource}, + world::{ChunkNotLoaded, ChunkTicket, WorldDescriptor, WorldSaveStrategy, WorldSettings}, + ChunkHandle, ChunkLock, World as _, WorldId, }; -/// Stores all blocks and chunks in a world, -/// along with global world data like weather, time, -/// and the [`WorldSource`](crate::world_source::WorldSource). -/// -/// NB: _not_ what most Rust ECSs call "world." -/// This does not store entities; it only contains blocks. +use crate::Game; + +use self::{chunk_cache::ChunkCache, chunk_map::ChunkMap, tickets::ChunkTickets}; + +mod chunk_cache; +mod chunk_map; +pub mod systems; +mod tickets; + +const CACHE_PURGE_INTERVAL: Duration = Duration::from_secs(10); + pub struct World { + id: WorldId, + name: Option, + + settings: WorldSettings, + + dimension_info: DimensionInfo, + chunk_map: ChunkMap, - pub cache: ChunkCache, - chunk_worker: ChunkWorker, + chunk_cache: ChunkCache, + tickets: ChunkTickets, + unload_queue: UnloadQueue, + + source: Box, loading_chunks: AHashSet, canceled_chunk_loads: AHashSet, - world_dir: PathBuf, + + save_retries: VecDeque, + + /// The set of chunks that have been modified since they were last saved. + dirty_chunks: RefCell>, + + /// If true, has a different void fog and horizon at y=min + flat: bool, + + last_save_time: Instant, + last_cache_purge: Instant, } -impl Default for World { - fn default() -> Self { +impl World { + pub fn new(desc: WorldDescriptor, _game: &Game) -> Self { + assert_eq!( + desc.dimension_info.info.height % 16, + 0, + "world height must be a multiple of the chunk section height (16)" + ); + + if matches!( + &desc.settings.save_strategy, + &WorldSaveStrategy::SaveIncrementally { .. } + ) { + assert!( + desc.source.supports_saving(), + "world is configured to save incrementally, but its source doesn't support saving!" + ); + } + Self { - chunk_map: ChunkMap::new(), - chunk_worker: ChunkWorker::new( - "world", - Arc::new(ComposableGenerator::default_with_seed(0)), + name: desc.name, + id: desc.id, + settings: desc.settings, + chunk_map: ChunkMap::new( + WorldHeight(desc.dimension_info.info.height as usize), + desc.dimension_info.info.min_y, ), - cache: ChunkCache::new(), + chunk_cache: ChunkCache::new(), + tickets: ChunkTickets::new(), + unload_queue: UnloadQueue::default(), loading_chunks: AHashSet::new(), + dirty_chunks: RefCell::new(AHashSet::new()), canceled_chunk_loads: AHashSet::new(), - world_dir: "world".into(), + source: desc.source, + dimension_info: desc.dimension_info, + flat: desc.flat, + save_retries: VecDeque::new(), + last_cache_purge: Instant::now(), + last_save_time: Instant::now(), } } -} -impl World { - pub fn new() -> Self { - Self::default() + /// Should be called when the server is shutdown. + /// + /// This method saves all chunks, waiting for all + /// saving tasks to complete before returning. + pub fn shutdown(&mut self) { + if !matches!( + &self.settings.save_strategy, + &WorldSaveStrategy::SaveIncrementally { .. }, + ) { + return; + } + + log::info!("Saving all chunks in world '{}'", self.display_name()); + for chunk in self.chunk_map.iter().collect::>() { + self.unload_chunk(chunk); + } + + while !self.chunk_cache.is_empty() { + self.update_saving_chunks(); + self.chunk_cache.purge_old_unused(); + if !self.chunk_cache.is_empty() { + std::thread::sleep(Duration::from_secs(1)); + } + } + + log::info!("Saved all chunks in world '{}'", self.display_name()); + assert_eq!(self.chunk_map.len(), 0); + assert!(self.chunk_cache.is_empty()); } - pub fn with_gen_and_path( - generator: Arc, - world_dir: impl Into + Clone, - ) -> Self { - Self { - world_dir: world_dir.clone().into(), - chunk_worker: ChunkWorker::new(world_dir, generator), - ..Default::default() + /// Should be called on each tick. + pub fn update_chunks(&mut self) -> Vec { + // For chunks that have lost all tickets, put them into the unload + // queue. + while let Some(chunk_to_unload) = self.tickets.poll_chunk_with_no_tickets() { + self.unload_queue.push(chunk_to_unload, &self.settings); + } + + // Unload chunks that have made their way through the unload queue. + if !matches!(&self.settings.save_strategy, &WorldSaveStrategy::KeepLoaded) { + let mut num_unloaded = 0; + while let Some(chunk) = self.unload_queue.pop() { + self.unload_chunk(chunk); + num_unloaded += 1; + } + if num_unloaded != 0 { + log::debug!( + "Unloaded {} chunks for world {} (total loaded chunks: {} + {} cached)", + num_unloaded, + self.display_name(), + self.chunk_map.len(), + self.chunk_cache.len() + ); + } + } + + self.update_saving_chunks(); + self.do_periodic_saving(); + if self.last_cache_purge.elapsed() > CACHE_PURGE_INTERVAL { + let num_purged = self.chunk_cache.purge_old_unused(); + self.last_cache_purge = Instant::now(); + if num_purged > 0 { + log::debug!( + "Purged {} cached chunks for world {} (total cached chunks left: {})", + num_purged, + self.display_name(), + self.chunk_cache.len() + ); + } } + self.load_chunks() } /// Queues the given chunk to be loaded. If the chunk was cached, it is loaded immediately. - pub fn queue_chunk_load(&mut self, req: LoadRequest) { - let pos = req.pos; - if self.cache.contains(&pos) { + fn queue_chunk_load(&mut self, pos: ChunkPosition) { + if self.is_chunk_loaded(pos) || self.is_chunk_loading(pos) { + return; + } + + if let Some(chunk) = self.chunk_cache.remove(pos) { + // Load immediately. // Move the chunk from the cache to the map - self.chunk_map - .0 - .insert(pos, self.cache.remove(pos).unwrap()); - self.chunk_map.chunk_handle_at(pos).unwrap().set_loaded(); - } else { - self.loading_chunks.insert(req.pos); - self.chunk_worker.queue_load(req); + chunk.set_loaded(); + self.chunk_map.insert_chunk(chunk); + } else if self.loading_chunks.insert(pos) { + self.source.queue_load_chunk(pos); + } + } + + fn do_periodic_saving(&mut self) { + if let WorldSaveStrategy::SaveIncrementally { save_interval } = &self.settings.save_strategy + { + if self.last_save_time.elapsed() > *save_interval { + let mut dirty_chunks = self.dirty_chunks.borrow_mut(); + let num_chunks = dirty_chunks.len(); + let chunks = dirty_chunks.drain().collect::>(); + drop(dirty_chunks); + for chunk in chunks { + self.save_chunk(chunk); + } + + if num_chunks > 0 { + log::debug!( + "Auto-saving {} chunks for world {}", + num_chunks, + self.display_name() + ); + } + + self.last_save_time = Instant::now(); + } + } + } + + fn save_chunk(&mut self, pos: ChunkPosition) { + if let Some(chunk) = self.chunk_map.chunk_handle_at(pos) { + self.source.queue_save_chunk(StoredChunk { pos, chunk }); + } + } + + fn update_saving_chunks(&mut self) { + self.poll_saved_chunks(); + self.retry_chunk_saves(); + } + + fn poll_saved_chunks(&mut self) { + if self.source.supports_saving() { + let mut num_saved = 0; + while let Some(result) = self.source.poll_saved_chunk() { + match result.result { + Ok(_) => { + self.chunk_cache.mark_saved(result.pos); + num_saved += 1; + } + Err(e) => { + log::error!( + "Failed to save chunk {:?} in world {}: {:?}", + result.pos, + self.display_name(), + e.error + ); + log::error!("Retrying in {:.1?}", e.retry_in); + self.save_retries.push_back(SaveRetry { + chunk: result.pos, + retry_at: Instant::now() + e.retry_in, + }); + } + } + } + + if num_saved > 0 { + log::debug!( + "Saved {} chunks for world {}", + num_saved, + self.display_name() + ); + } + } + } + + fn retry_chunk_saves(&mut self) { + while let Some(entry) = self.save_retries.get(0) { + if entry.retry_at < Instant::now() { + log::info!( + "Retrying chunk save at {:?} in world {}", + entry.chunk, + self.display_name() + ); + let chunk = entry.chunk; + self.save_chunk(chunk); + self.save_retries.pop_front(); + } else { + return; + } } } /// Loads any chunks that have been loaded asynchronously /// after a call to [`World::queue_chunk_load`]. - pub fn load_chunks(&mut self, ecs: &mut Ecs) -> SysResult { - while let Some(loaded) = self.chunk_worker.poll_loaded_chunk()? { + fn load_chunks(&mut self) -> Vec { + let mut events = Vec::new(); + while let Some(loaded) = self.source.poll_loaded_chunk() { self.loading_chunks.remove(&loaded.pos); if self.canceled_chunk_loads.remove(&loaded.pos) { continue; } - let chunk = loaded.chunk; + + let chunk = match loaded.result { + Ok(chunk) => chunk.chunk, + Err(ChunkLoadError::Missing) => { + log::debug!( + "Chunk at {:?} is missing from the world source. Using an empty chunk.", + loaded.pos + ); + ChunkHandle::new(ChunkLock::new(Chunk::new( + loaded.pos, + self.height().into(), + self.min_y(), + ))) + } + Err(e) => { + log::error!("Failed to load chunk at {:?}: {:?}", loaded.pos, e); + continue; + } + }; self.chunk_map.insert_chunk(chunk); - ecs.insert_event(ChunkLoadEvent { - chunk: Arc::clone(&self.chunk_map.0[&loaded.pos]), - position: loaded.pos, + + events.push(ChunkLoadEvent { + pos: loaded.pos, + world: self.id, }); log::trace!("Loaded chunk {:?}", loaded.pos); } - Ok(()) + + if !events.is_empty() { + log::debug!( + "Loaded {} chunks for world {} (total loaded chunks: {} + {} cached)", + events.len(), + self.display_name(), + self.chunk_map.len(), + self.chunk_cache.len() + ); + } + + events } /// Unloads the given chunk. - pub fn unload_chunk(&mut self, pos: ChunkPosition) -> anyhow::Result<()> { - if let Some((pos, handle)) = self.chunk_map.0.remove_entry(&pos) { - handle.set_unloaded()?; - self.chunk_worker.queue_chunk_save(SaveRequest { - pos, - chunk: handle.clone(), - entities: vec![], - block_entities: vec![], - }); - self.cache.insert(pos, handle); + fn unload_chunk(&mut self, pos: ChunkPosition) { + if matches!(&self.settings.save_strategy, &WorldSaveStrategy::KeepLoaded) { + // Don't ever unload chunks. + return; + } + + if let Some(handle) = self.chunk_map.remove_chunk(pos) { + // TODO: handle case where chunk is being written on a separate + // thread + handle.set_unloaded().ok(); + + let needs_saving = matches!( + &self.settings.save_strategy, + &WorldSaveStrategy::SaveIncrementally { .. } + ); + if needs_saving { + self.source.queue_save_chunk(StoredChunk { + pos, + chunk: Arc::clone(&handle), + }); + } + self.chunk_cache.insert(pos, handle, !needs_saving); } - self.chunk_map.remove_chunk(pos); + if self.is_chunk_loading(pos) { self.canceled_chunk_loads.insert(pos); } - - log::trace!("Unloaded chunk {:?}", pos); - Ok(()) - } - - /// Returns whether the given chunk is loaded. - pub fn is_chunk_loaded(&self, pos: ChunkPosition) -> bool { - self.chunk_map.0.contains_key(&pos) } - /// Returns whether the given chunk is queued to be loaded. - pub fn is_chunk_loading(&self, pos: ChunkPosition) -> bool { + fn is_chunk_loading(&self, pos: ChunkPosition) -> bool { self.loading_chunks.contains(&pos) } +} - /// Sets the block at the given position. - /// - /// Returns `true` if the block was set, or `false` - /// if its chunk was not loaded or the coordinates - /// are out of bounds and thus no operation - /// was performed. - pub fn set_block_at(&self, pos: ValidBlockPosition, block: BlockId) -> bool { - self.chunk_map.set_block_at(pos, block) - } - - /// Retrieves the block at the specified - /// location. If the chunk in which the block - /// exists is not loaded or the coordinates - /// are out of bounds, `None` is returned. - pub fn block_at(&self, pos: ValidBlockPosition) -> Option { - self.chunk_map.block_at(pos) +impl quill::World for World { + fn id(&self) -> WorldId { + self.id } - /// Returns the chunk map. - pub fn chunk_map(&self) -> &ChunkMap { - &self.chunk_map + fn name(&self) -> Option<&str> { + self.name.as_ref().map(String::as_str) } - /// Mutably gets the chunk map. - pub fn chunk_map_mut(&mut self) -> &mut ChunkMap { - &mut self.chunk_map + fn block_at(&self, pos: BlockPosition) -> Result { + self.chunk_map + .block_at(pos) + .ok_or_else(|| ChunkNotLoaded(pos.chunk())) } - pub fn load_player_data(&self, uuid: Uuid) -> anyhow::Result { - Ok(base::anvil::player::load_player_data( - &self.world_dir, - uuid, - )?) + fn set_block_at(&self, pos: BlockPosition, block: BlockState) -> Result<(), ChunkNotLoaded> { + if self.chunk_map.set_block_at(pos, block) { + self.dirty_chunks.borrow_mut().insert(pos.chunk()); + Ok(()) + } else { + Err(ChunkNotLoaded(pos.chunk())) + } } - pub fn save_player_data(&self, uuid: Uuid, data: &PlayerData) -> anyhow::Result<()> { - base::anvil::player::save_player_data(&self.world_dir, uuid, data) + fn chunk_handle_at(&self, pos: ChunkPosition) -> Result { + self.chunk_map + .chunk_handle_at(pos) + .ok_or_else(|| ChunkNotLoaded(pos)) } -} - -pub type ChunkMapInner = AHashMap; -/// This struct stores all the chunks on the server, -/// so it allows access to blocks and lighting data. -/// -/// Chunks are internally wrapped in `Arc`, -/// allowing multiple systems to access different parts -/// of the world in parallel. Mutable access to this -/// type is only required for inserting and removing -/// chunks. -#[derive(Default)] -pub struct ChunkMap(ChunkMapInner); - -impl ChunkMap { - /// Creates a new, empty world. - pub fn new() -> Self { - Self::default() + fn is_chunk_loaded(&self, pos: ChunkPosition) -> bool { + self.chunk_map.contains(pos) } - /// Retrieves a handle to the chunk at the given - /// position, or `None` if it is not loaded. - pub fn chunk_at(&self, pos: ChunkPosition) -> Option> { - self.0.get(&pos).map(|lock| lock.read()) + fn dimension_info(&self) -> &DimensionInfo { + &self.dimension_info } - /// Retrieves a handle to the chunk at the given - /// position, or `None` if it is not loaded. - pub fn chunk_at_mut(&self, pos: ChunkPosition) -> Option> { - self.0.get(&pos).and_then(|lock| lock.write()) + fn create_chunk_ticket(&mut self, chunk: ChunkPosition) -> ChunkTicket { + let ticket = self.tickets.create_ticket(chunk); + self.queue_chunk_load(chunk); + self.unload_queue.remove(chunk); + ticket } - /// Returns an `Arc>` at the given position. - pub fn chunk_handle_at(&self, pos: ChunkPosition) -> Option { - self.0.get(&pos).map(Arc::clone) + fn is_persistent(&self) -> bool { + self.source.supports_saving() } - pub fn block_at(&self, pos: ValidBlockPosition) -> Option { - check_coords(pos)?; - - let (x, y, z) = chunk_relative_pos(pos.into()); - self.chunk_at(pos.chunk()) - .and_then(|chunk| chunk.block_at(x, y, z)) + fn is_flat(&self) -> bool { + self.flat } +} - pub fn set_block_at(&self, pos: ValidBlockPosition, block: BlockId) -> bool { - if check_coords(pos).is_none() { - return false; - } - - let (x, y, z) = chunk_relative_pos(pos.into()); - - self.chunk_at_mut(pos.chunk()) - .map(|mut chunk| chunk.set_block_at(x, y, z, block)) - .is_some() - } +#[derive(Debug, Copy, Clone)] +struct QueuedChunkUnload { + pos: ChunkPosition, + time: Instant, +} - /// Returns an iterator over chunks. - pub fn iter_chunks(&self) -> impl IntoIterator { - self.0.values() - } +#[derive(Default)] +struct UnloadQueue { + entries: VecDeque, +} - /// Inserts a new chunk into the chunk map. - pub fn insert_chunk(&mut self, chunk: Chunk) { - self.0 - .insert(chunk.position(), Arc::new(ChunkLock::new(chunk, true))); +impl UnloadQueue { + pub fn push(&mut self, chunk: ChunkPosition, settings: &WorldSettings) { + self.remove(chunk); + let time = Instant::now() + settings.unload_delay; + self.entries + .push_back(QueuedChunkUnload { pos: chunk, time }); } - /// Removes the chunk at the given position, returning `true` if it existed. - pub fn remove_chunk(&mut self, pos: ChunkPosition) -> bool { - self.0.remove(&pos).is_some() + pub fn remove(&mut self, chunk: ChunkPosition) { + self.entries.retain(|e| e.pos != chunk) } -} -fn check_coords(pos: ValidBlockPosition) -> Option<()> { - if pos.y() >= 0 && pos.y() < CHUNK_HEIGHT as i32 { - Some(()) - } else { - None + pub fn pop(&mut self) -> Option { + match self.entries.get(0).copied() { + Some(entry) => { + if entry.time < Instant::now() { + self.entries.remove(0); + Some(entry.pos) + } else { + None + } + } + None => None, + } } } -fn chunk_relative_pos(block_pos: BlockPosition) -> (usize, usize, usize) { - ( - block_pos.x as usize & 0xf, - block_pos.y as usize, - block_pos.z as usize & 0xf, - ) -} - -#[cfg(test)] -mod tests { - use std::convert::TryInto; - - use super::*; - - #[test] - fn world_out_of_bounds() { - let mut world = World::new(); - world - .chunk_map_mut() - .insert_chunk(Chunk::new(ChunkPosition::new(0, 0))); - - assert!(world - .block_at(BlockPosition::new(0, -1, 0).try_into().unwrap()) - .is_none()); - assert!(world - .block_at(BlockPosition::new(0, 0, 0).try_into().unwrap()) - .is_some()); - } +#[derive(Debug)] +struct SaveRetry { + chunk: ChunkPosition, + retry_at: Instant, } diff --git a/feather/common/src/world/chunk_cache.rs b/feather/common/src/world/chunk_cache.rs new file mode 100644 index 000000000..3fd25e0ec --- /dev/null +++ b/feather/common/src/world/chunk_cache.rs @@ -0,0 +1,110 @@ +use std::{collections::VecDeque, sync::Arc}; + +use ahash::AHashMap; +use libcraft::ChunkPosition; +use quill::ChunkHandle; + +/// This struct contains chunks that were unloaded but remain in memory, either +/// because there are still handles to them (`Arc`s) or because they have not +/// yet completed saving. +#[derive(Default)] +pub struct ChunkCache { + map: AHashMap, // handle + was saved + unload_queue: VecDeque, +} + +impl ChunkCache { + pub fn new() -> Self { + Self { + map: AHashMap::new(), + unload_queue: VecDeque::new(), + } + } + + fn ref_count(&self, pos: &ChunkPosition) -> Option { + self.map.get(pos).map(|(arc, _)| Arc::strong_count(arc)) + } + + /// Purges all chunks in the cache that have no remaining references + /// and have been saved. + pub fn purge_old_unused(&mut self) -> usize { + let mut processed = 0; + let mut purged = 0; + let total = self.unload_queue.len(); + + while let Some(pos) = self.unload_queue.pop_front() { + if !self.map.contains_key(&pos) { + processed += 1; + continue; + } + let (_handle, was_saved) = self.map.get(&pos).unwrap(); + + if self.ref_count(&pos).unwrap() > 1 || !*was_saved { + // Another copy of this handle still exists, or + // the chunk has not yet been saved. + self.unload_queue.push_back(pos); + } else { + self.map.remove_entry(&pos); + purged += 1; + } + + processed += 1; + if processed >= total { + break; + } + } + + purged + } + + #[allow(unused)] + pub fn get(&self, pos: ChunkPosition) -> Option { + self.map.get(&pos).map(|(c, _)| Arc::clone(c)) + } + + /// Returns whether the chunk at the position is cached. + #[allow(unused)] + pub fn contains(&self, pos: &ChunkPosition) -> bool { + self.map.contains_key(pos) + } + + /// Inserts a chunk handle into the cache, returning the previous handle if there was one. + pub fn insert( + &mut self, + pos: ChunkPosition, + handle: ChunkHandle, + was_saved: bool, + ) -> Option { + if was_saved && Arc::strong_count(&handle) == 1 { + // No need to cache the chunk, as it's been saved + // and has no other handles alive. + return None; + } + + self.unload_queue.push_back(pos); + self.map + .insert(pos, (handle, was_saved)) + .map(|(handle, _)| handle) + } + + /// Marks the given chunk as saved. + pub fn mark_saved(&mut self, pos: ChunkPosition) { + if let Some((_, saved)) = self.map.get_mut(&pos) { + *saved = true; + } + } + + /// Removes the chunk handle at the given position, returning the handle if it was cached. + pub fn remove(&mut self, pos: ChunkPosition) -> Option { + self.map.remove(&pos).map(|(handle, _)| handle) + } + + pub fn len(&self) -> usize { + self.map.len() + } + + #[allow(dead_code)] + pub fn is_empty(&self) -> bool { + self.map.is_empty() + } +} diff --git a/feather/common/src/world/chunk_map.rs b/feather/common/src/world/chunk_map.rs new file mode 100644 index 000000000..760d48efd --- /dev/null +++ b/feather/common/src/world/chunk_map.rs @@ -0,0 +1,113 @@ +use std::sync::Arc; + +use ahash::AHashMap; +use libcraft::{BlockPosition, BlockState, Chunk, ChunkPosition, WorldHeight}; +use parking_lot::{RwLockReadGuard, RwLockWriteGuard}; + +use quill::ChunkHandle; + +pub type ChunkMapInner = AHashMap; + +/// This struct stores all the chunks on the server, +/// so it allows access to blocks and lighting data. +/// +/// Chunks are internally wrapped in `Arc`, +/// allowing multiple systems to access different parts +/// of the world in parallel. Mutable access to this +/// type is only required for inserting and removing +/// chunks. +pub struct ChunkMap { + inner: ChunkMapInner, + height: WorldHeight, + min_y: i32, +} + +impl ChunkMap { + /// Creates a new, empty world. + pub fn new(world_height: WorldHeight, min_y: i32) -> Self { + ChunkMap { + inner: ChunkMapInner::default(), + height: world_height, + min_y, + } + } + + pub fn len(&self) -> usize { + self.inner.len() + } + + /// Retrieves a handle to the chunk at the given + /// position, or `None` if it is not loaded. + pub fn chunk_at(&self, pos: ChunkPosition) -> Option> { + self.inner.get(&pos).map(|lock| lock.read()) + } + + /// Retrieves a handle to the chunk at the given + /// position, or `None` if it is not loaded. + pub fn chunk_at_mut(&self, pos: ChunkPosition) -> Option> { + self.inner.get(&pos).map(|lock| lock.write()).flatten() + } + + /// Returns an `Arc>` at the given position. + pub fn chunk_handle_at(&self, pos: ChunkPosition) -> Option { + self.inner.get(&pos).map(Arc::clone) + } + + pub fn block_at(&self, pos: BlockPosition) -> Option { + check_coords(pos, self.height, self.min_y)?; + + let (x, y, z) = chunk_relative_pos(pos); + self.chunk_at(pos.chunk()) + .map(|chunk| chunk.block_at(x, (y - self.min_y as isize) as usize, z)) + .flatten() + } + + pub fn set_block_at(&self, pos: BlockPosition, block: BlockState) -> bool { + if check_coords(pos, self.height, self.min_y).is_none() { + return false; + } + + let (x, y, z) = chunk_relative_pos(pos.into()); + + self.chunk_at_mut(pos.chunk()) + .map(|mut chunk| { + chunk.set_block_at(x, (y - self.min_y as isize) as usize, z, block, true) + }) + .is_some() + } + + /// Inserts a new chunk into the chunk map. + pub fn insert_chunk(&mut self, chunk: ChunkHandle) { + let pos = chunk.read().position(); + self.inner.insert(pos, chunk); + } + + /// Removes the chunk at the given position. + pub fn remove_chunk(&mut self, pos: ChunkPosition) -> Option { + self.inner.remove(&pos) + } + + pub fn contains(&self, pos: ChunkPosition) -> bool { + self.inner.contains_key(&pos) + } + + pub fn iter(&self) -> impl Iterator + '_ { + self.inner.keys().copied() + } +} + +fn check_coords(pos: BlockPosition, world_height: WorldHeight, min_y: i32) -> Option<()> { + if pos.y >= min_y && pos.y < *world_height as i32 + min_y { + Some(()) + } else { + None + } +} + +fn chunk_relative_pos(block_pos: BlockPosition) -> (usize, isize, usize) { + ( + block_pos.x as usize & 0xf, + block_pos.y as isize, + block_pos.z as usize & 0xf, + ) +} diff --git a/feather/common/src/world/systems.rs b/feather/common/src/world/systems.rs new file mode 100644 index 000000000..bb661c959 --- /dev/null +++ b/feather/common/src/world/systems.rs @@ -0,0 +1,21 @@ +use quill::SysResult; +use vane::SystemExecutor; + +use crate::Game; + +pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { + systems.add_system(update_world_chunks); +} + +fn update_world_chunks(game: &mut Game) -> SysResult { + let mut events = Vec::new(); + for mut world in game.worlds_mut() { + events.extend(world.update_chunks()); + } + + for event in events { + game.ecs.insert_event(event); + } + + Ok(()) +} diff --git a/feather/common/src/world/tickets.rs b/feather/common/src/world/tickets.rs new file mode 100644 index 000000000..7f7c46573 --- /dev/null +++ b/feather/common/src/world/tickets.rs @@ -0,0 +1,60 @@ +use ahash::AHashMap; +use flume::{Receiver, Sender}; +use libcraft::ChunkPosition; +use quill::world::ChunkTicket; + +pub struct ChunkTickets { + id_to_chunk: AHashMap, + next_id: u64, + dropped_receiver: Receiver, + dropped_sender: Sender, + + chunk_ticket_counts: AHashMap, +} + +impl ChunkTickets { + pub fn new() -> Self { + let (dropped_sender, dropped_receiver) = flume::unbounded(); + Self { + id_to_chunk: AHashMap::new(), + dropped_receiver, + dropped_sender, + chunk_ticket_counts: AHashMap::new(), + next_id: 0, + } + } + + pub fn create_ticket(&mut self, chunk: ChunkPosition) -> ChunkTicket { + let id = self.next_id(); + let ticket = ChunkTicket::new(id, self.dropped_sender.clone()); + + self.id_to_chunk.insert(id, chunk); + *self.chunk_ticket_counts.entry(chunk).or_default() += 1; + + ticket + } + + pub fn poll_chunk_with_no_tickets(&mut self) -> Option { + for dropped_ticket_id in self.dropped_receiver.try_iter() { + let chunk = self + .id_to_chunk + .remove(&dropped_ticket_id) + .expect("ticket removed twice"); + let ticket_count = self.chunk_ticket_counts.get_mut(&chunk).unwrap(); + *ticket_count -= 1; + + if *ticket_count == 0 { + self.chunk_ticket_counts.remove(&chunk); + return Some(chunk); + } + } + + None + } + + fn next_id(&mut self) -> u64 { + let id = self.next_id; + self.next_id += 1; + id + } +} diff --git a/feather/common/src/world_sources.rs b/feather/common/src/world_sources.rs new file mode 100644 index 000000000..a0597ffc8 --- /dev/null +++ b/feather/common/src/world_sources.rs @@ -0,0 +1,19 @@ +//! Built-in world sources. + +use quill::saveload::{EmptyWorldSource, WorldSourceFactory}; + +pub mod worldgen; + +pub struct EmptyWorldSourceFactory; + +impl WorldSourceFactory for EmptyWorldSourceFactory { + fn create_world_source( + &self, + _game: &dyn quill::Game, + _params: &toml::Value, + _dimension_info: &libcraft::dimension::DimensionInfo, + _world_id: quill::WorldId, + ) -> anyhow::Result> { + Ok(Box::new(EmptyWorldSource::default())) + } +} diff --git a/feather/common/src/world_sources/worldgen.rs b/feather/common/src/world_sources/worldgen.rs new file mode 100644 index 000000000..a56ea3c52 --- /dev/null +++ b/feather/common/src/world_sources/worldgen.rs @@ -0,0 +1,97 @@ +use std::sync::Arc; + +use anyhow::Context; +use libcraft::{ + anvil::level::SuperflatGeneratorOptions, biome::BiomeList, dimension::DimensionInfo, Sections, + WorldHeight, +}; +use quill::{ + saveload::{ + worldgen::{WorldGenerator, WorldGeneratorFactory, WorldGeneratorWorldSource}, + WorldSource, WorldSourceFactory, + }, + Game, WorldId, +}; +use worldgen::SuperflatWorldGenerator; + +#[derive(Debug, serde::Deserialize)] +struct Params { + generator: String, + inner: Inner, + #[serde(flatten)] + params: toml::Value, +} + +#[derive(Debug, serde::Deserialize)] +struct Inner { + #[serde(rename = "type")] + typ: String, + #[serde(flatten)] + params: toml::Value, +} + +pub struct WorldgenWorldSourceFactory; + +impl WorldSourceFactory for WorldgenWorldSourceFactory { + fn create_world_source( + &self, + game: &dyn Game, + params: &toml::Value, + dimension_info: &DimensionInfo, + world_id: WorldId, + ) -> anyhow::Result> { + let params: Params = params.clone().try_into()?; + + let generator_factory = game.world_generator_factory(¶ms.generator)?; + let generator = generator_factory + .create_world_generator( + game, + ¶ms.params, + world_id, + WorldHeight(dimension_info.info.height as usize).into(), + dimension_info.info.min_y, + ) + .with_context(|| { + format!( + "failed to initialize world generator '{}'", + params.generator + ) + })?; + + let inner = game + .world_source_factory(¶ms.inner.typ)? + .create_world_source(game, ¶ms.inner.params, dimension_info, world_id) + .with_context(|| { + format!( + "failed to initialize inner '{}' world source", + params.inner.typ + ) + })?; + + Ok(Box::new(WorldGeneratorWorldSource::new( + inner, + generator, + game.compute_pool(), + ))) + } +} + +pub struct SuperflatWorldGeneratorFactory; + +impl WorldGeneratorFactory for SuperflatWorldGeneratorFactory { + fn create_world_generator( + &self, + game: &dyn Game, + _params: &toml::Value, + _world_id: WorldId, + sections: Sections, + min_y: i32, + ) -> anyhow::Result> { + Ok(Arc::new(SuperflatWorldGenerator::new( + SuperflatGeneratorOptions::default(), + game.resources().get::>()?.clone(), + sections, + min_y, + ))) + } +} diff --git a/feather/datapacks/Cargo.toml b/feather/datapacks/Cargo.toml index d7bfd149c..f02085451 100644 --- a/feather/datapacks/Cargo.toml +++ b/feather/datapacks/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "feather-datapacks" version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" [dependencies] ahash = "0.4" @@ -10,7 +10,7 @@ anyhow = "1" log = "0.4" serde = { version = "1", features = [ "derive" ] } serde_json = "1" -smartstring = { version = "0.2", features = [ "serde" ] } +smartstring = { version = "1", features = [ "serde" ] } thiserror = "1" ureq = { version = "2", default-features = false, features = [ "tls" ] } -zip = { version = "0.5", default-features = false, features = [ "deflate", "bzip2" ] } +zip = { version = "0.6", default-features = false, features = [ "deflate", "bzip2" ] } diff --git a/feather/ecs/Cargo.toml b/feather/ecs/Cargo.toml deleted file mode 100644 index 976652287..000000000 --- a/feather/ecs/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "feather-ecs" -version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" - -[dependencies] -ahash = "0.7" -anyhow = "1" -hecs = { git = "https://github.com/feather-rs/feather-hecs" } -log = "0.4" -thiserror = "1" -utils = { path = "../utils", package = "feather-utils" } - diff --git a/feather/ecs/src/change.rs b/feather/ecs/src/change.rs deleted file mode 100644 index cf3d71161..000000000 --- a/feather/ecs/src/change.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::{any::TypeId, collections::VecDeque}; - -use ahash::AHashMap; -use hecs::{Component, DynamicBundle, Entity}; - -/// Tracks changes made to certain components. -#[derive(Default)] -pub struct ChangeTracker { - registries: AHashMap, -} - -impl ChangeTracker { - pub fn track_component(&mut self) { - self.registries - .insert(TypeId::of::(), ChangeRegistry::default()); - } - - pub fn on_insert(&mut self, entity: Entity, components: &impl DynamicBundle) { - components.with_ids(|typs| { - for ty in typs { - let registry = self.registries.get_mut(ty); - if let Some(registry) = registry { - registry.mark_changed(entity); - } - } - }); - } - - pub fn iter_changed(&self) -> impl Iterator + '_ { - self.registries.get(&TypeId::of::()) - .unwrap_or_else(|| panic!("Components of type {} are not tracked for changes. Call `Ecs::track_component` to enable change tracking.", std::any::type_name::())) - .changed_entities - .iter() - .copied() - } -} - -#[derive(Default)] -struct ChangeRegistry { - changed_entities: VecDeque, -} - -impl ChangeRegistry { - pub fn mark_changed(&mut self, entity: Entity) { - if !self.changed_entities.contains(&entity) { - self.changed_entities.push_back(entity); - } - } - - #[allow(unused)] - pub fn pop(&mut self) { - self.changed_entities.pop_front(); - } -} diff --git a/feather/ecs/src/lib.rs b/feather/ecs/src/lib.rs deleted file mode 100644 index 77fd48c2d..000000000 --- a/feather/ecs/src/lib.rs +++ /dev/null @@ -1,218 +0,0 @@ -//! A lightweight ECS wrapper tailored to Feather's needs. -//! -//! This is implemented as a wrapper around the Bevy Engine's fork of the -//! `hecs` crate, but we've made some interface changes: -//! * A system framework has been implemented, with systems written as plain functions and -//! executed sequentially. -//! * `World` is renamed to `Ecs` so as to avoid conflict with Minecraft's concept of worlds. -//! * We add support for events based on components. -//! -//! This wrapper library exists in case we need additional features in the ECS. If necessary, -//! we can change the backend crate or fork it as needed, without refactoring the rest of the codebase. - -use change::ChangeTracker; -use event::EventTracker; -use hecs::{Component, DynamicBundle, Fetch, Query, World}; - -#[doc(inline)] -pub use hecs::{ - BuiltEntity, ComponentError, DynamicQuery, DynamicQueryTypes, Entity, EntityBuilder, - MissingComponent, NoSuchEntity, QueryBorrow, Ref, RefMut, -}; - -mod system; -pub use system::{GroupBuilder, HasEcs, HasResources, SysResult, SystemExecutor}; - -mod resources; -pub use resources::{ResourceError, Resources}; - -mod change; -mod event; - -/// Stores entities and their components. This is a wrapper -/// around `hecs::World` with a slightly changed interface -/// and support for events. -/// -/// # Events -/// This struct supports _events_ by adding components to entities. -/// For example, the `EntityDamageEvent` is triggered whenever an -/// entity takes damage. What happens next: -/// 1. The system that damaged the entity adds `EntityDamageEvent` as a component -/// to the entity. -/// 2. All systems get a chance to observe that event by calling [`Ecs::query`] -/// using the `EntityDamageEvent` type. -/// 3. When the system that triggered the event runs again, the component -/// is automatically removed. -/// -/// This ensures that each event is observed exactly once by each system. -/// -/// Events can either be associated with an entity—in which case they -/// are added as a component to the entity—or they can be standalone. -/// For example, `BlockChangeEvent` is not related to any specific -/// entity. These standalone events are entities with only one component—the event. -#[derive(Default)] -pub struct Ecs { - world: World, - event_tracker: EventTracker, - change_tracker: ChangeTracker, -} - -impl Ecs { - pub fn new() -> Self { - Self::default() - } - - /// Returns the inner `hecs::World`. Should be used with caution. - pub fn inner(&self) -> &World { - &self.world - } - - pub fn inner_mut(&mut self) -> &mut World { - &mut self.world - } - - /// Spawns an entity with the provided components. - pub fn spawn(&mut self, components: impl DynamicBundle) -> Entity { - let entity = self.world.reserve_entity(); - self.change_tracker.on_insert(entity, &components); - self.world.insert(entity, components).unwrap(); - entity - } - - /// Returns an `EntityRef` for an entity. - pub fn entity(&self, entity: Entity) -> Result { - self.world.entity(entity).map(EntityRef) - } - - /// Gets a component of an entity. - pub fn get(&self, entity: Entity) -> Result, ComponentError> { - self.world.get(entity) - } - - /// Mutably gets a component of an entity. - pub fn get_mut(&self, entity: Entity) -> Result, ComponentError> { - self.world.get_mut(entity) - } - - /// Adds a component to an entity. - /// - /// Do not use this function to add events. Use [`Ecs::insert_event`] - /// instead. - pub fn insert( - &mut self, - entity: Entity, - component: impl Component, - ) -> Result<(), NoSuchEntity> { - self.world.insert_one(entity, component) - } - - /// Creates an event not related to any entity. Use - /// `insert_entity_event` for events regarding specific - /// entities (`PlayerJoinEvent`, `EntityDamageEvent`, etc...) - pub fn insert_event(&mut self, event: T) { - let entity = self.world.spawn((event,)); - self.event_tracker.insert_event(entity); - } - - /// Adds an event component to an entity and schedules - /// it to be removed immeditately before the current system - /// runs again. Thus, all systems have exactly one chance - /// to observe the event before it is dropped. - pub fn insert_entity_event( - &mut self, - entity: Entity, - event: T, - ) -> Result<(), NoSuchEntity> { - self.insert(entity, event)?; - self.event_tracker.insert_entity_event::(entity); - Ok(()) - } - - /// Removes a component from an entit and returns it. - pub fn remove(&mut self, entity: Entity) -> Result { - self.world.remove_one(entity) - } - - /// Removes an entity from the ECS. - pub fn despawn(&mut self, entity: Entity) -> Result<(), NoSuchEntity> { - self.world.despawn(entity) - } - - /// Defers removing an entity until before the next time this system - /// runs, allowing it to be observed by systems one last time. - pub fn defer_despawn(&mut self, entity: Entity) { - // a bit of a hack - but this will change once - // hecs allows taking out components of a despawned entity - self.event_tracker.insert_event(entity); - } - - /// Returns an iterator over all entities that match a query parameter. - pub fn query(&self) -> QueryBorrow { - self.world.query() - } - - /// Performs a dynamic query. Used for plugins. - pub fn query_dynamic<'q>(&'q self, types: DynamicQueryTypes<'q>) -> DynamicQuery<'q> { - self.world.query_dynamic(types) - } - - /// Sets the index of the currently executing system, - /// used for event tracking. - pub fn set_current_system_index(&mut self, index: usize) { - self.event_tracker.set_current_system_index(index); - } - - /// Should be called before each system runs. - pub fn remove_old_events(&mut self) { - self.event_tracker.remove_old_events(&mut self.world); - } - - /// Enables change tracking for `T` components. - /// - /// Calling this allows using `query_changed` - /// to iterate over entities whose `T` has changed. - pub fn track_component(&mut self) { - self.change_tracker.track_component::() - } - - /// Iterates over entities whose `T` component - /// changed since the previous time the current - /// system was executed. - /// - /// # Panics - /// Panics if `track_component` was not called for `T`. - pub fn for_each_changed( - &self, - mut function: impl FnMut(&T, <::Fetch as Fetch>::Item), - ) { - for entity in self.change_tracker.iter_changed::() { - let mut query = match self.world.query_one::<(&T, Q)>(entity) { - Ok(q) => q, - Err(_) => continue, - }; - let components = query.get(); - if let Some((tracked, components)) = components { - function(tracked, components); - } - } - } -} - -/// Allows access to all components of a single entity. -pub struct EntityRef<'a>(hecs::EntityRef<'a>); - -impl<'a> EntityRef<'a> { - /// Borrows the component of type `T` from this entity. - pub fn get(&self) -> Result, ComponentError> { - self.0 - .get() - .ok_or_else(|| ComponentError::MissingComponent(MissingComponent::new::())) - } - - /// Uniquely borrows the component of type `T` from this entity. - pub fn get_mut(&self) -> Result, ComponentError> { - self.0 - .get_mut() - .ok_or_else(|| ComponentError::MissingComponent(MissingComponent::new::())) - } -} diff --git a/feather/ecs/tests/events.rs b/feather/ecs/tests/events.rs deleted file mode 100644 index a9d6895ae..000000000 --- a/feather/ecs/tests/events.rs +++ /dev/null @@ -1,74 +0,0 @@ -#![allow(clippy::unnecessary_wraps)] - -use feather_ecs::{Ecs, HasEcs, SysResult, SystemExecutor}; - -#[derive(Debug, PartialEq, Eq)] -struct Event { - x: i32, -} - -struct Input { - ecs: Ecs, - is_first_run: bool, -} - -impl HasEcs for Input { - fn ecs(&self) -> &Ecs { - &self.ecs - } - - fn ecs_mut(&mut self) -> &mut Ecs { - &mut self.ecs - } -} - -fn pre_system(input: &mut Input) -> SysResult { - if !input.is_first_run { - let mut query = input.ecs.query::<&Event>(); - assert_eq!(query.iter().next().unwrap().1, &Event { x: 10 }); - } - Ok(()) -} - -fn trigger_system(input: &mut Input) -> SysResult { - if input.is_first_run { - let entity = input.ecs.spawn(()); - let event = Event { x: 10 }; - input.ecs.insert_entity_event(entity, event)?; - } else { - let mut query = input.ecs.query::<&Event>(); - assert_eq!(query.iter().next(), None); - } - - Ok(()) -} - -fn post_system(input: &mut Input) -> SysResult { - let mut query = input.ecs.query::<&Event>(); - let next = query.iter().next(); - if input.is_first_run { - assert_eq!(next.unwrap().1, &Event { x: 10 }); - } else { - assert_eq!(next, None); - } - Ok(()) -} - -#[test] -fn events_observed_once() { - let mut systems = SystemExecutor::::new(); - systems - .add_system(pre_system) - .add_system(trigger_system) - .add_system(post_system); - - let mut input = Input { - ecs: Ecs::new(), - is_first_run: true, - }; - systems.run(&mut input); - input.is_first_run = false; - systems.run(&mut input); - - assert_eq!(input.ecs.inner().len(), 1); -} diff --git a/feather/ecs/tests/random_access.rs b/feather/ecs/tests/random_access.rs deleted file mode 100644 index d36f16308..000000000 --- a/feather/ecs/tests/random_access.rs +++ /dev/null @@ -1,63 +0,0 @@ -use feather_ecs::{ComponentError, Ecs, EntityBuilder}; - -#[test] -fn add_simple_entity() { - let mut ecs = Ecs::new(); - let entity = ecs.inner_mut().spawn( - EntityBuilder::new() - .add(10i32) - .add(15u32) - .add(usize::MAX) - .build(), - ); - - assert_eq!(*ecs.get::(entity).unwrap(), 10); - assert_eq!(*ecs.get::(entity).unwrap(), 15); - assert_eq!(*ecs.get::(entity).unwrap(), usize::MAX); - - *ecs.get_mut::(entity).unwrap() = 324; - assert_eq!(*ecs.get::(entity).unwrap(), 324); -} - -#[test] -fn add_remove_entities() { - let mut ecs = Ecs::new(); - let entity = ecs - .inner_mut() - .spawn(EntityBuilder::new().add("test").build()); - - assert_eq!(*ecs.get::<&'static str>(entity).unwrap(), "test"); - - ecs.inner_mut().despawn(entity).unwrap(); - - assert!(matches!( - ecs.get::<&'static str>(entity).err(), - Some(ComponentError::NoSuchEntity) - )); - assert!(ecs.inner_mut().despawn(entity).is_err()); -} - -#[test] -fn fine_grained_borrow_checking() { - let mut ecs = Ecs::new(); - let entity1 = ecs - .inner_mut() - .spawn(EntityBuilder::new().add(()).add(16i32).build()); - let entity2 = ecs - .inner_mut() - .spawn(EntityBuilder::new().add(14i32).build()); - - let mut e1 = ecs.get_mut::(entity1).unwrap(); - let e2 = ecs.get_mut::(entity2).unwrap(); - - assert_eq!(*e1, 16); - assert_eq!(*e2, 14); - - *e1 = 12; - assert_eq!(*e1, 12); - - drop(e1); - assert_eq!(*ecs.get_mut::(entity1).unwrap(), 12); - - assert!(ecs.get_mut::<()>(entity1).is_ok()); -} diff --git a/feather/ecs/tests/systems.rs b/feather/ecs/tests/systems.rs deleted file mode 100644 index 40e0a449a..000000000 --- a/feather/ecs/tests/systems.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(clippy::unnecessary_wraps)] - -use feather_ecs::{Ecs, HasEcs, SysResult, SystemExecutor}; - -struct Input { - x: i32, - ecs: Ecs, -} - -impl HasEcs for Input { - fn ecs(&self) -> &Ecs { - &self.ecs - } - - fn ecs_mut(&mut self) -> &mut Ecs { - &mut self.ecs - } -} - -fn system1(input: &mut Input) -> SysResult { - input.x += 10; - Ok(()) -} - -fn system2(input: &mut Input) -> SysResult { - input.x *= 10; - Ok(()) -} - -#[test] -fn systems_are_executed_in_order() { - let mut executor = SystemExecutor::new(); - executor.add_system(system1); - executor.add_system(system2); - - let mut input = Input { - x: 1, - ecs: Ecs::new(), - }; - executor.run(&mut input); - assert_eq!(input.x, 110); -} diff --git a/feather/generated/generators/__pycache__/common.cpython-36.pyc b/feather/generated/generators/__pycache__/common.cpython-36.pyc new file mode 100644 index 000000000..2fc430d28 Binary files /dev/null and b/feather/generated/generators/__pycache__/common.cpython-36.pyc differ diff --git a/feather/old/core/inventory/src/window.rs b/feather/old/core/inventory/src/window.rs index beda44d5c..0f1a919a4 100644 --- a/feather/old/core/inventory/src/window.rs +++ b/feather/old/core/inventory/src/window.rs @@ -5,7 +5,7 @@ use crate::{Area, Inventory, Slot, SlotIndex}; use feather_items::ItemStack; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use legion::borrow::Ref; use smallvec::{smallvec, SmallVec}; use thiserror::Error; diff --git a/feather/old/server/block/src/chest.rs b/feather/old/server/block/src/chest.rs index fb2afa5d0..d8d61b043 100644 --- a/feather/old/server/block/src/chest.rs +++ b/feather/old/server/block/src/chest.rs @@ -22,7 +22,7 @@ use feather_server_types::{ EntityDespawnEvent, Game, InteractionHandler, Inventory, Network, SpawnPacketCreator, WindowCloseEvent, WindowOpenEvent, }; -use fecs::{Entity, EntityBuilder, EntityRef, World}; +use fvane::{Entity, EntityBuilder, EntityRef, World}; use num_traits::ToPrimitive; pub const SLOTS: usize = 27; @@ -61,7 +61,7 @@ fn should_replace(_old: BlockId, new: BlockId) -> bool { } /// When a chest is despawned, drops its contents. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chest_break_drop_contents( event: &EntityDespawnEvent, game: &mut Game, @@ -85,7 +85,7 @@ pub fn on_chest_break_drop_contents( } } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chest_create_try_connect(event: &BlockUpdateEvent, game: &mut Game, world: &mut World) { if event.new.kind() != BlockKind::Chest { return; @@ -100,7 +100,7 @@ pub fn on_chest_create_try_connect(event: &BlockUpdateEvent, game: &mut Game, wo /// When a chest is broken and it is connected with another chest, /// set the other chest as ChestKind::Single. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chest_break_try_disconnect(event: &BlockUpdateEvent, game: &mut Game, world: &mut World) { if event.old.kind() != BlockKind::Chest || event.new.kind() == BlockKind::Chest { return; @@ -134,7 +134,7 @@ fn create_spawn_packet(accessor: &EntityRef) -> Box { Box::new(viewers_packet(accessor)) } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chest_open_increment_viewers(event: &WindowOpenEvent, game: &Game, world: &mut World) { let should_resend = if let Some(mut viewers) = world.try_get_mut::(event.opened) { viewers.0 += 1; @@ -148,7 +148,7 @@ pub fn on_chest_open_increment_viewers(event: &WindowOpenEvent, game: &Game, wor } } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chest_close_decrement_viewers(event: &WindowCloseEvent, game: &Game, world: &mut World) { let should_resend = if let Some(mut viewers) = world.try_get_mut::(event.closed) { viewers.0 = viewers.0.checked_sub(1).unwrap_or_default(); diff --git a/feather/old/server/block/src/init.rs b/feather/old/server/block/src/init.rs index 8c3a4c65c..6b2500380 100644 --- a/feather/old/server/block/src/init.rs +++ b/feather/old/server/block/src/init.rs @@ -3,7 +3,7 @@ use ahash::AHashMap; use feather_core::blocks::BlockKind; use feather_core::util::BlockPosition; use feather_server_types::{BlockEntity, BlockUpdateEvent, EntitySpawnEvent, Game}; -use fecs::{EntityBuilder, World}; +use fvane::{EntityBuilder, World}; use once_cell::sync::Lazy; type BlockEntityCreator = fn(BlockPosition) -> EntityBuilder; @@ -20,7 +20,7 @@ static BLOCK_ENTITY_MAP: Lazy> = Lazy::n /// When a block is created, and there is a block entity kind /// associated with it, creates the block entity. Additionally, /// removes any old block entity, if it existed. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_update_create_block_entity( event: &BlockUpdateEvent, game: &mut Game, @@ -46,7 +46,7 @@ pub fn on_block_update_create_block_entity( } } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_entity_create_insert_to_map( event: &EntitySpawnEvent, game: &mut Game, diff --git a/feather/old/server/block/src/lib.rs b/feather/old/server/block/src/lib.rs index d17915acd..89c61b857 100644 --- a/feather/old/server/block/src/lib.rs +++ b/feather/old/server/block/src/lib.rs @@ -13,7 +13,7 @@ use feather_core::{ util::{BlockPosition, Position}, }; use feather_server_types::BlockEntity; -use fecs::{EntityBuilder, EntityRef}; +use fvane::{EntityBuilder, EntityRef}; pub use init::{on_block_entity_create_insert_to_map, on_block_update_create_block_entity}; /// A function which determines whether a given change between diff --git a/feather/old/server/chunk/src/chunk_manager.rs b/feather/old/server/chunk/src/chunk_manager.rs index 9964996eb..3a014acc0 100644 --- a/feather/old/server/chunk/src/chunk_manager.rs +++ b/feather/old/server/chunk/src/chunk_manager.rs @@ -17,7 +17,7 @@ use feather_server_types::{ ReleaseChunkRequest, TPS, }; use feather_server_util::current_time_in_millis; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use parking_lot::RwLock; use rayon::prelude::*; use smallvec::SmallVec; @@ -37,7 +37,7 @@ pub struct ChunkWorkerHandle { } /// System for handling replies from the chunk worker thread. -#[fecs::system] +#[fvane::system] pub fn handle_chunk_worker_replies( game: &mut Game, world: &mut World, @@ -129,7 +129,7 @@ const CHUNK_UNLOAD_TIME: u64 = TPS * 5; // 5 seconds - TODO make this configurab /// could quickly move between chunk boundaries, causing /// chunks at the edge of their view distance /// to be loaded and unloaded at an alarming rate. -#[fecs::system] +#[fvane::system] pub fn chunk_unload( game: &mut Game, world: &mut World, @@ -173,7 +173,7 @@ pub fn chunk_unload( /// Event handler which handles holder release events. If /// a chunk has no more holders, then a chunk unload is queued. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_holder_release_unload_chunk( event: &ChunkHolderReleaseEvent, game: &mut Game, @@ -192,7 +192,7 @@ pub fn on_chunk_holder_release_unload_chunk( /// System for removing an entity's chunk holds /// once it is destroyed. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_despawn_remove_chunk_holder( event: &EntityDespawnEvent, game: &mut Game, @@ -223,7 +223,7 @@ const CHUNK_OPTIMIZE_INTERVAL: u64 = TPS * 60 * 5; // 5 minutes /// For optimal performance, this system is fully /// concurrent - each chunk optimization is split /// into a separate job and fed into `rayon`. -#[fecs::system] +#[fvane::system] pub fn chunk_optimize(game: &mut Game) { // Only run every CHUNK_OPTIMIZE_INTERVAL ticks if game.tick_count % CHUNK_OPTIMIZE_INTERVAL != 0 { @@ -319,12 +319,12 @@ pub fn save_chunk( .unwrap(); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn release_chunk_request(event: &ReleaseChunkRequest, game: &mut Game, world: &mut World) { release_chunk(game, world, event.chunk, event.player); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn hold_chunk_request(event: &HoldChunkRequest, game: &mut Game, world: &mut World) { hold_chunk( game, @@ -334,7 +334,7 @@ pub fn hold_chunk_request(event: &HoldChunkRequest, game: &mut Game, world: &mut ); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn load_chunk_request( event: &LoadChunkRequest, handle: &ChunkWorkerHandle, diff --git a/feather/old/server/chunk/src/chunk_worker.rs b/feather/old/server/chunk/src/chunk_worker.rs index e2f678996..fa967b319 100644 --- a/feather/old/server/chunk/src/chunk_worker.rs +++ b/feather/old/server/chunk/src/chunk_worker.rs @@ -16,7 +16,7 @@ use feather_core::chunk::Chunk; use feather_core::util::ChunkPosition; use feather_server_util::EntityLoader; use feather_server_worldgen::WorldGenerator; -use fecs::EntityBuilder; +use fvane::EntityBuilder; use parking_lot::RwLock; use smallvec::SmallVec; use std::path::{Path, PathBuf}; diff --git a/feather/old/server/chunk/src/save.rs b/feather/old/server/chunk/src/save.rs index 5e5b270e8..4a34768e5 100644 --- a/feather/old/server/chunk/src/save.rs +++ b/feather/old/server/chunk/src/save.rs @@ -12,7 +12,7 @@ use feather_server_types::{ tasks, BlockSerializer, ChunkLoadEvent, ChunkUnloadEvent, ComponentSerializer, Game, Health, HeldItem, PlayerLeaveEvent, Uuid, TICK_LENGTH, TPS, }; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use std::collections::VecDeque; use std::path::Path; use std::sync::Arc; @@ -31,7 +31,7 @@ struct SaveTask { struct SaveQueue(VecDeque); /// On a chunk load, adds the chunk to the save queue. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_load_queue_for_saving( event: &ChunkLoadEvent, game: &mut Game, @@ -41,7 +41,7 @@ pub fn on_chunk_load_queue_for_saving( } /// On a chunk unload, saves the chunk first. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_unload_save_chunk( event: &ChunkUnloadEvent, game: &mut Game, @@ -65,7 +65,7 @@ fn queue_for_saving(game: &mut Game, save_queue: &mut SaveQueue, chunk: ChunkPos /// System which checks for chunks which have been queued for saving /// and, if it is time, saves them. -#[fecs::system] +#[fvane::system] pub fn chunk_save( game: &mut Game, world: &mut World, @@ -174,7 +174,7 @@ fn serialize_entities<'a>( (entities, block_entities) } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_leave_save_data(event: &PlayerLeaveEvent, game: &Game, world: &mut World) { save_player_data(game, world, event.player); } diff --git a/feather/old/server/commands/src/arguments.rs b/feather/old/server/commands/src/arguments.rs index e5fccca87..5ad711607 100644 --- a/feather/old/server/commands/src/arguments.rs +++ b/feather/old/server/commands/src/arguments.rs @@ -3,7 +3,7 @@ use feather_core::position; use feather_core::util::{Gamemode, Position}; use feather_definitions::Item; use feather_server_types::{Game, Name, NetworkId, Player}; -use fecs::{component, Entity, IntoQuery, Read, World}; +use fvane::{component, Entity, IntoQuery, Read, World}; use lieutenant::{ArgumentKind, Input}; use rand::Rng; use smallvec::SmallVec; diff --git a/feather/old/server/commands/src/impls.rs b/feather/old/server/commands/src/impls.rs index 00283bea4..67c91c2e0 100644 --- a/feather/old/server/commands/src/impls.rs +++ b/feather/old/server/commands/src/impls.rs @@ -16,7 +16,7 @@ use feather_server_types::{ Player, ShutdownChannels, Teleported, TimeUpdateEvent, WrappedBanInfo, }; use feather_server_util::{name_to_uuid_offline, name_to_uuid_online}; -use fecs::{Entity, IntoQuery, Read, ResourcesProvider, World}; +use fvane::{Entity, IntoQuery, Read, ResourcesProvider, World}; use lieutenant::command; use smallvec::SmallVec; use std::net::{IpAddr, SocketAddr}; diff --git a/feather/old/server/commands/src/lib.rs b/feather/old/server/commands/src/lib.rs index b070bddbe..a4875e3e7 100644 --- a/feather/old/server/commands/src/lib.rs +++ b/feather/old/server/commands/src/lib.rs @@ -9,7 +9,7 @@ mod impls; use feather_core::text::{Text, TextComponentBuilder}; use feather_server_types::{Game, MessageReceiver}; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use impls::*; use lieutenant::CommandDispatcher; use std::ops::{Deref, DerefMut}; diff --git a/feather/old/server/entity/src/broadcasters/entity_creation.rs b/feather/old/server/entity/src/broadcasters/entity_creation.rs index 400649351..0176bfd17 100644 --- a/feather/old/server/entity/src/broadcasters/entity_creation.rs +++ b/feather/old/server/entity/src/broadcasters/entity_creation.rs @@ -5,11 +5,11 @@ use feather_server_types::{ CreationPacketCreator, EntitySendEvent, EntitySpawnEvent, Game, Network, NetworkId, PlayerJoinEvent, SpawnPacketCreator, }; -use fecs::{IntoQuery, Read, World}; +use fvane::{IntoQuery, Read, World}; /// When an entity is created and has a `CreationPacketCreator` and/or `SpawnPacketCreator`, /// broadcasts the packets to all online clients. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_spawn_send_to_clients( event: &EntitySpawnEvent, game: &mut Game, @@ -66,7 +66,7 @@ pub fn on_entity_spawn_send_to_clients( /// /// This only handles init packets (PlayerInfo, etc.)—spawn packets /// are handled by the view update mechanism in `crate::view`. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_join_send_existing_entities(event: &PlayerJoinEvent, world: &mut World) { let network = world.get::(event.player); for (entity, creator) in >::query().iter_entities(world.inner()) { diff --git a/feather/old/server/entity/src/broadcasters/entity_deletion.rs b/feather/old/server/entity/src/broadcasters/entity_deletion.rs index f8d61cddf..ac5867ce5 100644 --- a/feather/old/server/entity/src/broadcasters/entity_deletion.rs +++ b/feather/old/server/entity/src/broadcasters/entity_deletion.rs @@ -6,10 +6,10 @@ use feather_core::{ util::BlockPosition, }; use feather_server_types::{BlockEntity, EntityDespawnEvent, Game, NetworkId, Player, Uuid}; -use fecs::{Entity, World}; +use fvane::{Entity, World}; /// Broadcasts when an entity is deleted. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_despawn_broadcast_despawn( event: &EntityDespawnEvent, game: &mut Game, diff --git a/feather/old/server/entity/src/broadcasters/inventory.rs b/feather/old/server/entity/src/broadcasters/inventory.rs index c69436cdb..b4475559f 100644 --- a/feather/old/server/entity/src/broadcasters/inventory.rs +++ b/feather/old/server/entity/src/broadcasters/inventory.rs @@ -8,13 +8,13 @@ use feather_server_types::{ EntitySendEvent, Game, HeldItem, InventoryUpdateEvent, ItemDamageEvent, Network, NetworkId, Player, }; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use num_traits::ToPrimitive; use rand::Rng; use smallvec::smallvec; /// System for broadcasting equipment updates. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_inventory_update_broadcast_equipment_update( event: &InventoryUpdateEvent, game: &mut Game, @@ -47,7 +47,7 @@ pub fn on_inventory_update_broadcast_equipment_update( /// System to send an entity's equipment when the /// entity is sent to a client. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_send_send_equipment(event: &EntitySendEvent, world: &mut World) { let client = event.client; let entity = event.entity; @@ -96,7 +96,7 @@ pub fn on_entity_send_send_equipment(event: &EntitySendEvent, world: &mut World) /// System for sending the Set Slot packet /// when a player's inventory is updated. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_inventory_update_send_set_slot(event: &InventoryUpdateEvent, world: &mut World) { if !world.has::(event.entity) { return; @@ -131,7 +131,7 @@ fn is_equipment_update(held_item: usize, slot: SlotIndex) -> Result(event.player); diff --git a/feather/old/server/entity/src/broadcasters/item_collect.rs b/feather/old/server/entity/src/broadcasters/item_collect.rs index 30b11c514..b14e544ff 100644 --- a/feather/old/server/entity/src/broadcasters/item_collect.rs +++ b/feather/old/server/entity/src/broadcasters/item_collect.rs @@ -1,9 +1,9 @@ use feather_core::network::packets::CollectItem; use feather_server_types::{Game, ItemCollectEvent, NetworkId}; -use fecs::World; +use fvane::World; /// Sends `CollectItem` packet when an item is collected. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_item_collect_broadcast(event: &ItemCollectEvent, game: &Game, world: &mut World) { let packet = CollectItem { collected: world.get::(event.item).0, diff --git a/feather/old/server/entity/src/broadcasters/metadata.rs b/feather/old/server/entity/src/broadcasters/metadata.rs index 4b19d6dfd..c9e82be85 100644 --- a/feather/old/server/entity/src/broadcasters/metadata.rs +++ b/feather/old/server/entity/src/broadcasters/metadata.rs @@ -3,11 +3,11 @@ use feather_core::entitymeta::EntityMetadata; use feather_core::network::packets::PacketEntityMetadata; use feather_server_types::{EntitySendEvent, Network, NetworkId}; -use fecs::World; +use fvane::World; /// System which sends entity metadata when an entity /// is sent to a player. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_send_send_metadata(event: &EntitySendEvent, world: &mut World) { if let Some(metadata) = world.try_get::(event.entity) { if let Some(network) = world.try_get::(event.client) { diff --git a/feather/old/server/entity/src/broadcasters/movement.rs b/feather/old/server/entity/src/broadcasters/movement.rs index 6fb7c405b..0be3854b3 100644 --- a/feather/old/server/entity/src/broadcasters/movement.rs +++ b/feather/old/server/entity/src/broadcasters/movement.rs @@ -11,12 +11,12 @@ use feather_server_types::{ PreviousPosition, PreviousVelocity, Velocity, }; use feather_server_util::{calculate_relative_move, degrees_to_stops, protocol_velocity}; -use fecs::{IntoQuery, Read, World}; +use fvane::{IntoQuery, Read, World}; use smallvec::SmallVec; use std::ops::Deref; /// System to broadcast when an entity moves. -#[fecs::system] +#[fvane::system] pub fn broadcast_movement(game: &mut Game, world: &mut World) { <(Read, Read, Read)>::query().par_entities_for_each( world.inner(), @@ -65,7 +65,7 @@ pub fn broadcast_movement(game: &mut Game, world: &mut World) { ); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_send_update_last_known_positions(event: &EntitySendEvent, world: &mut World) { if let Some(last_known_positions) = world.try_get::(event.client) { let pos = *world.get::(event.entity); @@ -78,7 +78,7 @@ pub fn on_entity_send_update_last_known_positions(event: &EntitySendEvent, world } } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_client_remove_update_last_known_positions( event: &EntityClientRemoveEvent, world: &mut World, @@ -94,7 +94,7 @@ pub fn on_entity_client_remove_update_last_known_positions( } /// Broadcasts an entity's velocity. -#[fecs::system] +#[fvane::system] pub fn broadcast_velocity(world: &mut World, game: &mut Game) { <(Read, Read, Read)>::query().par_entities_for_each( world.inner(), diff --git a/feather/old/server/entity/src/drops.rs b/feather/old/server/entity/src/drops.rs index f7fecfd94..13f31ce66 100644 --- a/feather/old/server/entity/src/drops.rs +++ b/feather/old/server/entity/src/drops.rs @@ -5,12 +5,12 @@ use feather_core::util::Position; use feather_server_types::{ BlockUpdateEvent, CanInstaBreak, EntitySpawnEvent, Game, Inventory, Velocity, TPS, }; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use rand::Rng; /// When a block is broken with valid conditions, /// yields items from the block's loot table. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_break_drop_loot(event: &BlockUpdateEvent, game: &mut Game, world: &mut World) { if event.old.is_air() || !event.new.is_air() { return; diff --git a/feather/old/server/entity/src/fall_damage.rs b/feather/old/server/entity/src/fall_damage.rs index 3dfe89fbe..3b19b526d 100644 --- a/feather/old/server/entity/src/fall_damage.rs +++ b/feather/old/server/entity/src/fall_damage.rs @@ -4,11 +4,11 @@ use feather_core::util::Position; use feather_server_types::{ BlocksFallen, BumpVec, CanTakeDamage, Dead, Game, Health, PreviousPosition, }; -use fecs::{component, Entity, IntoQuery, Read, World, Write}; +use fvane::{component, Entity, IntoQuery, Read, World, Write}; use std::cell::RefCell; /// System which updates `BlocksFallen` for all entities. -#[fecs::system] +#[fvane::system] pub fn update_blocks_fallen(game: &mut Game, world: &mut World) { // Entities who went from !on_ground => on_ground diff --git a/feather/old/server/entity/src/inventory.rs b/feather/old/server/entity/src/inventory.rs index bbcb705e6..a95d52985 100644 --- a/feather/old/server/entity/src/inventory.rs +++ b/feather/old/server/entity/src/inventory.rs @@ -1,7 +1,7 @@ use feather_core::inventory::{slot, Area, SlotIndex}; use feather_core::items::ItemStack; use feather_server_types::{HeldItem, Inventory}; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use num_derive::{FromPrimitive, ToPrimitive}; pub trait InventoryExt { diff --git a/feather/old/server/entity/src/lib.rs b/feather/old/server/entity/src/lib.rs index e33788b0c..5a3ebddae 100644 --- a/feather/old/server/entity/src/lib.rs +++ b/feather/old/server/entity/src/lib.rs @@ -29,13 +29,13 @@ use feather_core::util::Position; use feather_server_types::{ ChunkCrossEvent, Game, NetworkId, PreviousPosition, PreviousVelocity, Velocity, }; -use fecs::{EntityBuilder, IntoQuery, Read, World, Write}; +use fvane::{EntityBuilder, IntoQuery, Read, World, Write}; use std::sync::atomic::{AtomicI32, Ordering}; /// Entity ID counter, used to create new entity IDs. pub static ENTITY_ID_COUNTER: AtomicI32 = AtomicI32::new(0); -#[fecs::system] +#[fvane::system] pub fn previous_position_velocity_reset(world: &mut World) { <(Read, Write)>::query().par_for_each_mut( world.inner_mut(), @@ -51,7 +51,7 @@ pub fn previous_position_velocity_reset(world: &mut World) { ); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_cross_mark_modified(event: &ChunkCrossEvent, game: &mut Game) { if let Some(pos) = event.old { if let Some(mut old_chunk) = game.chunk_map.chunk_at_mut(pos) { diff --git a/feather/old/server/entity/src/mob.rs b/feather/old/server/entity/src/mob.rs index ee31f4fd5..581e83771 100644 --- a/feather/old/server/entity/src/mob.rs +++ b/feather/old/server/entity/src/mob.rs @@ -14,7 +14,7 @@ use feather_core::network::Packet; use feather_core::util::Position; use feather_server_types::{NetworkId, SpawnPacketCreator, Uuid, Velocity}; use feather_server_util::{degrees_to_stops, protocol_velocity}; -use fecs::{EntityBuilder, EntityRef}; +use fvane::{EntityBuilder, EntityRef}; pub use hostile::*; pub use neutral::*; pub use passive::*; diff --git a/feather/old/server/entity/src/mob/boss/ender_dragon.rs b/feather/old/server/entity/src/mob/boss/ender_dragon.rs index 33355695e..af32248f0 100644 --- a/feather/old/server/entity/src/mob/boss/ender_dragon.rs +++ b/feather/old/server/entity/src/mob/boss/ender_dragon.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct EnderDragon; diff --git a/feather/old/server/entity/src/mob/boss/wither.rs b/feather/old/server/entity/src/mob/boss/wither.rs index 7005fed6c..96dbe33ab 100644 --- a/feather/old/server/entity/src/mob/boss/wither.rs +++ b/feather/old/server/entity/src/mob/boss/wither.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Wither; diff --git a/feather/old/server/entity/src/mob/defensive/pufferfish.rs b/feather/old/server/entity/src/mob/defensive/pufferfish.rs index bee2f1644..b5762fa10 100644 --- a/feather/old/server/entity/src/mob/defensive/pufferfish.rs +++ b/feather/old/server/entity/src/mob/defensive/pufferfish.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Pufferfish; diff --git a/feather/old/server/entity/src/mob/hostile/blaze.rs b/feather/old/server/entity/src/mob/hostile/blaze.rs index ace2fd6af..ab188f807 100644 --- a/feather/old/server/entity/src/mob/hostile/blaze.rs +++ b/feather/old/server/entity/src/mob/hostile/blaze.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Blaze; diff --git a/feather/old/server/entity/src/mob/hostile/creeper.rs b/feather/old/server/entity/src/mob/hostile/creeper.rs index 19d1ecd64..f186ac966 100644 --- a/feather/old/server/entity/src/mob/hostile/creeper.rs +++ b/feather/old/server/entity/src/mob/hostile/creeper.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Creeper; diff --git a/feather/old/server/entity/src/mob/hostile/drowned.rs b/feather/old/server/entity/src/mob/hostile/drowned.rs index fbfebb796..d6d0ec4e3 100644 --- a/feather/old/server/entity/src/mob/hostile/drowned.rs +++ b/feather/old/server/entity/src/mob/hostile/drowned.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Drowned; diff --git a/feather/old/server/entity/src/mob/hostile/elder_guardian.rs b/feather/old/server/entity/src/mob/hostile/elder_guardian.rs index f0df7f270..1c1d78563 100644 --- a/feather/old/server/entity/src/mob/hostile/elder_guardian.rs +++ b/feather/old/server/entity/src/mob/hostile/elder_guardian.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct ElderGuardian; diff --git a/feather/old/server/entity/src/mob/hostile/endermite.rs b/feather/old/server/entity/src/mob/hostile/endermite.rs index f375ceea6..6ff694a95 100644 --- a/feather/old/server/entity/src/mob/hostile/endermite.rs +++ b/feather/old/server/entity/src/mob/hostile/endermite.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Endermite; diff --git a/feather/old/server/entity/src/mob/hostile/evoker.rs b/feather/old/server/entity/src/mob/hostile/evoker.rs index 2919f44bf..4ff67282a 100644 --- a/feather/old/server/entity/src/mob/hostile/evoker.rs +++ b/feather/old/server/entity/src/mob/hostile/evoker.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Evoker; diff --git a/feather/old/server/entity/src/mob/hostile/ghast.rs b/feather/old/server/entity/src/mob/hostile/ghast.rs index a1d6d5ee7..3ba9fb439 100644 --- a/feather/old/server/entity/src/mob/hostile/ghast.rs +++ b/feather/old/server/entity/src/mob/hostile/ghast.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Ghast; diff --git a/feather/old/server/entity/src/mob/hostile/guardian.rs b/feather/old/server/entity/src/mob/hostile/guardian.rs index aa4640901..5dec36651 100644 --- a/feather/old/server/entity/src/mob/hostile/guardian.rs +++ b/feather/old/server/entity/src/mob/hostile/guardian.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Guardian; diff --git a/feather/old/server/entity/src/mob/hostile/husk.rs b/feather/old/server/entity/src/mob/hostile/husk.rs index 5bc49a416..015f715e5 100644 --- a/feather/old/server/entity/src/mob/hostile/husk.rs +++ b/feather/old/server/entity/src/mob/hostile/husk.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Husk; diff --git a/feather/old/server/entity/src/mob/hostile/magma_cube.rs b/feather/old/server/entity/src/mob/hostile/magma_cube.rs index e57021994..e71404bc9 100644 --- a/feather/old/server/entity/src/mob/hostile/magma_cube.rs +++ b/feather/old/server/entity/src/mob/hostile/magma_cube.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct MagmaCube; diff --git a/feather/old/server/entity/src/mob/hostile/phantom.rs b/feather/old/server/entity/src/mob/hostile/phantom.rs index e8945fccc..cd1057c22 100644 --- a/feather/old/server/entity/src/mob/hostile/phantom.rs +++ b/feather/old/server/entity/src/mob/hostile/phantom.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Phantom; diff --git a/feather/old/server/entity/src/mob/hostile/shulker.rs b/feather/old/server/entity/src/mob/hostile/shulker.rs index 4e93523ad..1f8011a54 100644 --- a/feather/old/server/entity/src/mob/hostile/shulker.rs +++ b/feather/old/server/entity/src/mob/hostile/shulker.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Shulker; diff --git a/feather/old/server/entity/src/mob/hostile/silverfish.rs b/feather/old/server/entity/src/mob/hostile/silverfish.rs index ffc9d07d6..53560dc54 100644 --- a/feather/old/server/entity/src/mob/hostile/silverfish.rs +++ b/feather/old/server/entity/src/mob/hostile/silverfish.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Silverfish; diff --git a/feather/old/server/entity/src/mob/hostile/skeleton.rs b/feather/old/server/entity/src/mob/hostile/skeleton.rs index 53fc1a7e2..21fd13dc6 100644 --- a/feather/old/server/entity/src/mob/hostile/skeleton.rs +++ b/feather/old/server/entity/src/mob/hostile/skeleton.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Skeleton; diff --git a/feather/old/server/entity/src/mob/hostile/slime.rs b/feather/old/server/entity/src/mob/hostile/slime.rs index 785a173ee..f294abf16 100644 --- a/feather/old/server/entity/src/mob/hostile/slime.rs +++ b/feather/old/server/entity/src/mob/hostile/slime.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Slime; diff --git a/feather/old/server/entity/src/mob/hostile/stray.rs b/feather/old/server/entity/src/mob/hostile/stray.rs index f4fcd8e90..f8af34ef7 100644 --- a/feather/old/server/entity/src/mob/hostile/stray.rs +++ b/feather/old/server/entity/src/mob/hostile/stray.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Stray; diff --git a/feather/old/server/entity/src/mob/hostile/vex.rs b/feather/old/server/entity/src/mob/hostile/vex.rs index df0c539eb..d02e06c95 100644 --- a/feather/old/server/entity/src/mob/hostile/vex.rs +++ b/feather/old/server/entity/src/mob/hostile/vex.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Vex; diff --git a/feather/old/server/entity/src/mob/hostile/vindicator.rs b/feather/old/server/entity/src/mob/hostile/vindicator.rs index 2d1e9871e..5fff53b22 100644 --- a/feather/old/server/entity/src/mob/hostile/vindicator.rs +++ b/feather/old/server/entity/src/mob/hostile/vindicator.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Vindicator; diff --git a/feather/old/server/entity/src/mob/hostile/witch.rs b/feather/old/server/entity/src/mob/hostile/witch.rs index e31487a81..406676749 100644 --- a/feather/old/server/entity/src/mob/hostile/witch.rs +++ b/feather/old/server/entity/src/mob/hostile/witch.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Witch; diff --git a/feather/old/server/entity/src/mob/hostile/wither_skeleton.rs b/feather/old/server/entity/src/mob/hostile/wither_skeleton.rs index d8efda82a..b7afb41ea 100644 --- a/feather/old/server/entity/src/mob/hostile/wither_skeleton.rs +++ b/feather/old/server/entity/src/mob/hostile/wither_skeleton.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct WitherSkeleton; diff --git a/feather/old/server/entity/src/mob/hostile/zombie.rs b/feather/old/server/entity/src/mob/hostile/zombie.rs index 9e14f4d49..625716ad7 100644 --- a/feather/old/server/entity/src/mob/hostile/zombie.rs +++ b/feather/old/server/entity/src/mob/hostile/zombie.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Zombie; diff --git a/feather/old/server/entity/src/mob/hostile/zombie_villager.rs b/feather/old/server/entity/src/mob/hostile/zombie_villager.rs index 28b26e81b..32a11c758 100644 --- a/feather/old/server/entity/src/mob/hostile/zombie_villager.rs +++ b/feather/old/server/entity/src/mob/hostile/zombie_villager.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct ZombieVillager; diff --git a/feather/old/server/entity/src/mob/neutral/cave_spider.rs b/feather/old/server/entity/src/mob/neutral/cave_spider.rs index 241110b9a..0c537a88e 100644 --- a/feather/old/server/entity/src/mob/neutral/cave_spider.rs +++ b/feather/old/server/entity/src/mob/neutral/cave_spider.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct CaveSpider; diff --git a/feather/old/server/entity/src/mob/neutral/dolphin.rs b/feather/old/server/entity/src/mob/neutral/dolphin.rs index baf2e6eee..580a89c8b 100644 --- a/feather/old/server/entity/src/mob/neutral/dolphin.rs +++ b/feather/old/server/entity/src/mob/neutral/dolphin.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Dolphin; diff --git a/feather/old/server/entity/src/mob/neutral/enderman.rs b/feather/old/server/entity/src/mob/neutral/enderman.rs index 4b1967b9e..1c2a67f02 100644 --- a/feather/old/server/entity/src/mob/neutral/enderman.rs +++ b/feather/old/server/entity/src/mob/neutral/enderman.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Enderman; diff --git a/feather/old/server/entity/src/mob/neutral/iron_golem.rs b/feather/old/server/entity/src/mob/neutral/iron_golem.rs index fd3464bcb..315892739 100644 --- a/feather/old/server/entity/src/mob/neutral/iron_golem.rs +++ b/feather/old/server/entity/src/mob/neutral/iron_golem.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct IronGolem; diff --git a/feather/old/server/entity/src/mob/neutral/llama.rs b/feather/old/server/entity/src/mob/neutral/llama.rs index e03649549..8b790d7ad 100644 --- a/feather/old/server/entity/src/mob/neutral/llama.rs +++ b/feather/old/server/entity/src/mob/neutral/llama.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Llama; diff --git a/feather/old/server/entity/src/mob/neutral/polar_bear.rs b/feather/old/server/entity/src/mob/neutral/polar_bear.rs index 1e1c3c7de..1ecd30deb 100644 --- a/feather/old/server/entity/src/mob/neutral/polar_bear.rs +++ b/feather/old/server/entity/src/mob/neutral/polar_bear.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct PolarBear; diff --git a/feather/old/server/entity/src/mob/neutral/spider.rs b/feather/old/server/entity/src/mob/neutral/spider.rs index 051478aed..d61c5cec9 100644 --- a/feather/old/server/entity/src/mob/neutral/spider.rs +++ b/feather/old/server/entity/src/mob/neutral/spider.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Spider; diff --git a/feather/old/server/entity/src/mob/neutral/wolf.rs b/feather/old/server/entity/src/mob/neutral/wolf.rs index 68c05e59c..267979637 100644 --- a/feather/old/server/entity/src/mob/neutral/wolf.rs +++ b/feather/old/server/entity/src/mob/neutral/wolf.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Wolf; diff --git a/feather/old/server/entity/src/mob/neutral/zombie_pigman.rs b/feather/old/server/entity/src/mob/neutral/zombie_pigman.rs index 41dd7194d..db6349b66 100644 --- a/feather/old/server/entity/src/mob/neutral/zombie_pigman.rs +++ b/feather/old/server/entity/src/mob/neutral/zombie_pigman.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct ZombiePigman; diff --git a/feather/old/server/entity/src/mob/passive/bat.rs b/feather/old/server/entity/src/mob/passive/bat.rs index 583aef249..0f78cc3e8 100644 --- a/feather/old/server/entity/src/mob/passive/bat.rs +++ b/feather/old/server/entity/src/mob/passive/bat.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Bat; diff --git a/feather/old/server/entity/src/mob/passive/cat.rs b/feather/old/server/entity/src/mob/passive/cat.rs index a2a0f0146..f30c23420 100644 --- a/feather/old/server/entity/src/mob/passive/cat.rs +++ b/feather/old/server/entity/src/mob/passive/cat.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Cat; diff --git a/feather/old/server/entity/src/mob/passive/chicken.rs b/feather/old/server/entity/src/mob/passive/chicken.rs index 27694ba12..dae698f11 100644 --- a/feather/old/server/entity/src/mob/passive/chicken.rs +++ b/feather/old/server/entity/src/mob/passive/chicken.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Chicken; diff --git a/feather/old/server/entity/src/mob/passive/cod.rs b/feather/old/server/entity/src/mob/passive/cod.rs index cd6f0aa7c..17e4adecc 100644 --- a/feather/old/server/entity/src/mob/passive/cod.rs +++ b/feather/old/server/entity/src/mob/passive/cod.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Cod; diff --git a/feather/old/server/entity/src/mob/passive/cow.rs b/feather/old/server/entity/src/mob/passive/cow.rs index 0fbf9e4d9..60b07ed07 100644 --- a/feather/old/server/entity/src/mob/passive/cow.rs +++ b/feather/old/server/entity/src/mob/passive/cow.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Cow; diff --git a/feather/old/server/entity/src/mob/passive/donkey.rs b/feather/old/server/entity/src/mob/passive/donkey.rs index d05a24bf2..348fa5511 100644 --- a/feather/old/server/entity/src/mob/passive/donkey.rs +++ b/feather/old/server/entity/src/mob/passive/donkey.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Donkey; diff --git a/feather/old/server/entity/src/mob/passive/horse.rs b/feather/old/server/entity/src/mob/passive/horse.rs index c670782d2..096ecfa38 100644 --- a/feather/old/server/entity/src/mob/passive/horse.rs +++ b/feather/old/server/entity/src/mob/passive/horse.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Horse; diff --git a/feather/old/server/entity/src/mob/passive/mooshroom.rs b/feather/old/server/entity/src/mob/passive/mooshroom.rs index d5f7d7cc9..dc4a4a1fc 100644 --- a/feather/old/server/entity/src/mob/passive/mooshroom.rs +++ b/feather/old/server/entity/src/mob/passive/mooshroom.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Mooshroom; diff --git a/feather/old/server/entity/src/mob/passive/mule.rs b/feather/old/server/entity/src/mob/passive/mule.rs index 1eaa2b9fc..c2f73b964 100644 --- a/feather/old/server/entity/src/mob/passive/mule.rs +++ b/feather/old/server/entity/src/mob/passive/mule.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Mule; diff --git a/feather/old/server/entity/src/mob/passive/ocelot.rs b/feather/old/server/entity/src/mob/passive/ocelot.rs index d867b8af9..7f5e61f48 100644 --- a/feather/old/server/entity/src/mob/passive/ocelot.rs +++ b/feather/old/server/entity/src/mob/passive/ocelot.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Ocelot; diff --git a/feather/old/server/entity/src/mob/passive/parrot.rs b/feather/old/server/entity/src/mob/passive/parrot.rs index a6f7f368b..898b358a4 100644 --- a/feather/old/server/entity/src/mob/passive/parrot.rs +++ b/feather/old/server/entity/src/mob/passive/parrot.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Parrot; diff --git a/feather/old/server/entity/src/mob/passive/pig.rs b/feather/old/server/entity/src/mob/passive/pig.rs index 680c13b0a..f5cd4407b 100644 --- a/feather/old/server/entity/src/mob/passive/pig.rs +++ b/feather/old/server/entity/src/mob/passive/pig.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Pig; diff --git a/feather/old/server/entity/src/mob/passive/rabbit.rs b/feather/old/server/entity/src/mob/passive/rabbit.rs index a6e6852c6..f09df8a57 100644 --- a/feather/old/server/entity/src/mob/passive/rabbit.rs +++ b/feather/old/server/entity/src/mob/passive/rabbit.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Rabbit; diff --git a/feather/old/server/entity/src/mob/passive/salmon.rs b/feather/old/server/entity/src/mob/passive/salmon.rs index 89f94d7d2..9d2926b9e 100644 --- a/feather/old/server/entity/src/mob/passive/salmon.rs +++ b/feather/old/server/entity/src/mob/passive/salmon.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Salmon; diff --git a/feather/old/server/entity/src/mob/passive/sheep.rs b/feather/old/server/entity/src/mob/passive/sheep.rs index 47a12f385..c5294e4e8 100644 --- a/feather/old/server/entity/src/mob/passive/sheep.rs +++ b/feather/old/server/entity/src/mob/passive/sheep.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Sheep; diff --git a/feather/old/server/entity/src/mob/passive/skeleton_horse.rs b/feather/old/server/entity/src/mob/passive/skeleton_horse.rs index fa36c0e02..7207d6934 100644 --- a/feather/old/server/entity/src/mob/passive/skeleton_horse.rs +++ b/feather/old/server/entity/src/mob/passive/skeleton_horse.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct SkeletonHorse; diff --git a/feather/old/server/entity/src/mob/passive/snow_golem.rs b/feather/old/server/entity/src/mob/passive/snow_golem.rs index c7c6ab065..ae2e766ce 100644 --- a/feather/old/server/entity/src/mob/passive/snow_golem.rs +++ b/feather/old/server/entity/src/mob/passive/snow_golem.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct SnowGolem; diff --git a/feather/old/server/entity/src/mob/passive/squid.rs b/feather/old/server/entity/src/mob/passive/squid.rs index ec83849c9..45ed9c861 100644 --- a/feather/old/server/entity/src/mob/passive/squid.rs +++ b/feather/old/server/entity/src/mob/passive/squid.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Squid; diff --git a/feather/old/server/entity/src/mob/passive/tropical_fish.rs b/feather/old/server/entity/src/mob/passive/tropical_fish.rs index 4a60dc677..00bfb1884 100644 --- a/feather/old/server/entity/src/mob/passive/tropical_fish.rs +++ b/feather/old/server/entity/src/mob/passive/tropical_fish.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct TropicalFish; diff --git a/feather/old/server/entity/src/mob/passive/turtle.rs b/feather/old/server/entity/src/mob/passive/turtle.rs index 4296ec9a5..5b6a4c038 100644 --- a/feather/old/server/entity/src/mob/passive/turtle.rs +++ b/feather/old/server/entity/src/mob/passive/turtle.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Turtle; diff --git a/feather/old/server/entity/src/mob/passive/villager.rs b/feather/old/server/entity/src/mob/passive/villager.rs index 56bcad4b6..ab17961da 100644 --- a/feather/old/server/entity/src/mob/passive/villager.rs +++ b/feather/old/server/entity/src/mob/passive/villager.rs @@ -1,5 +1,5 @@ use crate::{mob, MobKind}; -use fecs::EntityBuilder; +use fvane::EntityBuilder; pub struct Villager; diff --git a/feather/old/server/entity/src/object/arrow.rs b/feather/old/server/entity/src/object/arrow.rs index 29661e87b..7fd93757f 100644 --- a/feather/old/server/entity/src/object/arrow.rs +++ b/feather/old/server/entity/src/object/arrow.rs @@ -6,7 +6,7 @@ use feather_server_types::{ ComponentSerializer, Game, NetworkId, PhysicsBuilder, SpawnPacketCreator, Uuid, Velocity, }; use feather_server_util::{degrees_to_stops, protocol_velocity}; -use fecs::{EntityBuilder, EntityRef}; +use fvane::{EntityBuilder, EntityRef}; pub fn create() -> EntityBuilder { crate::base() diff --git a/feather/old/server/entity/src/object/falling_block.rs b/feather/old/server/entity/src/object/falling_block.rs index 759c2ea6f..15a16411c 100644 --- a/feather/old/server/entity/src/object/falling_block.rs +++ b/feather/old/server/entity/src/object/falling_block.rs @@ -16,7 +16,7 @@ use feather_server_util::{ degrees_to_stops, protocol_velocity, BlockNotifyBlock, BlockNotifyFallingBlock, BlockNotifyPosition, }; -use fecs::{component, EntityBuilder, EntityRef, IntoQuery, Read, World}; +use fvane::{component, EntityBuilder, EntityRef, IntoQuery, Read, World}; /// Marker component indicating an entity is a falling block. #[derive(Copy, Clone, Debug)] @@ -28,7 +28,7 @@ pub struct FallingBlockType(pub BlockId); /// System to create a falling block when a block notify /// entity is spawned with `BlockNotifyFallingBlock`. -#[fecs::system] +#[fvane::system] pub fn spawn_falling_blocks(game: &mut Game, world: &mut World) { let mut actions = BumpVec::new_in(game.bump()); @@ -78,7 +78,7 @@ pub fn spawn_falling_blocks(game: &mut Game, world: &mut World) { /// it and creates a solid block where it landed or /// drops it on the ground if the block in the land position /// is not solid. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_entity_land_remove_falling_block( event: &EntityLandEvent, game: &mut Game, diff --git a/feather/old/server/entity/src/object/item.rs b/feather/old/server/entity/src/object/item.rs index 2ff631b03..6402b215d 100644 --- a/feather/old/server/entity/src/object/item.rs +++ b/feather/old/server/entity/src/object/item.rs @@ -15,7 +15,7 @@ use feather_server_types::{ SpawnPacketCreator, Uuid, Velocity, PLAYER_EYE_HEIGHT, TPS, }; use feather_server_util::{degrees_to_stops, nearby_entities, protocol_velocity}; -use fecs::{component, EntityBuilder, EntityRef, IntoQuery, Read, World, Write}; +use fvane::{component, EntityBuilder, EntityRef, IntoQuery, Read, World, Write}; use parking_lot::Mutex; use rand::Rng; use std::sync::atomic::{AtomicBool, Ordering}; @@ -37,7 +37,7 @@ inventory::submit! { /// Handler for spawning an item entity when /// an item is dropped. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_item_drop_spawn_item_entity(event: &ItemDropEvent, game: &mut Game, world: &mut World) { // Spawn item entity. @@ -79,7 +79,7 @@ pub fn on_item_drop_spawn_item_entity(event: &ItemDropEvent, game: &mut Game, wo } /// System to add items to player inventories when the player comes near. -#[fecs::system] +#[fvane::system] pub fn item_collect(game: &mut Game, world: &mut World) { // run every 1/10 second if game.tick_count % (TPS / 10) != 0 { diff --git a/feather/old/server/entity/src/object/supported_blocks.rs b/feather/old/server/entity/src/object/supported_blocks.rs index 5d0290278..459803181 100644 --- a/feather/old/server/entity/src/object/supported_blocks.rs +++ b/feather/old/server/entity/src/object/supported_blocks.rs @@ -5,11 +5,11 @@ use feather_server_types::{BlockUpdateCause, BumpVec, Game}; use feather_server_util::{ is_block_supported_at, BlockNotifyBlock, BlockNotifyPosition, BlockNotifySupportedBlock, }; -use fecs::{component, IntoQuery, Read, World}; +use fvane::{component, IntoQuery, Read, World}; /// System to check for supporting block when a block notify /// entity is spawned with `BlockNotifySupportedBlock`. -#[fecs::system] +#[fvane::system] pub fn break_unsupported_blocks(game: &mut Game, world: &mut World) { let mut actions = BumpVec::new_in(game.bump()); diff --git a/feather/old/server/entity/src/particle.rs b/feather/old/server/entity/src/particle.rs index 84be9eec6..38e02743b 100644 --- a/feather/old/server/entity/src/particle.rs +++ b/feather/old/server/entity/src/particle.rs @@ -4,7 +4,7 @@ use feather_core::misc::ParticleData; use feather_core::network::{packets, Packet}; use feather_core::util::Position; use feather_server_types::{ParticleCount, SpawnPacketCreator}; -use fecs::{EntityBuilder, EntityRef}; +use fvane::{EntityBuilder, EntityRef}; /// Creates a particle with the given kind and count. pub fn create(kind: ParticleData, count: u32) -> EntityBuilder { diff --git a/feather/old/server/lighting/src/lib.rs b/feather/old/server/lighting/src/lib.rs index 9e165cd45..ab103190d 100644 --- a/feather/old/server/lighting/src/lib.rs +++ b/feather/old/server/lighting/src/lib.rs @@ -59,7 +59,7 @@ use std::collections::VecDeque; use std::marker::PhantomData; use std::sync::Arc; -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_update_notify_lighting_worker( event: &BlockUpdateEvent, #[default] handle: &LightingWorkerHandle, @@ -71,7 +71,7 @@ pub fn on_block_update_notify_lighting_worker( .expect("failed to notify lighting worker of block update"); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_load_notify_lighting_worker( event: &ChunkLoadEvent, game: &mut Game, @@ -91,7 +91,7 @@ pub fn on_chunk_load_notify_lighting_worker( .expect("failed to notify lighting worker of chunk load"); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_unload_notify_lighting_worker( event: &ChunkUnloadEvent, handle: &LightingWorkerHandle, diff --git a/feather/old/server/network/src/lib.rs b/feather/old/server/network/src/lib.rs index daafe779e..ebdf2f7cd 100644 --- a/feather/old/server/network/src/lib.rs +++ b/feather/old/server/network/src/lib.rs @@ -16,7 +16,7 @@ use feather_core::util::Position; use feather_server_types::{ Config, PacketBuffers, ServerToWorkerMessage, Uuid, WorkerToServerMessage, WrappedBanInfo, }; -use fecs::Entity; +use fvane::Entity; use once_cell::sync::Lazy; use parking_lot::Mutex; use std::net::SocketAddr; diff --git a/feather/old/server/network/src/worker.rs b/feather/old/server/network/src/worker.rs index 65a5fcab1..19a47122d 100644 --- a/feather/old/server/network/src/worker.rs +++ b/feather/old/server/network/src/worker.rs @@ -15,7 +15,7 @@ use feather_core::util::{Position, Vec3d}; use feather_server_types::{ BanInfo, Config, PacketBuffers, ServerToWorkerMessage, Uuid, WorkerToServerMessage, }; -use fecs::Entity; +use fvane::Entity; use futures::future::Either; use futures::SinkExt; use futures::StreamExt; diff --git a/feather/old/server/packet_buffer/src/lib.rs b/feather/old/server/packet_buffer/src/lib.rs index dcff47b84..8437430f4 100644 --- a/feather/old/server/packet_buffer/src/lib.rs +++ b/feather/old/server/packet_buffer/src/lib.rs @@ -18,7 +18,7 @@ use ahash::AHashMap; use feather_core::network::{cast_packet, Packet, PacketType}; -use fecs::Entity; +use fvane::Entity; use indexmap::set::IndexSet; use num_traits::ToPrimitive; use once_cell::sync::Lazy; @@ -344,7 +344,7 @@ impl ArrayBuffer { mod tests { use super::*; use feather_core::network::packets::Request; - use fecs::{EntityBuilder, World}; + use fvane::{EntityBuilder, World}; #[test] fn map_buffer() { diff --git a/feather/old/server/physics/src/entity.rs b/feather/old/server/physics/src/entity.rs index 98a7571b3..49ad003b3 100644 --- a/feather/old/server/physics/src/entity.rs +++ b/feather/old/server/physics/src/entity.rs @@ -6,12 +6,12 @@ use feather_core::blocks::BlockKind; use feather_core::position; use feather_core::util::Position; use feather_server_types::{AABBExt, EntityLandEvent, Game, Physics, Velocity}; -use fecs::{IntoQuery, Read, World, Write}; +use fvane::{IntoQuery, Read, World, Write}; use parking_lot::Mutex; /// System for updating all entities' positions and velocities /// each tick. -#[fecs::system] +#[fvane::system] pub fn entity_physics(game: &mut Game, world: &mut World) { // Go through entities and update their positions according // to their velocities. diff --git a/feather/old/server/player/src/broadcasters/animation.rs b/feather/old/server/player/src/broadcasters/animation.rs index 4284903ac..7d39ea7fb 100644 --- a/feather/old/server/player/src/broadcasters/animation.rs +++ b/feather/old/server/player/src/broadcasters/animation.rs @@ -1,9 +1,9 @@ use feather_core::network::packets::AnimationClientbound; use feather_server_types::{Game, NetworkId, PlayerAnimationEvent}; -use fecs::World; +use fvane::World; /// Broadcasts animations. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_animation_broadcast_animation( event: &PlayerAnimationEvent, game: &mut Game, diff --git a/feather/old/server/player/src/broadcasters/block.rs b/feather/old/server/player/src/broadcasters/block.rs index 26e1b3ee1..2c98ff5db 100644 --- a/feather/old/server/player/src/broadcasters/block.rs +++ b/feather/old/server/player/src/broadcasters/block.rs @@ -4,11 +4,11 @@ use crate::packet_handlers::Digging; use crate::{FinishDiggingEvent, StartDiggingEvent}; use feather_core::network::packets::{BlockBreakAnimation, BlockChange, Effect}; use feather_server_types::{BlockUpdateCause, BlockUpdateEvent, BumpVec, Game, NetworkId}; -use fecs::{IntoQuery, Read, World, Write}; +use fvane::{IntoQuery, Read, World, Write}; /// System for broadcasting block update /// events to all clients. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_update_broadcast(event: &BlockUpdateEvent, game: &mut Game, world: &mut World) { // Broadcast Block Change packet. let packet = BlockChange { @@ -20,7 +20,7 @@ pub fn on_block_update_broadcast(event: &BlockUpdateEvent, game: &mut Game, worl /// Sends an `Effect` packet with status `BlockBreak` /// when a block is broken by a player. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_block_break_broadcast_effect( event: &BlockUpdateEvent, game: &mut Game, @@ -43,7 +43,7 @@ pub fn on_block_break_broadcast_effect( struct LastDestroyStage(i8); /// Sends `BlockBreakAnimation` while a block is being dug. -#[fecs::system] +#[fvane::system] pub fn broadcast_block_break_animation(game: &mut Game, world: &mut World) { let mut broadcasts = BumpVec::new_in(game.bump()); for (entity, (digging, entity_id, mut last_destroy_stage)) in @@ -71,7 +71,7 @@ pub fn broadcast_block_break_animation(game: &mut Game, world: &mut World) { /// Removes `LastDestroyStage` and broadcasts /// that a block animation is finished a player finishes digging. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_finish_digging_remove_animation( event: &FinishDiggingEvent, game: &mut Game, @@ -88,7 +88,7 @@ pub fn on_finish_digging_remove_animation( } /// Inserts `LastDestroyStage` when a player starts digging. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_start_digging_init_stage(event: &StartDiggingEvent, world: &mut World) { let _ = world.add(event.player, LastDestroyStage(-1)); } diff --git a/feather/old/server/player/src/broadcasters/chat.rs b/feather/old/server/player/src/broadcasters/chat.rs index 6d3e6fcdf..1f70fdf72 100644 --- a/feather/old/server/player/src/broadcasters/chat.rs +++ b/feather/old/server/player/src/broadcasters/chat.rs @@ -2,10 +2,10 @@ use feather_core::network::packets::ChatMessageClientbound; use feather_server_types::{ChatEvent, ChatPosition, Game, MessageReceiver, Network, Player}; -use fecs::{component, IntoQuery, Read, World, Write}; +use fvane::{component, IntoQuery, Read, World, Write}; /// System that broadcasts chat messages to all players -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chat_broadcast(event: &ChatEvent, game: &Game, world: &mut World) { let packet = ChatMessageClientbound { json_data: event.message.clone(), @@ -19,7 +19,7 @@ pub fn on_chat_broadcast(event: &ChatEvent, game: &Game, world: &mut World) { } /// System to flush a players `MessageReceiver` component and send the messages. -#[fecs::system] +#[fvane::system] pub fn flush_player_message_receiver(world: &mut World) { <(Write, Read)>::query() .filter(component::()) diff --git a/feather/old/server/player/src/broadcasters/gamemode.rs b/feather/old/server/player/src/broadcasters/gamemode.rs index e7a695e04..6355005e4 100644 --- a/feather/old/server/player/src/broadcasters/gamemode.rs +++ b/feather/old/server/player/src/broadcasters/gamemode.rs @@ -1,10 +1,10 @@ use feather_core::network::packets::ChangeGameState; use feather_core::util::Gamemode; use feather_server_types::{GamemodeUpdateEvent, Network}; -use fecs::World; +use fvane::World; /// Sends a Change Game State packet to update player's gamemode. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_gamemode_update_send(event: &GamemodeUpdateEvent, world: &mut World) { let packet = ChangeGameState { reason: 3, // change gamemode diff --git a/feather/old/server/player/src/broadcasters/health.rs b/feather/old/server/player/src/broadcasters/health.rs index 3ca7725ca..bffd8fc35 100644 --- a/feather/old/server/player/src/broadcasters/health.rs +++ b/feather/old/server/player/src/broadcasters/health.rs @@ -1,9 +1,9 @@ use feather_core::network::packets::UpdateHealth; use feather_server_types::{HealthUpdateEvent, Network}; -use fecs::World; +use fvane::World; /// When a player's health is updated, updates it on the client. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_health_update_send(event: &HealthUpdateEvent, world: &mut World) { if let Some(network) = world.try_get::(event.entity) { let packet = UpdateHealth { diff --git a/feather/old/server/player/src/broadcasters/keepalive.rs b/feather/old/server/player/src/broadcasters/keepalive.rs index 258c895d2..c3f8eee31 100644 --- a/feather/old/server/player/src/broadcasters/keepalive.rs +++ b/feather/old/server/player/src/broadcasters/keepalive.rs @@ -1,9 +1,9 @@ use feather_core::network::packets::KeepAliveClientbound; use feather_server_types::{Game, TPS}; -use fecs::World; +use fvane::World; /// Broadcasts keepalives every second. -#[fecs::system] +#[fvane::system] pub fn broadcast_keepalive(game: &Game, world: &mut World) { if game.tick_count % TPS == 0 { let packet = KeepAliveClientbound { diff --git a/feather/old/server/player/src/broadcasters/teleport.rs b/feather/old/server/player/src/broadcasters/teleport.rs index b4bc7e773..87718f2a9 100644 --- a/feather/old/server/player/src/broadcasters/teleport.rs +++ b/feather/old/server/player/src/broadcasters/teleport.rs @@ -1,7 +1,7 @@ use feather_core::network::packets::PlayerPositionAndLookClientbound; use feather_core::util::Position; use feather_server_types::{BumpVec, Game, Network, Teleported}; -use fecs::{component, IntoQuery, Read, World}; +use fvane::{component, IntoQuery, Read, World}; use std::sync::atomic::{AtomicI32, Ordering}; /// TODO: how are we supposed to handle this? @@ -9,7 +9,7 @@ static TELEPORT_ID_COUNTER: AtomicI32 = AtomicI32::new(1); /// System which polls for players with the `Teleported` component /// and notifies them of their new position. -#[fecs::system] +#[fvane::system] pub fn send_teleported(world: &mut World, game: &mut Game) { let mut to_delete = BumpVec::new_in(game.bump()); for (entity, (network, pos)) in <(Read, Read)>::query() diff --git a/feather/old/server/player/src/chat.rs b/feather/old/server/player/src/chat.rs index 743e13a5f..5ce3fbb30 100644 --- a/feather/old/server/player/src/chat.rs +++ b/feather/old/server/player/src/chat.rs @@ -1,8 +1,8 @@ use feather_core::text::{Color, TextRoot, Translate}; use feather_server_types::{ChatEvent, ChatPosition, Game, Name, PlayerJoinEvent}; -use fecs::World; +use fvane::World; -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_join_broadcast_join_message( event: &PlayerJoinEvent, game: &mut Game, diff --git a/feather/old/server/player/src/death.rs b/feather/old/server/player/src/death.rs index ab003efbc..06cc46b48 100644 --- a/feather/old/server/player/src/death.rs +++ b/feather/old/server/player/src/death.rs @@ -8,10 +8,10 @@ use entity::drops::drop_item; use feather_core::util::Position; use feather_server_types::{Dead, EntityDeathEvent, Game, Inventory, InventoryUpdateEvent, Player}; -use fecs::World; +use fvane::World; /// Scatters a player's items when they die. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_death_scatter_inventory( event: &EntityDeathEvent, game: &mut Game, @@ -52,7 +52,7 @@ pub fn on_player_death_scatter_inventory( /// /// The component will be removed once the user clicks the respawn /// button. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_death_mark_dead(event: &EntityDeathEvent, world: &mut World) { if world.has::(event.entity) { world.add(event.entity, Dead).unwrap(); diff --git a/feather/old/server/player/src/join.rs b/feather/old/server/player/src/join.rs index dc7c03c83..eba007e98 100644 --- a/feather/old/server/player/src/join.rs +++ b/feather/old/server/player/src/join.rs @@ -10,11 +10,11 @@ use feather_server_types::{ BumpVec, ChunkSendEvent, Game, HeldItem, Network, NetworkId, PlayerJoinEvent, WorkerToServerMessage, }; -use fecs::{IntoQuery, Read, World}; +use fvane::{IntoQuery, Read, World}; use std::iter; /// System which polls for player disconnects. -#[fecs::system] +#[fvane::system] pub fn poll_player_disconnect(game: &mut Game, world: &mut World) { // For each player with a Network component, // check their channel for disconnects. @@ -37,7 +37,7 @@ pub fn poll_player_disconnect(game: &mut Game, world: &mut World) { } /// System which polls for new clients from the listener task. -#[fecs::system] +#[fvane::system] pub fn poll_new_clients(game: &mut Game, world: &mut World, io_handle: &mut NetworkIoManager) { while let Ok(msg) = io_handle.rx.lock().try_recv() { match msg { @@ -69,7 +69,7 @@ pub struct Joined; /// System to run the join sequence. To determine when a player is ready to join, /// we wait for the chunk that the player is in to be sent—this appears to work /// well with the client. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_send_join_player(event: &ChunkSendEvent, game: &Game, world: &mut World) { if world.try_get::(event.player).is_some() { return; // already joined @@ -107,7 +107,7 @@ pub fn on_chunk_send_join_player(event: &ChunkSendEvent, game: &Game, world: &mu network.send(packet); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_join_send_join_packets(event: &PlayerJoinEvent, game: &Game, world: &mut World) { let network = world.get::(event.player); let id = world.get::(event.player); diff --git a/feather/old/server/player/src/lib.rs b/feather/old/server/player/src/lib.rs index efe572d81..6fc27329e 100644 --- a/feather/old/server/player/src/lib.rs +++ b/feather/old/server/player/src/lib.rs @@ -23,7 +23,7 @@ use feather_server_types::{ PreviousVelocity, ProfileProperties, SpawnPacketCreator, Uuid, Velocity, }; use feather_server_util::degrees_to_stops; -use fecs::{Entity, EntityRef, World}; +use fvane::{Entity, EntityRef, World}; pub use broadcasters::*; pub use chat::*; @@ -165,7 +165,7 @@ fn add_gamemode_comps(world: &mut World, gamemode: Gamemode, entity: Entity) { /// When a player's gamemode is updated, updates their capability /// marker components (`CanBreak`, `CanTakeDamage`, etc) -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_gamemode_update_update_capabilities(event: &GamemodeUpdateEvent, world: &mut World) { if world.is_alive(event.player) { add_gamemode_comps(world, event.new, event.player); diff --git a/feather/old/server/player/src/packet_handlers.rs b/feather/old/server/player/src/packet_handlers.rs index 0ae5fbf33..aa741f60e 100644 --- a/feather/old/server/player/src/packet_handlers.rs +++ b/feather/old/server/player/src/packet_handlers.rs @@ -15,7 +15,7 @@ pub use animation::handle_animation; pub use chat::handle_chat; pub use client_status::handle_client_status; pub use digging::*; -use fecs::{Entity, World}; +use fvane::{Entity, World}; pub use movement::handle_movement_packets; pub use placement::handle_player_block_placement; pub use use_item::handle_player_use_item; diff --git a/feather/old/server/player/src/packet_handlers/animation.rs b/feather/old/server/player/src/packet_handlers/animation.rs index e0a0e448d..81a45a95f 100644 --- a/feather/old/server/player/src/packet_handlers/animation.rs +++ b/feather/old/server/player/src/packet_handlers/animation.rs @@ -2,11 +2,11 @@ use crate::IteratorExt; use feather_core::network::packets::AnimationServerbound; use feather_core::util::{ClientboundAnimation, Hand}; use feather_server_types::{Game, PacketBuffers, PlayerAnimationEvent}; -use fecs::World; +use fvane::World; use std::sync::Arc; /// Handles animation packets. -#[fecs::system] +#[fvane::system] pub fn handle_animation(game: &mut Game, world: &mut World, packet_buffers: &Arc) { packet_buffers .received::() diff --git a/feather/old/server/player/src/packet_handlers/chat.rs b/feather/old/server/player/src/packet_handlers/chat.rs index a3cfffb4e..ad8bfc392 100644 --- a/feather/old/server/player/src/packet_handlers/chat.rs +++ b/feather/old/server/player/src/packet_handlers/chat.rs @@ -3,11 +3,11 @@ use feather_core::network::packets::ChatMessageServerbound; use feather_core::text::{TextRoot, Translate}; use feather_server_commands::CommandState; use feather_server_types::{ChatEvent, ChatPosition, Game, Name, PacketBuffers}; -use fecs::World; +use fvane::World; use std::sync::Arc; /// Handles chat packets. -#[fecs::system] +#[fvane::system] pub fn handle_chat( game: &mut Game, world: &mut World, diff --git a/feather/old/server/player/src/packet_handlers/client_status.rs b/feather/old/server/player/src/packet_handlers/client_status.rs index e1507c9e4..af48f7f8b 100644 --- a/feather/old/server/player/src/packet_handlers/client_status.rs +++ b/feather/old/server/player/src/packet_handlers/client_status.rs @@ -3,12 +3,12 @@ use feather_core::network::packets::ClientStatus; use feather_core::network::packets::Respawn; use feather_core::util::{Gamemode, Position}; use feather_server_types::{Dead, Health, Network, PacketBuffers, Teleported}; -use fecs::World; +use fvane::World; use std::sync::Arc; /// Handles the Client Status packet, which is sent /// when the user clicks the respawn button. -#[fecs::system] +#[fvane::system] pub fn handle_client_status(world: &mut World, packet_buffers: &Arc) { packet_buffers .received::() diff --git a/feather/old/server/player/src/packet_handlers/digging.rs b/feather/old/server/player/src/packet_handlers/digging.rs index 93051f075..1ced16ee6 100644 --- a/feather/old/server/player/src/packet_handlers/digging.rs +++ b/feather/old/server/player/src/packet_handlers/digging.rs @@ -18,7 +18,7 @@ use feather_server_types::{ PLAYER_EYE_HEIGHT, TPS, }; use feather_server_util::{charge_from_ticks_held, compute_projectile_velocity}; -use fecs::{Entity, IntoQuery, Read, World, Write}; +use fvane::{Entity, IntoQuery, Read, World, Write}; use smallvec::smallvec; use std::sync::Arc; @@ -40,7 +40,7 @@ pub struct Digging { /// System responsible for polling for PlayerDigging /// packets and writing the corresponding events. -#[fecs::system] +#[fvane::system] pub fn handle_player_digging( game: &mut Game, world: &mut World, @@ -150,7 +150,7 @@ fn handle_started_digging( } /// System to advance the digging progress. -#[fecs::system] +#[fvane::system] pub fn advance_dig_progress(game: &mut Game, world: &mut World) { <(Write, Read, Read)>::query().par_for_each_mut( world.inner_mut(), diff --git a/feather/old/server/player/src/packet_handlers/inventory.rs b/feather/old/server/player/src/packet_handlers/inventory.rs index 4f8dec7c6..e0cc1e9bb 100644 --- a/feather/old/server/player/src/packet_handlers/inventory.rs +++ b/feather/old/server/player/src/packet_handlers/inventory.rs @@ -12,14 +12,14 @@ use feather_core::util::Gamemode; use feather_server_types::{ Game, HeldItem, InventoryUpdateEvent, ItemDropEvent, Network, PacketBuffers, }; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use smallvec::smallvec; use std::convert::TryFrom; use std::sync::Arc; use thiserror::Error; /// System for handling Creative Inventory Action packets. -#[fecs::system] +#[fvane::system] pub fn handle_creative_inventory_action( game: &mut Game, world: &mut World, @@ -92,7 +92,7 @@ pub fn handle_creative_inventory_action( } /// System for handling Held Item Change packets. -#[fecs::system] +#[fvane::system] pub fn handle_held_item_change( game: &mut Game, world: &mut World, @@ -260,7 +260,7 @@ enum PaintAction { /// System for handling Click Window packets. /// /// This is a bulky one -#[fecs::system] +#[fvane::system] pub fn handle_click_windows( game: &mut Game, world: &mut World, diff --git a/feather/old/server/player/src/packet_handlers/movement.rs b/feather/old/server/player/src/packet_handlers/movement.rs index 1ce913a95..70ca9ae60 100644 --- a/feather/old/server/player/src/packet_handlers/movement.rs +++ b/feather/old/server/player/src/packet_handlers/movement.rs @@ -3,11 +3,11 @@ use feather_core::network::packets::{ }; use feather_core::util::Position; use feather_server_types::{Network, PacketBuffers}; -use fecs::{component, IntoQuery, World, Write}; +use fvane::{component, IntoQuery, World, Write}; use std::sync::Arc; /// System to handle player movement updates. -#[fecs::system] +#[fvane::system] pub fn handle_movement_packets(world: &mut World, packet_buffers: &Arc) { >::query() .filter(component::()) diff --git a/feather/old/server/player/src/packet_handlers/placement.rs b/feather/old/server/player/src/packet_handlers/placement.rs index e7160702f..afd797e64 100644 --- a/feather/old/server/player/src/packet_handlers/placement.rs +++ b/feather/old/server/player/src/packet_handlers/placement.rs @@ -16,7 +16,7 @@ use feather_server_types::{ PacketBuffers, }; use feather_server_util::is_block_supported_at; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use once_cell::sync::Lazy; use smallvec::smallvec; use std::boxed::Box; @@ -43,7 +43,7 @@ static INTERACTION_HANDLERS: Lazy(event.entity) { Some(net) => net, @@ -322,7 +322,7 @@ fn unload_chunk_for_player( } /// System which sends chunks to pending players when a chunk is loaded. -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_chunk_load_send_to_clients( event: &ChunkLoadEvent, game: &mut Game, diff --git a/feather/old/server/src/event_handlers.rs b/feather/old/server/src/event_handlers.rs index 65ece9724..7f90743eb 100644 --- a/feather/old/server/src/event_handlers.rs +++ b/feather/old/server/src/event_handlers.rs @@ -6,7 +6,7 @@ use feather_server_lighting::*; use feather_server_player::*; use feather_server_util::*; use feather_server_weather::*; -use fecs::EventHandlers; +use fvane::EventHandlers; macro_rules! event_handlers { ($($handler:path,)*) => { diff --git a/feather/old/server/src/init.rs b/feather/old/server/src/init.rs index ecc7cf5fb..a7c6673c0 100644 --- a/feather/old/server/src/init.rs +++ b/feather/old/server/src/init.rs @@ -12,7 +12,7 @@ use feather_server_types::{task, BanInfo, Config, Game, Shared, ShutdownChannels use feather_server_worldgen::{ ComposableGenerator, EmptyWorldGenerator, SuperflatWorldGenerator, WorldGenerator, }; -use fecs::{EntityBuilder, Executor, OwnedResources, ResourcesProvider, World}; +use fvane::{EntityBuilder, Executor, OwnedResources, ResourcesProvider, World}; use fxhash::FxHasher; use rand::Rng; use std::hash::{Hash, Hasher}; diff --git a/feather/old/server/src/lib.rs b/feather/old/server/src/lib.rs index 0ac3b0023..31a8c44f3 100644 --- a/feather/old/server/src/lib.rs +++ b/feather/old/server/src/lib.rs @@ -5,7 +5,7 @@ use feather_server_chunk::ChunkWorkerHandle; use feather_server_lighting::LightingWorkerHandle; use feather_server_types::{BanInfo, Game, ShutdownChannels, TPS}; -use fecs::{Executor, OwnedResources, ResourcesProvider, World}; +use fvane::{Executor, OwnedResources, ResourcesProvider, World}; use spin_sleep::LoopHelper; use std::ops::Deref; use std::panic::AssertUnwindSafe; diff --git a/feather/old/server/src/shutdown.rs b/feather/old/server/src/shutdown.rs index 04c9ea2cd..9be517f33 100644 --- a/feather/old/server/src/shutdown.rs +++ b/feather/old/server/src/shutdown.rs @@ -6,7 +6,7 @@ use feather_server_chunk::chunk_worker::Request; use feather_server_chunk::{save_chunk_at, ChunkWorkerHandle}; use feather_server_lighting::LightingWorkerHandle; use feather_server_types::{tasks, BanInfo, Game, Network, Player}; -use fecs::{IntoQuery, Read, World}; +use fvane::{IntoQuery, Read, World}; use std::sync::{Arc, RwLock}; use tokio::fs::File; use tokio::io::AsyncWriteExt; diff --git a/feather/old/server/src/systems.rs b/feather/old/server/src/systems.rs index 61d83ac68..1e0e8b800 100644 --- a/feather/old/server/src/systems.rs +++ b/feather/old/server/src/systems.rs @@ -1,6 +1,6 @@ //! Defines all systems and the order in which they are executed. -use fecs::Executor; +use fvane::Executor; use feather_server_chunk as chunk_logic; use feather_server_entity as entity; diff --git a/feather/old/server/test/src/unit.rs b/feather/old/server/test/src/unit.rs index 2ecf7d811..e97f5e603 100644 --- a/feather/old/server/test/src/unit.rs +++ b/feather/old/server/test/src/unit.rs @@ -18,7 +18,7 @@ use feather_server_types::{ WorkerToServerMessage, }; use feather_server_util::on_chunk_cross_update_chunk_entities; -use fecs::{ +use fvane::{ Entity, EntityBuilder, Event, EventHandlers, Executor, OwnedResources, RawEventHandler, RawSystem, RefResources, ResourcesEnum, ResourcesProvider, World, }; diff --git a/feather/old/server/types/src/components.rs b/feather/old/server/types/src/components.rs index f06a29986..070407512 100644 --- a/feather/old/server/types/src/components.rs +++ b/feather/old/server/types/src/components.rs @@ -15,7 +15,7 @@ use ahash::AHashSet; use dashmap::DashMap; use feather_core::text::Text; use feather_core::util::{ChunkPosition, Position}; -use fecs::Entity; +use fvane::Entity; /// The item an entity is currently holding. /// diff --git a/feather/old/server/types/src/components/serialize.rs b/feather/old/server/types/src/components/serialize.rs index 27cd26d17..03ec2ea28 100644 --- a/feather/old/server/types/src/components/serialize.rs +++ b/feather/old/server/types/src/components/serialize.rs @@ -4,7 +4,7 @@ use crate::Game; use feather_core::anvil::{block_entity::BlockEntityData, entity::EntityData}; use feather_core::network::Packet; -use fecs::EntityRef; +use fvane::EntityRef; pub trait PacketCreatorFn: Fn(&EntityRef) -> Box + Send + Sync + 'static {} impl PacketCreatorFn for F where F: Fn(&EntityRef) -> Box + Send + Sync + 'static {} diff --git a/feather/old/server/types/src/events.rs b/feather/old/server/types/src/events.rs index 66dc37aa7..ea09e462c 100644 --- a/feather/old/server/types/src/events.rs +++ b/feather/old/server/types/src/events.rs @@ -3,7 +3,7 @@ use feather_core::blocks::BlockId; use feather_core::inventory::SlotIndex; use feather_core::items::ItemStack; use feather_core::util::{BlockPosition, ChunkPosition, ClientboundAnimation, Gamemode, Position}; -use fecs::Entity; +use fvane::Entity; use smallvec::SmallVec; #[derive(Copy, Clone, Debug)] diff --git a/feather/old/server/types/src/game.rs b/feather/old/server/types/src/game.rs index 7eaae3ad3..264365d1f 100644 --- a/feather/old/server/types/src/game.rs +++ b/feather/old/server/types/src/game.rs @@ -13,7 +13,7 @@ use feather_core::network::{packets::DisconnectPlay, Packet}; use feather_core::text::Text; use feather_core::util::{BlockPosition, ChunkPosition, Position}; use feather_server_config::Config; -use fecs::{Entity, Event, EventHandlers, IntoQuery, OwnedResources, Read, RefResources, World}; +use fvane::{Entity, Event, EventHandlers, IntoQuery, OwnedResources, Read, RefResources, World}; use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; use smallvec::SmallVec; @@ -406,12 +406,12 @@ impl Time { } } -#[fecs::system] +#[fvane::system] pub fn reset_bump_allocators(game: &mut Game) { game.bump.iter_mut().for_each(Bump::reset); } -#[fecs::system] +#[fvane::system] pub fn increment_tick_count(game: &mut Game) { game.tick_count += 1; } diff --git a/feather/old/server/types/src/misc.rs b/feather/old/server/types/src/misc.rs index d0511d831..bd54c2f14 100644 --- a/feather/old/server/types/src/misc.rs +++ b/feather/old/server/types/src/misc.rs @@ -5,7 +5,7 @@ use feather_core::{ blocks::BlockKind, util::BlockPosition, }; -use fecs::{Entity, EntityBuilder, World}; +use fvane::{Entity, EntityBuilder, World}; pub type BumpVec<'bump, T> = bumpalo::collections::Vec<'bump, T>; diff --git a/feather/old/server/types/src/task.rs b/feather/old/server/types/src/task.rs index b61a2e7f5..68edde353 100644 --- a/feather/old/server/types/src/task.rs +++ b/feather/old/server/types/src/task.rs @@ -5,7 +5,7 @@ //! * All scheduled tasks will complete at some point. use crate::Game; -use fecs::World; +use fvane::World; use once_cell::sync::OnceCell; use parking_lot::Mutex; use std::future::Future; @@ -191,7 +191,7 @@ impl TaskManager { } /// System to run sync-queued tasks. -#[fecs::system] +#[fvane::system] pub fn run_sync_tasks(game: &mut Game, world: &mut World) { tasks().flush_sync(game, world); } diff --git a/feather/old/server/util/src/block.rs b/feather/old/server/util/src/block.rs index 21816e1b4..454ea6be1 100644 --- a/feather/old/server/util/src/block.rs +++ b/feather/old/server/util/src/block.rs @@ -22,7 +22,7 @@ use feather_core::blocks::{BlockId, BlockKind, Face}; use feather_core::chunk_map::chunk_relative_pos; use feather_core::util::BlockPosition; use feather_server_types::{BlockUpdateEvent, Game}; -use fecs::{EntityBuilder, World}; +use fvane::{EntityBuilder, World}; use std::cmp::max; use std::iter; @@ -67,7 +67,7 @@ fn notify_entity_for_block(block: BlockId, pos: BlockPosition) -> Option(event.player); diff --git a/feather/old/server/weather/src/lib.rs b/feather/old/server/weather/src/lib.rs index ff79114af..2fb8ce8d6 100644 --- a/feather/old/server/weather/src/lib.rs +++ b/feather/old/server/weather/src/lib.rs @@ -1,6 +1,6 @@ use feather_core::network::packets::ChangeGameState; use feather_server_types::{Game, Network, PlayerPreJoinEvent, Weather, WeatherChangeEvent}; -use fecs::{Entity, World}; +use fvane::{Entity, World}; use rand::Rng; const TICKS_DAY: i32 = 24_000; @@ -16,7 +16,7 @@ pub fn clear_weather(game: &mut Game) { set_weather(game, Weather::Clear, duration); } -#[fecs::system] +#[fvane::system] pub fn update_weather(game: &mut Game, world: &mut World) { if game.level.clear_weather_time >= 0 { game.level.clear_weather_time -= 1; @@ -96,12 +96,12 @@ pub fn set_weather(game: &mut Game, weather: Weather, duration: i32) -> Weather from } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_player_join_send_weather(event: &PlayerPreJoinEvent, game: &Game, world: &mut World) { send_weather(world, event.player, get_weather(game)); } -#[fecs::event_handler] +#[fvane::event_handler] pub fn on_weather_change_broadcast_weather( event: &WeatherChangeEvent, game: &mut Game, diff --git a/feather/plugin-host/Cargo.toml b/feather/plugin-host/Cargo.toml deleted file mode 100644 index b25394923..000000000 --- a/feather/plugin-host/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "feather-plugin-host" -version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" - -[dependencies] -ahash = "0.7" -anyhow = "1" -bincode = "1" -bumpalo = "3" -bytemuck = "1" -feather-base = { path = "../base" } -feather-common = { path = "../common" } -feather-ecs = { path = "../ecs" } -feather-plugin-host-macros = { path = "macros" } - -libloading = "0.7" -log = "0.4" -paste = "1" -quill-common = { path = "../../quill/common" } -quill-plugin-format = { path = "../../quill/plugin-format" } -serde = "1" -tempfile = "3" -vec-arena = "1" -wasmer = { version = "2", default-features = false, features = [ "jit" ] } -wasmer-wasi = { version = "2", default-features = false, features = [ "host-fs", "sys" ] } -serde_json = "1" - -[features] -llvm = [ "wasmer/llvm" ] -cranelift = [ "wasmer/cranelift" ] diff --git a/feather/plugin-host/macros/Cargo.toml b/feather/plugin-host/macros/Cargo.toml deleted file mode 100644 index eb89aeb1d..000000000 --- a/feather/plugin-host/macros/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "feather-plugin-host-macros" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[lib] -proc-macro = true - -[dependencies] -syn = { version = "1", features = ["full"] } -quote = "1" -proc-macro2 = "1" - -[dev-dependencies] -anyhow = "1" diff --git a/feather/plugin-host/macros/src/lib.rs b/feather/plugin-host/macros/src/lib.rs deleted file mode 100644 index f342e9060..000000000 --- a/feather/plugin-host/macros/src/lib.rs +++ /dev/null @@ -1,101 +0,0 @@ -use quote::{format_ident, quote}; -use syn::{FnArg, GenericArgument, PathSegment}; - -/// Annotates a function so that it implements -/// the NativeHostFunction trait. -#[proc_macro_attribute] -pub fn host_function( - _args: proc_macro::TokenStream, - input: proc_macro::TokenStream, -) -> proc_macro::TokenStream { - let input: syn::ItemFn = syn::parse_macro_input!(input); - - let ident = input.sig.ident.clone(); - let gateway_ident = format_ident!("{}_gateway", input.sig.ident); - let struct_ident = format_ident!("{}_struct", input.sig.ident); - - let args = input - .sig - .inputs - .iter() - .map(|arg| match arg { - FnArg::Receiver(_) => panic!("self functions are not supported"), - FnArg::Typed(arg) => arg.clone(), - }) - .collect::>(); - let args_idents: Vec<_> = args.iter().map(|arg| arg.pat.clone()).collect(); - let args_idents_without_cx: Vec<_> = args_idents.iter().skip(1).cloned().collect(); - let args_without_cx: Vec<_> = args.iter().skip(1).cloned().collect(); - - // Extract the inner return type from anyhow::Result. - let ret = match input.sig.output.clone() { - syn::ReturnType::Default => return_type_panic(), - syn::ReturnType::Type(_, ty) => match *ty { - syn::Type::Path(path) => { - let segments: Vec = path.path.segments.into_iter().collect(); - if segments[0].ident != "anyhow" { - return_type_panic(); - } - if segments[1].ident != "Result" { - return_type_panic(); - } - - let arg = segments[1].arguments.clone(); - match arg { - syn::PathArguments::AngleBracketed(inner) => { - match inner.args.first().unwrap() { - GenericArgument::Type(typ) => typ.clone(), - _ => return_type_panic(), - } - } - _ => return_type_panic(), - } - } - _ => return_type_panic(), - }, - }; - - let result = quote! { - #input - - extern "C" fn #gateway_ident(#(#args),*) -> #ret { - #ident(#(#args_idents),*).expect("host function panicked") - } - - #[allow(non_camel_case_types)] - pub struct #struct_ident; - - impl crate::host_function::NativeHostFunction for #struct_ident { - fn to_function_pointer(self) -> usize { - // Safety: see the Nomicon: https://rust-lang.github.io/unsafe-code-guidelines/layout/function-pointers.html#representation - // For all targets that Feather compiles to, function pointers - // have the same layout as a usize. - - unsafe { - std::mem::transmute(#gateway_ident as *const ()) - } - } - } - - impl crate::host_function::WasmHostFunction for #struct_ident { - fn to_wasm_function(self, store: &wasmer::Store, env: crate::env::PluginEnv) -> wasmer::Function { - wasmer::Function::new_native_with_env(store, env, |env: &crate::env::PluginEnv, #(#args_without_cx),*| { - let result: anyhow::Result<_> = #ident(&env.context, #(#args_idents_without_cx),*); - match result { - Ok(ret) => ret, - Err(e) => { - unsafe { - wasmer::raise_user_trap(e.into()) - } - } - } - }) - } - } - }; - result.into() -} - -fn return_type_panic() -> ! { - panic!("host functions must return an anyhow::Result") -} diff --git a/feather/plugin-host/src/context.rs b/feather/plugin-host/src/context.rs deleted file mode 100644 index 3e014ddcd..000000000 --- a/feather/plugin-host/src/context.rs +++ /dev/null @@ -1,433 +0,0 @@ -use std::{ - alloc::Layout, - cell::{Ref, RefMut}, - marker::PhantomData, - mem::size_of, - panic::AssertUnwindSafe, - ptr::NonNull, - sync::atomic::{AtomicBool, Ordering}, -}; - -use anyhow::anyhow; -use bytemuck::{Pod, Zeroable}; -use feather_common::Game; -use feather_ecs::EntityBuilder; -use quill_common::Component; -use serde::de::DeserializeOwned; -use vec_arena::Arena; -use wasmer::{FromToNativeWasmType, Instance}; - -use crate::{host_function::WasmHostFunction, thread_pinned::ThreadPinned, PluginId}; - -mod native; -mod wasm; - -/// Wraps a pointer into a plugin's memory space. -#[derive(Copy, Clone, PartialEq, Eq, Zeroable)] -#[repr(transparent)] -pub struct PluginPtr { - pub ptr: u64, - pub _marker: PhantomData<*const T>, -} - -impl PluginPtr { - pub fn as_native(&self) -> *const T { - self.ptr as usize as *const T - } - - /// # Safety - /// Adding `n` to this pointer - /// must produce a pointer within the same allocated - /// object. - #[must_use = "PluginPtr::add returns a new pointer"] - pub unsafe fn add(self, n: usize) -> Self { - Self { - ptr: self.ptr + (n * size_of::()) as u64, - _marker: self._marker, - } - } - - /// # Safety - /// The cast must be valid. - pub unsafe fn cast(self) -> PluginPtr { - PluginPtr { - ptr: self.ptr, - _marker: PhantomData, - } - } -} - -unsafe impl Pod for PluginPtr {} - -/// Wraps a pointer into a plugin's memory space. -#[derive(Copy, Clone, PartialEq, Eq, Zeroable)] -#[repr(transparent)] -pub struct PluginPtrMut { - pub ptr: u64, - pub _marker: PhantomData<*mut T>, -} - -impl PluginPtrMut { - pub fn as_native(&self) -> *mut T { - self.ptr as usize as *mut T - } - - /// # Safety - /// A null pointer must be valid in the context it is used. - pub unsafe fn null() -> Self { - Self { - ptr: 0, - _marker: PhantomData, - } - } - - /// # Safety - /// Adding `n` to this pointer - /// must produce a pointer within the same allocated - /// object. - #[must_use = "PluginPtrMut::add returns a new pointer"] - pub unsafe fn add(self, n: usize) -> Self { - Self { - ptr: self.ptr + (n * size_of::()) as u64, - _marker: self._marker, - } - } - - /// # Safety - /// The cast must be valid. - pub unsafe fn cast(self) -> PluginPtrMut { - PluginPtrMut { - ptr: self.ptr, - _marker: PhantomData, - } - } -} - -unsafe impl Pod for PluginPtrMut {} - -unsafe impl FromToNativeWasmType for PluginPtr { - type Native = i64; - - fn from_native(native: Self::Native) -> Self { - Self { - ptr: native as u64, - _marker: PhantomData, - } - } - - fn to_native(self) -> Self::Native { - self.ptr as i64 - } -} - -unsafe impl FromToNativeWasmType for PluginPtrMut { - type Native = i64; - - fn from_native(native: Self::Native) -> Self { - Self { - ptr: native as u64, - _marker: PhantomData, - } - } - - fn to_native(self) -> Self::Native { - self.ptr as i64 - } -} - -/// Context of a running plugin. -/// -/// Provides methods to access plugin memory, -/// invoke exported functions, and access the `Game`. -/// -/// This type abstracts over WASM or native plugins, -/// providing the same interface for both. -/// -/// # Safety -/// The `native` version of the plugin context -/// dereferences raw pointers. We assume pointers -/// passed by plugins are valid. Most functions -/// will cause undefined behavior if these constraints -/// are violated. -/// -/// We type-encode that a pointer originates from a plugin -/// using the `PluginPtr` structs. Methods that -/// dereference pointers take instances of these -/// structs. Since creating a `PluginPtr` is unsafe, -/// `PluginContext` methods don't have to be marked -/// unsafe. -/// -/// On WASM targets, the plugin is never trusted, -/// and pointer accesses are checked. Undefined behavior -/// can never occur as a result of malicious plugin input. -pub struct PluginContext { - inner: Inner, - - /// Whether the plugin is currently being invoked - /// on the main thread. - /// If this is `true`, then plugin functions are on the call stack. - invoking_on_main_thread: AtomicBool, - - /// The current `Game`. - /// - /// Set to `None` if `invoking_on_main_thread` is `false`. - /// Otherwise, must point to a valid game. The pointer - /// must be cleared after the plugin finishes executing - /// or we risk a dangling reference. - game: ThreadPinned>>, - - /// ID of the plugin. - id: PluginId, - - /// Active entity builders for the plugin. - pub entity_builders: ThreadPinned>, -} - -impl PluginContext { - /// Creates a new WASM plugin context. - pub fn new_wasm(id: PluginId) -> Self { - Self { - inner: Inner::Wasm(ThreadPinned::new(wasm::WasmPluginContext::new())), - invoking_on_main_thread: AtomicBool::new(false), - game: ThreadPinned::new(None), - id, - entity_builders: ThreadPinned::new(Arena::new()), - } - } - - /// Creates a new native plugin context. - pub fn new_native(id: PluginId) -> Self { - Self { - inner: Inner::Native(native::NativePluginContext::new()), - invoking_on_main_thread: AtomicBool::new(false), - game: ThreadPinned::new(None), - id, - entity_builders: ThreadPinned::new(Arena::new()), - } - } - - pub fn init_with_instance(&self, instance: &Instance) -> anyhow::Result<()> { - match &self.inner { - Inner::Wasm(w) => w.borrow_mut().init_with_instance(instance), - Inner::Native(_) => panic!("cannot initialize native plugin context"), - } - } - - /// Enters the plugin context, invoking a function inside the plugin. - /// - /// # Panics - /// Panics if we are already inside the plugin context. - /// Panics if not called on the main thread. - pub fn enter(&self, game: &mut Game, callback: impl FnOnce() -> R) -> R { - let was_already_entered = self.invoking_on_main_thread.swap(true, Ordering::SeqCst); - assert!(!was_already_entered, "cannot recursively invoke a plugin"); - - *self.game.borrow_mut() = Some(NonNull::from(game)); - - // If a panic occurs, we need to catch it so - // we clear `self.game`. Otherwise, we get - // a dangling pointer. - let result = std::panic::catch_unwind(AssertUnwindSafe(callback)); - - self.invoking_on_main_thread.store(false, Ordering::SeqCst); - *self.game.borrow_mut() = None; - - self.bump_reset(); - - result.unwrap() - } - - /// Gets a mutable reference to the `Game`. - /// - /// # Panics - /// Panics if the plugin is not currently being - /// invoked on the main thread. - pub fn game_mut(&self) -> RefMut { - let ptr = self.game.borrow_mut(); - RefMut::map(ptr, |ptr| { - let game_ptr = ptr.expect("plugin is not exeuctugin"); - - assert!(self.invoking_on_main_thread.load(Ordering::Relaxed)); - - // SAFETY: `game_ptr` points to a valid `Game` whenever - // the plugin is executing. If the plugin is not - // executing, then we already panicked when unwrapping `ptr`. - unsafe { &mut *game_ptr.as_ptr() } - }) - } - - /// Gets the plugin ID. - pub fn plugin_id(&self) -> PluginId { - self.id - } - - /// Accesses a byte slice in the plugin's memory space. - /// - /// # Safety - /// **WASM**: mutating plugin memory or invoking - /// plugin functions while this byte slice is - /// alive is undefined behavior. - /// **Native**: `ptr` must be valid. - pub unsafe fn deref_bytes(&self, ptr: PluginPtr, len: u32) -> anyhow::Result<&[u8]> { - match &self.inner { - Inner::Wasm(w) => { - let w = w.borrow(); - let bytes = w.deref_bytes(ptr, len)?; - Ok(unsafe { std::slice::from_raw_parts(bytes.as_ptr(), bytes.len()) }) - } - Inner::Native(n) => n.deref_bytes(ptr, len), - } - } - - /// Accesses a byte slice in the plugin's memory space. - /// - /// # Safety - /// **WASM**: accessing plugin memory or invoking - /// plugin functions while this byte slice is - /// alive is undefined behavior. - /// **Native**: `ptr` must be valid and the aliasing - /// rules must not be violated. - pub unsafe fn deref_bytes_mut( - &self, - ptr: PluginPtrMut, - len: u32, - ) -> anyhow::Result<&mut [u8]> { - match &self.inner { - Inner::Wasm(w) => { - let w = w.borrow(); - let bytes = w.deref_bytes_mut(ptr, len)?; - Ok(unsafe { std::slice::from_raw_parts_mut(bytes.as_mut_ptr(), bytes.len()) }) - } - Inner::Native(n) => n.deref_bytes_mut(ptr, len), - } - } - - /// Accesses a `Pod` value in the plugin's memory space. - pub fn read_pod(&self, ptr: PluginPtr) -> anyhow::Result { - // SAFETY: we do not return a reference to these - // bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), size_of::() as u32)?; - bytemuck::try_from_bytes(bytes) - .map_err(|_| anyhow!("badly aligned data")) - .map(|val| *val) - } - } - - /// Accesses a `bincode`-encoded value in the plugin's memory space. - pub fn read_bincode( - &self, - ptr: PluginPtr, - len: u32, - ) -> anyhow::Result { - // SAFETY: we do not return a reference to these - // bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), len)?; - bincode::deserialize(bytes).map_err(From::from) - } - } - - /// Accesses a `json`-encoded value in the plugin's memory space. - pub fn read_json( - &self, - ptr: PluginPtr, - len: u32, - ) -> anyhow::Result { - // SAFETY: we do not return a reference to these - // bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), len)?; - serde_json::from_slice(bytes).map_err(From::from) - } - } - - /// Deserializes a component value in the plugin's memory space. - pub fn read_component(&self, ptr: PluginPtr, len: u32) -> anyhow::Result { - // SAFETY: we do not return a reference to these - // bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), len)?; - T::from_bytes(bytes) - .ok_or_else(|| anyhow!("malformed component")) - .map(|(component, _bytes_read)| component) - } - } - - /// Reads a string from the plugin's memory space. - pub fn read_string(&self, ptr: PluginPtr, len: u32) -> anyhow::Result { - // SAFETY: we do not return a reference to these bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), len)?; - let string = std::str::from_utf8(bytes)?.to_owned(); - Ok(string) - } - } - - /// Reads a `Vec` from the plugin's memory space. - pub fn read_bytes(&self, ptr: PluginPtr, len: u32) -> anyhow::Result> { - // SAFETY: we do not return a reference to these bytes. - unsafe { - let bytes = self.deref_bytes(ptr.cast(), len)?; - Ok(bytes.to_owned()) - } - } - - /// Allocates some memory within the plugin's bump - /// allocator. - /// - /// The memory is reset after the plugin finishes - /// executing the current system. - pub fn bump_allocate(&self, layout: Layout) -> anyhow::Result> { - match &self.inner { - Inner::Wasm(w) => w.borrow().bump_allocate(layout), - Inner::Native(n) => n.bump_allocate(layout), - } - } - - /// Bump allocates some memory, then copies `data` into it. - pub fn bump_allocate_and_write_bytes(&self, data: &[u8]) -> anyhow::Result> { - let layout = Layout::array::(data.len())?; - let ptr = self.bump_allocate(layout)?; - - // SAFETY: our access to these bytes is isolated to the - // current function. `ptr` is valid as it was just allocated. - unsafe { - self.write_bytes(ptr, data)?; - } - - Ok(ptr) - } - - /// Writes `data` to `ptr`. - /// - /// # Safety - /// **WASM**: No concerns. - /// **NATIVE**: `ptr` must point to a slice - /// of at least `len` valid bytes. - pub unsafe fn write_bytes(&self, ptr: PluginPtrMut, data: &[u8]) -> anyhow::Result<()> { - let bytes = self.deref_bytes_mut(ptr, data.len() as u32)?; - bytes.copy_from_slice(data); - Ok(()) - } - - /// Writes a `Pod` type to `ptr`. - pub fn write_pod(&self, ptr: PluginPtrMut, value: T) -> anyhow::Result<()> { - // SAFETY: Unlike `write_bytes`, we know `ptr` is valid for values - // of type `T` because of its type parameter. - unsafe { self.write_bytes(ptr.cast(), bytemuck::bytes_of(&value)) } - } - - /// Deallocates all bump-allocated memory. - fn bump_reset(&self) { - match &self.inner { - Inner::Wasm(w) => w.borrow().bump_reset(), - Inner::Native(n) => n.bump_reset(), - } - } -} - -enum Inner { - Wasm(ThreadPinned), - Native(native::NativePluginContext), -} diff --git a/feather/plugin-host/src/context/native.rs b/feather/plugin-host/src/context/native.rs deleted file mode 100644 index 564c5d8fb..000000000 --- a/feather/plugin-host/src/context/native.rs +++ /dev/null @@ -1,49 +0,0 @@ -use std::{alloc::Layout, marker::PhantomData}; - -use crate::thread_pinned::ThreadPinned; - -use super::{PluginPtr, PluginPtrMut}; - -pub struct NativePluginContext { - bump: ThreadPinned>, -} - -impl NativePluginContext { - pub fn new() -> Self { - Self { - bump: ThreadPinned::new(Vec::new()), - } - } - - pub unsafe fn deref_bytes(&self, ptr: PluginPtr, len: u32) -> anyhow::Result<&[u8]> { - Ok(std::slice::from_raw_parts(ptr.as_native(), len as usize)) - } - - pub unsafe fn deref_bytes_mut( - &self, - ptr: PluginPtrMut, - len: u32, - ) -> anyhow::Result<&mut [u8]> { - Ok(std::slice::from_raw_parts_mut( - ptr.as_native(), - len as usize, - )) - } - - pub fn bump_allocate(&self, layout: Layout) -> anyhow::Result> { - let ptr = unsafe { std::alloc::alloc(layout) }; - self.bump.borrow_mut().push((ptr, layout)); - Ok(PluginPtrMut { - ptr: ptr as usize as u64, - _marker: PhantomData, - }) - } - - pub fn bump_reset(&self) { - for (ptr, layout) in self.bump.borrow_mut().drain(..) { - unsafe { - std::alloc::dealloc(ptr, layout); - } - } - } -} diff --git a/feather/plugin-host/src/context/wasm.rs b/feather/plugin-host/src/context/wasm.rs deleted file mode 100644 index 4b079fe01..000000000 --- a/feather/plugin-host/src/context/wasm.rs +++ /dev/null @@ -1,79 +0,0 @@ -use std::{alloc::Layout, marker::PhantomData}; - -use anyhow::bail; -use bump::WasmBump; -use wasmer::{Instance, LazyInit, Memory}; - -use crate::thread_pinned::ThreadPinned; - -use super::{PluginPtr, PluginPtrMut}; - -mod bump; - -#[derive(Default)] -pub struct WasmPluginContext { - bump: LazyInit>, - - memory: LazyInit, -} - -impl WasmPluginContext { - pub fn new() -> Self { - Self::default() - } - - pub fn init_with_instance(&mut self, instance: &Instance) -> anyhow::Result<()> { - let allocate = instance.exports.get_function("quill_allocate")?; - let deallocate = instance.exports.get_function("quill_deallocate")?; - - let bump = WasmBump::new(allocate.native()?, deallocate.native()?)?; - self.bump.initialize(ThreadPinned::new(bump)); - - self.memory - .initialize(instance.exports.get_memory("memory")?.clone()); - - Ok(()) - } - - pub unsafe fn deref_bytes(&self, ptr: PluginPtr, len: u32) -> anyhow::Result<&[u8]> { - let data = self.memory.get_ref().unwrap().data_unchecked(); - let offset = ptr.ptr as usize; - - if data.len() <= offset + len as usize { - bail!("pointer out of bounds"); - } - - Ok(&data[offset..(offset + len as usize)]) - } - - pub unsafe fn deref_bytes_mut( - &self, - ptr: PluginPtrMut, - len: u32, - ) -> anyhow::Result<&mut [u8]> { - let data = self.memory.get_ref().unwrap().data_unchecked_mut(); - let offset = ptr.ptr as usize; - - if data.len() <= offset + len as usize { - bail!("pointer out of bounds"); - } - - Ok(&mut data[offset..(offset + len as usize)]) - } - - pub fn bump_allocate(&self, layout: Layout) -> anyhow::Result> { - self.bump - .get_ref() - .unwrap() - .borrow_mut() - .alloc(layout) - .map(|wasm_ptr| PluginPtrMut { - ptr: wasm_ptr.offset() as u64, - _marker: PhantomData, - }) - } - - pub fn bump_reset(&self) { - let _ = self.bump.get_ref().unwrap().borrow_mut().reset(); - } -} diff --git a/feather/plugin-host/src/context/wasm/bump.rs b/feather/plugin-host/src/context/wasm/bump.rs deleted file mode 100644 index 6c97db69a..000000000 --- a/feather/plugin-host/src/context/wasm/bump.rs +++ /dev/null @@ -1,146 +0,0 @@ -use std::{alloc::Layout, cell::Cell}; - -use anyhow::Context; -use wasmer::{NativeFunc, WasmPtr}; - -const INITIAL_CHUNK_SIZE: usize = 2048; - -const CHUNK_ALIGN: usize = 16; - -fn round_up_to(n: usize, divisor: usize) -> Option { - debug_assert!(divisor > 0); - debug_assert!(divisor.is_power_of_two()); - Some(n.checked_add(divisor - 1)? & !(divisor - 1)) -} - -/// Host-controlled bump allocator for a WASM plugin. -/// See the Quill docs for why we use this. -/// -/// The implementation is mostly ported from the `bumpalo` -/// crate. -pub struct WasmBump { - /// Plugin function to allocate memory. Used - /// for the slow path when the current chunk - /// is exhausted. - allocate_function: NativeFunc<(u32, u32), u32>, - /// Plugin function to deallocate memory. - deallocate_function: NativeFunc<(u32, u32, u32)>, - /// Allocated chunks. - chunks: Vec, -} - -impl WasmBump { - /// Creates a new bump allocator. - pub fn new( - allocate_function: NativeFunc<(u32, u32), u32>, - deallocate_function: NativeFunc<(u32, u32, u32)>, - ) -> anyhow::Result { - let mut this = Self { - allocate_function, - deallocate_function, - chunks: Vec::new(), - }; - Ok(this) - } - - /// Allocates memory of the given layout - /// within the plugin's linear memory. - pub fn alloc(&mut self, layout: Layout) -> anyhow::Result> { - let offset = match self.alloc_fast_path(layout) { - Some(offset) => offset, - None => self.alloc_slow_path(layout)?, - }; - Ok(WasmPtr::new(offset)) - } - - fn alloc_fast_path(&self, layout: Layout) -> Option { - let chunk = self.chunks.last().expect(">0 chunks"); - let ptr = chunk.ptr.get(); - let start = chunk.start; - debug_assert!(start <= ptr); - - let ptr = ptr.checked_sub(layout.size() as u32)?; - let aligned_ptr = ptr & !(layout.align() as u32 - 1); - - if aligned_ptr >= start { - chunk.ptr.set(aligned_ptr); - Some(aligned_ptr) - } else { - None - } - } - - /// Slow path for allocation where we need to allocate - /// a new chunk. - fn alloc_slow_path(&mut self, layout: Layout) -> anyhow::Result { - let previous_size = self.chunks.last().expect(">0 chunks").layout.size(); - let new_chunk = self.allocate_chunk(Some(layout), Some(previous_size))?; - self.chunks.push(new_chunk); - Ok(self - .alloc_fast_path(layout) - .expect("new chunk can fit layout")) - } - - fn allocate_chunk( - &self, - min_layout: Option, - previous_size: Option, - ) -> anyhow::Result { - let mut new_size = match previous_size { - Some(previous_size) => previous_size - .checked_mul(2) - .context("chunk overflows usize")?, - None => INITIAL_CHUNK_SIZE, - }; - let mut align = CHUNK_ALIGN; - if let Some(min_layout) = min_layout { - align = align.max(min_layout.align()); - let requested_size = - round_up_to(min_layout.size(), align).context("allocation too large")?; - new_size = new_size.max(requested_size); - } - assert_eq!(align % CHUNK_ALIGN, 0); - assert_eq!(new_size % CHUNK_ALIGN, 0); - let layout = Layout::from_size_align(new_size, align).context("size or align is 0")?; - assert!(new_size >= previous_size.unwrap_or(0) * 2); - let start = self - .allocate_function - .call(layout.size() as u32, layout.align() as u32)?; - Ok(Chunk { - start, - layout, - ptr: Cell::new(start + new_size as u32), - }) - } - - /// Resets the bump allocator, freeing - /// all allocated memory. - pub fn reset(&mut self) -> anyhow::Result<()> { - // Free all but the last chunk. - for chunk in self.chunks.drain(..self.chunks.len()) { - self.deallocate_function.call( - chunk.start, - chunk.layout.size() as u32, - chunk.layout.align() as u32, - )?; - } - - // Allocate initial chunk - let chunk = self.allocate_chunk(None, None)?; - self.chunks.push(chunk); - - Ok(()) - } -} - -/// A chunk of memory in the bump allocator. -struct Chunk { - /// Offset into linear memory of the start - /// of this chunk. - start: u32, - /// Layout of the chunk. - layout: Layout, - /// Pointer to the next available byte plus one - /// in the chunk. Starts at the end of the chunk. - ptr: Cell, -} diff --git a/feather/plugin-host/src/env.rs b/feather/plugin-host/src/env.rs deleted file mode 100644 index c7bc01ba9..000000000 --- a/feather/plugin-host/src/env.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::sync::Arc; - -use wasmer::{ExportError, HostEnvInitError, Instance, WasmerEnv}; - -use crate::context::PluginContext; - -/// The [`WasmerEnv`] passed to host calls. -#[derive(Clone)] -pub struct PluginEnv { - pub context: Arc, -} - -impl WasmerEnv for PluginEnv { - fn init_with_instance(&mut self, instance: &Instance) -> Result<(), HostEnvInitError> { - self.context - .init_with_instance(instance) - .map_err(|e| wasmer::HostEnvInitError::Export(ExportError::Missing(e.to_string())))?; - Ok(()) - } -} diff --git a/feather/plugin-host/src/host_calls.rs b/feather/plugin-host/src/host_calls.rs deleted file mode 100644 index 91c0109f4..000000000 --- a/feather/plugin-host/src/host_calls.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! Implements all host calls defined in the `quill-sys` crate. - -use std::collections::HashMap; -use std::sync::Arc; - -use paste::paste; - -use crate::env::PluginEnv; -use crate::host_function::{NativeHostFunction, WasmHostFunction}; - -mod block; -mod component; -mod entity; -mod entity_builder; -mod event; -mod plugin_message; -mod query; -mod system; - -macro_rules! host_calls { - ( - $($name:literal => $function:ident),* $(,)? - ) => { - pub fn generate_vtable() -> HashMap<&'static str, usize> { - let mut vtable = HashMap::new(); - $( - paste! { - vtable.insert($name, [< $function _struct >].to_function_pointer()); - } - )* - vtable - } - - pub fn generate_import_object(store: &wasmer::Store, env: &PluginEnv) -> wasmer::ImportObject { - $( - paste! { - let $function = [< $function _struct >].to_wasm_function(store, env.clone()); - } - )* - wasmer::imports! { - "quill_01" => {$( - $name => $function, - )*} - } - } - } -} - -use block::*; -use component::*; -use entity::*; -use entity_builder::*; -use event::*; -use plugin_message::*; -use query::*; -use system::*; - -host_calls! { - "register_system" => register_system, - "entity_get_component" => entity_get_component, - "entity_set_component" => entity_set_component, - "entity_add_event" => entity_add_event, - "add_event" => add_event, - "entity_builder_new_empty" => entity_builder_new_empty, - "entity_builder_new" => entity_builder_new, - "entity_builder_add_component" => entity_builder_add_component, - "entity_builder_finish" => entity_builder_finish, - "entity_query" => entity_query, - "entity_exists" => entity_exists, - "entity_send_message" => entity_send_message, - "entity_send_title" => entity_send_title, - "block_get" => block_get, - "block_set" => block_set, - "block_fill_chunk_section" => block_fill_chunk_section, - "plugin_message_send" => plugin_message_send, -} diff --git a/feather/plugin-host/src/host_calls/block.rs b/feather/plugin-host/src/host_calls/block.rs deleted file mode 100644 index cc1f14b8b..000000000 --- a/feather/plugin-host/src/host_calls/block.rs +++ /dev/null @@ -1,42 +0,0 @@ -use std::convert::TryInto; - -use feather_base::{BlockId, BlockPosition, ChunkPosition}; -use feather_plugin_host_macros::host_function; -use quill_common::block::BlockGetResult; - -use crate::context::PluginContext; - -/// NB: `u32` has the same layout as `BlockGetResult`. -#[host_function] -pub fn block_get(cx: &PluginContext, x: i32, y: i32, z: i32) -> anyhow::Result { - let pos = BlockPosition::new(x, y, z).try_into()?; - - let block = cx.game_mut().block(pos); - let result = BlockGetResult::new(block.map(BlockId::vanilla_id)); - Ok(result.to_u32()) -} - -#[host_function] -pub fn block_set(cx: &PluginContext, x: i32, y: i32, z: i32, block_id: u16) -> anyhow::Result { - let pos = BlockPosition::new(x, y, z).try_into()?; - let block = BlockId::from_vanilla_id(block_id); - - let was_successful = cx.game_mut().set_block(pos, block); - Ok(was_successful as u32) -} - -#[host_function] -pub fn block_fill_chunk_section( - cx: &PluginContext, - chunk_x: i32, - section_y: u32, - chunk_z: i32, - block_id: u16, -) -> anyhow::Result { - let chunk_pos = ChunkPosition::new(chunk_x, chunk_z); - let block = BlockId::from_vanilla_id(block_id); - let was_successful = cx - .game_mut() - .fill_chunk_section(chunk_pos, section_y as usize, block); - Ok(was_successful as u32) -} diff --git a/feather/plugin-host/src/host_calls/component.rs b/feather/plugin-host/src/host_calls/component.rs deleted file mode 100644 index b9722255d..000000000 --- a/feather/plugin-host/src/host_calls/component.rs +++ /dev/null @@ -1,99 +0,0 @@ -use anyhow::Context; -use feather_ecs::Entity; -use feather_plugin_host_macros::host_function; -use quill_common::{component::ComponentVisitor, HostComponent}; - -use crate::context::{PluginContext, PluginPtr, PluginPtrMut}; - -struct GetComponentVisitor<'a> { - cx: &'a PluginContext, - entity: Entity, -} - -impl<'a> ComponentVisitor, u32)>> for GetComponentVisitor<'a> { - fn visit(self) -> anyhow::Result<(PluginPtrMut, u32)> { - let game = self.cx.game_mut(); - let component = match game.ecs.get::(self.entity) { - Ok(c) => c, - Err(_) => return Ok((unsafe { PluginPtrMut::null() }, 0)), - }; - let bytes = component.to_cow_bytes(); - let ptr = self.cx.bump_allocate_and_write_bytes(&bytes)?; - - Ok((ptr, bytes.len() as u32)) - } -} - -#[host_function] -pub fn entity_get_component( - cx: &PluginContext, - entity: u64, - component: u32, - bytes_ptr_ptr: PluginPtrMut>, - bytes_len_ptr: PluginPtrMut, -) -> anyhow::Result<()> { - let component = HostComponent::from_u32(component).context("invalid component")?; - let entity = Entity::from_bits(entity); - let visitor = GetComponentVisitor { cx, entity }; - let (bytes_ptr, bytes_len) = component.visit(visitor)?; - - cx.write_pod(bytes_ptr_ptr, bytes_ptr)?; - cx.write_pod(bytes_len_ptr, bytes_len)?; - - Ok(()) -} - -pub(crate) struct InsertComponentVisitor<'a> { - pub cx: &'a PluginContext, - pub bytes_ptr: PluginPtr, - pub bytes_len: u32, - pub action: SetComponentAction, -} - -pub(crate) enum SetComponentAction { - SetComponent(Entity), - AddEntityEvent(Entity), - AddEvent, -} - -impl<'a> ComponentVisitor> for InsertComponentVisitor<'a> { - fn visit(self) -> anyhow::Result<()> { - let component = self - .cx - .read_component::(self.bytes_ptr, self.bytes_len)?; - let mut game = self.cx.game_mut(); - - match self.action { - SetComponentAction::SetComponent(entity) => { - let _ = game.ecs.insert(entity, component); - } - SetComponentAction::AddEntityEvent(entity) => { - let _ = game.ecs.insert_entity_event(entity, component); - } - SetComponentAction::AddEvent => { - game.ecs.insert_event(component); - } - } - - Ok(()) - } -} - -#[host_function] -pub fn entity_set_component( - cx: &PluginContext, - entity: u64, - component: u32, - bytes_ptr: PluginPtr, - bytes_len: u32, -) -> anyhow::Result<()> { - let entity = Entity::from_bits(entity); - let component = HostComponent::from_u32(component).context("invalid component")?; - let visitor = InsertComponentVisitor { - cx, - bytes_ptr, - bytes_len, - action: SetComponentAction::SetComponent(entity), - }; - component.visit(visitor) -} diff --git a/feather/plugin-host/src/host_calls/entity.rs b/feather/plugin-host/src/host_calls/entity.rs deleted file mode 100644 index 0224f6a0c..000000000 --- a/feather/plugin-host/src/host_calls/entity.rs +++ /dev/null @@ -1,39 +0,0 @@ -use feather_base::Text; -use feather_common::chat::{ChatKind, ChatMessage}; -use feather_ecs::Entity; -use feather_plugin_host_macros::host_function; - -use crate::context::{PluginContext, PluginPtr}; - -#[host_function] -pub fn entity_exists(cx: &PluginContext, entity: u64) -> anyhow::Result { - Ok(cx.game_mut().ecs.entity(Entity::from_bits(entity)).is_ok()).map(|b| b as u32) -} - -#[host_function] -pub fn entity_send_message( - cx: &PluginContext, - entity: u64, - message_ptr: PluginPtr, - message_len: u32, -) -> anyhow::Result<()> { - let message = cx.read_json(message_ptr, message_len)?; - let entity = Entity::from_bits(entity); - let _ = cx - .game_mut() - .send_message(entity, ChatMessage::new(ChatKind::System, message)); - Ok(()) -} - -#[host_function] -pub fn entity_send_title( - cx: &PluginContext, - entity: u64, - title_ptr: PluginPtr, - title_len: u32, -) -> anyhow::Result<()> { - let title = cx.read_json(title_ptr, title_len)?; - let entity = Entity::from_bits(entity); - cx.game_mut().send_title(entity, title); - Ok(()) -} diff --git a/feather/plugin-host/src/host_calls/entity_builder.rs b/feather/plugin-host/src/host_calls/entity_builder.rs deleted file mode 100644 index 3274ec0fe..000000000 --- a/feather/plugin-host/src/host_calls/entity_builder.rs +++ /dev/null @@ -1,89 +0,0 @@ -use anyhow::{bail, Context}; -use feather_base::Position; -use feather_plugin_host_macros::host_function; -use quill_common::{component::ComponentVisitor, HostComponent}; - -use crate::context::{PluginContext, PluginPtr}; - -#[host_function] -pub fn entity_builder_new_empty(cx: &PluginContext) -> anyhow::Result { - let builder = cx.game_mut().create_empty_entity_builder(); - let id = cx.entity_builders.borrow_mut().insert(builder); - - if id > u32::MAX as usize { - bail!("created too many entity builders!"); - } - - Ok(id as u32) -} - -#[host_function] -pub fn entity_builder_new( - cx: &PluginContext, - position: PluginPtr, - entity_init_ptr: PluginPtr, - entity_init_len: u32, -) -> anyhow::Result { - let position = cx.read_pod(position)?; - let init = cx.read_bincode(entity_init_ptr, entity_init_len)?; - let builder = cx.game_mut().create_entity_builder(position, init); - let id = cx.entity_builders.borrow_mut().insert(builder); - - if id > u32::MAX as usize { - bail!("created too many entity builders"); - } - - Ok(id as u32) -} - -struct BuilderAddComponentVisitor<'a> { - builder: u32, - cx: &'a PluginContext, - bytes_ptr: PluginPtr, - bytes_len: u32, -} - -impl<'a> ComponentVisitor> for BuilderAddComponentVisitor<'a> { - fn visit(self) -> anyhow::Result<()> { - let component = self - .cx - .read_component::(self.bytes_ptr, self.bytes_len)?; - self.cx - .entity_builders - .borrow_mut() - .get_mut(self.builder as usize) - .context("invalid entity builder")? - .add(component); - Ok(()) - } -} - -#[host_function] -pub fn entity_builder_add_component( - cx: &PluginContext, - builder: u32, - component: u32, - bytes_ptr: PluginPtr, - bytes_len: u32, -) -> anyhow::Result<()> { - let component = HostComponent::from_u32(component).context("invalid component")?; - let visitor = BuilderAddComponentVisitor { - builder, - cx, - bytes_ptr, - bytes_len, - }; - component.visit(visitor) -} - -#[host_function] -pub fn entity_builder_finish(cx: &PluginContext, builder: u32) -> anyhow::Result { - let builder = cx - .entity_builders - .borrow_mut() - .remove(builder as usize) - .context("invalid entity builder")?; - - let entity = cx.game_mut().spawn_entity(builder); - Ok(entity.to_bits()) -} diff --git a/feather/plugin-host/src/host_calls/event.rs b/feather/plugin-host/src/host_calls/event.rs deleted file mode 100644 index 649ffce65..000000000 --- a/feather/plugin-host/src/host_calls/event.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::context::{PluginContext, PluginPtr}; -use crate::host_calls::component::{InsertComponentVisitor, SetComponentAction}; -use anyhow::Context; -use feather_ecs::Entity; -use feather_plugin_host_macros::host_function; -use quill_common::HostComponent; - -#[host_function] -pub fn entity_add_event( - cx: &PluginContext, - entity: u64, - event: u32, - bytes_ptr: PluginPtr, - bytes_len: u32, -) -> anyhow::Result<()> { - let entity = Entity::from_bits(entity); - let event = HostComponent::from_u32(event).context("invalid component")?; - let visitor = InsertComponentVisitor { - cx, - bytes_ptr, - bytes_len, - action: SetComponentAction::AddEntityEvent(entity), - }; - event.visit(visitor) -} - -#[host_function] -pub fn add_event( - cx: &PluginContext, - event: u32, - bytes_ptr: PluginPtr, - bytes_len: u32, -) -> anyhow::Result<()> { - let event = HostComponent::from_u32(event).context("invalid component")?; - let visitor = InsertComponentVisitor { - cx, - bytes_ptr, - bytes_len, - action: SetComponentAction::AddEvent, - }; - event.visit(visitor) -} diff --git a/feather/plugin-host/src/host_calls/plugin_message.rs b/feather/plugin-host/src/host_calls/plugin_message.rs deleted file mode 100644 index 55108733c..000000000 --- a/feather/plugin-host/src/host_calls/plugin_message.rs +++ /dev/null @@ -1,24 +0,0 @@ -use feather_common::events::PluginMessageEvent; -use feather_ecs::Entity; -use feather_plugin_host_macros::host_function; - -use crate::context::{PluginContext, PluginPtr}; - -#[host_function] -pub fn plugin_message_send( - cx: &PluginContext, - entity: u64, - channel_ptr: PluginPtr, - channel_len: u32, - data_ptr: PluginPtr, - data_len: u32, -) -> anyhow::Result<()> { - let channel = cx.read_string(channel_ptr, channel_len)?; - let data = cx.read_bytes(data_ptr, data_len)?; - - let entity = Entity::from_bits(entity); - let event = PluginMessageEvent { channel, data }; - cx.game_mut().ecs.insert_entity_event(entity, event)?; - - Ok(()) -} diff --git a/feather/plugin-host/src/host_calls/query.rs b/feather/plugin-host/src/host_calls/query.rs deleted file mode 100644 index f52a85f4b..000000000 --- a/feather/plugin-host/src/host_calls/query.rs +++ /dev/null @@ -1,154 +0,0 @@ -//! Implements the `entity_query` host call. - -use std::{alloc::Layout, any::TypeId, mem::size_of, ptr}; - -use anyhow::Context; -use feather_ecs::{DynamicQuery, DynamicQueryTypes, Ecs}; -use feather_plugin_host_macros::host_function; -use quill_common::{ - component::{ComponentVisitor, SerializationMethod}, - entity::QueryData, - Component, EntityId, HostComponent, PointerMut, -}; - -use crate::context::{PluginContext, PluginPtr, PluginPtrMut}; - -#[host_function] -pub fn entity_query( - cx: &PluginContext, - components_ptr: PluginPtr, - components_len: u32, - query_data_out: PluginPtrMut, -) -> anyhow::Result<()> { - let mut components = Vec::with_capacity(components_len as usize); - for i in 0..components_len { - let ptr = unsafe { components_ptr.add(i as usize) }; - let id = cx.read_pod(ptr)?; - - let component = HostComponent::from_u32(id).context("bad component type")?; - components.push(component); - } - - let game = cx.game_mut(); - let query_data = create_query_data(cx, &game.ecs, &components)?; - cx.write_pod(query_data_out, query_data)?; - - Ok(()) -} - -struct WrittenComponentData { - pointer: PluginPtrMut, - len: u32, -} - -/// `ComponentVisitor` implementation used to write -/// component data to plugin memory. -struct WriteComponentsVisitor<'a> { - query: &'a DynamicQuery<'a>, - cx: &'a PluginContext, - num_entities: usize, -} - -impl<'a> ComponentVisitor> for WriteComponentsVisitor<'a> { - fn visit(self) -> anyhow::Result { - let components = self.query.iter_component_slices(TypeId::of::()); - - // Write each component. - // We use a different strategy depending - // on how the component is serialized. - let (buffer, len) = match T::SERIALIZATION_METHOD { - SerializationMethod::Bytemuck => { - // Allocate enough memory to hold all the components. - let layout = Layout::array::(self.num_entities)?; - let buffer = self.cx.bump_allocate(layout)?; - - if size_of::() != 0 { - // Copy the components into the buffer. - let mut byte_index = 0; - for component_slice in components { - for component in component_slice.as_slice::() { - let bytes = component.as_bytes(); - - unsafe { - self.cx.write_bytes(buffer.add(byte_index), bytes)?; - } - - byte_index += bytes.len(); - } - } - } - - (buffer, self.num_entities * size_of::()) - } - SerializationMethod::Bincode => { - // Memory will need to be allocated dynamically, - // but we can approximate a minimum capacity. - let mut bytes = Vec::with_capacity(self.num_entities * size_of::()); - - // Write components into the buffer. - for component_slice in components { - for component in component_slice.as_slice::() { - component.to_bytes(&mut bytes); - } - } - - let buffer = self.cx.bump_allocate_and_write_bytes(&bytes)?; - (buffer, bytes.len()) - } - }; - - Ok(WrittenComponentData { - pointer: buffer, - len: len as u32, - }) - } -} - -fn create_query_data( - cx: &PluginContext, - ecs: &Ecs, - types: &[HostComponent], -) -> anyhow::Result { - let query_types: Vec = types.iter().copied().map(HostComponent::type_id).collect(); - let query = ecs.query_dynamic(DynamicQueryTypes::new(&query_types, &[])); - - let num_entities = query.iter_entities().count(); - if num_entities == 0 { - return Ok(QueryData { - num_entities: 0, - entities_ptr: PointerMut::new(ptr::null_mut()), - component_ptrs: PointerMut::new(ptr::null_mut()), - component_lens: PointerMut::new(ptr::null_mut()), - }); - } - - let component_ptrs = cx.bump_allocate(Layout::array::>(types.len())?)?; - let component_lens = cx.bump_allocate(Layout::array::(types.len())?)?; - for (i, &typ) in types.iter().enumerate() { - let data = typ.visit(WriteComponentsVisitor { - query: &query, - cx, - num_entities, - })?; - - unsafe { - cx.write_pod(component_ptrs.cast().add(i), data.pointer)?; - cx.write_pod(component_lens.cast().add(i), data.len)?; - } - } - - let entities_ptr = cx.bump_allocate(Layout::array::(num_entities)?)?; - for (i, entity) in query.iter_entities().enumerate() { - let bits = entity.to_bits(); - unsafe { - cx.write_pod(entities_ptr.cast().add(i), bits)?; - } - } - - Ok(QueryData { - num_entities: num_entities as u64, - entities_ptr: PointerMut::new(entities_ptr.as_native().cast()), - component_ptrs: PointerMut::new(component_ptrs.as_native().cast()), - component_lens: PointerMut::new(component_lens.as_native().cast()), - }) -} diff --git a/feather/plugin-host/src/host_calls/system.rs b/feather/plugin-host/src/host_calls/system.rs deleted file mode 100644 index a1c4c0635..000000000 --- a/feather/plugin-host/src/host_calls/system.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![allow(warnings)] - -use std::{cell::RefCell, rc::Rc}; - -use feather_common::Game; -use feather_ecs::{HasResources, SysResult}; -use feather_plugin_host_macros::host_function; - -use crate::{ - context::{PluginContext, PluginPtr, PluginPtrMut}, - PluginId, PluginManager, -}; - -#[host_function] -pub fn register_system( - cx: &PluginContext, - data_ptr: PluginPtrMut, - name_ptr: PluginPtr, - name_len: u32, -) -> anyhow::Result<()> { - let name = cx.read_string(name_ptr, name_len)?; - - let game = cx.game_mut(); - game.system_executor - .borrow_mut() - .add_system_with_name(plugin_system(cx.plugin_id(), data_ptr), &name); - - Ok(()) -} - -fn plugin_system(id: PluginId, data_ptr: PluginPtrMut) -> impl FnMut(&mut Game) -> SysResult { - move |game: &mut Game| { - let plugin_manager = Rc::clone(&*game.resources.get::>>()?); - let plugin_manager = plugin_manager.borrow(); - let plugin = plugin_manager.plugin(id); - if let Some(plugin) = plugin { - plugin.run_system(game, data_ptr)?; - } - - Ok(()) - } -} diff --git a/feather/plugin-host/src/host_function.rs b/feather/plugin-host/src/host_function.rs deleted file mode 100644 index ed37b011d..000000000 --- a/feather/plugin-host/src/host_function.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::{any::Any, marker::PhantomData, sync::Arc}; - -use wasmer::{FromToNativeWasmType, Store, WasmTypeList, WasmerEnv}; - -use crate::context::{PluginContext, PluginPtr, PluginPtrMut}; -use crate::env::PluginEnv; - -/// Signature of a host function. -pub trait WasmHostFunction { - /// Creates a WASM function given the plugin environment. - fn to_wasm_function(self, store: &Store, env: PluginEnv) -> wasmer::Function; -} - -/// Signature of a host function for native. -/// All HostFunction types also implement NativeHostFunction. -/// -/// This trait is implemented by the `#[host_function]` -/// macro attribute. -pub trait NativeHostFunction { - /// Creates a raw function pointer to be included - /// in the plugin's vtable. - fn to_function_pointer(self) -> usize; -} diff --git a/feather/plugin-host/src/lib.rs b/feather/plugin-host/src/lib.rs deleted file mode 100644 index 4167b6457..000000000 --- a/feather/plugin-host/src/lib.rs +++ /dev/null @@ -1,149 +0,0 @@ -//! Feather's implementation of the [Quill API](https://github.com/feather-rs/quill). -//! -//! Uses [`wasmer`](https://docs.rs/wasmer) to run WebAssembly plugins -//! in a sandbox. - -#![allow(warnings)] // TEMP - -use std::{ - fs, - path::Path, - sync::atomic::{AtomicUsize, Ordering}, -}; - -use ahash::AHashMap; -use anyhow::Context; -use env::PluginEnv; -use feather_common::Game; -use plugin::Plugin; -use quill_plugin_format::{PluginFile, PluginMetadata}; -use vec_arena::Arena; -use wasmer::{ - ChainableNamedResolver, CompilerConfig, ExportError, Features, Function, ImportObject, - Instance, Module, Store, JIT, -}; -use wasmer_wasi::{WasiEnv, WasiState, WasiVersion}; - -mod context; -mod env; -mod host_calls; -mod host_function; -mod plugin; -mod thread_pinned; -mod wasm_ptr_ext; - -/// Features enabled for WASM plugins -const WASM_FEATURES: Features = Features { - threads: true, - reference_types: false, - simd: true, - bulk_memory: true, - multi_value: false, - tail_call: false, - module_linking: false, - multi_memory: false, - memory64: false, - exceptions: true, -}; - -/// Unique ID of a plugin. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -pub struct PluginId(usize); - -/// Resource storing all enabled plugins plus the WebAssembly VM. -pub struct PluginManager { - plugins: Arena, - - store: wasmer::Store, -} - -impl Default for PluginManager { - fn default() -> Self { - Self::new() - } -} - -impl PluginManager { - /// Creates a plugin manager with no plugins. - pub fn new() -> Self { - let compiler_config = compiler_config(); - let engine_config = JIT::new(compiler_config).features(WASM_FEATURES); - let engine = engine_config.engine(); - let store = Store::new(&engine); - - Self { - plugins: Arena::new(), - store, - } - } - - /// Loads all plugins in the given directory. - pub fn load_dir(&mut self, game: &mut Game, dir: impl AsRef) -> anyhow::Result<()> { - let dir = dir.as_ref(); - if !dir.exists() { - return Ok(()); - } - - for entry in std::fs::read_dir(dir)? { - let entry = entry?; - if entry.file_type()?.is_dir() { - continue; - } - - if entry.path().extension() != Some("plugin".as_ref()) { - continue; - } - - let bytes = fs::read(entry.path())?; - self.load(game, &bytes).with_context(|| { - format!("failed to load plugin from {}", entry.path().display()) - })?; - } - - Ok(()) - } - - /// Loads and enables a plugin from the given plugin file bytes. - /// - /// Returns the ID of the loaded plugin. - pub fn load(&mut self, game: &mut Game, file: &[u8]) -> anyhow::Result { - let file = PluginFile::decode(file).context("malformed plugin file")?; - - let id = PluginId(self.plugins.next_vacant()); - let mut plugin = Plugin::load(self, &file, id)?; - - plugin.enable(game).context("failed to enable plugin")?; - - self.plugins.insert(plugin); - - Ok(id) - } - - /// Gets the plugin with the given ID, - /// or `None` if it has been unloaded. - pub fn plugin(&self, id: PluginId) -> Option<&Plugin> { - self.plugins.get(id.0) - } - - /// Mutably gets the plugin with the given ID, - /// or `None` if it has been unloaded. - pub fn plugin_mut(&mut self, id: PluginId) -> Option<&mut Plugin> { - self.plugins.get_mut(id.0) - } -} - -#[cfg(all(feature = "cranelift", not(feature = "llvm")))] -fn compiler_config() -> impl CompilerConfig { - use wasmer::{Cranelift, CraneliftOptLevel}; - let mut cfg = Cranelift::new(); - cfg.opt_level(CraneliftOptLevel::Speed); - cfg -} - -#[cfg(feature = "llvm")] -fn compiler_config() -> impl CompilerConfig { - use wasmer::{LLVMOptLevel, LLVM}; - let mut cfg = LLVM::new(); - cfg.opt_level(LLVMOptLevel::Aggressive); - cfg -} diff --git a/feather/plugin-host/src/plugin.rs b/feather/plugin-host/src/plugin.rs deleted file mode 100644 index 9390e3a65..000000000 --- a/feather/plugin-host/src/plugin.rs +++ /dev/null @@ -1,102 +0,0 @@ -use std::sync::Arc; - -use anyhow::bail; -use feather_common::Game; -use quill_plugin_format::{PluginFile, PluginMetadata, PluginTarget, Triple}; - -use crate::{ - context::{PluginContext, PluginPtrMut}, - PluginId, PluginManager, -}; - -mod native; -mod wasm; - -pub struct Plugin { - inner: Inner, - context: Arc, - metadata: PluginMetadata, -} - -impl Plugin { - /// Loads a plugin from the given plugin file. - /// - /// Does not enable the plugin. - pub fn load(manager: &PluginManager, file: &PluginFile, id: PluginId) -> anyhow::Result { - let plugin_type = match &file.metadata().target { - PluginTarget::Wasm => "WebAssembly", - PluginTarget::Native { .. } => "native", - }; - log::info!( - "Loading {} plugin {} version {}", - plugin_type, - file.metadata().name, - file.metadata().version - ); - - let (inner, context) = match &file.metadata().target { - PluginTarget::Wasm => { - let context = Arc::new(PluginContext::new_wasm(id)); - let plugin = - wasm::WasmPlugin::load(manager, &context, file.module(), file.metadata())?; - (Inner::Wasm(plugin), context) - } - PluginTarget::Native { target_triple } => { - if target_triple != &Triple::host() { - bail!( - "native plguin was built for {}, but this system has target {}", - target_triple, - Triple::host() - ); - } - let plugin = native::NativePlugin::load(file.module())?; - let context = PluginContext::new_native(id); - (Inner::Native(plugin), Arc::new(context)) - } - }; - - Ok(Self { - inner, - context, - metadata: file.metadata().clone(), - }) - } - - /// Enables the plugin. - /// - /// # Panics - /// Panics if called more than once. - pub fn enable(&mut self, game: &mut Game) -> anyhow::Result<()> { - let context = Arc::clone(&self.context); - - self.context.enter(game, || match &self.inner { - Inner::Wasm(w) => w.enable(), - Inner::Native(n) => { - n.enable(context); - Ok(()) - } - })?; - - log::info!("Enabled plugin {} ", self.metadata.name); - Ok(()) - } - - /// Runs a plugin system. - /// - /// `data` must be the data pointer passed - /// to the `register_system` host call. - pub fn run_system(&self, game: &mut Game, data: PluginPtrMut) -> anyhow::Result<()> { - self.context.enter(game, || match &self.inner { - Inner::Wasm(w) => w.run_system(data), - Inner::Native(n) => { - n.run_system(data); - Ok(()) - } - }) - } -} - -enum Inner { - Wasm(wasm::WasmPlugin), - Native(native::NativePlugin), -} diff --git a/feather/plugin-host/src/plugin/native.rs b/feather/plugin-host/src/plugin/native.rs deleted file mode 100644 index 48601ffe1..000000000 --- a/feather/plugin-host/src/plugin/native.rs +++ /dev/null @@ -1,92 +0,0 @@ -use std::{io::Write, sync::Arc}; - -use anyhow::Context; -use libloading::Library; -use tempfile::{NamedTempFile, TempPath}; - -use crate::context::{PluginContext, PluginPtrMut}; - -/// A native plugin loaded from a shared library -pub struct NativePlugin { - /// The tempfile containing the shared library. - tempfile: TempPath, - - /// The plugin's shared library. - library: Library, - - /// The plugin's exported quill_setup function. - /// - /// Parameters: - /// 1. Host context pointer - /// 2. Pointer to bincode-encoded vtable - /// 3. Length of bincode-encoded vtable - enable: unsafe extern "C" fn(*const u8, *const u8, usize), - - /// The plugin's exported quill_run_system function. - /// - /// Parameters: - /// 1. Plugin data pointer for this system - run_system: unsafe extern "C" fn(*mut u8), -} - -impl NativePlugin { - pub fn load(module: &[u8]) -> anyhow::Result { - // Libraries have to be loaded from files, so - // we'll create a tempfile containing the module bytes. - let mut tempfile = NamedTempFile::new()?; - tempfile.write_all(module)?; - tempfile.flush()?; - let path = tempfile.into_temp_path(); - - // SAFETY: Library::new() is unsafe because - // the loaded module can execute arbitrary - // code. Since native plugins are trusted, - // this is sound. - let library = unsafe { Library::new(&path)? }; - - // SAFETY: these functions will not be accessed after the plugin is unloaded. - let enable = unsafe { - *library - .get("quill_setup".as_bytes()) - .context("plugin is missing quill_setup export")? - }; - let run_system = unsafe { - *library - .get("quill_run_system".as_bytes()) - .context("plugin is missing quill_run_system export")? - }; - - Ok(Self { - tempfile: path, - library, - enable, - run_system, - }) - } - - pub fn enable(&self, context: Arc) { - let vtable = self.generate_vtable(); - let context_ptr = Arc::as_ptr(&context); - // Ensure context stays alive - std::mem::forget(context); - - // SAFETY: we assume the plugin is sound. - unsafe { - (self.enable)( - context_ptr.cast::(), - vtable.as_ptr(), - vtable.len() as usize, - ) - } - } - - fn generate_vtable(&self) -> Vec { - let vtable = crate::host_calls::generate_vtable(); - bincode::serialize(&vtable).expect("can't serialize vtable") - } - - pub fn run_system(&self, data: PluginPtrMut) { - // SAFETY: we assume the plugin is sound. - unsafe { (self.run_system)(data.as_native()) } - } -} diff --git a/feather/plugin-host/src/plugin/wasm.rs b/feather/plugin-host/src/plugin/wasm.rs deleted file mode 100644 index 73d839e9d..000000000 --- a/feather/plugin-host/src/plugin/wasm.rs +++ /dev/null @@ -1,77 +0,0 @@ -use std::sync::Arc; - -use quill_plugin_format::PluginMetadata; -use wasmer::{ - ChainableNamedResolver, Features, Function, ImportObject, Instance, Module, NativeFunc, Store, -}; -use wasmer_wasi::{WasiEnv, WasiState, WasiVersion}; - -use crate::{ - context::{PluginContext, PluginPtr, PluginPtrMut}, - env::PluginEnv, - PluginManager, -}; - -pub struct WasmPlugin { - /// The WebAssembly instancing containing - /// the plugin. - instance: Instance, - - /// Exported function to enable the plugin. - enable: Function, - - /// Exported function to run a system given its data pointer. - run_system: NativeFunc, -} - -impl WasmPlugin { - pub fn load( - manager: &PluginManager, - cx: &Arc, - module: &[u8], - metadata: &PluginMetadata, - ) -> anyhow::Result { - let env = PluginEnv { - context: Arc::clone(cx), - }; - let quill_imports = crate::host_calls::generate_import_object(&manager.store, &env); - let wasi_imports = generate_wasi_import_object(&manager.store, &metadata.identifier)?; - let imports = quill_imports.chain_back(wasi_imports); - - let module = Module::new(&manager.store, module)?; - let instance = Instance::new(&module, &imports)?; - - let run_system = instance - .exports - .get_function("quill_run_system")? - .native()? - .clone(); - let enable = instance.exports.get_function("quill_setup")?.clone(); - - Ok(Self { - instance, - run_system, - enable, - }) - } - - pub fn enable(&self) -> anyhow::Result<()> { - self.enable.call(&[])?; - Ok(()) - } - - pub fn run_system(&self, data_ptr: PluginPtrMut) -> anyhow::Result<()> { - self.run_system.call(data_ptr.ptr as u32)?; - Ok(()) - } -} - -fn generate_wasi_import_object(store: &Store, plugin_name: &str) -> anyhow::Result { - let state = WasiState::new(plugin_name).build()?; - let env = WasiEnv::new(state); - Ok(wasmer_wasi::generate_import_object_from_env( - store, - env, - WasiVersion::Latest, - )) -} diff --git a/feather/plugin-host/src/thread_pinned.rs b/feather/plugin-host/src/thread_pinned.rs deleted file mode 100644 index dccc72c47..000000000 --- a/feather/plugin-host/src/thread_pinned.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::{ - cell::{Ref, RefCell, RefMut}, - thread::{self, ThreadId}, -}; - -/// Wraps a [`RefCell`] but implements `Send` and `Sync`. -/// -/// The value can only be borrowed on the thread it was created -/// on; this is enforced at runtime. In other words, access to -/// the value is pinned to the main thread. -pub struct ThreadPinned { - cell: RefCell, - pinned_to: ThreadId, -} - -impl ThreadPinned { - pub fn new(value: T) -> Self { - Self { - cell: RefCell::new(value), - pinned_to: thread::current().id(), - } - } - - #[allow(unused)] - pub fn borrow(&self) -> Ref { - self.assert_thread(); - self.cell.borrow() - } - - pub fn borrow_mut(&self) -> RefMut { - self.assert_thread(); - self.cell.borrow_mut() - } - - fn assert_thread(&self) { - assert_eq!( - thread::current().id(), - self.pinned_to, - "can only borrow value on the main thread" - ); - } -} - -unsafe impl Send for ThreadPinned {} -unsafe impl Sync for ThreadPinned {} diff --git a/feather/plugin-host/src/wasm_ptr_ext.rs b/feather/plugin-host/src/wasm_ptr_ext.rs deleted file mode 100644 index db0184d1c..000000000 --- a/feather/plugin-host/src/wasm_ptr_ext.rs +++ /dev/null @@ -1,29 +0,0 @@ -use wasmer::{Array, WasmPtr}; - -pub trait WasmPtrExt { - fn add(self, offset: usize) -> Self; -} - -impl WasmPtrExt for WasmPtr -where - T: Copy, -{ - fn add(self, offset: usize) -> Self { - WasmPtr::new(self.offset() + offset as u32) - } -} - -pub trait WasmPtrIntoArray { - fn array(self) -> WasmPtr - where - T: Copy; -} - -impl WasmPtrIntoArray for WasmPtr -where - T: Copy, -{ - fn array(self) -> WasmPtr { - WasmPtr::new(self.offset()) - } -} diff --git a/feather/protocol/Cargo.toml b/feather/protocol/Cargo.toml index d919d83b4..80d766057 100644 --- a/feather/protocol/Cargo.toml +++ b/feather/protocol/Cargo.toml @@ -1,26 +1,23 @@ [package] name = "feather-protocol" version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" [dependencies] aes = "0.7" anyhow = "1" -base = { path = "../base", package = "feather-base" } -blocks = { path = "../blocks", package = "feather-blocks" } bytemuck = "1" byteorder = "1" -bytes = "0.5" +bytes = "1" cfb8 = "0.7" +either = "1" flate2 = "1" - hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } +libcraft = { path = "../../libcraft" } num-traits = "0.2" -parking_lot = "0.11" # Arc> compat -quill-common = { path = "../../quill/common" } +parking_lot = "0.12" # Arc> compat +quill = { path = "../../quill" } serde = "1" thiserror = "1" uuid = "0.8" -libcraft-core = { path = "../../libcraft/core" } -libcraft-items = { path = "../../libcraft/items" } diff --git a/feather/protocol/src/codec.rs b/feather/protocol/src/codec.rs index d38217eb3..0cf90a20f 100644 --- a/feather/protocol/src/codec.rs +++ b/feather/protocol/src/codec.rs @@ -1,4 +1,4 @@ -use crate::{io::VarInt, ProtocolVersion, Readable, Writeable}; +use crate::{ProtocolVersion, Readable, VarInt, Writeable}; use aes::Aes128; use bytes::BytesMut; use cfb8::{ @@ -68,7 +68,7 @@ impl MinecraftCodec { /// Writes a packet into the provided writer. pub fn encode(&mut self, packet: &impl Writeable, output: &mut Vec) -> anyhow::Result<()> { - packet.write(&mut self.staging_buf, ProtocolVersion::V1_16_2)?; + packet.write(&mut self.staging_buf, ProtocolVersion::V1_18_1)?; if let Some(threshold) = self.compression { self.encode_compressed(output, threshold)?; @@ -104,8 +104,8 @@ impl MinecraftCodec { .unwrap(); let packet_length = data_length_bytes.position() as usize + data.len(); - VarInt(packet_length as i32).write(output, ProtocolVersion::V1_16_2)?; - VarInt(data_length as i32).write(output, ProtocolVersion::V1_16_2)?; + VarInt(packet_length as i32).write(output, ProtocolVersion::V1_18_1)?; + VarInt(data_length as i32).write(output, ProtocolVersion::V1_18_1)?; output.extend_from_slice(data); self.compression_target.clear(); @@ -129,7 +129,7 @@ impl MinecraftCodec { // TODO: we should probably be able to determine the length without writing the packet, // which could remove an unnecessary copy. let length = self.staging_buf.len() as i32; - VarInt(length).write(output, ProtocolVersion::V1_16_2)?; + VarInt(length).write(output, ProtocolVersion::V1_18_1)?; output.extend_from_slice(&self.staging_buf); Ok(()) @@ -153,7 +153,7 @@ impl MinecraftCodec { T: Readable, { let mut cursor = Cursor::new(&self.received_buf[..]); - let packet = if let Ok(length) = VarInt::read(&mut cursor, ProtocolVersion::V1_16_2) { + let packet = if let Ok(length) = VarInt::read(&mut cursor, ProtocolVersion::V1_18_1) { let length_field_length = cursor.position() as usize; if self.received_buf.len() - length_field_length >= length.0 as usize { @@ -163,7 +163,7 @@ impl MinecraftCodec { ); if self.compression.is_some() { - let data_length = VarInt::read(&mut cursor, ProtocolVersion::V1_16_2)?; + let data_length = VarInt::read(&mut cursor, ProtocolVersion::V1_18_1)?; if data_length.0 != 0 { let mut decoder = ZlibDecoder::new(&cursor.get_ref()[cursor.position() as usize..]); @@ -172,7 +172,7 @@ impl MinecraftCodec { } } - let packet = T::read(&mut cursor, ProtocolVersion::V1_16_2)?; + let packet = T::read(&mut cursor, ProtocolVersion::V1_18_1)?; let bytes_read = length.0 as usize + length_field_length; self.received_buf = self.received_buf.split_off(bytes_read); diff --git a/feather/protocol/src/io.rs b/feather/protocol/src/io.rs index 4c9a51be6..14a436650 100644 --- a/feather/protocol/src/io.rs +++ b/feather/protocol/src/io.rs @@ -2,14 +2,14 @@ use crate::{ProtocolVersion, Slot}; use anyhow::{anyhow, bail, Context}; -use base::{ - anvil::entity::ItemNbt, metadata::MetaEntry, BlockId, BlockPosition, Direction, EntityMetadata, +use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; +use libcraft::items::InventorySlot::*; +use libcraft::{ + anvil::entity::ItemNbt, entity_metadata::MetaEntry, BlockPosition, BlockState, EntityMetadata, Gamemode, Item, ItemStackBuilder, ValidBlockPosition, }; -use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use libcraft_items::InventorySlot::*; use num_traits::{FromPrimitive, ToPrimitive}; -use quill_common::components::PreviousGamemode; +use quill::components::PreviousGamemode; use serde::{de::DeserializeOwned, Serialize}; use std::io::ErrorKind; use std::{ @@ -21,6 +21,9 @@ use std::{ marker::PhantomData, num::TryFromIntError, }; + +use libcraft::chunk::paletted_container::{Paletteable, PalettedContainer}; +use libcraft::Direction; use thiserror::Error; use uuid::Uuid; @@ -609,7 +612,7 @@ impl Readable for EntityMetadata { } let entry = read_meta_entry(buffer, version)?; - values.insert(index, entry); + values.insert(index as i8, entry); } Ok(EntityMetadata { values }) @@ -655,7 +658,7 @@ fn read_meta_entry( } else { None }), - 13 => MetaEntry::OptBlockId({ + 13 => MetaEntry::OptBlockState({ let id = VarInt::read(buffer, version)?.0; if id == 0 { None @@ -743,7 +746,7 @@ fn write_meta_entry( false.write(buffer, version)?; } } - MetaEntry::OptBlockId(ox) => { + MetaEntry::OptBlockState(ox) => { if let Some(x) = ox { VarInt(*x).write(buffer, version)?; } else { @@ -798,9 +801,13 @@ impl Readable for ValidBlockPosition { let val = i64::read(buffer, version)?; let x = (val >> 38) as i32; - let y = (val & 0xFFF) as i32; + let mut y = (val & 0xFFF) as i32; let z = (val << 26 >> 38) as i32; + if y >= 1 << 11 { + y -= 1 << 12 + } + Ok(BlockPosition { x, y, z }.try_into()?) } } @@ -852,21 +859,21 @@ impl Writeable for Angle { } } -impl Readable for BlockId { +impl Readable for BlockState { fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { let id = VarInt::read(buffer, version)?.0; - let block = BlockId::from_vanilla_id(id.try_into()?); - Ok(block) + let block = BlockState::from_id(id.try_into()?); + Ok(block.unwrap_or_default()) } } -impl Writeable for BlockId { +impl Writeable for BlockState { fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { - VarInt(self.vanilla_id().into()).write(buffer, version)?; + VarInt(self.id().into()).write(buffer, version)?; Ok(()) } } @@ -915,3 +922,119 @@ impl Writeable for PreviousGamemode { self.id().write(buffer, version) } } + +macro_rules! tuple_impl { + ($($item: ident),*) => { + impl<$($item: Readable),*> Readable for ($($item,)*) { + fn read(#[allow(unused)] buffer: &mut Cursor<&[u8]>, #[allow(unused)] version: ProtocolVersion) -> anyhow::Result + where + Self: Sized, + { + Ok(($($item::read(buffer, version)?,)*)) + } + } + impl<$($item: Writeable),*> Writeable for ($($item,)*) { + fn write(&self, #[allow(unused)] buffer: &mut Vec, #[allow(unused)] version: ProtocolVersion) -> anyhow::Result<()> { + #[allow(non_snake_case)] + let ($($item,)*): &($($item,)*) = self; + $($item.write(buffer, version)?;)* + Ok(()) + } + } + }; +} + +tuple_impl!(); +tuple_impl!(T1); +tuple_impl!(T1, T2); +tuple_impl!(T1, T2, T3); + +// TODO remove and use bitvec instead +#[derive(Default)] +pub struct BitMask(Vec); + +impl BitMask { + // pushes a bit to this bitmask + pub fn set(&mut self, i: usize, bit: bool) { + let n = i / 64; + while n >= self.0.len() { + self.0.push(0); + } + self.0[n] |= (bit as u64) << (i % 64); + } + + pub fn is_set(&self, i: usize) -> bool { + let n = i / 64; + if n >= self.0.len() { + false + } else { + self.0[n] & (1 << (i % 64)) != 0 + } + } + + pub fn max_len(&self) -> usize { + self.0.len() * u64::BITS as usize / 8 + } +} + +impl Writeable for BitMask { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + VarInt(self.0.len() as i32).write(buffer, version)?; + for long in &self.0 { + long.write(buffer, version)? + } + Ok(()) + } +} + +impl Readable for BitMask { + fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result + where + Self: Sized, + { + let mut bitmask = Vec::new(); + for _ in 0..VarInt::read(buffer, version)?.0 { + bitmask.push(u64::read(buffer, version)?); + } + Ok(BitMask(bitmask)) + } +} + +impl Writeable for PalettedContainer +where + T: Paletteable, +{ + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + let data = self.data(); + (data + .map(|arr| arr.bits_per_value().get()) + .unwrap_or_default() as u8) + .write(buffer, version)?; + + match self { + PalettedContainer::SingleValue(value) => { + VarInt(value.default_palette_index() as i32).write(buffer, version)? + } + PalettedContainer::MultipleValues { palette, .. } => { + VarInt(palette.len() as i32).write(buffer, version)?; + for item in palette { + VarInt(item.default_palette_index() as i32).write(buffer, version)?; + } + } + PalettedContainer::GlobalPalette { .. } => {} + } + + VarInt( + data.map(|data| data.as_u64_slice().len()) + .unwrap_or_default() as i32, + ) + .write(buffer, version)?; + if let Some(data) = data { + for u64 in data.as_u64_slice() { + u64.write(buffer, version)?; + } + } + + Ok(()) + } +} diff --git a/feather/protocol/src/lib.rs b/feather/protocol/src/lib.rs index 411ac5ef8..4232780ed 100644 --- a/feather/protocol/src/lib.rs +++ b/feather/protocol/src/lib.rs @@ -9,7 +9,7 @@ use crate::codec::CompressionThreshold; pub use codec::MinecraftCodec; pub use io::Nbt; pub use io::{Readable, VarInt, VarLong, Writeable}; -use libcraft_items::InventorySlot; +use libcraft::items::InventorySlot; #[doc(inline)] pub use packets::{ client::{ClientHandshakePacket, ClientLoginPacket, ClientPlayPacket, ClientStatusPacket}, @@ -22,7 +22,7 @@ pub type Slot = InventorySlot; /// A protocol version. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum ProtocolVersion { - V1_16_2, + V1_18_1, } /// A protocol state. diff --git a/feather/protocol/src/mod.rs b/feather/protocol/src/mod.rs new file mode 100644 index 000000000..14ed541f2 --- /dev/null +++ b/feather/protocol/src/mod.rs @@ -0,0 +1,232 @@ +use anyhow::anyhow; + +pub mod codec; +pub mod io; +pub mod packets; + +#[doc(inline)] +pub use codec::MinecraftCodec; +pub use io::Nbt; +pub use io::{Readable, VarInt, VarLong, Writeable}; +use libcraft_items::InventorySlot; +#[doc(inline)] +pub use packets::{ + client::{ClientHandshakePacket, ClientLoginPacket, ClientPlayPacket, ClientStatusPacket}, + server::{ServerLoginPacket, ServerPlayPacket, ServerStatusPacket}, + VariantOf, +}; + +pub type Slot = InventorySlot; + +/// A protocol version. +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[allow(non_camel_case_types)] +pub enum ProtocolVersion { + V1_18_1, +} + +/// A protocol state. +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +pub enum ProtocolState { + Handshake, + Status, + Login, + Play, +} + +/// Reads an arbitrary packet sent by a client based on a dynamically-updated +/// protocol state. As opposed to `MinecraftCodec`, this struct does not type-encode +/// the current protocol state using generics. +/// +/// This is a wrapper around a `MinecraftCodec` but more useful in certain situations +/// (e.g. when writing a proxy.) +pub struct ClientPacketCodec { + state: ProtocolState, + codec: MinecraftCodec, +} + +impl Default for ClientPacketCodec { + fn default() -> Self { + Self::new() + } +} + +impl ClientPacketCodec { + pub fn new() -> Self { + Self { + state: ProtocolState::Handshake, + codec: MinecraftCodec::new(), + } + } + + pub fn set_state(&mut self, state: ProtocolState) { + self.state = state + } + + /// Decodes a `ClientPacket` using the provided data. + pub fn decode(&mut self, data: &[u8]) -> anyhow::Result> { + self.codec.accept(data); + match self.state { + ProtocolState::Handshake => self + .codec + .next_packet::() + .map(|opt| opt.map(ClientPacket::from)), + ProtocolState::Status => self + .codec + .next_packet::() + .map(|opt| opt.map(ClientPacket::from)), + ProtocolState::Login => self + .codec + .next_packet::() + .map(|opt| opt.map(ClientPacket::from)), + ProtocolState::Play => self + .codec + .next_packet::() + .map(|opt| opt.map(ClientPacket::from)), + } + } + + /// Encodes a `ClientPacket` into a buffer. + pub fn encode(&mut self, packet: &ClientPacket, buffer: &mut Vec) { + match packet { + ClientPacket::Handshake(packet) => self.codec.encode(packet, buffer).unwrap(), + ClientPacket::Status(packet) => self.codec.encode(packet, buffer).unwrap(), + ClientPacket::Login(packet) => self.codec.encode(packet, buffer).unwrap(), + ClientPacket::Play(packet) => self.codec.encode(packet, buffer).unwrap(), + } + } +} + +/// Similar to `ClientPacketCodec` but for server-sent packets. +pub struct ServerPacketCodec { + state: ProtocolState, + codec: MinecraftCodec, +} + +impl Default for ServerPacketCodec { + fn default() -> Self { + Self::new() + } +} + +impl ServerPacketCodec { + pub fn new() -> Self { + Self { + state: ProtocolState::Handshake, + codec: MinecraftCodec::new(), + } + } + + pub fn set_state(&mut self, state: ProtocolState) { + self.state = state + } + + /// Decodes a `ServerPacket` using the provided data. + pub fn decode(&mut self, data: &[u8]) -> anyhow::Result> { + self.codec.accept(data); + match self.state { + ProtocolState::Handshake => Err(anyhow!("server sent data during handshake state")), + ProtocolState::Status => self + .codec + .next_packet::() + .map(|opt| opt.map(ServerPacket::from)), + ProtocolState::Login => self + .codec + .next_packet::() + .map(|opt| opt.map(ServerPacket::from)), + ProtocolState::Play => self + .codec + .next_packet::() + .map(|opt| opt.map(ServerPacket::from)), + } + } + + /// Encodes a `ServerPacket` into a buffer. + pub fn encode(&mut self, packet: &ServerPacket, buffer: &mut Vec) { + match packet { + ServerPacket::Status(packet) => self.codec.encode(packet, buffer).unwrap(), + ServerPacket::Login(packet) => self.codec.encode(packet, buffer).unwrap(), + ServerPacket::Play(packet) => self.codec.encode(packet, buffer).unwrap(), + } + } +} + +/// A packet sent by the client from any one of the packet stages. +#[derive(Debug, Clone)] +pub enum ClientPacket { + Handshake(ClientHandshakePacket), + Status(ClientStatusPacket), + Login(ClientLoginPacket), + Play(ClientPlayPacket), +} + +impl ClientPacket { + pub fn id(&self) -> u32 { + match self { + ClientPacket::Handshake(packet) => packet.id(), + ClientPacket::Status(packet) => packet.id(), + ClientPacket::Login(packet) => packet.id(), + ClientPacket::Play(packet) => packet.id(), + } + } +} + +impl From for ClientPacket { + fn from(packet: ClientHandshakePacket) -> Self { + ClientPacket::Handshake(packet) + } +} + +impl From for ClientPacket { + fn from(packet: ClientStatusPacket) -> Self { + ClientPacket::Status(packet) + } +} + +impl From for ClientPacket { + fn from(packet: ClientLoginPacket) -> Self { + ClientPacket::Login(packet) + } +} + +impl From for ClientPacket { + fn from(packet: ClientPlayPacket) -> Self { + ClientPacket::Play(packet) + } +} + +/// A packet sent by the server from any one of the packet stages. +#[derive(Debug, Clone)] +pub enum ServerPacket { + Status(ServerStatusPacket), + Login(ServerLoginPacket), + Play(ServerPlayPacket), +} + +impl ServerPacket { + pub fn id(&self) -> u32 { + match self { + ServerPacket::Status(packet) => packet.id(), + ServerPacket::Login(packet) => packet.id(), + ServerPacket::Play(packet) => packet.id(), + } + } +} + +impl From for ServerPacket { + fn from(packet: ServerStatusPacket) -> Self { + ServerPacket::Status(packet) + } +} + +impl From for ServerPacket { + fn from(packet: ServerLoginPacket) -> Self { + ServerPacket::Login(packet) + } +} + +impl From for ServerPacket { + fn from(packet: ServerPlayPacket) -> Self { + ServerPacket::Play(packet) + } +} diff --git a/feather/protocol/src/packets.rs b/feather/protocol/src/packets.rs index 445051ef0..3d522927d 100644 --- a/feather/protocol/src/packets.rs +++ b/feather/protocol/src/packets.rs @@ -2,10 +2,10 @@ macro_rules! user_type { (VarInt) => { i32 }; - (VarIntPrefixedVec <$inner:ident>) => { + (VarIntPrefixedVec <$inner:ty>) => { Vec<$inner> }; - (ShortPrefixedVec <$inner:ident>) => { + (ShortPrefixedVec <$inner:ty>) => { Vec<$inner> }; (LengthInferredVecU8) => { @@ -23,10 +23,10 @@ macro_rules! user_type_convert_to_writeable { (VarInt, $e:expr) => { VarInt(*$e as i32) }; - (VarIntPrefixedVec <$inner:ident>, $e:expr) => { + (VarIntPrefixedVec <$inner:ty>, $e:expr) => { VarIntPrefixedVec::from($e.as_slice()) }; - (ShortPrefixedVec <$inner:ident>, $e:expr) => { + (ShortPrefixedVec <$inner:ty>, $e:expr) => { ShortPrefixedVec::from($e.as_slice()) }; (LengthInferredVecU8, $e:expr) => { @@ -43,48 +43,59 @@ macro_rules! user_type_convert_to_writeable { macro_rules! packets { ( $( - $packet:ident { - $( - $field:ident $typ:ident $(<$generics:ident>)? - );* $(;)? - } $(,)? + $packet:ident + $( + { + $( + $field:ident $typ:ident $(<$generics:ty>)? + );* $(;)? + } + )? $(,)? )* ) => { $( #[derive(Debug, Clone)] pub struct $packet { $( - pub $field: user_type!($typ $(<$generics>)?), - )* + $( + pub $field: user_type!($typ $(<$generics>)?), + )* + )? } #[allow(unused_imports, unused_variables)] - impl crate::Readable for $packet { - fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: crate::ProtocolVersion) -> anyhow::Result + impl $crate::Readable for $packet { + fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: $crate::ProtocolVersion) -> anyhow::Result where Self: Sized { use anyhow::Context as _; $( - let $field = <$typ $(<$generics>)?>::read(buffer, version) - .context(concat!("failed to read field `", stringify!($field), "` of packet `", stringify!($packet), "`"))? - .into(); - )* + $( + let $field = <$typ $(<$generics>)?>::read(buffer, version) + .context(concat!("failed to read field `", stringify!($field), "` of packet `", stringify!($packet), "`"))? + .into(); + )* + )? Ok(Self { $( - $field, - )* + $( + $field, + )* + )? }) } } #[allow(unused_variables)] - impl crate::Writeable for $packet { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + impl $crate::Writeable for $packet { + fn write(&self, buffer: &mut Vec, version: $crate::ProtocolVersion) -> anyhow::Result<()> { $( - user_type_convert_to_writeable!($typ $(<$generics>)?, &self.$field).write(buffer, version)?; - )* + $( + user_type_convert_to_writeable!($typ $(<$generics>)?, &self.$field).write(buffer, version)?; + )* + )? Ok(()) } } @@ -130,8 +141,8 @@ macro_rules! def_enum { )* } - impl crate::Readable for $ident { - fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: crate::ProtocolVersion) -> anyhow::Result + impl $crate::Readable for $ident { + fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: $crate::ProtocolVersion) -> anyhow::Result where Self: Sized { @@ -169,8 +180,8 @@ macro_rules! def_enum { } } - impl crate::Writeable for $ident { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + impl $crate::Writeable for $ident { + fn write(&self, buffer: &mut Vec, version: $crate::ProtocolVersion) -> anyhow::Result<()> { match self { $( $ident::$variant $( @@ -219,8 +230,8 @@ macro_rules! packet_enum { } } - impl crate::Readable for $ident { - fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: crate::ProtocolVersion) -> anyhow::Result + impl $crate::Readable for $ident { + fn read(buffer: &mut ::std::io::Cursor<&[u8]>, version: $crate::ProtocolVersion) -> anyhow::Result where Self: Sized { @@ -234,8 +245,8 @@ macro_rules! packet_enum { } } - impl crate::Writeable for $ident { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + impl $crate::Writeable for $ident { + fn write(&self, buffer: &mut Vec, version: $crate::ProtocolVersion) -> anyhow::Result<()> { VarInt(self.id() as i32).write(buffer, version)?; match self { $( @@ -284,11 +295,5 @@ pub trait VariantOf { Self: Sized; } -use crate::io::{Angle, LengthInferredVecU8, Nbt, ShortPrefixedVec, VarInt, VarIntPrefixedVec}; -use crate::Slot; -use base::BlockId; -use nbt::Blob; -use uuid::Uuid; - pub mod client; pub mod server; diff --git a/feather/protocol/src/packets/client.rs b/feather/protocol/src/packets/client.rs index 3708c12a4..0fc218ee5 100644 --- a/feather/protocol/src/packets/client.rs +++ b/feather/protocol/src/packets/client.rs @@ -1,7 +1,6 @@ //! Packets sent from client to server. - -use super::*; - +use crate::VarInt; +use crate::VariantOf; mod handshake; mod login; mod play; @@ -35,29 +34,29 @@ packet_enum!(ClientPlayPacket { 0x04 = ClientStatus, 0x05 = ClientSettings, 0x06 = TabComplete, - 0x07 = WindowConfirmation, - 0x08 = ClickWindowButton, - 0x09 = ClickWindow, - 0x0A = CloseWindow, - 0x0B = PluginMessage, - 0x0C = EditBook, - 0x0D = QueryEntityNbt, - 0x0E = InteractEntity, - 0x0F = GenerateStructure, - 0x10 = KeepAlive, - 0x11 = LockDifficulty, - 0x12 = PlayerPosition, - 0x13 = PlayerPositionAndRotation, - 0x14 = PlayerRotation, - 0x15 = PlayerMovement, - 0x16 = VehicleMove, - 0x17 = SteerBoat, - 0x18 = PickItem, - 0x19 = CraftRecipeRequest, - 0x1A = PlayerAbilities, - 0x1B = PlayerDigging, - 0x1C = EntityAction, - 0x1D = SteerVehicle, + 0x07 = ClickWindowButton, + 0x08 = ClickWindow, + 0x09 = CloseWindow, + 0x0A = PluginMessage, + 0x0B = EditBook, + 0x0C = QueryEntityNbt, + 0x0D = InteractEntity, + 0x0E = GenerateStructure, + 0x0F = KeepAlive, + 0x10 = LockDifficulty, + 0x11 = PlayerPosition, + 0x12 = PlayerPositionAndRotation, + 0x13 = PlayerRotation, + 0x14 = PlayerMovement, + 0x15 = VehicleMove, + 0x16 = SteerBoat, + 0x17 = PickItem, + 0x18 = CraftRecipeRequest, + 0x19 = PlayerAbilities, + 0x1A = PlayerDigging, + 0x1B = EntityAction, + 0x1C = SteerVehicle, + 0x1D = Pong, 0x1E = SetDisplayedRecipe, 0x1F = SetRecipeBookState, 0x20 = NameItem, diff --git a/feather/protocol/src/packets/client/handshake.rs b/feather/protocol/src/packets/client/handshake.rs index 70fa2ec51..57ecc5173 100644 --- a/feather/protocol/src/packets/client/handshake.rs +++ b/feather/protocol/src/packets/client/handshake.rs @@ -1,4 +1,4 @@ -use super::*; +use crate::VarInt; def_enum! { HandshakeState (VarInt) { diff --git a/feather/protocol/src/packets/client/login.rs b/feather/protocol/src/packets/client/login.rs index 8e3694eab..ab09b976a 100644 --- a/feather/protocol/src/packets/client/login.rs +++ b/feather/protocol/src/packets/client/login.rs @@ -1,4 +1,6 @@ -use super::*; +use crate::io::LengthInferredVecU8; +use crate::io::VarIntPrefixedVec; +use crate::VarInt; packets! { LoginStart { diff --git a/feather/protocol/src/packets/client/play.rs b/feather/protocol/src/packets/client/play.rs index 211c71e6a..c6ca133a8 100644 --- a/feather/protocol/src/packets/client/play.rs +++ b/feather/protocol/src/packets/client/play.rs @@ -1,7 +1,10 @@ -use base::ValidBlockPosition; - -use super::*; +use crate::io::LengthInferredVecU8; +use crate::io::VarIntPrefixedVec; use crate::packets::server::Hand; +use crate::Slot; +use crate::VarInt; +use libcraft::ValidBlockPosition; +use uuid::Uuid; packets! { TeleportConfirm { @@ -42,6 +45,8 @@ packets! { chat_colors bool; displayed_skin_parts u8; main_hand VarInt; + enable_text_filtering bool; + allow_listing bool; } } @@ -59,12 +64,6 @@ packets! { text String; } - WindowConfirmation { - window_id u8; - action_number u16; - accepted bool; - } - ClickWindowButton { window_id u8; button_id u8; @@ -72,10 +71,11 @@ packets! { ClickWindow { window_id u8; + state_id VarInt; slot i16; button i8; - action_number u16; mode VarInt; + slots VarIntPrefixedVec<(u16, Slot)>; clicked_item Slot; } @@ -182,6 +182,10 @@ packets! { flags u8; } + Pong { + id i32; + } + SetDisplayedRecipe { recipe_id String; } diff --git a/feather/protocol/src/packets/client/status.rs b/feather/protocol/src/packets/client/status.rs index ec9dd3b9b..91b15b651 100644 --- a/feather/protocol/src/packets/client/status.rs +++ b/feather/protocol/src/packets/client/status.rs @@ -1,5 +1,5 @@ packets! { - Request {} + Request Ping { payload i64; diff --git a/feather/protocol/src/packets/server.rs b/feather/protocol/src/packets/server.rs index 2c761925e..d79585fd7 100644 --- a/feather/protocol/src/packets/server.rs +++ b/feather/protocol/src/packets/server.rs @@ -1,6 +1,6 @@ //! Packets sent from server to client; - -use super::*; +use crate::VarInt; +use crate::VariantOf; mod login; mod play; @@ -29,91 +29,103 @@ packet_enum!(ServerPlayPacket { 0x02 = SpawnLivingEntity, 0x03 = SpawnPainting, 0x04 = SpawnPlayer, - 0x05 = EntityAnimation, - 0x06 = Statistics, - 0x07 = AcknowledgePlayerDigging, - 0x08 = BlockBreakAnimation, - 0x09 = BlockEntityData, - 0x0A = BlockAction, - 0x0B = BlockChange, - 0x0C = BossBar, - 0x0D = ServerDifficulty, - 0x0E = ChatMessage, - 0x0F = TabComplete, - 0x10 = DeclareCommands, - 0x11 = WindowConfirmation, - 0x12 = CloseWindow, - 0x13 = WindowItems, - 0x14 = WindowProperty, - 0x15 = SetSlot, - 0x16 = SetCooldown, - 0x17 = PluginMessage, - 0x18 = NamedSoundEffect, - 0x19 = Disconnect, - 0x1A = EntityStatus, - 0x1B = Explosion, - 0x1C = UnloadChunk, - 0x1D = ChangeGameState, - 0x1E = OpenHorseWindow, - 0x1F = KeepAlive, - 0x20 = ChunkData, - 0x21 = Effect, - 0x22 = Particle, - 0x23 = UpdateLight, - 0x24 = JoinGame, - 0x25 = MapData, - 0x26 = TradeList, - 0x27 = EntityPosition, - 0x28 = EntityPositionAndRotation, - 0x29 = EntityRotation, - 0x2A = EntityMovement, - 0x2B = VehicleMove, - 0x2C = OpenBook, - 0x2D = OpenWindow, - 0x2E = OpenSignEditor, - 0x2F = CraftRecipeResponse, - 0x30 = PlayerAbilities, - 0x31 = CombatEvent, - 0x32 = PlayerInfo, - 0x33 = FacePlayer, - 0x34 = PlayerPositionAndLook, - 0x35 = UnlockRecipes, - 0x36 = DestroyEntities, - 0x37 = RemoveEntityEffect, - 0x38 = ResourcePack, - 0x39 = Respawn, - 0x3A = EntityHeadLook, - 0x3B = MultiBlockChange, - 0x3C = SelectAdvancementTab, - 0x3D = WorldBorder, - 0x3E = Camera, - 0x3F = HeldItemChange, - 0x40 = UpdateViewPosition, - 0x41 = UpdateViewDistance, - 0x42 = SpawnPosition, - 0x43 = DisplayScoreboard, - 0x44 = SendEntityMetadata, - 0x45 = AttachEntity, - 0x46 = EntityVelocity, - 0x47 = EntityEquipment, - 0x48 = SetExperience, - 0x49 = UpdateHealth, - 0x4A = ScoreboardObjective, - 0x4B = SetPassengers, - 0x4C = Teams, - 0x4D = UpdateScore, - 0x4E = TimeUpdate, - 0x4F = Title, - 0x50 = EntitySoundEffect, - 0x51 = SoundEffect, - 0x52 = StopSound, - 0x53 = PlayerListHeaderAndFooter, - 0x54 = NbtQueryResponse, - 0x55 = CollectItem, - 0x56 = EntityTeleport, - 0x57 = Advancements, - 0x58 = EntityProperties, - 0x59 = EntityEffect, - 0x5A = DeclareRecipes, - 0x5B = AllTags, + 0x05 = SculkVibrationSignal, + 0x06 = EntityAnimation, + 0x07 = Statistics, + 0x08 = AcknowledgePlayerDigging, + 0x09 = BlockBreakAnimation, + 0x0A = BlockEntityData, + 0x0B = BlockAction, + 0x0C = BlockChange, + 0x0D = BossBar, + 0x0E = ServerDifficulty, + 0x0F = ChatMessage, + 0x10 = ClearTitles, + 0x11 = TabComplete, + 0x12 = DeclareCommands, + 0x13 = CloseWindow, + 0x14 = WindowItems, + 0x15 = WindowProperty, + 0x16 = SetSlot, + 0x17 = SetCooldown, + 0x18 = PluginMessage, + 0x19 = NamedSoundEffect, + 0x1A = Disconnect, + 0x1B = EntityStatus, + 0x1C = Explosion, + 0x1D = UnloadChunk, + 0x1E = ChangeGameState, + 0x1F = OpenHorseWindow, + 0x20 = InitializeWorldBorder, + 0x21 = KeepAlive, + 0x22 = ChunkData, + 0x23 = Effect, + 0x24 = Particle, + 0x25 = UpdateLight, + 0x26 = JoinGame, + 0x27 = MapData, + 0x28 = TradeList, + 0x29 = EntityPosition, + 0x2A = EntityPositionAndRotation, + 0x2B = EntityRotation, + 0x2C = VehicleMove, + 0x2D = OpenBook, + 0x2E = OpenWindow, + 0x2F = OpenSignEditor, + 0x30 = Ping, + 0x31 = CraftRecipeResponse, + 0x32 = PlayerAbilities, + 0x33 = EndCombatEvent, + 0x34 = EnterCombatEvent, + 0x35 = DeathCombatEvent, + 0x36 = PlayerInfo, + 0x37 = FacePlayer, + 0x38 = PlayerPositionAndLook, + 0x39 = UnlockRecipes, + 0x3A = DestroyEntities, + 0x3B = RemoveEntityEffect, + 0x3C = ResourcePack, + 0x3D = Respawn, + 0x3E = EntityHeadLook, + 0x3F = MultiBlockChange, + 0x40 = SelectAdvancementTab, + 0x41 = ActionBar, + 0x42 = WorldBorderCenter, + 0x43 = WorldBorderLerpSize, + 0x44 = WorldBorderSize, + 0x45 = WorldBorderWarningDelay, + 0x46 = WorldBorderWarningReach, + 0x47 = Camera, + 0x48 = HeldItemChange, + 0x49 = UpdateViewPosition, + 0x4A = UpdateViewDistance, + 0x4B = SpawnPosition, + 0x4C = DisplayScoreboard, + 0x4D = SendEntityMetadata, + 0x4E = AttachEntity, + 0x4F = EntityVelocity, + 0x50 = EntityEquipment, + 0x51 = SetExperience, + 0x52 = UpdateHealth, + 0x53 = ScoreboardObjective, + 0x54 = SetPassengers, + 0x55 = Teams, + 0x56 = UpdateScore, + 0x57 = UpdateSimulationDistance, + 0x58 = SetTitleSubtitle, + 0x59 = TimeUpdate, + 0x5A = SetTitleText, + 0x5B = SetTitleTimes, + 0x5C = EntitySoundEffect, + 0x5D = SoundEffect, + 0x5E = StopSound, + 0x5F = PlayerListHeaderAndFooter, + 0x60 = NbtQueryResponse, + 0x61 = CollectItem, + 0x62 = EntityTeleport, + 0x63 = Advancements, + 0x64 = EntityProperties, + 0x65 = EntityEffect, + 0x66 = DeclareRecipes, + 0x67 = AllTags, }); diff --git a/feather/protocol/src/packets/server/login.rs b/feather/protocol/src/packets/server/login.rs index 6626d3130..72efb8a2b 100644 --- a/feather/protocol/src/packets/server/login.rs +++ b/feather/protocol/src/packets/server/login.rs @@ -1,4 +1,7 @@ -use super::*; +use crate::io::LengthInferredVecU8; +use crate::io::VarIntPrefixedVec; +use crate::VarInt; +use uuid::Uuid; packets! { DisconnectLogin { diff --git a/feather/protocol/src/packets/server/play.rs b/feather/protocol/src/packets/server/play.rs index e52266b58..ee22c8458 100644 --- a/feather/protocol/src/packets/server/play.rs +++ b/feather/protocol/src/packets/server/play.rs @@ -1,20 +1,30 @@ -use std::io::Cursor; +use crate::io::Angle; +use crate::io::LengthInferredVecU8; +use crate::io::VarIntPrefixedVec; +use crate::Nbt; +use crate::VarLong; +use crate::{ProtocolVersion, Readable, Slot, VarInt, Writeable}; use anyhow::{anyhow, bail}; +use libcraft::biome::BiomeInfo; +use libcraft::dimension::DimensionTypeInfo; +use libcraft::BlockState; +use libcraft::EntityMetadata; +use libcraft::Gamemode; +use libcraft::ValidBlockPosition; +use libcraft::{ParticleKind, ProfileProperty}; +use quill::components::PreviousGamemode; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::io::Cursor; +use uuid::Uuid; -use base::{ - BlockState, EntityMetadata, Gamemode, ParticleKind, ProfileProperty, ValidBlockPosition, -}; -pub use chunk_data::{ChunkData, ChunkDataKind}; -use quill_common::components::PreviousGamemode; +pub use chunk_data::ChunkData; pub use update_light::UpdateLight; -use crate::{io::VarLong, ProtocolVersion, Readable, Writeable}; - -use super::*; - mod chunk_data; mod update_light; + packets! { SpawnEntity { entity_id VarInt; @@ -83,6 +93,25 @@ packets! { pitch Angle; } + SculkVibrationSignal { + source_position ValidBlockPosition; + destination SculkVibrationDestination; + arrival_ticks VarInt; + } +} + +def_enum! { + SculkVibrationDestination (String) { + "block" = Block { + position ValidBlockPosition; + }, + "entity" = Entity { + entity_id VarInt; + } + } +} + +packets! { EntityAnimation { entity_id VarInt; animation Animation; @@ -113,7 +142,7 @@ packets! { AcknowledgePlayerDigging { position ValidBlockPosition; - block BlockId; + block BlockState; status PlayerDiggingStatus; successful bool; } @@ -136,8 +165,8 @@ packets! { BlockEntityData { position ValidBlockPosition; - action u8; - data Nbt; + block_entity_type VarInt; + data Nbt; } BlockAction { @@ -149,7 +178,7 @@ packets! { BlockChange { position ValidBlockPosition; - block BlockId; + block BlockState; } BossBar { @@ -256,19 +285,15 @@ packets! { __todo__ LengthInferredVecU8; } - WindowConfirmation { - window_id u8; - action_number i16; - is_accepted bool; - } - CloseWindow { window_id u8; } WindowItems { window_id u8; - items ShortPrefixedVec; + state_id VarInt; + items VarIntPrefixedVec; + cursor_item Slot; } WindowProperty { @@ -279,6 +304,7 @@ packets! { SetSlot { window_id u8; + state_id VarInt; slot i16; slot_data Slot; } @@ -487,16 +513,17 @@ packets! { entity_id i32; is_hardcore bool; gamemode Gamemode; - previous_gamemode PreviousGamemode; // can be -1 if "not set", otherwise corresponds to a gamemode ID - world_names VarIntPrefixedVec; + previous_gamemode PreviousGamemode; + dimension_names VarIntPrefixedVec; - dimension_codec Nbt; - dimension Nbt; + dimension_codec Nbt; + dimension Nbt; - world_name String; + dimension_name String; hashed_seed u64; max_players VarInt; view_distance VarInt; + simulation_distance VarInt; reduced_debug_info bool; enable_respawn_screen bool; @@ -505,17 +532,42 @@ packets! { } } +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct DimensionCodec { + #[serde(flatten)] + pub registries: HashMap, +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(tag = "type", content = "value")] +pub enum DimensionCodecRegistry { + #[serde(rename = "minecraft:dimension_type")] + DimensionType(Vec>), + #[serde(rename = "minecraft:worldgen/biome")] + WorldgenBiome(Vec>), +} + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct DimensionCodecEntry { + pub name: String, + pub id: i16, + pub element: T, +} + packets! { MapData { map_id VarInt; scale i8; - show_tracking_position bool; is_locked bool; - icons VarIntPrefixedVec; - // TODO: a bunch of fields only if a Columns is set to 0 + icon Option; + // TODO: and a bunch of fields only if a Columns is set to 0 __todo__ LengthInferredVecU8; } + WrappedIcon { + icon VarIntPrefixedVec; + } + Icon { kind VarInt; x i8; @@ -588,6 +640,10 @@ packets! { position ValidBlockPosition; } + Ping { + id i32; + } + CraftRecipeResponse { window_id i8; recipe String; @@ -599,23 +655,17 @@ packets! { fov_modifier f32; } - CombatEvent { - event CombatEventKind; + EndCombatEvent { + duration VarInt; + entity_id i32; } -} -def_enum! { - CombatEventKind (VarInt) { - 0 = EnterCombat, - 1 = EndCombat { - duration VarInt; - entity_id i32; - }, - 2 = EntityDead { - player_id VarInt; - entity_id i32; - message String; - } + EnterCombatEvent + + DeathCombatEvent { + player_id VarInt; + entity_id i32; + message String; } } @@ -634,10 +684,7 @@ pub struct Particle { } impl Readable for Particle { - fn read( - buffer: &mut std::io::Cursor<&[u8]>, - version: crate::ProtocolVersion, - ) -> anyhow::Result + fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { @@ -696,7 +743,7 @@ impl Readable for Particle { } impl Writeable for Particle { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { self.particle_kind.id().write(buffer, version)?; self.long_distance.write(buffer, version)?; self.x.write(buffer, version)?; @@ -755,10 +802,7 @@ pub enum PlayerInfo { } impl Readable for PlayerInfo { - fn read( - buffer: &mut std::io::Cursor<&[u8]>, - version: crate::ProtocolVersion, - ) -> anyhow::Result + fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { @@ -852,7 +896,7 @@ impl Readable for PlayerInfo { } impl Writeable for PlayerInfo { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { let (action_id, num_players) = match self { PlayerInfo::AddPlayers(vec) => (0, vec.len()), PlayerInfo::UpdateGamemodes(vec) => (1, vec.len()), @@ -939,6 +983,7 @@ packets! { pitch f32; flags u8; teleport_id VarInt; + dismount_vehicle bool; } UnlockRecipes { @@ -957,14 +1002,16 @@ packets! { ResourcePack { url String; hash String; + forced bool; + prompt_message Option; } Respawn { - dimension Nbt; - world_name String; + dimension Nbt; + dimension_name String; hashed_seed u64; gamemode Gamemode; - previous_gamemode Gamemode; + previous_gamemode PreviousGamemode; is_debug bool; is_flat bool; copy_metadata bool; @@ -978,6 +1025,44 @@ packets! { SelectAdvancementTab { identifier Option; } + + ActionBar { + action_bar_text String; + } + + WorldBorderSize { + diameter f64; + } + + WorldBorderLerpSize { + old_diameter f64; + new_diameter f64; + speed u64; + } + + WorldBorderCenter { + x f64; + z f64; + } + + InitializeWorldBorder { + x f64; + z f64; + old_diameter f64; + new_diameter f64; + speed VarLong; + portal_teeport_boundary VarInt; + warning_time VarInt; + warning_blocks VarInt; + } + + WorldBorderWarningDelay { + warning_time VarInt; + } + + WorldBorderWarningReach { + warning_blocks VarInt; + } } def_enum! { @@ -1061,10 +1146,7 @@ pub struct EntityEquipment { } impl Readable for EntityEquipment { - fn read( - buffer: &mut std::io::Cursor<&[u8]>, - version: crate::ProtocolVersion, - ) -> anyhow::Result + fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { @@ -1099,7 +1181,7 @@ impl Readable for EntityEquipment { } impl Writeable for EntityEquipment { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { VarInt(self.entity_id).write(buffer, version)?; for (i, entry) in self.entries.iter().enumerate() { @@ -1209,8 +1291,13 @@ packets! { value Option; } + UpdateSimulationDistance { + simulation_distance VarInt; + } + SpawnPosition { position ValidBlockPosition; + angle f32; } TimeUpdate { @@ -1219,24 +1306,23 @@ packets! { } } -def_enum! { - Title (VarInt) { - 0 = SetTitle { - text String; - }, - 1 = SetSubtitle { - text String; - }, - 2 = SetActionBar { - text String; - }, - 3 = SetTimesAndDisplay { - fade_in i32; - stay i32; - fade_out i32; - }, - 4 = Hide, - 5 = Reset, +packets! { + ClearTitles { + reset bool; + } + + SetTitleSubtitle { + subtitle_text String; + } + + SetTitleText { + title_text String; + } + + SetTitleTimes { + fade_in i32; + stay i32; + fade_out i32; } } @@ -1272,7 +1358,7 @@ packets! { NbtQueryResponse { transaction_id VarInt; - nbt Nbt; + nbt Nbt; } CollectItem { @@ -1391,10 +1477,12 @@ packets! { } AllTags { - block_tags VarIntPrefixedVec; - item_tags VarIntPrefixedVec; - fluid_tags VarIntPrefixedVec; - entity_tags VarIntPrefixedVec; + tags VarIntPrefixedVec; + } + + TagRegistry { + tag_type TagType; + tags VarIntPrefixedVec; } Tag { @@ -1402,3 +1490,13 @@ packets! { entries VarIntPrefixedVec; } } + +def_enum! { + TagType (String) { + "minecraft:block" = Block, + "minecraft:item" = Item, + "minecraft:fluid" = Fluid, + "minecraft:entity_type" = EntityType, + "minecraft:game_event" = GameEvent + } +} diff --git a/feather/protocol/src/packets/server/play/chunk_data.rs b/feather/protocol/src/packets/server/play/chunk_data.rs index 569ce0148..e884785ee 100644 --- a/feather/protocol/src/packets/server/play/chunk_data.rs +++ b/feather/protocol/src/packets/server/play/chunk_data.rs @@ -1,280 +1,110 @@ -use std::{ - fmt::{self, Debug}, - marker::PhantomData, - sync::Arc, -}; +use std::borrow::Cow; +use std::fmt::{self, Debug}; -use base::{Chunk, ChunkHandle, ChunkLock, ChunkPosition, ChunkSection}; -use blocks::BlockId; -use libcraft_core::Biome; -use serde::{ - de, - de::{SeqAccess, Visitor}, - Deserialize, Deserializer, Serialize, -}; +use either::Either; +use serde::{Deserialize, Serialize}; -use crate::{io::VarInt, Nbt, ProtocolVersion, Readable, Writeable}; +use libcraft::ChunkPosition; +use libcraft::{Chunk, ChunkSection}; +use quill::ChunkHandle; -#[derive(Serialize, Deserialize)] -struct Heightmaps { - #[serde(rename = "MOTION_BLOCKING")] - #[serde(serialize_with = "nbt::i64_array")] - #[serde(deserialize_with = "deserialize_i64_37")] - motion_blocking: [i64; 37], -} +use crate::packets::server::play::update_light::LightData; +use crate::{Nbt, ProtocolVersion, Readable, VarInt, Writeable}; -#[derive(Debug, Clone)] -pub enum ChunkDataKind { - /// Load a chunk on the client. Sends all sections + biomes. - LoadChunk, - /// Overwrite an existing chunk on the client. Sends - /// only the sections in `sections`. - OverwriteChunk { sections: Vec }, +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +struct Heightmaps<'a> { + motion_blocking: Cow<'a, [i64]>, + world_surface: Cow<'a, [i64]>, } /// Packet to load a chunk on the client. #[derive(Clone)] pub struct ChunkData { - /// The chunk to send. - pub chunk: ChunkHandle, - - /// Whether this packet will load a chunk on - /// the client or overwrite an existing one. - pub kind: ChunkDataKind, + /// The chunk to send. Serialization panics if Either::Right. Right is only + /// used for deserialization as we don't know the world height and + /// can't infer section count + pub chunk: Either, } impl Debug for ChunkData { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut debug_struct = f.debug_struct("ChunkData"); - debug_struct.field("position", &self.chunk.read().position()); - debug_struct.field("kind", &self.kind); + debug_struct.field( + "position", + &self + .chunk + .clone() + .map_left(|chunk| chunk.read().position()) + .into_inner(), + ); debug_struct.finish() } } -impl ChunkData { - fn should_skip_section(&self, y: usize) -> bool { - match &self.kind { - ChunkDataKind::LoadChunk => false, - ChunkDataKind::OverwriteChunk { sections } => !sections.contains(&y), - } - } -} - impl Writeable for ChunkData { fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { - let chunk = self.chunk.read(); + let chunk = self.chunk.as_ref().unwrap_left().read(); chunk.position().x.write(buffer, version)?; chunk.position().z.write(buffer, version)?; - let full_chunk = matches!(self.kind, ChunkDataKind::LoadChunk); - full_chunk.write(buffer, version)?; - - // Compute primary bit mask - let mut bitmask = 0; - for (y, section) in chunk.sections().iter().enumerate().skip(1).take(16) { - if section.is_some() { - if self.should_skip_section(y) { - continue; - } - - bitmask |= 1 << (y - 1) as i32; - } - } - VarInt(bitmask).write(buffer, version)?; - let heightmaps = build_heightmaps(&chunk); Nbt(heightmaps).write(buffer, version)?; - if full_chunk { - // Write biomes (only if we're sending a new chunk) - VarInt(1024).write(buffer, version)?; // length of biomes - for &biome in chunk.biomes().as_slice() { - VarInt(biome.id() as i32).write(buffer, version)?; - } - } - // Sections let mut data = Vec::new(); - for (y, section) in chunk.sections().iter().enumerate().skip(1).take(16) { - if let Some(section) = section { - if self.should_skip_section(y) { - continue; - } - encode_section(section, &mut data, version)?; - } + for section in chunk + .sections() + .iter() + .skip(1) + .take(chunk.sections().len() - 2) + { + encode_section(section, &mut data, version)?; } VarInt(data.len() as i32).write(buffer, version)?; buffer.extend_from_slice(&data); - VarInt(0).write(buffer, version)?; // number of block entities - always 0 for Feather + VarInt(0).write(buffer, version)?; // block entities are not implemented yet + + LightData::from_full_chunk(&chunk).write(buffer, version)?; Ok(()) } } -fn build_heightmaps(chunk: &Chunk) -> Heightmaps { - let mut motion_blocking = [0; 37]; - let chunk_motion_blocking = chunk.heightmaps().motion_blocking.as_u64_slice(); - motion_blocking.copy_from_slice(bytemuck::cast_slice::<_, i64>(chunk_motion_blocking)); - Heightmaps { motion_blocking } -} - -fn encode_section( - section: &ChunkSection, - buffer: &mut Vec, - version: ProtocolVersion, -) -> anyhow::Result<()> { - (section.non_air_blocks() as u16).write(buffer, version)?; - (section.blocks().data().bits_per_value() as u8).write(buffer, version)?; - - if let Some(palette) = section.blocks().palette() { - VarInt(palette.len() as i32).write(buffer, version)?; - for &block in palette.as_slice() { - VarInt(block.vanilla_id() as i32).write(buffer, version)?; - } - } - - let data = section.blocks().data().as_u64_slice(); - VarInt(data.len() as i32).write(buffer, version)?; - for &x in data { - x.write(buffer, version)?; - } - - Ok(()) -} - impl Readable for ChunkData { fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { - let chunk_x = i32::read(buffer, version)?; - let chunk_z = i32::read(buffer, version)?; - - let mut chunk = Chunk::new(ChunkPosition { - x: chunk_x, - z: chunk_z, - }); - - let full_chunk = bool::read(buffer, version)?; - let chunk_data_kind: ChunkDataKind = match full_chunk { - true => ChunkDataKind::LoadChunk, - false => ChunkDataKind::OverwriteChunk { sections: vec![] }, - }; - - let primary_bit_mask = VarInt::read(buffer, version)?.0; - let heightmaps: Nbt = Nbt::read(buffer, version)?; - let heightmaps = heightmaps.0; - for (heightmaps_index, i) in heightmaps.motion_blocking.iter().enumerate() { - chunk - .heightmaps_mut() - .motion_blocking - .set_height_index(heightmaps_index, *i); - } - - if full_chunk { - let biomes_length = VarInt::read(buffer, version)?.0; - assert_eq!(biomes_length, 1024); - for y in 0..64 { - for z in 0..4 { - for x in 0..4 { - chunk.biomes_mut().set( - x, - y, - z, - Biome::from_id(VarInt::read(buffer, version)?.0 as u32) - .unwrap_or(Biome::Plains), - ); - } - } - } - } - - VarInt::read(buffer, version)?; // Size of following array - - for i in 0..16 { - if (primary_bit_mask & (1 << i)) != 0 { - if chunk.section(i).is_none() { - chunk.set_section_at(i as isize, Some(ChunkSection::default())); - } - if let Some(section) = chunk.section_mut(i + 1) { - let non_air_blocks = u16::read(buffer, version)?; - section - .blocks_mut() - .set_air_blocks(4096 - non_air_blocks as u32); - let bits_per_block = u8::read(buffer, version)?; - section - .blocks_mut() - .data_mut() - .set_bits_per_value(bits_per_block as usize); - if bits_per_block <= 4 || (5..=8).contains(&bits_per_block) { - if let Some(pallete) = section.blocks_mut().palette_mut() { - let pallete_length = VarInt::read(buffer, version)?.0 as usize; - for _ in 0..pallete_length { - let block_id = VarInt::read(buffer, version)?.0; - pallete.index_or_insert(BlockId::from_vanilla_id(block_id as u16)); - } - } - } - let data_length = VarInt::read(buffer, version)?.0 as usize; - for i in 0..data_length { - section.blocks_mut().data_mut().as_u64_mut_vec()[i] = - u64::read(buffer, version)?; - } - } - } - } - - VarInt::read(buffer, version)?; // Block entities length, redundant for feather right now - - Ok(Self { - chunk: Arc::new(ChunkLock::new(chunk, true)), - kind: chunk_data_kind, + Ok(ChunkData { + chunk: Either::Right(ChunkPosition::new( + i32::read(buffer, version)?, + i32::read(buffer, version)?, + )), }) } } -fn deserialize_i64_37<'de, D>(deserializer: D) -> Result<[i64; 37], D::Error> -where - D: Deserializer<'de>, -{ - struct MaxVisitor(PhantomData [i64; 37]>); - - impl<'de> Visitor<'de> for MaxVisitor { - type Value = [i64; 37]; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("a sequence of 37 numbers") - } - - fn visit_seq(self, mut seq: S) -> Result<[i64; 37], S::Error> - where - S: SeqAccess<'de>, - { - let mut res = [0; 37]; - let mut index: usize = 0; - - while let Some(value) = seq.next_element()? { - res[index] = value; - index += 1; - } - - if index != 37 { - return Err(de::Error::custom(format!( - "expected 37 numbers, found {}", - index - ))); - } - - Ok(res) - } +fn build_heightmaps(chunk: &Chunk) -> Heightmaps { + let chunk_motion_blocking = chunk.heightmaps().motion_blocking.as_u64_slice(); + let chunk_world_surface = chunk.heightmaps().motion_blocking.as_u64_slice(); + let motion_blocking = Cow::Borrowed(bytemuck::cast_slice(chunk_motion_blocking)); + let world_surface = Cow::Borrowed(bytemuck::cast_slice(chunk_world_surface)); + Heightmaps { + motion_blocking, + world_surface, } +} - // Create the visitor and ask the deserializer to drive it. The - // deserializer will call visitor.visit_seq() if a seq is present in - // the input data. - let visitor = MaxVisitor(PhantomData); - deserializer.deserialize_seq(visitor) +fn encode_section( + section: &ChunkSection, + buffer: &mut Vec, + version: ProtocolVersion, +) -> anyhow::Result<()> { + (section.non_air_blocks() as u16).write(buffer, version)?; + section.blocks().write(buffer, version)?; + section.biomes().write(buffer, version)?; + Ok(()) } diff --git a/feather/protocol/src/packets/server/play/update_light.rs b/feather/protocol/src/packets/server/play/update_light.rs index 51ad2070d..76445586c 100644 --- a/feather/protocol/src/packets/server/play/update_light.rs +++ b/feather/protocol/src/packets/server/play/update_light.rs @@ -1,129 +1,239 @@ -use std::{fmt::Debug, sync::Arc}; - -use base::{chunk::PackedArray, Chunk, ChunkHandle, ChunkLock, ChunkPosition, ChunkSection}; - -use crate::{io::VarInt, ProtocolVersion, Readable, Writeable}; +use crate::io::BitMask; +use crate::{ProtocolVersion, Readable, VarInt, Writeable}; +use libcraft::chunk::{LightStore, PackedArray, SECTION_VOLUME}; +use libcraft::Chunk; +use libcraft::ChunkPosition; +use std::collections::VecDeque; +use std::fmt::Debug; +use std::io::{Cursor, Read}; +use std::mem::ManuallyDrop; #[derive(Clone)] pub struct UpdateLight { - pub chunk: ChunkHandle, + pub position: ChunkPosition, + pub light: LightData, } impl Debug for UpdateLight { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let mut debug_struct = f.debug_struct("UpdateLight"); - debug_struct.field("position", &self.chunk.read().position()); - debug_struct.finish() + f.debug_struct("UpdateLight") + .field("position", &self.position) + .finish() } } impl Writeable for UpdateLight { - fn write(&self, buffer: &mut Vec, version: crate::ProtocolVersion) -> anyhow::Result<()> { - let chunk = self.chunk.read(); - VarInt(chunk.position().x).write(buffer, version)?; - VarInt(chunk.position().z).write(buffer, version)?; + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + VarInt(self.position.x).write(buffer, version)?; + VarInt(self.position.z).write(buffer, version)?; + + self.light.write(buffer, version) + } +} + +impl Readable for UpdateLight { + fn read(buffer: &mut std::io::Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result + where + Self: Sized, + { + let x = VarInt::read(buffer, version)?.0; + let z = VarInt::read(buffer, version)?.0; + + let light = LightData::read(buffer, version)?; + Ok(UpdateLight { + position: ChunkPosition::new(x, z), + light, + }) + } +} + +#[derive(Clone)] +pub struct LightData { + pub trust_edges: bool, + pub light: Vec>, +} + +impl LightData { + pub fn from_full_chunk(chunk: &Chunk) -> LightData { + LightData { + trust_edges: true, + light: chunk + .sections() + .iter() + .map(|s| Some(s.light().clone())) + .collect(), + } + } + pub fn from_chunk(chunk: &Chunk, sections: Vec) -> LightData { + LightData { + trust_edges: true, + light: chunk + .sections() + .iter() + .map(|s| s.light().clone()) + .enumerate() + .map(|(i, l)| if sections.contains(&i) { Some(l) } else { None }) + .collect(), + } + } +} - true.write(buffer, version)?; // trust edges? +impl Writeable for LightData { + fn write(&self, buffer: &mut Vec, version: ProtocolVersion) -> anyhow::Result<()> { + self.trust_edges.write(buffer, version)?; // trust edges? + + let mut sky_mask = BitMask::default(); + let mut empty_sky_mask = BitMask::default(); + let mut block_mask = BitMask::default(); + let mut empty_block_mask = BitMask::default(); + + let mut sky_set = 0; + let mut block_set = 0; + + for (y, light) in self.light.iter().enumerate() { + if let Some(light) = light { + if !light.sky_light().map(|l| l.is_empty()).unwrap_or(true) { + sky_mask.set(y, true); + sky_set += 1; + } else { + empty_sky_mask.set(y, true); + } - let mut mask = 0; - for (y, section) in chunk.sections().iter().enumerate() { - if section.is_some() { - mask |= 1 << y; + if !light.block_light().map(|l| l.is_empty()).unwrap_or(true) { + block_mask.set(y, true); + block_set += 1; + } else { + empty_block_mask.set(y, true); + } } } - VarInt(mask).write(buffer, version)?; // sky light mask - VarInt(mask).write(buffer, version)?; // block light mask + sky_mask.write(buffer, version)?; + block_mask.write(buffer, version)?; - VarInt(!mask).write(buffer, version)?; // empty sky light mask - VarInt(!mask).write(buffer, version)?; // empty block light mask + empty_sky_mask.write(buffer, version)?; + empty_block_mask.write(buffer, version)?; - for section in chunk.sections().iter().flatten() { - encode_light(section.light().sky_light(), buffer, version); + VarInt(sky_set).write(buffer, version)?; + for (i, light) in self.light.iter().enumerate() { + if sky_mask.is_set(i) { + encode_light( + light.as_ref().unwrap().sky_light().unwrap(), + buffer, + version, + )?; + } } - for section in chunk.sections().iter().flatten() { - encode_light(section.light().block_light(), buffer, version); + VarInt(block_set).write(buffer, version)?; + for (i, light) in self.light.iter().enumerate() { + if block_mask.is_set(i) { + encode_light( + light.as_ref().unwrap().block_light().unwrap(), + buffer, + version, + )?; + } } Ok(()) } } -fn encode_light(light: &PackedArray, buffer: &mut Vec, version: ProtocolVersion) { - VarInt(2048).write(buffer, version).unwrap(); - let light_data: &[u8] = bytemuck::cast_slice(light.as_u64_slice()); - assert_eq!(light_data.len(), 2048); - buffer.extend_from_slice(light_data); -} - -impl Readable for UpdateLight { - fn read( - buffer: &mut std::io::Cursor<&[u8]>, - version: crate::ProtocolVersion, - ) -> anyhow::Result +impl Readable for LightData { + fn read(buffer: &mut Cursor<&[u8]>, version: ProtocolVersion) -> anyhow::Result where Self: Sized, { - let mut chunk = Chunk::new(ChunkPosition { - x: VarInt::read(buffer, version)?.0, - z: VarInt::read(buffer, version)?.0, - }); - - let _trust_edges = bool::read(buffer, version)?; - - let sky_light_mask = VarInt::read(buffer, version)?.0; - let block_light_mask = VarInt::read(buffer, version)?.0; - let _empty_sky_light_mask = VarInt::read(buffer, version)?; - let _empty_block_light_mask = VarInt::read(buffer, version)?; - - for i in 0..18 { - if (sky_light_mask & (1 << i)) != 0 { - let probably_2048 = VarInt::read(buffer, version)?.0 as usize; - assert_eq!(probably_2048, 2048); - let mut bytes: Vec = Vec::new(); - for _ in 0..probably_2048 { - bytes.push(u8::read(buffer, version)?); - } - let mut bytes = bytes.iter(); - if chunk.section(i).is_none() { - chunk.set_section_at(i as isize, Some(ChunkSection::default())); - } - if let Some(section) = chunk.section_mut(i + 1) { - for x in 0..16 { - for y in 0..16 { - for z in 0..16 { - section.set_sky_light_at(x, y, z, *bytes.next().unwrap_or(&15)); - } - } - } - } + let trust_edges = bool::read(buffer, version)?; + + let sky_mask = BitMask::read(buffer, version)?; + let block_mask = BitMask::read(buffer, version)?; + + let empty_sky_mask = BitMask::read(buffer, version)?; + let empty_block_mask = BitMask::read(buffer, version)?; + + let sky_set = VarInt::read(buffer, version)?.0 as usize; + let mut sky_light_sections = VecDeque::new(); + for _ in 0..sky_set { + sky_light_sections.push_back(decode_light(buffer, version)?); + } + let mut sky_light = Vec::new(); + // We don't have the world height, try to infer the max section count + for i in 0..sky_mask.max_len() { + if sky_mask.is_set(i) { + sky_light.push(sky_light_sections.pop_front()) + } else if empty_sky_mask.is_set(i) { + sky_light.push(Some(PackedArray::from_u64_vec( + vec![0; SECTION_VOLUME * 4 / u64::BITS as usize], + 4, + ))) + } else { + sky_light.push(None) } } - for i in 0..18 { - if (block_light_mask & (1 << i)) != 0 { - let probably_2048 = VarInt::read(buffer, version)?.0 as usize; - assert_eq!(probably_2048, 2048); - let mut bytes: Vec = Vec::new(); - for _ in 0..probably_2048 { - bytes.push(u8::read(buffer, version)?); - } - let mut bytes = bytes.iter(); - if let Some(section) = chunk.section_mut(i) { - for x in 0..16 { - for y in 0..16 { - for z in 0..16 { - section.set_block_light_at(x, y, z, *bytes.next().unwrap_or(&15)); - } - } - } - } + let block_set = VarInt::read(buffer, version)?.0 as usize; + let mut block_light_sections = VecDeque::new(); + for _ in 0..block_set { + block_light_sections.push_back(decode_light(buffer, version)?); + } + let mut block_light = Vec::new(); + // We don't have the world height, try to infer the max section count + for i in 0..block_mask.max_len() { + if block_mask.is_set(i) { + block_light.push(sky_light_sections.pop_front()) + } else if empty_block_mask.is_set(i) { + block_light.push(Some(PackedArray::from_u64_vec( + vec![0; SECTION_VOLUME * 4 / u64::BITS as usize], + 4, + ))) + } else { + block_light.push(None) } } - Ok(Self { - chunk: Arc::new(ChunkLock::new(chunk, true)), + Ok(LightData { + trust_edges, + light: sky_light + .into_iter() + .zip(block_light.into_iter()) + .map(|(sky, block)| LightStore::from_packed_arrays(block, sky)) + .collect(), }) } } + +fn encode_light( + light: &PackedArray, + buffer: &mut Vec, + version: ProtocolVersion, +) -> anyhow::Result<()> { + VarInt(light.len() as i32 / 2).write(buffer, version)?; + let light_data: &[u8] = bytemuck::cast_slice(light.as_u64_slice()); + debug_assert_eq!(light_data.len(), 2048); + buffer.extend_from_slice(light_data); + Ok(()) +} + +fn decode_light( + buffer: &mut Cursor<&[u8]>, + version: ProtocolVersion, +) -> anyhow::Result { + let should_be_2048 = VarInt::read(buffer, version)?.0 as usize; + debug_assert_eq!(should_be_2048, 2048); + let mut light_data = vec![0; should_be_2048]; + buffer.read_exact(&mut light_data)?; + let mut light_data = ManuallyDrop::new(light_data); + // SAFETY: light_data is ManuallyDrop so there's no double-free + Ok(PackedArray::from_u64_vec( + unsafe { + Vec::from_raw_parts( + light_data.as_mut_ptr() as *mut u64, + light_data.len() * u8::BITS as usize / u64::BITS as usize, + light_data.capacity() * u8::BITS as usize / u64::BITS as usize, + ) + }, + 4, + )) +} diff --git a/feather/server/Cargo.toml b/feather/server/Cargo.toml index 970560311..05e17aa17 100644 --- a/feather/server/Cargo.toml +++ b/feather/server/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "feather-server" version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" default-run = "feather-server" [[bin]] @@ -15,58 +15,51 @@ path = "src/lib.rs" [dependencies] ahash = "0.7" anyhow = "1" -base = { path = "../base", package = "feather-base" } base64 = "0.13" -time = { version = "0.3", features = ["local-offset", "formatting", "macros"] } +base64ct = "1" colored = "2" common = { path = "../common", package = "feather-common" } +const_format = "0.2.22" +ctrlc = "3" crossbeam-utils = "0.8" -ecs = { path = "../ecs", package = "feather-ecs" } +either = "1.6.1" fern = "0.6" flate2 = "1" flume = "0.10" futures-lite = "1" hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } +humantime-serde = "1" +indexmap = { version = "1", features = ["serde"] } +itertools = "0.10.3" +konst = "0.2.13" +libcraft = { path = "../../libcraft" } log = "0.4" -md-5 = "0.9" +md-5 = "0.10" num-bigint = "0.4" num-traits = "0.2" once_cell = "1" -parking_lot = "0.11" -plugin-host = { path = "../plugin-host", package = "feather-plugin-host" } +parking_lot = "0.12" protocol = { path = "../protocol", package = "feather-protocol" } -quill-common = { path = "../../quill/common" } - +quill = { path = "../../quill" } rand = "0.8" ring = "0.16" - rsa = "0.5" rsa-der = "0.3" -base64ct = "1" - serde = { version = "1", features = [ "derive" ] } serde_json = "1" -sha-1 = "0.9" +sha-1 = "0.10" +slotmap = "1" +time = { version = "0.3", features = ["local-offset", "formatting", "macros"] } tokio = { version = "1", features = [ "full" ] } toml = "0.5" ureq = { version = "2", features = [ "json" ] } utils = { path = "../utils", package = "feather-utils" } uuid = "0.8" -slab = "0.4" -libcraft-core = { path = "../../libcraft/core" } -libcraft-items = { path = "../../libcraft/items" } -worldgen = { path = "../worldgen", package = "feather-worldgen" } +vane = { path = "../../vane" } -[features] -default = [ "plugin-cranelift" ] +# Built-in plugins +feather-world-format-plugin = { path = "../../builtin-plugins/world-format" } +[features] # Use zlib-ng for faster compression. Requires CMake. -zlib-ng = [ "flate2/zlib-ng-compat" ] - -# Use Cranelift to JIT-compile plugins. Pure Rust -# but produces slower code than LLVM. -plugin-cranelift = [ "plugin-host/cranelift" ] -# Use LLVM to JIT-compile plugins. Produces -# very fast code, but requires LLVM to be installed -# on the build system. May impact startup times. -plugin-llvm = [ "plugin-host/llvm" ] +zlib-ng = ["flate2/zlib-ng-compat"] diff --git a/feather/server/config.toml b/feather/server/config.toml index 5e9efff7a..b2ac5e85d 100644 --- a/feather/server/config.toml +++ b/feather/server/config.toml @@ -13,6 +13,8 @@ motd = "A Feather server" max_players = 16 default_gamemode = "creative" view_distance = 12 +# The default world where players will spawn on join +default_world = "default" [log] # If you prefer less verbose logs, switch this to "info". @@ -27,17 +29,19 @@ url = "" # Optional SHA1 hash of the resource pack file. hash = "" -[world] -# The name of the directory containing the world. -name = "world" -# The generator to use if the world does not exist. -# Implemented values are: default, flat, void -generator = "default" -# The seed to use if the world does not exist. -# Leaving this value empty will generate a random seed. -# If this value is not a valid integer (i64), the string -# will be converted using a hash function. -seed = "" +# Worlds to configure at startup. +# Note that plugins may create additional worlds +# not in this config file. +[worlds.default] +# How the server will save chunks: +# - save_incrementally: save chunks at a time interval and on shutdown +# - drop_changes: never save chunks; changes are lost when chunks are unloaded (use only for immutable worlds) +# - keep_loaded: never save or unload chunks; changes are lost on server restart (useful for minigames with small maps) +save_strategy = { type = "save_incrementally", interval = "1min" } +dimension_type = "minecraft:overworld" +# `freg` is the custom world format used by default in Feather. +source = { type = "worldgen", generator = "flat", inner = { type = "freg", directory = "world" } } +flat = true [proxy] # Select the IP forwarding mode that is used by proxies like BungeeCord or Velocity. diff --git a/feather/server/src/builder.rs b/feather/server/src/builder.rs new file mode 100644 index 000000000..f0b088457 --- /dev/null +++ b/feather/server/src/builder.rs @@ -0,0 +1,52 @@ +use common::Game; +use feather_world_format_plugin::FeatherWorldFormat; +use quill::Plugin; +use tokio::runtime::Runtime; +use vane::SystemExecutor; + +use crate::plugin::PluginLoader; + +pub struct ServerBuilder { + game: Game, + plugin_loader: PluginLoader, +} + +impl ServerBuilder { + pub fn new() -> anyhow::Result { + let runtime = build_tokio_runtime(); + let game = crate::init::create_game(runtime)?; + let plugin_loader = PluginLoader::new("plugins.toml")?; + + Ok(Self { + game, + plugin_loader, + }) + } + + pub fn register_default_plugins(self) -> Self { + self.register_plugin(FeatherWorldFormat) + } + + pub fn register_plugin(mut self, plugin: P) -> Self { + self.plugin_loader.register_plugin(plugin); + self + } + + pub fn run(mut self) -> anyhow::Result<()> { + self.plugin_loader.initialize(&mut self.game)?; + print_systems(&self.game.system_executor.borrow()); + crate::init::run(self.game) + } +} + +fn print_systems(systems: &SystemExecutor) { + let systems: Vec<&str> = systems.system_names().collect(); + log::debug!("---SYSTEMS---\n{:#?}\n", systems); +} + +fn build_tokio_runtime() -> Runtime { + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .expect("failed to create Tokio runtime") +} diff --git a/feather/server/src/chunk_subscriptions.rs b/feather/server/src/chunk_subscriptions.rs index fc7484a0f..c3fa6ab1a 100644 --- a/feather/server/src/chunk_subscriptions.rs +++ b/feather/server/src/chunk_subscriptions.rs @@ -1,21 +1,35 @@ use ahash::AHashMap; -use base::ChunkPosition; use common::{events::ViewUpdateEvent, view::View, Game}; -use ecs::{SysResult, SystemExecutor}; -use quill_common::events::EntityRemoveEvent; +use libcraft::ChunkPosition; +use quill::components::EntityWorld; +use quill::events::EntityRemoveEvent; +use quill::WorldId; use utils::vec_remove_item; +use vane::{SysResult, SystemExecutor}; use crate::{ClientId, Server}; +#[derive(Eq, PartialEq, Hash)] +pub struct ChunkPositionWithWorld { + pub world: WorldId, + pub chunk: ChunkPosition, +} + +impl ChunkPositionWithWorld { + pub fn new(world: WorldId, chunk: ChunkPosition) -> Self { + Self { world, chunk } + } +} + /// Data structure to query which clients should /// receive updates from a given chunk, fast. #[derive(Default)] pub struct ChunkSubscriptions { - chunks: AHashMap>, + chunks: AHashMap>, } impl ChunkSubscriptions { - pub fn subscriptions_for(&self, chunk: ChunkPosition) -> &[ClientId] { + pub fn subscriptions_for(&self, chunk: ChunkPositionWithWorld) -> &[ClientId] { self.chunks .get(&chunk) .map(Vec::as_slice) @@ -31,35 +45,46 @@ pub fn register(systems: &mut SystemExecutor) { fn update_chunk_subscriptions(game: &mut Game, server: &mut Server) -> SysResult { // Update players whose views have changed - for (_, (event, &client_id)) in game.ecs.query::<(&ViewUpdateEvent, &ClientId)>().iter() { - for new_chunk in event.new_view.difference(event.old_view) { + for (_, (event, client_id)) in game.ecs.query::<(&ViewUpdateEvent, &ClientId)>().iter() { + for new_chunk in event.new_view.difference(&event.old_view) { server .chunk_subscriptions .chunks - .entry(new_chunk) + .entry(ChunkPositionWithWorld::new( + event.new_view.world(), + new_chunk, + )) .or_default() - .push(client_id); + .push(*client_id); } - for old_chunk in event.old_view.difference(event.new_view) { - remove_subscription(server, old_chunk, client_id); + for old_chunk in event.old_view.difference(&event.new_view) { + remove_subscription( + server, + ChunkPositionWithWorld::new(event.old_view.world(), old_chunk), + *client_id, + ); } } // Update players that have left - for (_, (_event, &client_id, &view)) in game + for (_, (_event, client_id, view, world)) in game .ecs - .query::<(&EntityRemoveEvent, &ClientId, &View)>() + .query::<(&EntityRemoveEvent, &ClientId, &View, &EntityWorld)>() .iter() { for chunk in view.iter() { - remove_subscription(server, chunk, client_id); + remove_subscription( + server, + ChunkPositionWithWorld::new(world.0, chunk), + *client_id, + ); } } Ok(()) } -fn remove_subscription(server: &mut Server, chunk: ChunkPosition, client_id: ClientId) { +fn remove_subscription(server: &mut Server, chunk: ChunkPositionWithWorld, client_id: ClientId) { if let Some(vec) = server.chunk_subscriptions.chunks.get_mut(&chunk) { vec_remove_item(vec, &client_id); diff --git a/feather/server/src/client.rs b/feather/server/src/client.rs index f18af09a1..9e5d716d6 100644 --- a/feather/server/src/client.rs +++ b/feather/server/src/client.rs @@ -1,42 +1,45 @@ -use std::{ - cell::{Cell, RefCell}, - collections::VecDeque, - io::Cursor, - sync::Arc, -}; - use ahash::AHashSet; +use common::entities::player::HotbarSlot; +use common::Game; +use common::PlayerWindow; +use either::Either; use flume::{Receiver, Sender}; -use slab::Slab; -use uuid::Uuid; - -use base::{ - BlockId, ChunkHandle, ChunkPosition, EntityKind, EntityMetadata, Gamemode, Position, - ProfileProperty, Text, ValidBlockPosition, +use itertools::Itertools; +use libcraft::biome::BiomeList; +use libcraft::items::InventorySlot; +use libcraft::{ + Area, BlockState, ChunkPosition, EntityKind, EntityMetadata, Gamemode, Inventory, Particle, + Position, ProfileProperty, Text, Title, ValidBlockPosition, }; -use common::{ - chat::{ChatKind, ChatMessage}, - Window, -}; -use libcraft_items::InventorySlot; -use packets::server::{Particle, SetSlot, SpawnLivingEntity, UpdateLight, WindowConfirmation}; +use packets::server::{SetSlot, SpawnLivingEntity}; use protocol::packets::server::{ - ChangeGameState, EntityPosition, EntityPositionAndRotation, EntityTeleport, GameStateChange, - HeldItemChange, PlayerAbilities, + ChangeGameState, ClearTitles, DimensionCodec, DimensionCodecEntry, DimensionCodecRegistry, + EntityEquipment, EntityPosition, EntityPositionAndRotation, EntityTeleport, EquipmentEntry, + EquipmentSlot, GameStateChange, HeldItemChange, PlayerAbilities, Respawn, SetTitleSubtitle, + SetTitleText, SetTitleTimes, }; use protocol::{ packets::{ self, server::{ - AddPlayer, Animation, BlockChange, ChatPosition, ChunkData, ChunkDataKind, - DestroyEntities, Disconnect, EntityAnimation, EntityHeadLook, JoinGame, KeepAlive, - PlayerInfo, PlayerPositionAndLook, PluginMessage, SendEntityMetadata, SpawnPlayer, - Title, UnloadChunk, UpdateViewPosition, WindowItems, + AddPlayer, Animation, BlockChange, ChatPosition, ChunkData, DestroyEntities, + Disconnect, EntityAnimation, EntityHeadLook, JoinGame, KeepAlive, PlayerInfo, + PlayerPositionAndLook, PluginMessage, SendEntityMetadata, SpawnPlayer, UnloadChunk, + UpdateViewPosition, WindowItems, }, }, - ClientPlayPacket, Nbt, ProtocolVersion, ServerPlayPacket, Writeable, + ClientPlayPacket, Nbt, ProtocolVersion, ServerPlayPacket, VarInt, Writeable, }; -use quill_common::components::{OnGround, PreviousGamemode}; +use quill::chat::{ChatKind, ChatMessage}; +use quill::components::{OnGround, PreviousGamemode}; +use quill::{ChunkHandle, SysResult, World, WorldId}; +use slotmap::SlotMap; +use std::any::type_name; +use std::collections::HashMap; +use std::iter::FromIterator; +use std::{collections::VecDeque, sync::Arc}; +use uuid::Uuid; +use vane::Component; use crate::{ entities::{PreviousOnGround, PreviousPosition}, @@ -46,16 +49,20 @@ use crate::{ }; /// Max number of chunks to send to a client per tick. -const MAX_CHUNKS_PER_TICK: usize = 10; +const MAX_CHUNKS_PER_TICK: usize = 20; -/// ID of a client. Can be reused. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -pub struct ClientId(usize); +const MIN_CHUNKS_BEFORE_SPAWNING: usize = 5 * 5; + +slotmap::new_key_type! { + pub struct ClientId; +} + +impl Component for ClientId {} /// Stores all `Client`s. #[derive(Default)] pub struct Clients { - slab: Slab, + map: SlotMap, } impl Clients { @@ -64,23 +71,27 @@ impl Clients { } pub fn insert(&mut self, client: Client) -> ClientId { - ClientId(self.slab.insert(client)) + self.map.insert(client) } pub fn remove(&mut self, id: ClientId) -> Option { - self.slab.try_remove(id.0) + self.map.remove(id) } pub fn get(&self, id: ClientId) -> Option<&Client> { - self.slab.get(id.0) + self.map.get(id) } pub fn get_mut(&mut self, id: ClientId) -> Option<&mut Client> { - self.slab.get_mut(id.0) + self.map.get_mut(id) } pub fn iter(&self) -> impl Iterator + '_ { - self.slab.iter().map(|(_i, client)| client) + self.map.iter().map(|(_i, client)| client) + } + + pub fn iter_mut(&mut self) -> impl Iterator + '_ { + self.map.iter_mut().map(|(_i, client)| client) } } @@ -96,21 +107,25 @@ pub struct Client { profile: Vec, uuid: Uuid, - teleport_id_counter: Cell, + teleport_id_counter: i32, network_id: Option, - sent_entities: RefCell>, + sent_entities: AHashSet, - knows_position: Cell, - known_chunks: RefCell>, + knows_position: bool, + known_chunks: AHashSet, - chunk_send_queue: RefCell>, + chunk_send_queue: VecDeque, /// The previous own position sent by the client. /// Used to detect when we need to teleport the client. - client_known_position: Cell>, + client_known_position: Option, + + disconnected: bool, + + world: Option, - disconnected: Cell, + total_sent_chunks: usize, } impl Client { @@ -120,25 +135,27 @@ impl Client { received_packets: player.received_packets, options, username: player.username, - teleport_id_counter: Cell::new(0), + teleport_id_counter: 0, network_id: None, profile: player.profile, uuid: player.uuid, - sent_entities: RefCell::new(AHashSet::new()), - knows_position: Cell::new(false), - known_chunks: RefCell::new(AHashSet::new()), - chunk_send_queue: RefCell::new(VecDeque::new()), - client_known_position: Cell::new(None), - disconnected: Cell::new(false), + sent_entities: AHashSet::new(), + knows_position: false, + known_chunks: AHashSet::new(), + chunk_send_queue: VecDeque::new(), + client_known_position: None, + disconnected: false, + world: None, + total_sent_chunks: 0, } } - pub fn set_client_known_position(&self, pos: Position) { - self.client_known_position.set(Some(pos)); + pub fn set_client_known_position(&mut self, pos: Position) { + self.client_known_position = Some(pos); } pub fn client_known_position(&self) -> Option { - self.client_known_position.get() + self.client_known_position } pub fn profile(&self) -> &[ProfileProperty] { @@ -162,69 +179,127 @@ impl Client { } pub fn is_disconnected(&self) -> bool { - self.received_packets.is_disconnected() || self.disconnected.get() + self.received_packets.is_disconnected() || self.disconnected } - pub fn known_chunks(&self) -> usize { - self.known_chunks.borrow().len() + pub fn known_chunks(&self) -> &AHashSet { + &self.known_chunks } pub fn knows_own_position(&self) -> bool { - self.knows_position.get() - } - - pub fn tick(&self) { - let num_to_send = MAX_CHUNKS_PER_TICK.min(self.chunk_send_queue.borrow().len()); - for packet in self.chunk_send_queue.borrow_mut().drain(0..num_to_send) { - log::trace!( - "Sending chunk at {:?} to {}", - packet.chunk.read().position(), - self.username - ); - let chunk = Arc::clone(&packet.chunk); - self.send_packet(UpdateLight { chunk }); - self.send_packet(packet); + self.knows_position + } + + pub fn tick(&mut self, game: &Game, pos: Position) -> SysResult { + self.flush_chunk_queue(game, pos) + } + + fn flush_chunk_queue(&mut self, game: &Game, pos: Position) -> SysResult { + if let Some(world_id) = self.world { + let mut sent = 0; + let world = game.world(world_id)?; + while let Some(&chunk_pos) = self.chunk_send_queue.get(0) { + if !self.known_chunks.contains(&chunk_pos) { + // The chunk has been unloaded on the client, so + // we don't need to send it anymore. + self.chunk_send_queue.pop_front(); + continue; + } + + match world.chunk_handle_at(chunk_pos) { + Ok(chunk) => { + self.send_packet(ChunkData { + chunk: Either::Left(chunk), + }); + self.total_sent_chunks += 1; + } + Err(_not_loaded) => break, + } + + self.chunk_send_queue.pop_front(); + + sent += 1; + if sent >= MAX_CHUNKS_PER_TICK { + break; + } + } + } + + if self.total_sent_chunks >= MIN_CHUNKS_BEFORE_SPAWNING && !self.knows_own_position() { + log::info!("Spawning {}", self.username()); + self.update_own_position(pos); } + + Ok(()) } /// Returns whether the entity with the given ID /// is currently loaded on the client. pub fn is_entity_loaded(&self, network_id: NetworkId) -> bool { - self.sent_entities.borrow().contains(&network_id) + self.sent_entities.contains(&network_id) } pub fn set_network_id(&mut self, network_id: NetworkId) { self.network_id = Some(network_id); } - pub fn send_join_game(&self, gamemode: Gamemode, previous_gamemode: PreviousGamemode) { + #[allow(clippy::too_many_arguments)] + pub fn send_join_game( + &mut self, + gamemode: Gamemode, + previous_gamemode: PreviousGamemode, + biomes: &BiomeList, + max_players: i32, + world: &dyn World, + ) { log::trace!("Sending Join Game to {}", self.username); - // Use the dimension codec sent by the default vanilla server. (Data acquired via tools/proxy) - let dimension_codec = nbt::Blob::from_reader(&mut Cursor::new(include_bytes!( - "../../../assets/dimension_codec.nbt" - ))) - .expect("dimension codec asset is malformed"); - let dimension = nbt::Blob::from_reader(&mut Cursor::new(include_bytes!( - "../../../assets/dimension.nbt" - ))) - .expect("dimension asset is malformed"); + + let dimension_codec = DimensionCodec { + registries: HashMap::from_iter([ + ( + "minecraft:dimension_type".to_string(), + DimensionCodecRegistry::DimensionType(vec![DimensionCodecEntry { + name: world.dimension_info().r#type.to_owned(), + id: 0, + element: world.dimension_info().info.clone(), + }]), + ), + ( + "minecraft:worldgen/biome".to_string(), + DimensionCodecRegistry::WorldgenBiome( + biomes + .iter() + .enumerate() + .map(|(i, (name, biome))| DimensionCodecEntry { + name: name.to_owned(), + id: i as i16, + element: biome.info.clone(), + }) + .collect(), + ), + ), + ]), + }; + + self.world = Some(world.id()); self.send_packet(JoinGame { entity_id: self.network_id.expect("No network id! Use client.set_network_id(NetworkId) before calling this method.").0, is_hardcore: false, gamemode, previous_gamemode, - world_names: vec!["world".to_owned()], + dimension_names: vec![world.dimension_info().r#type.clone()], dimension_codec: Nbt(dimension_codec), - dimension: Nbt(dimension), - world_name: "world".to_owned(), + dimension: Nbt(world.dimension_info().info.clone()), + dimension_name: world.dimension_info().r#type.clone(), hashed_seed: 0, - max_players: 0, + max_players, view_distance: self.options.view_distance as i32, + simulation_distance: self.options.view_distance as i32, reduced_debug_info: false, enable_respawn_screen: true, - is_debug: false, - is_flat: false, + is_debug:false, + is_flat: world.is_flat(), }); } @@ -232,7 +307,7 @@ impl Client { let mut data = Vec::new(); "Feather" .to_owned() - .write(&mut data, ProtocolVersion::V1_16_2) + .write(&mut data, ProtocolVersion::V1_18_1) .unwrap(); self.send_plugin_message("minecraft:brand", data) } @@ -246,12 +321,13 @@ impl Client { }) } - pub fn update_own_position(&self, new_position: Position) { + pub fn update_own_position(&mut self, new_position: Position) { log::trace!( "Updating position of {} to {:?}", self.username, new_position ); + self.teleport_id_counter += 1; self.send_packet(PlayerPositionAndLook { x: new_position.x, y: new_position.y, @@ -259,12 +335,37 @@ impl Client { yaw: new_position.yaw, pitch: new_position.pitch, flags: 0, - teleport_id: self.teleport_id_counter.get(), + teleport_id: self.teleport_id_counter, + dismount_vehicle: false, }); - self.teleport_id_counter - .set(self.teleport_id_counter.get() + 1); - self.knows_position.set(true); - self.client_known_position.set(Some(new_position)); + self.knows_position = true; + self.client_known_position = Some(new_position); + } + + pub fn move_to_world( + &mut self, + gamemode: Gamemode, + previous_gamemode: PreviousGamemode, + world: &dyn World, + ) { + let dimension_info = world.dimension_info().info.clone(); + + self.world = Some(world.id()); + + self.send_packet(Respawn { + dimension: Nbt(dimension_info), + dimension_name: world.dimension_info().r#type.clone(), + hashed_seed: 0, + gamemode, + previous_gamemode, + is_debug: false, + is_flat: world.is_flat(), + copy_metadata: true, + }); + + self.knows_position = false; + self.client_known_position = None; + self.unload_all_entities(); } pub fn update_own_chunk(&self, pos: ChunkPosition) { @@ -275,37 +376,33 @@ impl Client { }); } - pub fn send_chunk(&self, chunk: &ChunkHandle) { - self.chunk_send_queue.borrow_mut().push_back(ChunkData { - chunk: Arc::clone(chunk), - kind: ChunkDataKind::LoadChunk, - }); - self.known_chunks - .borrow_mut() - .insert(chunk.read().position()); + pub fn queue_send_chunk(&mut self, chunk: ChunkPosition) { + if self.known_chunks.insert(chunk) { + self.chunk_send_queue.push_back(chunk); + } } - pub fn overwrite_chunk_sections(&self, chunk: &ChunkHandle, sections: Vec) { + pub fn overwrite_chunk(&self, chunk: &ChunkHandle) { self.send_packet(ChunkData { - chunk: Arc::clone(chunk), - kind: ChunkDataKind::OverwriteChunk { sections }, + chunk: Either::Left(Arc::clone(chunk)), }); } - pub fn send_block_change(&self, position: ValidBlockPosition, new_block: BlockId) { + pub fn send_block_change(&self, position: ValidBlockPosition, new_block: BlockState) { self.send_packet(BlockChange { position, block: new_block, }); } - pub fn unload_chunk(&self, pos: ChunkPosition) { - log::trace!("Unloading chunk at {:?} on {}", pos, self.username); - self.send_packet(UnloadChunk { - chunk_x: pos.x, - chunk_z: pos.z, - }); - self.known_chunks.borrow_mut().remove(&pos); + pub fn unload_chunk(&mut self, pos: ChunkPosition) { + if self.known_chunks.remove(&pos) { + log::trace!("Unloading chunk at {:?} on {}", pos, self.username); + self.send_packet(UnloadChunk { + chunk_x: pos.x, + chunk_z: pos.z, + }); + } } pub fn add_tablist_player( @@ -336,17 +433,38 @@ impl Client { self.send_packet(PlayerInfo::UpdateGamemodes(vec![(uuid, gamemode)])); } - pub fn unload_entity(&self, id: NetworkId) { + pub fn unload_entity(&mut self, id: NetworkId) { log::trace!("Unloading {:?} on {}", id, self.username); - self.sent_entities.borrow_mut().remove(&id); + self.sent_entities.remove(&id); self.send_packet(DestroyEntities { entity_ids: vec![id.0.into()], }); } - pub fn send_player(&self, network_id: NetworkId, uuid: Uuid, pos: Position) { + pub fn unload_all_entities(&mut self) { + self.unload_entities(&self.sent_entities.iter().copied().collect_vec()) + } + + pub fn unload_entities(&mut self, ids: &[NetworkId]) { + if !ids.is_empty() { + log::trace!("Unloading {:?} on {}", ids, self.username); + self.sent_entities.retain(|e| !ids.contains(e)); + self.send_packet(DestroyEntities { + entity_ids: ids.iter().map(|id| VarInt(id.0)).collect(), + }); + } else { + log::trace!("Unloading 0 entities on {}", self.username) + } + } + + pub fn send_player(&mut self, network_id: NetworkId, uuid: Uuid, pos: Position) { + if Some(network_id) == self.network_id { + return; + } + if self.sent_entities.contains(&network_id) { + return; + } log::trace!("Sending {:?} to {}", uuid, self.username); - assert!(!self.sent_entities.borrow().contains(&network_id)); self.send_packet(SpawnPlayer { entity_id: network_id.0, player_uuid: uuid, @@ -388,66 +506,102 @@ impl Client { }); } + pub fn send_entity_equipment( + &mut self, + network_id: NetworkId, + inventory: &Inventory, + hotbar_slot: &HotbarSlot, + ) { + if Some(network_id) == self.network_id { + return; + } + + let entries = vec![ + equipment_entry(EquipmentSlot::Boots, inventory, Area::Boots, 0), + equipment_entry(EquipmentSlot::Leggings, inventory, Area::Leggings, 0), + equipment_entry(EquipmentSlot::Chestplate, inventory, Area::Chestplate, 0), + equipment_entry(EquipmentSlot::Helmet, inventory, Area::Helmet, 0), + equipment_entry( + EquipmentSlot::MainHand, + inventory, + Area::Hotbar, + hotbar_slot.get(), + ), + equipment_entry(EquipmentSlot::OffHand, inventory, Area::Offhand, 0), + ]; + self.send_packet(EntityEquipment { + entity_id: network_id.0, + entries, + }); + } + + #[allow(clippy::too_many_arguments)] pub fn update_entity_position( - &self, + &mut self, network_id: NetworkId, position: Position, prev_position: PreviousPosition, on_ground: OnGround, prev_on_ground: PreviousOnGround, + world: &dyn World, + gamemode: Option, + previous_gamemode: Option, ) { + let another_world = self.world != Some(world.id()); + if self.network_id == Some(network_id) { // This entity is the client. Only update // the position if it has changed from the client's - // known position. - if Some(position) != self.client_known_position.get() { + // known position or dimension/world has changed. + if another_world { + self.move_to_world(gamemode.unwrap(), previous_gamemode.unwrap(), world); + } else if Some(position) != self.client_known_position { self.update_own_position(position); } - return; - } - - let no_change_yaw = (position.yaw - prev_position.0.yaw).abs() < 0.001; - let no_change_pitch = (position.pitch - prev_position.0.pitch).abs() < 0.001; - - // If the entity jumps or falls we should send a teleport packet instead to keep relative movement in sync. - if on_ground != prev_on_ground.0 { - self.send_packet(EntityTeleport { - entity_id: network_id.0, - x: position.x, - y: position.y, - z: position.z, - yaw: position.yaw, - pitch: position.pitch, - on_ground: *on_ground, - }); + } else if !another_world { + let no_change_yaw = (position.yaw - prev_position.0.yaw).abs() < 0.001; + let no_change_pitch = (position.pitch - prev_position.0.pitch).abs() < 0.001; + + // If the entity jumps or falls we should send a teleport packet instead to keep relative movement in sync. + if on_ground != prev_on_ground.0 { + self.send_packet(EntityTeleport { + entity_id: network_id.0, + x: position.x, + y: position.y, + z: position.z, + yaw: position.yaw, + pitch: position.pitch, + on_ground: *on_ground, + }); - return; - } + return; + } - if no_change_yaw && no_change_pitch { - self.send_packet(EntityPosition { - entity_id: network_id.0, - delta_x: ((position.x * 32.0 - prev_position.0.x * 32.0) * 128.0) as i16, - delta_y: ((position.y * 32.0 - prev_position.0.y * 32.0) * 128.0) as i16, - delta_z: ((position.z * 32.0 - prev_position.0.z * 32.0) * 128.0) as i16, - on_ground: on_ground.0, - }); - } else { - self.send_packet(EntityPositionAndRotation { - entity_id: network_id.0, - delta_x: ((position.x * 32.0 - prev_position.0.x * 32.0) * 128.0) as i16, - delta_y: ((position.y * 32.0 - prev_position.0.y * 32.0) * 128.0) as i16, - delta_z: ((position.z * 32.0 - prev_position.0.z * 32.0) * 128.0) as i16, - yaw: position.yaw, - pitch: position.pitch, - on_ground: on_ground.0, - }); + if no_change_yaw && no_change_pitch { + self.send_packet(EntityPosition { + entity_id: network_id.0, + delta_x: ((position.x * 32.0 - prev_position.0.x * 32.0) * 128.0) as i16, + delta_y: ((position.y * 32.0 - prev_position.0.y * 32.0) * 128.0) as i16, + delta_z: ((position.z * 32.0 - prev_position.0.z * 32.0) * 128.0) as i16, + on_ground: on_ground.0, + }); + } else { + self.send_packet(EntityPositionAndRotation { + entity_id: network_id.0, + delta_x: ((position.x * 32.0 - prev_position.0.x * 32.0) * 128.0) as i16, + delta_y: ((position.y * 32.0 - prev_position.0.y * 32.0) * 128.0) as i16, + delta_z: ((position.z * 32.0 - prev_position.0.z * 32.0) * 128.0) as i16, + yaw: position.yaw, + pitch: position.pitch, + on_ground: on_ground.0, + }); - // Needed for head orientation - self.send_packet(EntityHeadLook { - entity_id: network_id.0, - head_yaw: position.yaw, - }); + // Needed for head orientation + self.send_packet(EntityHeadLook { + entity_id: network_id.0, + head_yaw: position.yaw, + }); + } } } @@ -466,6 +620,11 @@ impl Client { }) } + pub fn send_message(&self, message: ChatMessage) { + let packet = chat_packet(message); + self.send_packet(packet); + } + pub fn send_chat_message(&self, message: ChatMessage) { let packet = chat_packet(message); self.send_packet(packet); @@ -478,25 +637,25 @@ impl Client { /// /// If the sum of `fade_in`, `stay` and `fade_out` is `0` /// This will emit the [`Title::Reset`] packet. - pub fn send_title(&self, title: base::Title) { + pub fn send_title(&self, title: Title) { if title.title.is_none() && title.sub_title.is_none() { - self.send_packet(Title::Hide); + self.send_packet(ClearTitles { reset: false }); } else if title.fade_in + title.stay + title.fade_out == 0 { - self.send_packet(Title::Reset); + self.send_packet(ClearTitles { reset: true }); } else { if let Some(main_title) = title.title { - self.send_packet(Title::SetTitle { - text: main_title.to_string(), + self.send_packet(SetTitleText { + title_text: main_title.to_string(), }); } if let Some(sub_title) = title.sub_title { - self.send_packet(Title::SetSubtitle { - text: sub_title.to_string(), + self.send_packet(SetTitleSubtitle { + subtitle_text: sub_title.to_string(), }) } - self.send_packet(Title::SetTimesAndDisplay { + self.send_packet(SetTitleTimes { fade_in: title.fade_in as i32, stay: title.stay as i32, fade_out: title.fade_out as i32, @@ -509,7 +668,7 @@ impl Client { /// /// Not to be confused with [`Self::hide_title()`] pub fn reset_title(&self) { - self.send_packet(Title::Reset); + self.send_packet(ClearTitles { reset: true }); } /// Hides the title for the player, this removes @@ -518,39 +677,39 @@ impl Client { /// /// Not to be confused with [`Self::reset_title()`] pub fn hide_title(&self) { - self.send_packet(Title::Hide); - } - - pub fn confirm_window_action(&self, window_id: u8, action_number: i16, is_accepted: bool) { - self.send_packet(WindowConfirmation { - window_id, - action_number, - is_accepted, - }); + self.send_packet(ClearTitles { reset: false }); } - pub fn send_window_items(&self, window: &Window) { - log::trace!("Updating window for {}", self.username); + pub fn send_window_items(&self, window: &PlayerWindow) { + log::trace!("Updating inventory for {}", self.username); let packet = WindowItems { window_id: 0, + state_id: 0, items: window.inner().to_vec(), + cursor_item: window.cursor_item().clone(), }; self.send_packet(packet); } - pub fn set_slot(&self, slot: i16, item: &InventorySlot) { - log::trace!("Setting slot {} of {} to {:?}", slot, self.username, item); + pub fn send_inventory_slot(&self, slot: i16, item: &InventorySlot) { + log::trace!( + "Setting inventory slot {} of {} to {:?}", + slot, + self.username, + item + ); self.send_packet(SetSlot { window_id: 0, + state_id: 0, slot, slot_data: item.clone(), }); } - pub fn send_particle(&self, particle: &base::Particle, position: &Position) { - self.send_packet(Particle { + pub fn send_particle(&self, particle: &Particle, long_distance: bool, position: &Position) { + self.send_packet(packets::server::Particle { particle_kind: particle.kind, - long_distance: true, + long_distance, x: position.x, y: position.y, z: position.z, @@ -562,16 +721,16 @@ impl Client { }) } - pub fn set_cursor_slot(&self, item: &InventorySlot) { + pub fn send_cursor_slot(&self, item: &InventorySlot) { log::trace!("Setting cursor slot of {} to {:?}", self.username, item); - self.set_slot(-1, item); + self.send_inventory_slot(-1, item); } - pub fn send_player_model_flags(&self, netowrk_id: NetworkId, model_flags: u8) { + pub fn send_player_model_flags(&self, network_id: NetworkId, model_flags: u8) { let mut entity_metadata = EntityMetadata::new(); - entity_metadata.set(16, model_flags); + entity_metadata.set(17, model_flags); self.send_packet(SendEntityMetadata { - entity_id: netowrk_id.0, + entity_id: network_id.0, entries: entity_metadata, }); } @@ -586,28 +745,28 @@ impl Client { }); } - pub fn send_abilities(&self, abilities: &base::anvil::player::PlayerAbilities) { + pub fn send_abilities(&self, abilities: &libcraft::anvil::player::PlayerAbilities) { let mut bitfield = 0; - if *abilities.invulnerable { + if abilities.invulnerable { bitfield |= 1 << 0; } - if *abilities.is_flying { + if abilities.is_flying { bitfield |= 1 << 1; } - if *abilities.may_fly { + if abilities.may_fly { bitfield |= 1 << 2; } - if *abilities.instabreak { + if abilities.instabreak { bitfield |= 1 << 3; } self.send_packet(PlayerAbilities { flags: bitfield, - flying_speed: *abilities.fly_speed, - fov_modifier: *abilities.walk_speed, + flying_speed: abilities.fly_speed, + fov_modifier: abilities.walk_speed, }); } - pub fn set_hotbar_slot(&self, slot: u8) { + pub fn send_hotbar_slot(&self, slot: u8) { self.send_packet(HeldItemChange { slot }); } @@ -617,20 +776,43 @@ impl Client { }) } - fn register_entity(&self, network_id: NetworkId) { - self.sent_entities.borrow_mut().insert(network_id); + fn register_entity(&mut self, network_id: NetworkId) { + self.sent_entities.insert(network_id); } - fn send_packet(&self, packet: impl Into) { - let _ = self.packets_to_send.try_send(packet.into()); + fn send_packet>(&self, packet: P) { + let packet = packet.into(); + log::trace!("Sending packet {} to {}", type_name::

(), self.username); + let _ = self.packets_to_send.try_send(packet); } - pub fn disconnect(&self, reason: &str) { - self.disconnected.set(true); + pub fn disconnect(&mut self, reason: impl Into) { + self.disconnected = true; self.send_packet(Disconnect { - reason: Text::from(reason.to_owned()).to_string(), + reason: reason.into().to_string(), }); } + + pub fn world(&self) -> Option { + self.world + } +} + +fn equipment_entry( + slot: EquipmentSlot, + inventory: &Inventory, + area: Area, + index: usize, +) -> EquipmentEntry { + EquipmentEntry { + slot, + item: InventorySlot::from( + inventory + .item(area, index) + .map(|item| item.clone().into_option()) + .flatten(), + ), + } } fn chat_packet(message: ChatMessage) -> packets::server::ChatMessage { diff --git a/feather/server/src/config.rs b/feather/server/src/config.rs index 9111a037f..460ab738d 100644 --- a/feather/server/src/config.rs +++ b/feather/server/src/config.rs @@ -1,9 +1,11 @@ //! Loads an `Options` from a TOML config. -use std::{fs, net::IpAddr, path::Path, str::FromStr}; +use std::{fs, net::IpAddr, path::Path, str::FromStr, time::Duration}; use anyhow::Context; -use base::Gamemode; +use indexmap::IndexMap; +use libcraft::Gamemode; +use quill::world::WorldSaveStrategy; use serde::{Deserialize, Deserializer}; use crate::{favicon::Favicon, Options}; @@ -37,12 +39,12 @@ pub struct ConfigContainer { pub was_config_created: bool, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Config { pub network: Network, pub server: ServerConfig, pub log: Log, - pub world: World, + pub worlds: IndexMap, pub proxy: Proxy, } @@ -76,42 +78,77 @@ impl Config { } } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Network { pub address: IpAddr, pub port: u16, pub compression_threshold: i32, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct ServerConfig { pub online_mode: bool, pub motd: String, pub max_players: u32, pub default_gamemode: Gamemode, pub view_distance: u32, + pub default_world: String, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Log { #[serde(deserialize_with = "deserialize_log_level")] pub level: log::LevelFilter, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct World { - pub name: String, - pub generator: String, - pub seed: String, + pub save_strategy: SaveStrategy, + pub dimension_type: String, + pub source: WorldSourceSpec, + #[serde(default)] + pub flat: bool, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] +#[serde(tag = "type")] +#[serde(rename_all = "snake_case")] +pub enum SaveStrategy { + SaveIncrementally { + #[serde(with = "humantime_serde")] + interval: Duration, + }, + DropChanges, + KeepLoaded, +} + +impl From for WorldSaveStrategy { + fn from(s: SaveStrategy) -> Self { + match s { + SaveStrategy::SaveIncrementally { interval } => WorldSaveStrategy::SaveIncrementally { + save_interval: interval, + }, + SaveStrategy::DropChanges => WorldSaveStrategy::DropChanges, + SaveStrategy::KeepLoaded => WorldSaveStrategy::KeepLoaded, + } + } +} + +#[derive(Debug, Deserialize, Clone)] +pub struct WorldSourceSpec { + #[serde(rename = "type")] + pub typ: String, + #[serde(flatten)] + pub params: toml::value::Table, +} + +#[derive(Debug, Deserialize, Clone)] pub struct Proxy { pub proxy_mode: ProxyMode, pub velocity_secret: String, } -#[derive(Debug, Deserialize, PartialEq, Eq)] +#[derive(Debug, Deserialize, Clone, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum ProxyMode { None, diff --git a/feather/server/src/connection_worker.rs b/feather/server/src/connection_worker.rs index 2fe57e784..32adb6068 100644 --- a/feather/server/src/connection_worker.rs +++ b/feather/server/src/connection_worker.rs @@ -1,9 +1,9 @@ use std::{fmt::Debug, io, net::SocketAddr, sync::Arc, time::Duration}; -use base::Text; use flume::{Receiver, Sender}; use futures_lite::FutureExt; use io::ErrorKind; +use libcraft::Text; use protocol::{ codec::CryptKey, packets::server::Disconnect, ClientPlayPacket, MinecraftCodec, Readable, ServerPlayPacket, Writeable, diff --git a/feather/server/src/entities.rs b/feather/server/src/entities.rs index 67015afda..059feff1b 100644 --- a/feather/server/src/entities.rs +++ b/feather/server/src/entities.rs @@ -1,16 +1,22 @@ -use base::{EntityKind, Position}; -use ecs::{EntityBuilder, EntityRef, SysResult}; -use quill_common::{components::OnGround, entity_init::EntityInit}; -use uuid::Uuid; +use libcraft::{EntityKind, Position}; +use protocol::packets::client::ClientSettings; +use quill::components::{EntityKindComponent, EntityPosition, EntityUuid, OnGround}; +use vane::{Component, EntityBuilder, EntityRef, SysResult}; use crate::{Client, NetworkId}; +pub struct PlayerClientSettings(pub ClientSettings); + +impl Component for PlayerClientSettings {} + /// Component that sends the spawn packet for an entity /// using its components. -pub struct SpawnPacketSender(fn(&EntityRef, &Client) -> SysResult); +pub struct SpawnPacketSender(fn(&EntityRef, &mut Client) -> SysResult); + +impl Component for SpawnPacketSender {} impl SpawnPacketSender { - pub fn send(&self, entity: &EntityRef, client: &Client) -> SysResult { + pub fn send(&self, entity: &EntityRef, client: &mut Client) -> SysResult { (self.0)(entity, client) } } @@ -20,13 +26,18 @@ impl SpawnPacketSender { /// when to send movement updates. #[derive(Copy, Clone, Debug)] pub struct PreviousPosition(pub Position); + +impl Component for PreviousPosition {} + /// Stores the [`OnGround`] status of an entity on /// the previous tick. Used to determine /// what movement packet to send. #[derive(Copy, Clone, Debug)] pub struct PreviousOnGround(pub OnGround); -pub fn add_entity_components(builder: &mut EntityBuilder, init: &EntityInit) { +impl Component for PreviousOnGround {} + +pub fn add_entity_components(builder: &mut EntityBuilder, kind: EntityKind) { if !builder.has::() { builder.add(NetworkId::new()); } @@ -34,40 +45,45 @@ pub fn add_entity_components(builder: &mut EntityBuilder, init: &EntityInit) { // can't panic because this is only called after both position and onground is added to all entities. // Position is added in the caller of this function and on_ground is added in the // build default function. All entity builder functions call the build default function. - let prev_position = *builder.get::().unwrap(); - let on_ground = *builder.get::().unwrap(); + let prev_position = builder.get::().unwrap(); + let on_ground = builder.get::().unwrap(); builder - .add(PreviousPosition(prev_position)) + .add(PreviousPosition(prev_position.0)) .add(PreviousOnGround(on_ground)); - add_spawn_packet(builder, init); + add_spawn_packet(builder, kind); } -fn add_spawn_packet(builder: &mut EntityBuilder, init: &EntityInit) { +fn add_spawn_packet(builder: &mut EntityBuilder, kind: EntityKind) { // TODO: object entities spawned with Spawn Entity // (minecarts, items, ...) - let spawn_packet = match init { - EntityInit::Player => spawn_player, + let spawn_packet = match kind { + EntityKind::Player => spawn_player, _ => spawn_living_entity, }; builder.add(SpawnPacketSender(spawn_packet)); } -fn spawn_player(entity: &EntityRef, client: &Client) -> SysResult { +fn spawn_player(entity: &EntityRef, client: &mut Client) -> SysResult { let network_id = *entity.get::()?; - let uuid = *entity.get::()?; - let pos = *entity.get::()?; + let uuid = entity.get::()?.0; + let pos = entity.get::()?; + + client.send_player(network_id, uuid, pos.0); + + if let Ok(settings) = entity.get::() { + client.send_player_model_flags(network_id, settings.0.displayed_skin_parts); + } - client.send_player(network_id, uuid, pos); Ok(()) } -fn spawn_living_entity(entity: &EntityRef, client: &Client) -> SysResult { +fn spawn_living_entity(entity: &EntityRef, client: &mut Client) -> SysResult { let network_id = *entity.get::()?; - let uuid = *entity.get::()?; - let pos = *entity.get::()?; - let kind = *entity.get::()?; + let uuid = entity.get::()?.0; + let pos = entity.get::()?; + let kind = *entity.get::()?; - client.send_living_entity(network_id, uuid, pos, kind); + client.send_living_entity(network_id, uuid, pos.0, kind.0); Ok(()) } diff --git a/feather/server/src/init.rs b/feather/server/src/init.rs new file mode 100644 index 000000000..3029ffb34 --- /dev/null +++ b/feather/server/src/init.rs @@ -0,0 +1,162 @@ +use std::{cell::RefCell, rc::Rc, sync::Arc}; + +use anyhow::{anyhow, bail, Context}; +use quill::world::{WorldDescriptor, WorldSettings}; +use quill::{Game as _, WorldId}; +use tokio::runtime::Runtime; + +use crate::{config::Config, logging, Server}; +use common::{Game, TickLoop}; +use libcraft::biome::BiomeList; +use vane::SystemExecutor; + +const CONFIG_PATH: &str = "config.toml"; + +pub fn create_game(runtime: Runtime) -> anyhow::Result { + let crate::config::ConfigContainer { + config, + was_config_created, + } = crate::config::load(CONFIG_PATH).context("failed to load configuration file")?; + logging::init(config.log.level); + if was_config_created { + log::info!("Created default config"); + } + log::info!("Loaded config"); + + log::info!("Creating server"); + let options = config.to_options(); + let server = runtime.block_on(async move { Server::bind(options).await })?; + + let mut game = init_game(server, &config, runtime)?; + game.insert_resource(config); + + Ok(game) +} + +pub fn run(game: Game) -> anyhow::Result<()> { + launch(game) +} + +fn init_game(server: Server, _config: &Config, runtime: Runtime) -> anyhow::Result { + let mut game = Game::new(runtime); + init_systems(&mut game, server); + init_biomes(&mut game); + Ok(game) +} + +fn init_systems(game: &mut Game, server: Server) { + let mut systems = SystemExecutor::new(); + + // Register common before server code, so + // that packet broadcasting happens after + // gameplay actions. + common::register(game, &mut systems); + server.link_with_game(game, &mut systems); + + game.system_executor = Rc::new(RefCell::new(systems)); +} + +fn init_biomes(game: &mut Game) { + let biomes = Arc::new(BiomeList::vanilla()); + game.insert_resource(biomes); +} + +fn launch(mut game: Game) -> anyhow::Result<()> { + // World initialization must happen after plugin initialization + // so plugin world sources can be referenced in the `config.toml`. + init_worlds(&mut game)?; + + let tick_loop = create_tick_loop(game); + log::debug!("Launching the game loop"); + tick_loop.run(); + + Ok(()) +} + +fn init_worlds(game: &mut Game) -> anyhow::Result<()> { + let config = game.resources.get::()?.clone(); + let dimension_types = libcraft::dimension::vanilla_dimensions(); + let mut default_world_set = false; + for (world_name, world) in config.worlds { + let dimension_info = dimension_types + .iter() + .find(|dim| dim.r#type == world.dimension_type) + .ok_or_else(|| { + anyhow!( + "world '{}' has unknown dimension type '{}'", + world_name, + world.dimension_type + ) + })? + .clone(); + + let id = WorldId::new_random(); // TODO persist + + let source_factory = game + .world_source_factory(&world.source.typ) + .with_context(|| format!("unknown world source in world '{}'", world_name))?; + let source = source_factory + .create_world_source( + game, + &toml::Value::Table(world.source.params), + &dimension_info, + id, + ) + .with_context(|| { + format!( + "failed to initialize world source for world '{}'", + world_name + ) + })?; + + let desc = WorldDescriptor { + id, + source, + name: Some(world_name.clone()), + dimension_info, + flat: world.flat, + settings: WorldSettings { + save_strategy: world.save_strategy.into(), + ..Default::default() + }, + }; + game.create_world(desc); + + if world_name == config.server.default_world { + game.set_default_world(id); + default_world_set = true; + } + } + + if !default_world_set { + bail!( + "default world '{}' is not configured", + config.server.default_world + ); + } + + Ok(()) +} + +fn create_tick_loop(mut game: Game) -> TickLoop { + let (shutdown_sender, shutdown) = flume::bounded(1); + ctrlc::set_handler(move || { + shutdown_sender.send(()).ok(); + }) + .expect("failed to set shutdown handler"); + + TickLoop::new(move || { + let systems = Rc::clone(&game.system_executor); + systems.borrow_mut().run(&mut game); + game.tick_count += 1; + + let should_shutdown = shutdown.try_recv().is_ok(); + if should_shutdown { + log::info!("Server shutting down"); + for mut world in game.worlds_mut() { + world.shutdown(); + } + } + should_shutdown + }) +} diff --git a/feather/server/src/initial_handler.rs b/feather/server/src/initial_handler.rs index adb72127b..1a06477ee 100644 --- a/feather/server/src/initial_handler.rs +++ b/feather/server/src/initial_handler.rs @@ -1,12 +1,21 @@ //! Initial handling of a connection. -use crate::{connection_worker::Worker, favicon::Favicon}; +use std::convert::TryInto; + use anyhow::bail; -use base::{ProfileProperty, Text}; +use const_format::concatcp; use flume::{Receiver, Sender}; use md5::Digest; use num_bigint::BigInt; use once_cell::sync::Lazy; +use rand::rngs::OsRng; +use rsa::{PaddingScheme, PublicKeyParts, RsaPrivateKey}; +use serde::{Deserialize, Serialize}; +use sha1::Sha1; +use uuid::Uuid; + +use libcraft::{ProfileProperty, Text}; +use libcraft::{PROTOCOL_VERSION, VERSION_STRING}; use protocol::{ codec::CryptKey, packets::{ @@ -18,17 +27,12 @@ use protocol::{ ClientHandshakePacket, ClientLoginPacket, ClientPlayPacket, ClientStatusPacket, ServerLoginPacket, ServerPlayPacket, ServerStatusPacket, }; -use rand::rngs::OsRng; -use rsa::{PaddingScheme, PublicKeyParts, RsaPrivateKey}; -use serde::{Deserialize, Serialize}; -use sha1::Sha1; -use std::convert::TryInto; -use uuid::Uuid; + +use crate::{connection_worker::Worker, favicon::Favicon}; use self::proxy::ProxyData; -const SERVER_NAME: &str = "Feather 1.16.5"; -const PROTOCOL_VERSION: i32 = 754; +const SERVER_NAME: &str = concatcp!("Feather ", VERSION_STRING); mod proxy; diff --git a/feather/server/src/initial_handler/proxy.rs b/feather/server/src/initial_handler/proxy.rs index f2a2775bb..e202dcbc9 100644 --- a/feather/server/src/initial_handler/proxy.rs +++ b/feather/server/src/initial_handler/proxy.rs @@ -1,6 +1,6 @@ //! Proxy support for BungeeCord and Velocity. -use base::ProfileProperty; +use libcraft::ProfileProperty; use protocol::packets::client::Handshake; use uuid::Uuid; diff --git a/feather/server/src/initial_handler/proxy/bungeecord.rs b/feather/server/src/initial_handler/proxy/bungeecord.rs index 4e576a10a..677251fcf 100644 --- a/feather/server/src/initial_handler/proxy/bungeecord.rs +++ b/feather/server/src/initial_handler/proxy/bungeecord.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use anyhow::bail; -use base::ProfileProperty; +use libcraft::ProfileProperty; use protocol::packets::client::Handshake; use uuid::Uuid; @@ -40,7 +40,7 @@ pub fn extract(packet: &Handshake) -> anyhow::Result { #[cfg(test)] mod tests { - use base::ProfileProperty; + use libcraft::ProfileProperty; use protocol::packets::client::HandshakeState; use crate::initial_handler::PROTOCOL_VERSION; diff --git a/feather/server/src/initial_handler/proxy/velocity.rs b/feather/server/src/initial_handler/proxy/velocity.rs index 134ee556a..bc2efec26 100644 --- a/feather/server/src/initial_handler/proxy/velocity.rs +++ b/feather/server/src/initial_handler/proxy/velocity.rs @@ -2,7 +2,7 @@ use std::io::Cursor; use anyhow::anyhow; use anyhow::bail; -use base::ProfileProperty; +use libcraft::ProfileProperty; use protocol::{ io::VarIntPrefixedVec, packets::server::LoginPluginRequest, ClientLoginPacket, ProtocolVersion, Readable, ServerLoginPacket, VarInt, @@ -62,7 +62,7 @@ fn read_player_info(key: &str, payload: &[u8]) -> anyhow::Result { let payload = verify_hmac(key, payload)?; let mut payload = Cursor::new(payload); - let mcversion = ProtocolVersion::V1_16_2; + let mcversion = ProtocolVersion::V1_18_1; let version = VarInt::read(&mut payload, mcversion)?; if version.0 != FORWARDING_VERSION { diff --git a/feather/server/src/lib.rs b/feather/server/src/lib.rs index c1aec55dc..6dbe640b6 100644 --- a/feather/server/src/lib.rs +++ b/feather/server/src/lib.rs @@ -1,147 +1,26 @@ #![allow(clippy::unnecessary_wraps)] // systems are required to return Results -use std::{sync::Arc, time::Instant}; - -use base::Position; -use chunk_subscriptions::ChunkSubscriptions; -use common::Game; -use ecs::SystemExecutor; -use flume::Receiver; -use initial_handler::NewPlayer; -use listener::Listener; - +pub mod builder; mod chunk_subscriptions; pub mod client; pub mod config; mod connection_worker; mod entities; pub mod favicon; +pub mod init; mod initial_handler; mod listener; +mod logging; mod network_id_registry; mod options; mod packet_handlers; mod player_count; +mod plugin; +pub mod server; mod systems; +pub use builder::ServerBuilder; pub use client::{Client, ClientId, Clients}; pub use network_id_registry::NetworkId; pub use options::Options; -use player_count::PlayerCount; -use systems::view::WaitingChunks; - -/// A Minecraft server. -/// -/// Call [`link_with_game`](Server::link_with_game) to register the server -/// with a [`Game`](common::Game). This will -/// cause the server to serve the game to players. -/// -/// Uses asynchronous IO with Tokio. -pub struct Server { - options: Arc, - clients: Clients, - new_players: Receiver, - - waiting_chunks: WaitingChunks, - chunk_subscriptions: ChunkSubscriptions, - - last_keepalive_time: Instant, - - player_count: PlayerCount, -} - -impl Server { - /// Starts a server with the given `Options`. - /// - /// Must be called within the context of a Tokio runtime. - pub async fn bind(options: Options) -> anyhow::Result { - let options = Arc::new(options); - let player_count = PlayerCount::new(options.max_players); - - let (new_players_tx, new_players) = flume::bounded(4); - Listener::start(Arc::clone(&options), player_count.clone(), new_players_tx).await?; - - log::info!( - "Server is listening on {}:{}", - options.bind_address, - options.port - ); - - Ok(Self { - options, - clients: Clients::new(), - new_players, - waiting_chunks: WaitingChunks::default(), - chunk_subscriptions: ChunkSubscriptions::default(), - last_keepalive_time: Instant::now(), - player_count, - }) - } - - /// Links this server with a `Game` so that players connecting - /// to the server become part of this `Game`. - pub fn link_with_game(self, game: &mut Game, systems: &mut SystemExecutor) { - systems::register(self, game, systems); - game.add_entity_spawn_callback(entities::add_entity_components); - } - - /// Gets the number of online players. - pub fn player_count(&self) -> u32 { - self.player_count.get() - } -} - -/// Low-level functions, mostly used internally. -/// You may find these useful for some custom functionality. -impl Server { - /// Polls for newly connected players. Returns the IDs of the new clients. - pub fn accept_new_players(&mut self) -> Vec { - let mut clients = Vec::new(); - for player in self.new_players.clone().try_iter() { - if let Some(old_client) = self.clients.iter().find(|x| x.uuid() == player.uuid) { - old_client.disconnect("Logged in from another location!"); - } - let id = self.create_client(player); - clients.push(id); - } - clients - } - - /// Removes a client. - pub fn remove_client(&mut self, id: ClientId) { - let client = self.clients.remove(id); - if let Some(client) = client { - log::debug!("Removed client for {}", client.username()); - } - } - - fn create_client(&mut self, player: NewPlayer) -> ClientId { - log::debug!("Creating client for {}", player.username); - let client = Client::new(player, Arc::clone(&self.options)); - self.clients.insert(client) - } - - /// Invokes a callback on all clients. - pub fn broadcast_with(&self, mut callback: impl FnMut(&Client)) { - for client in self.clients.iter() { - callback(client); - } - } - - /// Sends a packet to all clients currently subscribed - /// to the given position. This function should be - /// used for entity updates, block updates, etc— - /// any packets that need to be sent only to nearby players. - pub fn broadcast_nearby_with(&self, position: Position, mut callback: impl FnMut(&Client)) { - for &client_id in self.chunk_subscriptions.subscriptions_for(position.chunk()) { - if let Some(client) = self.clients.get(client_id) { - callback(client); - } - } - } - - pub fn broadcast_keepalive(&mut self) { - self.broadcast_with(|client| client.send_keepalive()); - self.last_keepalive_time = Instant::now(); - } -} +pub use server::Server; diff --git a/feather/server/src/main.rs b/feather/server/src/main.rs index c3bf7ea16..6234fee80 100644 --- a/feather/server/src/main.rs +++ b/feather/server/src/main.rs @@ -1,107 +1,5 @@ -use std::{cell::RefCell, rc::Rc, sync::Arc}; +use feather_server::ServerBuilder; -use anyhow::Context; -use base::anvil::level::SuperflatGeneratorOptions; -use common::{Game, TickLoop, World}; -use ecs::SystemExecutor; -use feather_server::{config::Config, Server}; -use plugin_host::PluginManager; -use worldgen::{ComposableGenerator, SuperflatWorldGenerator, VoidWorldGenerator, WorldGenerator}; - -mod logging; - -const PLUGINS_DIRECTORY: &str = "plugins"; -const CONFIG_PATH: &str = "config.toml"; - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - let feather_server::config::ConfigContainer { - config, - was_config_created, - } = feather_server::config::load(CONFIG_PATH).context("failed to load configuration file")?; - logging::init(config.log.level); - if was_config_created { - log::info!("Created default config"); - } - log::info!("Loaded config"); - - log::info!("Creating server"); - let options = config.to_options(); - let server = Server::bind(options).await?; - - let game = init_game(server, &config)?; - - run(game); - - Ok(()) -} - -fn init_game(server: Server, config: &Config) -> anyhow::Result { - let mut game = Game::new(); - init_systems(&mut game, server); - init_world_source(&mut game, config); - init_plugin_manager(&mut game)?; - Ok(game) -} - -fn init_systems(game: &mut Game, server: Server) { - let mut systems = SystemExecutor::new(); - - // Register common before server code, so - // that packet broadcasting happens after - // gameplay actions. - common::register(game, &mut systems); - server.link_with_game(game, &mut systems); - - print_systems(&systems); - - game.system_executor = Rc::new(RefCell::new(systems)); -} - -fn init_world_source(game: &mut Game, config: &Config) { - // Load chunks from the world save first, - // and fall back to generating a superflat - // world otherwise. This is a placeholder: - // we don't have proper world generation yet. - - let seed = 42; // FIXME: load from the level file - - let generator: Arc = match &config.world.generator[..] { - "flat" => Arc::new(SuperflatWorldGenerator::new( - SuperflatGeneratorOptions::default(), - )), - "void" => Arc::new(VoidWorldGenerator), - _ => Arc::new(ComposableGenerator::default_with_seed(seed)), - }; - game.world = World::with_gen_and_path(generator, config.world.name.clone()); -} - -fn init_plugin_manager(game: &mut Game) -> anyhow::Result<()> { - let mut plugin_manager = PluginManager::new(); - plugin_manager.load_dir(game, PLUGINS_DIRECTORY)?; - - let plugin_manager_rc = Rc::new(RefCell::new(plugin_manager)); - game.insert_resource(plugin_manager_rc); - Ok(()) -} - -fn print_systems(systems: &SystemExecutor) { - let systems: Vec<&str> = systems.system_names().collect(); - log::debug!("---SYSTEMS---\n{:#?}\n", systems); -} - -fn run(game: Game) { - let tick_loop = create_tick_loop(game); - log::debug!("Launching the game loop"); - tick_loop.run(); -} - -fn create_tick_loop(mut game: Game) -> TickLoop { - TickLoop::new(move || { - let systems = Rc::clone(&game.system_executor); - systems.borrow_mut().run(&mut game); - game.tick_count += 1; - - false - }) +fn main() -> anyhow::Result<()> { + ServerBuilder::new()?.register_default_plugins().run() } diff --git a/feather/server/src/network_id_registry.rs b/feather/server/src/network_id_registry.rs index 117c293a0..d3f576168 100644 --- a/feather/server/src/network_id_registry.rs +++ b/feather/server/src/network_id_registry.rs @@ -1,10 +1,14 @@ use std::sync::atomic::{AtomicI32, Ordering}; +use vane::Component; + /// An entity's ID used by the protocol /// in `entity_id` fields. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub struct NetworkId(pub i32); +impl Component for NetworkId {} + impl NetworkId { /// Creates a new, unique network ID. pub(crate) fn new() -> Self { diff --git a/feather/server/src/options.rs b/feather/server/src/options.rs index f75fc203f..9da23cb79 100644 --- a/feather/server/src/options.rs +++ b/feather/server/src/options.rs @@ -1,4 +1,4 @@ -use base::Gamemode; +use libcraft::Gamemode; use crate::favicon::Favicon; diff --git a/feather/server/src/packet_handlers.rs b/feather/server/src/packet_handlers.rs index b0452c96a..5b70552ad 100644 --- a/feather/server/src/packet_handlers.rs +++ b/feather/server/src/packet_handlers.rs @@ -1,10 +1,9 @@ -use base::{Position, Text}; -use common::{chat::ChatKind, Game}; -use ecs::{Entity, EntityRef, SysResult}; +use common::{events::ViewUpdateEvent, view::View, Game}; use interaction::{ handle_held_item_change, handle_interact_entity, handle_player_block_placement, handle_player_digging, }; +use libcraft::Text; use protocol::{ packets::{ client, @@ -12,9 +11,11 @@ use protocol::{ }, ClientPlayPacket, }; -use quill_common::components::Name; +use quill::chat::ChatKind; +use quill::components::{EntityPosition, EntityWorld, Name}; +use vane::{Entity, EntityRef, SysResult}; -use crate::{NetworkId, Server}; +use crate::{entities::PlayerClientSettings, NetworkId, Server}; mod entity_action; mod interaction; @@ -62,12 +63,16 @@ pub fn handle_packet( handle_player_block_placement(game, server, packet, player_id) } - ClientPlayPacket::HeldItemChange(packet) => handle_held_item_change(player, packet), + ClientPlayPacket::HeldItemChange(packet) => { + handle_held_item_change(game, player_id, packet) + } ClientPlayPacket::InteractEntity(packet) => { handle_interact_entity(game, server, packet, player_id) } - ClientPlayPacket::ClientSettings(packet) => handle_client_settings(server, player, packet), + ClientPlayPacket::ClientSettings(packet) => { + handle_client_settings(server, game, player_id, packet) + } ClientPlayPacket::PlayerAbilities(packet) => { movement::handle_player_abilities(game, player_id, packet) @@ -82,7 +87,6 @@ pub fn handle_packet( | ClientPlayPacket::SetDifficulty(_) | ClientPlayPacket::ClientStatus(_) | ClientPlayPacket::TabComplete(_) - | ClientPlayPacket::WindowConfirmation(_) | ClientPlayPacket::ClickWindowButton(_) | ClientPlayPacket::CloseWindow(_) | ClientPlayPacket::PluginMessage(_) @@ -109,7 +113,8 @@ pub fn handle_packet( | ClientPlayPacket::UpdateStructureBlock(_) | ClientPlayPacket::UpdateSign(_) | ClientPlayPacket::Spectate(_) - | ClientPlayPacket::UseItem(_) => Ok(()), + | ClientPlayPacket::UseItem(_) + | ClientPlayPacket::Pong(_) => Ok(()), } } @@ -118,7 +123,6 @@ fn handle_animation( player: EntityRef, packet: client::Animation, ) -> SysResult { - let pos = *player.get::()?; let network_id = *player.get::()?; let animation = match packet.hand { @@ -126,9 +130,11 @@ fn handle_animation( Hand::Off => Animation::SwingOffhand, }; - server.broadcast_nearby_with(pos, |client| { - client.send_entity_animation(network_id, animation.clone()) - }); + server.broadcast_nearby_with( + player.get::()?.0, + player.get::()?.0, + |client| client.send_entity_animation(network_id, animation.clone()), + ); Ok(()) } @@ -141,12 +147,31 @@ fn handle_chat_message(game: &Game, player: EntityRef, packet: client::ChatMessa fn handle_client_settings( server: &mut Server, - player: EntityRef, + game: &mut Game, + player_id: Entity, packet: client::ClientSettings, ) -> SysResult { - let network_id = *player.get::()?; - server.broadcast_with(|client| { - client.send_player_model_flags(network_id, packet.displayed_skin_parts) - }); + let player = game.ecs.entity(player_id)?; + + let (old_view, new_view) = { + let network_id = *player.get::()?; + server.broadcast_with(|client| { + client.send_player_model_flags(network_id, packet.displayed_skin_parts) + }); + + let mut view = player.get_mut::()?; + let old_view = view.clone(); + view.set_view_distance((packet.view_distance as u32).min(server.options.view_distance)); + (old_view, view.clone()) + }; + + // Don't overwrite an existing view update event + if !game.ecs.has::(player_id) { + game.ecs + .insert_entity_event(player_id, ViewUpdateEvent::new(&old_view, &new_view))?; + } + + game.ecs.insert(player_id, PlayerClientSettings(packet))?; + Ok(()) } diff --git a/feather/server/src/packet_handlers/entity_action.rs b/feather/server/src/packet_handlers/entity_action.rs index 8de3210c2..896f39ea4 100644 --- a/feather/server/src/packet_handlers/entity_action.rs +++ b/feather/server/src/packet_handlers/entity_action.rs @@ -1,10 +1,10 @@ use common::Game; -use ecs::{Entity, SysResult}; use protocol::packets::client::{EntityAction, EntityActionKind}; -use quill_common::{ +use quill::{ components::{Sneaking, Sprinting}, events::{SneakEvent, SprintEvent}, }; +use vane::{Entity, SysResult}; /// From [wiki](https://wiki.vg/Protocol#Entity_Action) /// Sent by the client to indicate that it has performed certain actions: diff --git a/feather/server/src/packet_handlers/interaction.rs b/feather/server/src/packet_handlers/interaction.rs index 1c6f69d9c..9361224fc 100644 --- a/feather/server/src/packet_handlers/interaction.rs +++ b/feather/server/src/packet_handlers/interaction.rs @@ -1,23 +1,28 @@ -use crate::{ClientId, NetworkId, Server}; -use base::inventory::{SLOT_HOTBAR_OFFSET, SLOT_OFFHAND}; +use common::block::placement::item_to_block; use common::entities::player::HotbarSlot; +use common::events::BlockChangeEvent; use common::interactable::InteractableRegistry; -use common::{Game, Window}; -use ecs::{Entity, EntityRef, SysResult}; -use libcraft_core::{BlockFace as LibcraftBlockFace, Hand}; -use libcraft_core::{InteractionType, Vec3f}; +use common::{Game, PlayerWindow}; +use libcraft::anvil::inventory_consts::{SLOT_HOTBAR_OFFSET, SLOT_OFFHAND}; +use libcraft::{Area, BlockFace as LibcraftBlockFace, Hand}; +use libcraft::{BlockKind, BlockState}; +use libcraft::{InteractionType, Vec3f}; use protocol::packets::client::{ BlockFace, HeldItemChange, InteractEntity, InteractEntityKind, PlayerBlockPlacement, PlayerDigging, PlayerDiggingStatus, }; -use quill_common::{ - events::{BlockInteractEvent, BlockPlacementEvent, InteractEntityEvent}, - EntityId, +use quill::components::{EntityInventory, EntityPosition, EntityWorld, Sneaking}; +use quill::events::{ + BlockInteractEvent, BlockPlacementEvent, HeldItemChangeEvent, InteractEntityEvent, }; +use vane::{Entity, SysResult}; + +use crate::{ClientId, NetworkId, Server}; + /// Handles the player block placement packet. Currently just removes the block client side for the player. pub fn handle_player_block_placement( game: &mut Game, - _server: &mut Server, + server: &mut Server, packet: PlayerBlockPlacement, player: Entity, ) -> SysResult { @@ -27,7 +32,7 @@ pub fn handle_player_block_placement( _ => { let client_id = game.ecs.get::(player).unwrap(); - let client = _server.clients.get(*client_id).unwrap(); + let client = server.clients.get_mut(*client_id).unwrap(); client.disconnect("Malformed Packet!"); @@ -54,13 +59,15 @@ pub fn handle_player_block_placement( ); let block_kind = { - let result = game.block(packet.position); + let world_id = game.ecs.get::(player)?; + let world = game.world(world_id.0)?; + let result = world.block_at(packet.position.into()); match result { - Some(block) => block.kind(), - None => { + Ok(block) => block.kind(), + Err(_) => { let client_id = game.ecs.get::(player).unwrap(); - let client = _server.clients.get(*client_id).unwrap(); + let client = server.clients.get_mut(*client_id).unwrap(); client.disconnect("Attempted to interact with an unloaded block!"); @@ -77,7 +84,7 @@ pub fn handle_player_block_placement( .get::() .expect("Failed to get the interactable registry"); - if interactable_registry.is_registered(block_kind) { + if interactable_registry.is_registered(block_kind) && !game.ecs.get::(player)?.0 { // Handle this as a block interaction let event = BlockInteractEvent { hand, @@ -90,6 +97,16 @@ pub fn handle_player_block_placement( game.ecs.insert_entity_event(player, event)?; } else { // Handle this as a block placement + let item = { + let inventory = game.ecs.get::(player)?; + let slot = game.ecs.get::(player)?; + let item = inventory.item(Area::Hotbar, slot.get()); + item.and_then(|slot| slot.item_kind()) + }; + let block = match item.and_then(item_to_block) { + Some(block) => block, + None => return Ok(()), + }; let event = BlockPlacementEvent { hand, location: packet.position.into(), @@ -98,7 +115,27 @@ pub fn handle_player_block_placement( inside_block: packet.inside_block, }; + let mut block_change_events = Vec::new(); + { + let mut world = game.world_mut(game.ecs.get::(player)?.0)?; + let light_level = 15; + + common::block::placement::place_block( + game, + &mut *world, + game.ecs.get::(player)?.0, + block, + &event, + light_level, + &mut block_change_events, + ); + } + game.ecs.insert_entity_event(player, event)?; + + for event in block_change_events { + game.ecs.insert_event(event); + } } Ok(()) @@ -120,11 +157,18 @@ pub fn handle_player_digging( log::trace!("Got player digging with status {:?}", packet.status); match packet.status { PlayerDiggingStatus::StartDigging | PlayerDiggingStatus::CancelDigging => { - game.break_block(packet.position); + let world_id = game.ecs.get::(player)?.0; + { + let world = game.world(world_id)?; + world.set_block_at(packet.position.into(), BlockState::new(BlockKind::Air))?; + } + + game.ecs + .insert_event(BlockChangeEvent::single(packet.position, world_id)); Ok(()) } PlayerDiggingStatus::SwapItemInHand => { - let window = game.ecs.get::(player)?; + let window = game.ecs.get::(player)?; let hotbar_slot = game.ecs.get::(player)?.get(); @@ -132,8 +176,8 @@ pub fn handle_player_digging( let offhand_index = SLOT_OFFHAND; { - let mut hotbar_item = window.item(hotbar_index)?; - let mut offhand_item = window.item(offhand_index)?; + let mut hotbar_item = window.item_mut(hotbar_index)?; + let mut offhand_item = window.item_mut(offhand_index)?; std::mem::swap(&mut *hotbar_item, &mut *offhand_item); } @@ -151,13 +195,13 @@ pub fn handle_player_digging( pub fn handle_interact_entity( game: &mut Game, - _server: &mut Server, + server: &mut Server, packet: InteractEntity, player: Entity, ) -> SysResult { let target = { let mut found_entity = None; - for (entity, &network_id) in game.ecs.query::<&NetworkId>().iter() { + for (entity, network_id) in game.ecs.query::<&NetworkId>().iter() { if network_id.0 == packet.entity_id { found_entity = Some(entity); break; @@ -168,7 +212,7 @@ pub fn handle_interact_entity( None => { let client_id = game.ecs.get::(player).unwrap(); - let client = _server.clients.get(*client_id).unwrap(); + let client = server.clients.get_mut(*client_id).unwrap(); client.disconnect("Interacted with an invalid entity!"); @@ -180,14 +224,14 @@ pub fn handle_interact_entity( let event = match packet.kind { InteractEntityKind::Attack => InteractEntityEvent { - target: EntityId(target.id() as u64), + target, ty: InteractionType::Attack, target_pos: None, hand: None, sneaking: packet.sneaking, }, InteractEntityKind::Interact => InteractEntityEvent { - target: EntityId(target.id() as u64), + target, ty: InteractionType::Interact, target_pos: None, hand: None, @@ -206,7 +250,7 @@ pub fn handle_interact_entity( }; InteractEntityEvent { - target: EntityId(target.id() as u64), + target, ty: InteractionType::Attack, target_pos: Some(Vec3f::new( target_x as f32, @@ -224,13 +268,22 @@ pub fn handle_interact_entity( Ok(()) } -pub fn handle_held_item_change(player: EntityRef, packet: HeldItemChange) -> SysResult { +pub fn handle_held_item_change( + game: &mut Game, + player_id: Entity, + packet: HeldItemChange, +) -> SysResult { let new_id = packet.slot as usize; - let mut slot = player.get_mut::()?; + let mut slot = game.ecs.get_mut::(player_id)?; log::trace!("Got player slot change from {} to {}", slot.get(), new_id); slot.set(new_id)?; + + drop(slot); + game.ecs + .insert_entity_event(player_id, HeldItemChangeEvent)?; + Ok(()) } @@ -243,13 +296,12 @@ mod tests { #[test] fn held_item_change() { - let mut game = Game::new(); + let mut game = Game::default(); let entity = game.ecs.spawn((HotbarSlot::new(0),)); - let player = game.ecs.entity(entity).unwrap(); let packet = HeldItemChange { slot: 8 }; - handle_held_item_change(player, packet).unwrap(); + handle_held_item_change(&mut game, entity, packet).unwrap(); assert_eq!( *game.ecs.get::(entity).unwrap(), diff --git a/feather/server/src/packet_handlers/inventory.rs b/feather/server/src/packet_handlers/inventory.rs index 48a397197..bbac69eaf 100644 --- a/feather/server/src/packet_handlers/inventory.rs +++ b/feather/server/src/packet_handlers/inventory.rs @@ -1,22 +1,23 @@ use anyhow::bail; -use base::Gamemode; -use common::{window::BackingWindow, Window}; -use ecs::{EntityRef, SysResult}; +use common::{window::BackingWindow, PlayerWindow}; +use libcraft::Gamemode; use protocol::packets::client::{ClickWindow, CreativeInventoryAction}; +use quill::components::PlayerGamemode; +use vane::{EntityRef, SysResult}; use crate::{ClientId, Server}; pub fn handle_creative_inventory_action( player: EntityRef, packet: CreativeInventoryAction, - server: &mut Server, + _server: &mut Server, ) -> SysResult { - if *player.get::()? != Gamemode::Creative { + if player.get::()?.0 != Gamemode::Creative { bail!("cannot use Creative Inventory Action outside of creative mode"); } if packet.slot != -1 { - let window = player.get::()?; + let window = player.get::()?; if !matches!(window.inner(), BackingWindow::Player { .. }) { bail!("cannot use Creative Inventory Action in external inventories"); } @@ -24,12 +25,6 @@ pub fn handle_creative_inventory_action( window .inner() .set_item(packet.slot as usize, packet.clicked_item)?; - - // Sends the client updates about window changes. - // Is required to make delete inventory button reflect in-game. - let client_id = *player.get::()?; - let client = server.clients.get(client_id).unwrap(); - client.send_window_items(&window); } Ok(()) @@ -40,29 +35,28 @@ pub fn handle_click_window( player: EntityRef, packet: ClickWindow, ) -> SysResult { - let result = _handle_click_window(&player, &packet); + let mut window = player.get_mut::().unwrap(); + let result = _handle_click_window(&packet, &mut window); - let client = server.clients.get(*player.get::()?).unwrap(); - client.confirm_window_action( - packet.window_id, - packet.action_number as i16, - result.is_ok(), - ); - - let window = player.get::()?; + let client = server + .clients + .get(*player.get::().unwrap()) + .unwrap(); if packet.slot >= 0 { - client.set_slot(packet.slot, &*window.item(packet.slot as usize)?); + let item = window.item(packet.slot as usize)?.clone(); + let old_cursor_item = window.cursor_item(); + client.send_inventory_slot(packet.slot, old_cursor_item); + window.set_cursor_item(item); } - client.set_cursor_slot(window.cursor_item()); + client.send_cursor_slot(window.cursor_item()); client.send_window_items(&*window); result } -fn _handle_click_window(player: &EntityRef, packet: &ClickWindow) -> SysResult { - let mut window = player.get_mut::()?; +fn _handle_click_window(packet: &ClickWindow, window: &mut PlayerWindow) -> SysResult { match packet.mode { 0 => match packet.button { 0 => window.left_click(packet.slot as usize)?, @@ -79,6 +73,5 @@ fn _handle_click_window(player: &EntityRef, packet: &ClickWindow) -> SysResult { }, _ => bail!("unsupported window click mode"), }; - Ok(()) } diff --git a/feather/server/src/packet_handlers/movement.rs b/feather/server/src/packet_handlers/movement.rs index 27b03ee23..ffe321351 100644 --- a/feather/server/src/packet_handlers/movement.rs +++ b/feather/server/src/packet_handlers/movement.rs @@ -1,13 +1,13 @@ -use base::Position; use common::Game; -use ecs::{Entity, EntityRef, SysResult}; +use libcraft::Position; use protocol::packets::client::{ PlayerAbilities, PlayerMovement, PlayerPosition, PlayerPositionAndRotation, PlayerRotation, }; -use quill_common::{ - components::{CreativeFlying, OnGround}, +use quill::{ + components::{CreativeFlying, EntityPosition, OnGround}, events::CreativeFlyingEvent, }; +use vane::{Entity, EntityRef, SysResult}; use crate::{ClientId, Server}; @@ -17,7 +17,7 @@ use crate::{ClientId, Server}; /// is aware of the position update. fn should_skip_movement(server: &Server, player: &EntityRef) -> SysResult { if let Some(client) = server.clients.get(*player.get::()?) { - let server_position = *player.get::()?; + let server_position = player.get::()?.0; let client_position = client.client_known_position(); if let Some(client_position) = client_position { if client_position != server_position { @@ -25,6 +25,9 @@ fn should_skip_movement(server: &Server, player: &EntityRef) -> SysResult // Don't override. return Ok(true); } + } else { + // Client doesn't know its position yet. + return Ok(true); } } Ok(false) @@ -36,59 +39,68 @@ pub fn handle_player_movement(player: EntityRef, packet: PlayerMovement) -> SysR } pub fn handle_player_position( - server: &Server, + server: &mut Server, player: EntityRef, packet: PlayerPosition, ) -> SysResult { if should_skip_movement(server, &player)? { return Ok(()); } - let mut pos = player.get_mut::()?; - pos.x = packet.x; - pos.y = packet.feet_y; - pos.z = packet.z; - player.get_mut::()?.0 = packet.on_ground; - update_client_position(server, player, *pos)?; + let pos = { + let mut pos = player.get_mut::()?; + pos.x = packet.x; + pos.y = packet.feet_y; + pos.z = packet.z; + player.get_mut::()?.0 = packet.on_ground; + *pos + }; + update_client_position(server, player, pos.0)?; Ok(()) } pub fn handle_player_position_and_rotation( - server: &Server, + server: &mut Server, player: EntityRef, packet: PlayerPositionAndRotation, ) -> SysResult { if should_skip_movement(server, &player)? { return Ok(()); } - let mut pos = player.get_mut::()?; - pos.x = packet.x; - pos.y = packet.feet_y; - pos.z = packet.z; - pos.yaw = packet.yaw; - pos.pitch = packet.pitch; - player.get_mut::()?.0 = packet.on_ground; - update_client_position(server, player, *pos)?; + let pos = { + let mut pos = player.get_mut::()?; + pos.x = packet.x; + pos.y = packet.feet_y; + pos.z = packet.z; + pos.yaw = packet.yaw; + pos.pitch = packet.pitch; + player.get_mut::()?.0 = packet.on_ground; + *pos + }; + update_client_position(server, player, pos.0)?; Ok(()) } pub fn handle_player_rotation( - server: &Server, + server: &mut Server, player: EntityRef, packet: PlayerRotation, ) -> SysResult { if should_skip_movement(server, &player)? { return Ok(()); } - let mut pos = player.get_mut::()?; - pos.yaw = packet.yaw; - pos.pitch = packet.pitch; - player.get_mut::()?.0 = packet.on_ground; - update_client_position(server, player, *pos)?; + let pos = { + let mut pos = player.get_mut::()?; + pos.yaw = packet.yaw; + pos.pitch = packet.pitch; + player.get_mut::()?.0 = packet.on_ground; + *pos + }; + update_client_position(server, player, pos.0)?; Ok(()) } -fn update_client_position(server: &Server, player: EntityRef, pos: Position) -> SysResult { - if let Some(client) = server.clients.get(*player.get::()?) { +fn update_client_position(server: &mut Server, player: EntityRef, pos: Position) -> SysResult { + if let Some(client) = server.clients.get_mut(*player.get::()?) { client.set_client_known_position(pos); } Ok(()) diff --git a/feather/server/src/plugin.rs b/feather/server/src/plugin.rs new file mode 100644 index 000000000..c974b6fa6 --- /dev/null +++ b/feather/server/src/plugin.rs @@ -0,0 +1,149 @@ +use std::{ + fs::{self}, + path::{Path, PathBuf}, + sync::Arc, +}; + +use anyhow::Context; +use common::Game; +use indexmap::IndexMap; +use quill::{Plugin, PluginInfo, SysResult}; +use serde::{Deserialize, Serialize}; + +/// Manages the loading of plugins at startup time. +pub struct PluginLoader { + plugins: Vec, + file: PluginsFile, + file_path: PathBuf, +} + +impl PluginLoader { + pub fn new(plugins_file_path: impl AsRef) -> anyhow::Result { + let plugins_file_path = plugins_file_path.as_ref(); + let file = if plugins_file_path.exists() { + toml::from_slice(&fs::read(plugins_file_path)?).context("malformed `plugins.toml`")? + } else { + PluginsFile::default() + }; + Ok(Self { + plugins: Vec::new(), + file, + file_path: plugins_file_path.to_path_buf(), + }) + } + + pub fn register_plugin(&mut self, plugin: P) { + self.plugins.push(RegisteredPlugin::new(plugin)); + } + + pub fn initialize(mut self, game: &mut Game) -> anyhow::Result<()> { + self.initialize_plugins(game)?; + self.warn_for_unknown_plugins(); + + // Rewrite the plugins.toml file, since its contents may have been updated + let new_plugins_file = toml::to_string_pretty(&self.file)?; + fs::write(&self.file_path, new_plugins_file.as_bytes())?; + Ok(()) + } + + fn initialize_plugins(&mut self, game: &mut Game) -> anyhow::Result<()> { + for plugin in &mut self.plugins { + let id = &plugin.info.id; + let enabled = *self.file.plugins.entry(id.to_string()).or_insert(true); + if enabled { + log::info!("Loading plugin {}", plugin.info.name); + plugin + .instance + .initialize(game) + .with_context(|| format!("failed to initialize plugin {}", plugin.info.name))?; + } else { + log::info!( + "Plugin {} is disabled and will not be loaded", + plugin.info.name + ); + } + } + Ok(()) + } + + fn warn_for_unknown_plugins(&self) { + for plugin_id in self.file.plugins.keys() { + let registered = self.plugins.iter().any(|p| p.info.id == plugin_id); + if !registered { + log::warn!("plugins.toml refers to a plugin `{}`, but the plugin is not registered in this build of Feather. It will not be loaded.", plugin_id); + } + } + } +} + +/// The `plugins.toml` file that defines which registered plugins are enabled/disabled. +#[derive(Debug, Serialize, Deserialize, Default)] +struct PluginsFile { + plugins: IndexMap, +} + +struct RegisteredPlugin { + /// The `Plugin` instance associated with the plugin. + instance: Box, + /// The plugin metadata. + info: PluginInfo, +} + +impl RegisteredPlugin { + pub fn new(instance: P) -> Self { + Self { + info: instance.info(), + instance: Box::new(instance), + } + } +} + +/// A type-erased plugin. +trait ErasedPlugin { + fn initialize(&mut self, game: &mut Game) -> SysResult; +} + +impl

ErasedPlugin for P +where + P: Plugin, +{ + fn initialize(&mut self, game: &mut Game) -> SysResult { + let mut setup = Setup { game }; + let plugin_state =

::initialize(self, &mut setup)?; + game.insert_resource(plugin_state); + Ok(()) + } +} + +/// State passed into Plugin::initialize. +struct Setup<'a> { + game: &'a mut Game, +} + +impl<'a, P> quill::Setup

for Setup<'a> +where + P: Plugin, +{ + fn register_system( + &mut self, + system: fn(&mut dyn quill::Game, &mut P::State) -> quill::SysResult, + name: &str, + ) { + self.game.system_executor.borrow_mut().add_system_with_name( + move |game| { + let resources = Arc::clone(&game.resources); + let mut state = resources.get_mut::()?; + system(game, &mut state) + }, + name, + ); + } + + fn game(&self) -> &dyn quill::Game { + self.game + } + + fn game_mut(&mut self) -> &mut dyn quill::Game { + self.game + } +} diff --git a/feather/server/src/server.rs b/feather/server/src/server.rs new file mode 100644 index 000000000..ebad9a2bd --- /dev/null +++ b/feather/server/src/server.rs @@ -0,0 +1,158 @@ +use std::{sync::Arc, time::Instant}; + +use flume::Receiver; + +use common::Game; +use libcraft::Position; +use quill::WorldId; +use vane::SystemExecutor; + +use crate::{ + chunk_subscriptions::{ChunkPositionWithWorld, ChunkSubscriptions}, + initial_handler::NewPlayer, + listener::Listener, + player_count::PlayerCount, + Client, ClientId, Clients, Options, +}; + +/// A Minecraft server. +/// +/// Call [`link_with_game`](Server::link_with_game) to register the server +/// with a [`Game`](common::Game). This will +/// cause the server to serve the game to players. +/// +/// Uses asynchronous IO with Tokio. +pub struct Server { + pub(crate) options: Arc, + pub(crate) clients: Clients, + pub(crate) new_players: Receiver, + + pub(crate) chunk_subscriptions: ChunkSubscriptions, + + pub(crate) last_keepalive_time: Instant, + + pub(crate) player_count: PlayerCount, +} + +impl Server { + /// Starts a server with the given `Options`. + /// + /// Must be called within the context of a Tokio runtime. + pub async fn bind(options: Options) -> anyhow::Result { + let options = Arc::new(options); + let player_count = PlayerCount::new(options.max_players); + + let (new_players_tx, new_players) = flume::bounded(4); + Listener::start(Arc::clone(&options), player_count.clone(), new_players_tx).await?; + + log::info!( + "Server is listening on {}:{}", + options.bind_address, + options.port + ); + + Ok(Self { + options, + clients: Clients::new(), + new_players, + chunk_subscriptions: ChunkSubscriptions::default(), + last_keepalive_time: Instant::now(), + player_count, + }) + } + + /// Links this server with a `Game` so that players connecting + /// to the server become part of this `Game`. + pub fn link_with_game(self, game: &mut Game, systems: &mut SystemExecutor) { + crate::systems::register(self, game, systems); + game.add_entity_spawn_callback(crate::entities::add_entity_components); + } + + /// Gets the number of online players. + pub fn player_count(&self) -> u32 { + self.player_count.get() + } +} + +/// Low-level functions, mostly used internally. +/// You may find these useful for some custom functionality. +impl Server { + /// Polls for newly connected players. Returns the IDs of the new clients. + pub fn accept_new_players(&mut self) -> Vec { + let mut clients = Vec::new(); + for player in self.new_players.clone().try_iter() { + if let Some(old_client) = self.clients.iter_mut().find(|x| x.uuid() == player.uuid) { + old_client.disconnect("Logged in from another location!"); + } + let id = self.create_client(player); + clients.push(id); + } + clients + } + + /// Removes a client. + pub fn remove_client(&mut self, id: ClientId) { + let client = self.clients.remove(id); + if let Some(client) = client { + log::debug!("Removed client for {}", client.username()); + } + } + + fn create_client(&mut self, player: NewPlayer) -> ClientId { + log::debug!("Creating client for {}", player.username); + let client = Client::new(player, Arc::clone(&self.options)); + self.clients.insert(client) + } + + /// Invokes a callback on all clients. + pub fn broadcast_with(&self, mut callback: impl FnMut(&Client)) { + for client in self.clients.iter() { + callback(client); + } + } + + /// Sends a packet to all clients currently subscribed + /// to the given position. This function should be + /// used for entity updates, block updates, etc— + /// any packets that need to be sent only to nearby players. + pub fn broadcast_nearby_with( + &self, + world: WorldId, + position: Position, + mut callback: impl FnMut(&Client), + ) { + for &client_id in self + .chunk_subscriptions + .subscriptions_for(ChunkPositionWithWorld::new(world, position.chunk())) + { + if let Some(client) = self.clients.get(client_id) { + callback(client); + } + } + } + + /// Sends a packet to all clients currently subscribed + /// to the given position. This function should be + /// used for entity updates, block updates, etc— + /// any packets that need to be sent only to nearby players. + pub fn broadcast_nearby_with_mut( + &mut self, + world: WorldId, + position: Position, + mut callback: impl FnMut(&mut Client), + ) { + for &client_id in self + .chunk_subscriptions + .subscriptions_for(ChunkPositionWithWorld::new(world, position.chunk())) + { + if let Some(client) = self.clients.get_mut(client_id) { + callback(client); + } + } + } + + pub fn broadcast_keepalive(&mut self) { + self.broadcast_with(|client| client.send_keepalive()); + self.last_keepalive_time = Instant::now(); + } +} diff --git a/feather/server/src/systems.rs b/feather/server/src/systems.rs index e364dc591..b2d503c44 100644 --- a/feather/server/src/systems.rs +++ b/feather/server/src/systems.rs @@ -14,8 +14,8 @@ pub mod view; use std::time::{Duration, Instant}; use common::Game; -use ecs::{SysResult, SystemExecutor}; -use quill_common::components::Name; +use quill::components::{EntityPosition, Name}; +use vane::{SysResult, SystemExecutor}; use crate::{client::ClientId, Server}; @@ -47,8 +47,8 @@ pub fn register(server: Server, game: &mut Game, systems: &mut SystemExecutor SysResult { let mut packets = Vec::new(); - for (player, &client_id) in game.ecs.query::<&ClientId>().iter() { - if let Some(client) = server.clients.get(client_id) { + for (player, client_id) in game.ecs.query::<&ClientId>().iter() { + if let Some(client) = server.clients.get(*client_id) { for packet in client.received_packets() { packets.push((player, packet)); } @@ -78,10 +78,12 @@ fn send_keepalives(_game: &mut Game, server: &mut Server) -> SysResult { } /// Ticks `Client`s. -fn tick_clients(_game: &mut Game, server: &mut Server) -> SysResult { - for client in server.clients.iter() { - client.tick(); +fn tick_clients(game: &mut Game, server: &mut Server) -> SysResult { + for (_player, (client_id, position)) in game.ecs.query::<(&ClientId, &EntityPosition)>().iter() + { + if let Some(client) = server.clients.get_mut(*client_id) { + client.tick(game, position.0)?; + } } - Ok(()) } diff --git a/feather/server/src/systems/block.rs b/feather/server/src/systems/block.rs index 5544da2bd..23dfb366d 100644 --- a/feather/server/src/systems/block.rs +++ b/feather/server/src/systems/block.rs @@ -13,10 +13,9 @@ //! like WorldEdit. This module chooses the optimal packet from //! the above three options to achieve ideal performance. -use ahash::AHashMap; -use base::{chunk::SECTION_VOLUME, position, ChunkPosition, CHUNK_WIDTH}; use common::{events::BlockChangeEvent, Game}; -use ecs::{SysResult, SystemExecutor}; +use libcraft::{chunk::SECTION_VOLUME, position, CHUNK_WIDTH}; +use vane::{SysResult, SystemExecutor}; use crate::Server; @@ -28,7 +27,7 @@ pub fn register(systems: &mut SystemExecutor) { fn broadcast_block_changes(game: &mut Game, server: &mut Server) -> SysResult { for (_, event) in game.ecs.query::<&BlockChangeEvent>().iter() { - broadcast_block_change(event, game, server); + broadcast_block_change(&event, game, server)?; } Ok(()) } @@ -37,11 +36,11 @@ fn broadcast_block_changes(game: &mut Game, server: &mut Server) -> SysResult { // overwrite packets. const CHUNK_OVERWRITE_THRESHOLD: usize = SECTION_VOLUME / 2; -fn broadcast_block_change(event: &BlockChangeEvent, game: &Game, server: &mut Server) { +fn broadcast_block_change(event: &BlockChangeEvent, game: &Game, server: &mut Server) -> SysResult { if event.count() >= CHUNK_OVERWRITE_THRESHOLD { - broadcast_block_change_chunk_overwrite(event, game, server); + broadcast_block_change_chunk_overwrite(event, game, server) } else { - broadcast_block_change_simple(event, game, server); + broadcast_block_change_simple(event, game, server) } } @@ -49,34 +48,36 @@ fn broadcast_block_change_chunk_overwrite( event: &BlockChangeEvent, game: &Game, server: &mut Server, -) { - let mut sections: AHashMap> = AHashMap::new(); - for (chunk, section, _) in event.iter_affected_chunk_sections() { - sections.entry(chunk).or_default().push(section + 1); // + 1 to account for the void air chunk - } - - for (chunk_pos, sections) in sections { - let chunk = game.world.chunk_map().chunk_handle_at(chunk_pos); - if let Some(chunk) = chunk { +) -> SysResult { + let world = game.world(event.world())?; + for (chunk_pos, _, _) in event.iter_affected_chunk_sections() { + if let Ok(chunk) = world.chunk_handle_at(chunk_pos) { let position = position!( (chunk_pos.x * CHUNK_WIDTH as i32) as f64, 0.0, (chunk_pos.z * CHUNK_WIDTH as i32) as f64, ); - server.broadcast_nearby_with(position, |client| { - client.overwrite_chunk_sections(&chunk, sections.clone()); + server.broadcast_nearby_with(event.world(), position, |client| { + client.overwrite_chunk(&chunk); }) } } + Ok(()) } -fn broadcast_block_change_simple(event: &BlockChangeEvent, game: &Game, server: &mut Server) { +fn broadcast_block_change_simple( + event: &BlockChangeEvent, + game: &Game, + server: &mut Server, +) -> SysResult { + let world = game.world(event.world())?; for pos in event.iter_changed_blocks() { - let new_block = game.block(pos); - if let Some(new_block) = new_block { - server.broadcast_nearby_with(pos.position(), |client| { + let new_block = world.block_at(pos.into()); + if let Ok(new_block) = new_block { + server.broadcast_nearby_with(event.world(), pos.position(), |client| { client.send_block_change(pos, new_block) }); } } + Ok(()) } diff --git a/feather/server/src/systems/chat.rs b/feather/server/src/systems/chat.rs index d19aa64ed..1bc2f93de 100644 --- a/feather/server/src/systems/chat.rs +++ b/feather/server/src/systems/chat.rs @@ -1,11 +1,14 @@ -use common::{chat::ChatPreference, ChatBox, Game}; -use ecs::{EntityBuilder, SysResult, SystemExecutor}; +use common::Game; +use quill::{chat::ChatPreference, ChatBox}; +use vane::{Component, EntityBuilder, SysResult, SystemExecutor}; use crate::{ClientId, Server}; /// Marker component for the console entity. struct Console; +impl Component for Console {} + pub fn register(game: &mut Game, systems: &mut SystemExecutor) { // Create the console entity so the console can receive messages let mut console = EntityBuilder::new(); @@ -13,7 +16,7 @@ pub fn register(game: &mut Game, systems: &mut SystemExecutor) { // We can use the raw spawn method because // the console isn't a "normal" entity. - game.ecs.spawn(console.build()); + game.ecs.spawn_builder(&mut console); systems.add_system(flush_console_chat_box); systems.group::().add_system(flush_chat_boxes); @@ -22,8 +25,8 @@ pub fn register(game: &mut Game, systems: &mut SystemExecutor) { /// Flushes players' chat mailboxes and sends the needed packets. fn flush_chat_boxes(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&client_id, mailbox)) in game.ecs.query::<(&ClientId, &mut ChatBox)>().iter() { - if let Some(client) = server.clients.get(client_id) { + for (_, (client_id, mut mailbox)) in game.ecs.query::<(&ClientId, &mut ChatBox)>().iter() { + if let Some(client) = server.clients.get(*client_id) { for message in mailbox.drain() { client.send_chat_message(message); } @@ -35,7 +38,7 @@ fn flush_chat_boxes(game: &mut Game, server: &mut Server) -> SysResult { /// Prints chat messages to the console. fn flush_console_chat_box(game: &mut Game) -> SysResult { - for (_, (_console, mailbox)) in game.ecs.query::<(&Console, &mut ChatBox)>().iter() { + for (_, (_console, mut mailbox)) in game.ecs.query::<(&Console, &mut ChatBox)>().iter() { for message in mailbox.drain() { // TODO: properly display chat message log::info!("{:?}", message.text()); @@ -46,8 +49,8 @@ fn flush_console_chat_box(game: &mut Game) -> SysResult { } fn flush_title_chat_boxes(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&client_id, mailbox)) in game.ecs.query::<(&ClientId, &mut ChatBox)>().iter() { - if let Some(client) = server.clients.get(client_id) { + for (_, (client_id, mut mailbox)) in game.ecs.query::<(&ClientId, &mut ChatBox)>().iter() { + if let Some(client) = server.clients.get(*client_id) { for message in mailbox.drain_titles() { client.send_title(message); } diff --git a/feather/server/src/systems/entity.rs b/feather/server/src/systems/entity.rs index 49aed542f..3f5fd72bb 100644 --- a/feather/server/src/systems/entity.rs +++ b/feather/server/src/systems/entity.rs @@ -1,16 +1,22 @@ //! Sends entity-related packets to clients. //! Spawn packets, position updates, equipment, animations, etc. -use base::{ - metadata::{EntityBitMask, Pose, META_INDEX_ENTITY_BITMASK, META_INDEX_POSE}, - EntityMetadata, Position, -}; +use common::entities::player::HotbarSlot; use common::Game; -use ecs::{SysResult, SystemExecutor}; -use quill_common::{ +use libcraft::{ + entity_metadata::{EntityBitMask, Pose, META_INDEX_ENTITY_BITMASK, META_INDEX_POSE}, + Area, EntityMetadata, +}; +use quill::events::HeldItemChangeEvent; +use quill::{ + components::{EntityInventory, EntityPosition, EntityWorld, PlayerGamemode, PreviousGamemode}, + events::InventorySlotUpdateEvent, +}; +use quill::{ components::{OnGround, Sprinting}, events::{SneakEvent, SprintEvent}, }; +use vane::{SysResult, SystemExecutor}; use crate::{ entities::{PreviousOnGround, PreviousPosition}, @@ -25,36 +31,42 @@ pub fn register(game: &mut Game, systems: &mut SystemExecutor) { .group::() .add_system(send_entity_movement) .add_system(send_entity_sneak_metadata) - .add_system(send_entity_sprint_metadata); + .add_system(send_entity_sprint_metadata) + .add_system(send_entity_equipment); } /// Sends entity movement packets. fn send_entity_movement(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&position, prev_position, &on_ground, &network_id, prev_on_ground)) in game - .ecs - .query::<( - &Position, - &mut PreviousPosition, - &OnGround, - &NetworkId, - &mut PreviousOnGround, - )>() - .iter() + for (entity, (position, mut prev_position, on_ground, network_id, mut prev_on_ground, world)) in + game.ecs + .query::<( + &EntityPosition, + &mut PreviousPosition, + &OnGround, + &NetworkId, + &mut PreviousOnGround, + &EntityWorld, + )>() + .iter() { - if position != prev_position.0 { - server.broadcast_nearby_with(position, |client| { + if position.0 != prev_position.0 { + let world = game.world(world.0)?; + server.broadcast_nearby_with_mut(world.id(), position.0, |client| { client.update_entity_position( - network_id, - position, + *network_id, + position.0, *prev_position, - on_ground, + *on_ground, *prev_on_ground, + &*world, + game.ecs.get::(entity).ok().map(|g| g.0), + game.ecs.get::(entity).ok().map(|g| *g), ); }); - prev_position.0 = position; + prev_position.0 = position.0; } - if on_ground != prev_on_ground.0 { - prev_on_ground.0 = on_ground; + if *on_ground != prev_on_ground.0 { + prev_on_ground.0 = *on_ground; } } Ok(()) @@ -62,27 +74,33 @@ fn send_entity_movement(game: &mut Game, server: &mut Server) -> SysResult { /// Sends [SendEntityMetadata](protocol::packets::server::play::SendEntityMetadata) packet for when an entity is sneaking. fn send_entity_sneak_metadata(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&position, &SneakEvent { is_sneaking }, is_sprinting, &network_id)) in game + for (_, (position, sneak_event, is_sprinting, network_id, world)) in game .ecs - .query::<(&Position, &SneakEvent, &Sprinting, &NetworkId)>() + .query::<( + &EntityPosition, + &SneakEvent, + &Sprinting, + &NetworkId, + &EntityWorld, + )>() .iter() { let mut metadata = EntityMetadata::entity_base(); let mut bit_mask = EntityBitMask::empty(); // The Entity can sneak and sprint at the same time, what happens is that when it stops sneaking you immediately start running again. - bit_mask.set(EntityBitMask::CROUCHED, is_sneaking); + bit_mask.set(EntityBitMask::CROUCHED, sneak_event.is_sneaking); bit_mask.set(EntityBitMask::SPRINTING, is_sprinting.0); metadata.set(META_INDEX_ENTITY_BITMASK, bit_mask.bits()); - if is_sneaking { + if sneak_event.is_sneaking { metadata.set(META_INDEX_POSE, Pose::Sneaking); } else { metadata.set(META_INDEX_POSE, Pose::Standing); } - server.broadcast_nearby_with(position, |client| { - client.send_entity_metadata(network_id, metadata.clone()); + server.broadcast_nearby_with(world.0, position.0, |client| { + client.send_entity_metadata(*network_id, metadata.clone()); }); } Ok(()) @@ -90,20 +108,67 @@ fn send_entity_sneak_metadata(game: &mut Game, server: &mut Server) -> SysResult /// Sends [SendEntityMetadata](protocol::packets::server::play::SendEntityMetadata) packet for when an entity is sprinting. fn send_entity_sprint_metadata(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&position, &SprintEvent { is_sprinting }, &network_id)) in game + for (_, (position, sprint_event, network_id, world)) in game .ecs - .query::<(&Position, &SprintEvent, &NetworkId)>() + .query::<(&EntityPosition, &SprintEvent, &NetworkId, &EntityWorld)>() .iter() { let mut metadata = EntityMetadata::entity_base(); let mut bit_mask = EntityBitMask::empty(); - bit_mask.set(EntityBitMask::SPRINTING, is_sprinting); + bit_mask.set(EntityBitMask::SPRINTING, sprint_event.is_sprinting); metadata.set(META_INDEX_ENTITY_BITMASK, bit_mask.bits()); - server.broadcast_nearby_with(position, |client| { - client.send_entity_metadata(network_id, metadata.clone()); + server.broadcast_nearby_with(world.0, position.0, |client| { + client.send_entity_metadata(*network_id, metadata.clone()); }); } Ok(()) } + +/// Resends entity equipment when inventory slots change. +fn send_entity_equipment(game: &mut Game, server: &mut Server) -> SysResult { + let mut updated_entities = Vec::new(); + for (_, event) in game.ecs.query::<&InventorySlotUpdateEvent>().iter() { + if !game.ecs.contains(event.entity) { + continue; + } + + if is_equipment_area(event.area) { + updated_entities.push(event.entity); + } + } + + for (entity, _event) in game.ecs.query::<&HeldItemChangeEvent>().iter() { + updated_entities.push(entity); + } + + for entity in updated_entities { + let network_id = *game.ecs.get::(entity)?; + let inventory = game.ecs.get::(entity)?; + let hotbar_slot = game + .ecs + .get::(entity) + .map(|r| *r) + .unwrap_or_else(|_| HotbarSlot::new(0)); + server.broadcast_nearby_with_mut( + game.ecs.get::(entity)?.0, + game.ecs.get::(entity)?.0, + |client| client.send_entity_equipment(network_id, &inventory, &hotbar_slot), + ); + } + + Ok(()) +} + +fn is_equipment_area(area: Area) -> bool { + matches!( + area, + Area::Boots + | Area::Leggings + | Area::Chestplate + | Area::Helmet + | Area::Offhand + | Area::Hotbar + ) +} diff --git a/feather/server/src/systems/entity/spawn_packet.rs b/feather/server/src/systems/entity/spawn_packet.rs index 23cb0b523..f86d4a3ba 100644 --- a/feather/server/src/systems/entity/spawn_packet.rs +++ b/feather/server/src/systems/entity/spawn_packet.rs @@ -1,14 +1,18 @@ use ahash::AHashSet; use anyhow::Context; -use base::Position; use common::{ + entities::player::HotbarSlot, events::{ChunkCrossEvent, ViewUpdateEvent}, Game, }; -use ecs::{SysResult, SystemExecutor}; -use quill_common::events::{EntityCreateEvent, EntityRemoveEvent}; +use quill::components::{EntityInventory, EntityPosition, EntityWorld}; +use quill::events::{EntityCreateEvent, EntityRemoveEvent}; +use vane::{SysResult, SystemExecutor}; -use crate::{entities::SpawnPacketSender, ClientId, NetworkId, Server}; +use crate::{ + chunk_subscriptions::ChunkPositionWithWorld, entities::SpawnPacketSender, ClientId, NetworkId, + Server, +}; pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { systems @@ -22,8 +26,8 @@ pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { /// System to spawn entities on clients when they become visible, /// and despawn entities when they become invisible, based on the client's view. pub fn update_visible_entities(game: &mut Game, server: &mut Server) -> SysResult { - for (player, (event, &client_id)) in game.ecs.query::<(&ViewUpdateEvent, &ClientId)>().iter() { - let client = match server.clients.get(client_id) { + for (player, (event, client_id)) in game.ecs.query::<(&ViewUpdateEvent, &ClientId)>().iter() { + let client = match server.clients.get_mut(*client_id) { Some(client) => client, None => continue, }; @@ -33,11 +37,17 @@ pub fn update_visible_entities(game: &mut Game, server: &mut Server) -> SysResul for &entity_id in game.chunk_entities.entities_in_chunk(new_chunk) { if entity_id != player { let entity_ref = game.ecs.entity(entity_id)?; + let network_id = entity_ref.get::()?; if let Ok(spawn_packet) = entity_ref.get::() { spawn_packet .send(&entity_ref, client) .context("failed to send spawn packet")?; - } + }; + if let Ok(inventory) = entity_ref.get::() { + if let Ok(hotbar_slot) = entity_ref.get::() { + client.send_entity_equipment(*network_id, &inventory, &hotbar_slot); + } + }; } } } @@ -59,16 +69,27 @@ pub fn update_visible_entities(game: &mut Game, server: &mut Server) -> SysResul /// System to send an entity to clients when it is created. fn send_entities_when_created(game: &mut Game, server: &mut Server) -> SysResult { - for (entity, (_event, &position, spawn_packet)) in game + for (entity, (_event, network_id, position, spawn_packet, world)) in game .ecs - .query::<(&EntityCreateEvent, &Position, &SpawnPacketSender)>() + .query::<( + &EntityCreateEvent, + &NetworkId, + &EntityPosition, + &SpawnPacketSender, + &EntityWorld, + )>() .iter() { let entity_ref = game.ecs.entity(entity)?; - server.broadcast_nearby_with(position, |client| { + server.broadcast_nearby_with_mut(world.0, position.0, |client| { spawn_packet .send(&entity_ref, client) - .expect("failed to create spawn packet") + .expect("failed to create spawn packet"); + if let Ok(inventory) = entity_ref.get::() { + if let Ok(hotbar_slot) = entity_ref.get::() { + client.send_entity_equipment(*network_id, &inventory, &hotbar_slot); + } + } }); } @@ -77,12 +98,19 @@ fn send_entities_when_created(game: &mut Game, server: &mut Server) -> SysResult /// System to unload an entity on clients when it is removed. fn unload_entities_when_removed(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (_event, &position, &network_id)) in game + for (_, (_event, position, network_id, world)) in game .ecs - .query::<(&EntityRemoveEvent, &Position, &NetworkId)>() + .query::<( + &EntityRemoveEvent, + &EntityPosition, + &NetworkId, + &EntityWorld, + )>() .iter() { - server.broadcast_nearby_with(position, |client| client.unload_entity(network_id)); + server.broadcast_nearby_with_mut(world.0, position.0, |client| { + client.unload_entity(*network_id) + }); } Ok(()) @@ -90,33 +118,38 @@ fn unload_entities_when_removed(game: &mut Game, server: &mut Server) -> SysResu /// System to send/unsend entities on clients when the entity changes chunks. fn update_entities_on_chunk_cross(game: &mut Game, server: &mut Server) -> SysResult { - for (entity, (event, spawn_packet, &network_id)) in game + for (entity, (event, spawn_packet, network_id, world)) in game .ecs - .query::<(&ChunkCrossEvent, &SpawnPacketSender, &NetworkId)>() + .query::<( + &ChunkCrossEvent, + &SpawnPacketSender, + &NetworkId, + &EntityWorld, + )>() .iter() { let old_clients: AHashSet<_> = server .chunk_subscriptions - .subscriptions_for(event.old_chunk) + .subscriptions_for(ChunkPositionWithWorld::new(world.0, event.old_chunk)) .iter() .copied() .collect(); let new_clients: AHashSet<_> = server .chunk_subscriptions - .subscriptions_for(event.new_chunk) + .subscriptions_for(ChunkPositionWithWorld::new(world.0, event.new_chunk)) .iter() .copied() .collect(); for left_client in old_clients.difference(&new_clients) { - if let Some(client) = server.clients.get(*left_client) { - client.unload_entity(network_id); + if let Some(client) = server.clients.get_mut(*left_client) { + client.unload_entity(*network_id); } } let entity_ref = game.ecs.entity(entity)?; for send_client in new_clients.difference(&old_clients) { - if let Some(client) = server.clients.get(*send_client) { + if let Some(client) = server.clients.get_mut(*send_client) { spawn_packet.send(&entity_ref, client)?; } } diff --git a/feather/server/src/systems/gamemode.rs b/feather/server/src/systems/gamemode.rs index 8c9581bd1..80465ba08 100644 --- a/feather/server/src/systems/gamemode.rs +++ b/feather/server/src/systems/gamemode.rs @@ -1,15 +1,15 @@ -use base::anvil::player::PlayerAbilities; -use base::Gamemode; use common::Game; -use ecs::{SysResult, SystemExecutor}; -use quill_common::components::{ +use libcraft::anvil::player::PlayerAbilities; +use libcraft::Gamemode; +use quill::components::{ CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Instabreak, Invulnerable, - PreviousGamemode, WalkSpeed, + PlayerGamemode, PreviousGamemode, WalkSpeed, }; -use quill_common::events::{ +use quill::events::{ BuildingAbilityEvent, CreativeFlyingEvent, FlyingAbilityEvent, GamemodeEvent, InstabreakEvent, InvulnerabilityEvent, }; +use vane::{SysResult, SystemExecutor}; use crate::{ClientId, Server}; @@ -27,16 +27,16 @@ fn gamemode_change(game: &mut Game, server: &mut Server) -> SysResult { entity, ( event, - &client_id, - &walk_speed, - &fly_speed, + client_id, + walk_speed, + fly_speed, mut may_fly, mut is_flying, mut instabreak, mut may_build, mut invulnerable, - gamemode, - prev_gamemode, + mut gamemode, + mut prev_gamemode, ), ) in game .ecs @@ -50,17 +50,17 @@ fn gamemode_change(game: &mut Game, server: &mut Server) -> SysResult { &mut Instabreak, &mut CanBuild, &mut Invulnerable, - &mut Gamemode, + &mut PlayerGamemode, &mut PreviousGamemode, )>() .iter() { - if **event == *gamemode { + if **event == **gamemode { continue; } - *prev_gamemode = PreviousGamemode(Some(*gamemode)); - *gamemode = **event; - match gamemode { + *prev_gamemode = PreviousGamemode(Some(**gamemode)); + **gamemode = **event; + match **gamemode { Gamemode::Creative => { if !**instabreak { instabreak_changes.push((entity, true)); @@ -148,21 +148,21 @@ fn gamemode_change(game: &mut Game, server: &mut Server) -> SysResult { } server .clients - .get(client_id) + .get(*client_id) .unwrap() .change_gamemode(**event); server .clients - .get(client_id) + .get(*client_id) .unwrap() .send_abilities(&PlayerAbilities { - walk_speed, - fly_speed, - may_fly: *may_fly, - is_flying: *is_flying, - may_build: *may_build, - instabreak: *instabreak, - invulnerable: *invulnerable, + walk_speed: walk_speed.0, + fly_speed: fly_speed.0, + may_fly: may_fly.0, + is_flying: is_flying.0, + may_build: may_build.0, + instabreak: instabreak.0, + invulnerable: invulnerable.0, }); } for (entity, flying) in fly_changes { diff --git a/feather/server/src/systems/particle.rs b/feather/server/src/systems/particle.rs index a30cdd0cc..3d66ef4ba 100644 --- a/feather/server/src/systems/particle.rs +++ b/feather/server/src/systems/particle.rs @@ -1,7 +1,7 @@ use crate::Server; -use base::{Particle, Position}; use common::Game; -use ecs::{SysResult, SystemExecutor}; +use quill::components::{EntityParticle, EntityPosition, EntityWorld}; +use vane::{SysResult, SystemExecutor}; pub fn register(systems: &mut SystemExecutor) { systems.group::().add_system(send_particle_packets); @@ -10,9 +10,13 @@ pub fn register(systems: &mut SystemExecutor) { fn send_particle_packets(game: &mut Game, server: &mut Server) -> SysResult { let mut entities = Vec::new(); - for (entity, (&particle, &position)) in game.ecs.query::<(&Particle, &Position)>().iter() { - server.broadcast_nearby_with(position, |client| { - client.send_particle(&particle, &position); + for (entity, (particle, position, world)) in game + .ecs + .query::<(&EntityParticle, &EntityPosition, &EntityWorld)>() + .iter() + { + server.broadcast_nearby_with(world.0, position.0, |client| { + client.send_particle(&particle, false, &position); }); entities.push(entity); diff --git a/feather/server/src/systems/player_join.rs b/feather/server/src/systems/player_join.rs index f8e01b195..26a96ed62 100644 --- a/feather/server/src/systems/player_join.rs +++ b/feather/server/src/systems/player_join.rs @@ -1,27 +1,31 @@ -use libcraft_items::InventorySlot; -use log::debug; - -use base::anvil::player::PlayerAbilities; -use base::{Gamemode, Inventory, ItemStack, Position, Text}; -use common::{ - chat::{ChatKind, ChatPreference}, - entities::player::HotbarSlot, - view::View, - window::BackingWindow, - ChatBox, Game, Window, -}; -use ecs::{SysResult, SystemExecutor}; -use quill_common::components::{ - CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Health, Instabreak, +use std::sync::Arc; + +use common::entities::player::PlayerProfile; + +use common::events::PlayerRespawnEvent; +use common::{entities::player::HotbarSlot, view::View, window::BackingWindow, Game, PlayerWindow}; +use libcraft::anvil::player::PlayerAbilities; +use libcraft::biome::BiomeList; +use libcraft::EntityKind; +use libcraft::{Gamemode, Inventory, Position, Text}; +use quill::chat::{ChatKind, ChatPreference}; +use quill::components::{self, EntityInventory, EntityPosition, EntityUuid, PlayerGamemode}; +use quill::components::{ + CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, EntityWorld, Health, Instabreak, Invulnerable, PreviousGamemode, WalkSpeed, }; -use quill_common::events::GamemodeEvent; -use quill_common::{components::Name, entity_init::EntityInit}; +use quill::events::GamemodeEvent; +use quill::ChatBox; +use vane::{SysResult, SystemExecutor}; +use crate::config::Config; use crate::{ClientId, NetworkId, Server}; pub fn register(systems: &mut SystemExecutor) { - systems.group::().add_system(poll_new_players); + systems + .group::() + .add_system(poll_new_players) + .add_system(send_respawn_packets); } /// Polls for new clients and sends them the necessary packets @@ -34,107 +38,72 @@ fn poll_new_players(game: &mut Game, server: &mut Server) -> SysResult { } fn accept_new_player(game: &mut Game, server: &mut Server, client_id: ClientId) -> SysResult { + let biomes = game.resources.get::>()?.clone(); + + let config = game.resources.get::().unwrap().clone(); let client = server.clients.get_mut(client_id).unwrap(); - let player_data = game.world.load_player_data(client.uuid()); - let mut builder = game.create_entity_builder( - player_data - .as_ref() - .map(|data| Position { - x: data.animal.base.position[0], - y: data.animal.base.position[1], - z: data.animal.base.position[2], - yaw: data.animal.base.rotation[0], - pitch: data.animal.base.rotation[1], - }) - .unwrap_or_default(), - EntityInit::Player, - ); - client.set_network_id(*builder.get::().unwrap()); - if player_data.is_err() { - debug!("{} is a new player", client.username()) - } - let gamemode = player_data - .as_ref() - .map(|data| Gamemode::from_id(data.gamemode as u8).expect("Unsupported gamemode")) - .unwrap_or(server.options.default_gamemode); - let previous_gamemode = player_data - .as_ref() - .map(|data| PreviousGamemode::from_id(data.previous_gamemode as i8)) - .unwrap_or(PreviousGamemode(None)); - - client.send_join_game(gamemode, previous_gamemode); - client.send_brand(); + // TODO: player data loading - // Abilities - let abilities = player_abilities_or_default( - player_data.as_ref().map(|data| data.abilities.clone()).ok(), + let position = Position::default(); + let mut builder = game.create_entity_builder(position, EntityKind::Player); + client.set_network_id(builder.get::().unwrap()); + + let world = game.default_world(); + + let gamemode = config.server.default_gamemode; + let previous_gamemode = PreviousGamemode(Some(gamemode)); + + client.send_join_game( gamemode, + previous_gamemode, + &biomes, + config.server.max_players as i32, + &*world, ); - client.send_abilities(&abilities); + client.send_brand(); - let hotbar_slot = player_data - .as_ref() - .map(|data| HotbarSlot::new(data.held_item as usize)) - .unwrap_or_else(|_e| HotbarSlot::new(0)); - client.set_hotbar_slot(hotbar_slot.get() as u8); + let abilities = player_abilities_or_default(None, gamemode); + let hotbar_slot = HotbarSlot::new(0); let inventory = Inventory::player(); - let window = Window::new(BackingWindow::Player { + let window = PlayerWindow::new(BackingWindow::Player { player: inventory.new_handle(), }); - if let Ok(data) = player_data.as_ref() { - for inventory_slot in data.inventory.iter() { - let net_slot = inventory_slot.convert_index(); - let slot = match net_slot { - Some(slot) => slot, - None => { - log::error!("Failed to convert saved slot into network slot"); - continue; - } - }; - - // This can't fail since the earlier match filters out all incorrect indexes. - window - .set_item(slot, InventorySlot::Filled(ItemStack::from(inventory_slot))) - .unwrap(); - } - } - - client.send_window_items(&window); builder .add(client_id) + .add(EntityPosition(position)) .add(View::new( - Position::default().chunk(), - server.options.view_distance, + position.chunk(), + config.server.view_distance, + world.id(), )) - .add(gamemode) + .add(PlayerGamemode(gamemode)) .add(previous_gamemode) - .add(Name::new(client.username())) - .add(client.uuid()) - .add(client.profile().to_vec()) + .add(components::Name::new(client.username())) + .add(EntityUuid(client.uuid())) + .add(PlayerProfile(client.profile().to_vec())) .add(ChatBox::new(ChatPreference::All)) - .add(inventory) + .add(EntityInventory::new(inventory)) .add(window) .add(hotbar_slot) - .add(Health( - player_data - .as_ref() - .map(|data| data.animal.health) - .unwrap_or(20.0), - )) - .add(abilities.walk_speed) - .add(abilities.fly_speed) - .add(abilities.is_flying) - .add(abilities.may_fly) - .add(abilities.may_build) - .add(abilities.instabreak) - .add(abilities.invulnerable); + .add(EntityWorld(world.id())) + .add(Health(20.)) + .add(WalkSpeed(abilities.walk_speed)) + .add(CreativeFlyingSpeed(abilities.fly_speed)) + .add(CreativeFlying(abilities.is_flying)) + .add(CanCreativeFly(abilities.may_fly)) + .add(CanBuild(abilities.may_build)) + .add(Instabreak(abilities.instabreak)) + .add(Invulnerable(abilities.invulnerable)); + + drop(world); - builder.add(GamemodeEvent(gamemode)); + let entity = game.spawn_entity(builder); - game.spawn_entity(builder); + game.ecs + .insert_entity_event(entity, GamemodeEvent(gamemode))?; broadcast_player_join(game, client.username()); @@ -151,12 +120,61 @@ fn player_abilities_or_default( gamemode: Gamemode, ) -> PlayerAbilities { data.unwrap_or(PlayerAbilities { - walk_speed: WalkSpeed::default(), - fly_speed: CreativeFlyingSpeed::default(), - may_fly: CanCreativeFly(matches!(gamemode, Gamemode::Creative | Gamemode::Spectator)), - is_flying: CreativeFlying(matches!(gamemode, Gamemode::Spectator)), - may_build: CanBuild(!matches!(gamemode, Gamemode::Adventure)), - instabreak: Instabreak(matches!(gamemode, Gamemode::Creative)), - invulnerable: Invulnerable(matches!(gamemode, Gamemode::Creative | Gamemode::Spectator)), + walk_speed: WalkSpeed::default().0, + fly_speed: CreativeFlyingSpeed::default().0, + may_fly: matches!(gamemode, Gamemode::Creative | Gamemode::Spectator), + is_flying: matches!(gamemode, Gamemode::Spectator), + may_build: !matches!(gamemode, Gamemode::Adventure), + instabreak: matches!(gamemode, Gamemode::Creative), + invulnerable: matches!(gamemode, Gamemode::Creative | Gamemode::Spectator), }) } + +fn send_respawn_packets(game: &mut Game, server: &mut Server) -> SysResult { + for ( + _, + ( + _, + client_id, + walk_speed, + fly_speed, + may_fly, + is_flying, + may_build, + instabreak, + invulnerable, + hotbar_slot, + window, + ), + ) in game + .ecs + .query::<( + &PlayerRespawnEvent, + &ClientId, + &WalkSpeed, + &CreativeFlyingSpeed, + &CanCreativeFly, + &CreativeFlying, + &CanBuild, + &Instabreak, + &Invulnerable, + &HotbarSlot, + &PlayerWindow, + )>() + .iter() + { + let client = server.clients.get(*client_id).unwrap(); + client.send_abilities(&PlayerAbilities { + walk_speed: walk_speed.0, + fly_speed: fly_speed.0, + may_fly: may_fly.0, + is_flying: is_flying.0, + may_build: may_build.0, + instabreak: instabreak.0, + invulnerable: invulnerable.0, + }); + client.send_hotbar_slot(hotbar_slot.get() as u8); + client.send_window_items(&window); + } + Ok(()) +} diff --git a/feather/server/src/systems/player_leave.rs b/feather/server/src/systems/player_leave.rs index 8034d0b0a..6bcb8391f 100644 --- a/feather/server/src/systems/player_leave.rs +++ b/feather/server/src/systems/player_leave.rs @@ -1,15 +1,17 @@ use num_traits::cast::ToPrimitive; -use base::anvil::entity::{AnimalData, BaseEntityData}; -use base::anvil::player::{InventorySlot, PlayerAbilities, PlayerData}; -use base::{Gamemode, Inventory, Position, Text}; use common::entities::player::HotbarSlot; -use common::{chat::ChatKind, Game}; -use ecs::{SysResult, SystemExecutor}; -use quill_common::components::{ - CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Health, Instabreak, - Invulnerable, Name, PreviousGamemode, WalkSpeed, +use common::Game; +use libcraft::anvil::entity::{AnimalData, BaseEntityData}; +use libcraft::anvil::player::{InventorySlot, PlayerAbilities, PlayerData}; +use libcraft::{Gamemode, Inventory, Position, Text}; +use quill::chat::ChatKind; +use quill::components::{ + CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, EntityInventory, EntityPosition, + Health, Instabreak, Invulnerable, Name, PlayerGamemode, PreviousGamemode, WalkSpeed, }; +use quill::World; +use vane::{SysResult, SystemExecutor}; use crate::{ClientId, Server}; @@ -24,29 +26,29 @@ fn remove_disconnected_clients(game: &mut Game, server: &mut Server) -> SysResul for ( player, ( - &client_id, + client_id, name, - position, - gamemode, - previous_gamemode, - health, - walk_speed, - fly_speed, - can_fly, - is_flying, - can_build, - instabreak, - invulnerable, - hotbar_slot, - inventory, + _position, + _gamemode, + _previous_gamemode, + _health, + _walk_speed, + _fly_speed, + _can_fly, + _is_flying, + _can_build, + _instabreak, + _invulnerable, + _hotbar_slot, + _inventory, ), ) in game .ecs .query::<( &ClientId, &Name, - &Position, - &Gamemode, + &EntityPosition, + &PlayerGamemode, &PreviousGamemode, &Health, &WalkSpeed, @@ -57,37 +59,15 @@ fn remove_disconnected_clients(game: &mut Game, server: &mut Server) -> SysResul &Instabreak, &Invulnerable, &HotbarSlot, - &Inventory, + &EntityInventory, )>() .iter() { - let client = server.clients.get(client_id).unwrap(); + let client = server.clients.get(*client_id).unwrap(); if client.is_disconnected() { entities_to_remove.push(player); - broadcast_player_leave(game, name); - game.world - .save_player_data( - client.uuid(), - &create_player_data( - *position, - *gamemode, - *previous_gamemode, - *health, - PlayerAbilities { - walk_speed: *walk_speed, - fly_speed: *fly_speed, - may_fly: *can_fly, - is_flying: *is_flying, - may_build: *can_build, - instabreak: *instabreak, - invulnerable: *invulnerable, - }, - *hotbar_slot, - inventory, - ), - ) - .unwrap_or_else(|e| panic!("Couldn't save data for {}: {}", client.username(), e)); - server.remove_client(client_id); + broadcast_player_leave(game, &name); + server.remove_client(*client_id); } } @@ -103,6 +83,8 @@ fn broadcast_player_leave(game: &Game, username: &Name) { game.broadcast_chat(ChatKind::System, message); } +#[allow(clippy::too_many_arguments)] +#[allow(unused)] fn create_player_data( position: Position, gamemode: Gamemode, @@ -111,6 +93,7 @@ fn create_player_data( abilities: PlayerAbilities, hotbar_slot: HotbarSlot, inventory: &Inventory, + world: &dyn World, ) -> PlayerData { PlayerData { animal: AnimalData { @@ -123,6 +106,7 @@ fn create_player_data( }, gamemode: gamemode.to_i32().unwrap(), previous_gamemode: previous_gamemode.id() as i32, + dimension: world.dimension_info().r#type.clone(), inventory: inventory .to_vec() .iter() @@ -130,7 +114,7 @@ fn create_player_data( // Here we filter out all empty slots. .filter_map(|(slot, item)| { match item { - libcraft_items::InventorySlot::Filled(item) => { + libcraft::items::InventorySlot::Filled(item) => { let res = InventorySlot::from_network_index(slot, item); match res { Some(i) => Some(i), @@ -140,7 +124,7 @@ fn create_player_data( } } } - libcraft_items::InventorySlot::Empty => { + libcraft::items::InventorySlot::Empty => { // Empty items are filtered out. None } diff --git a/feather/server/src/systems/plugin_message.rs b/feather/server/src/systems/plugin_message.rs index 3b426cf3b..5558a14dc 100644 --- a/feather/server/src/systems/plugin_message.rs +++ b/feather/server/src/systems/plugin_message.rs @@ -1,6 +1,6 @@ use crate::{ClientId, Server}; use common::{events::PluginMessageEvent, Game}; -use ecs::{SysResult, SystemExecutor}; +use vane::{SysResult, SystemExecutor}; pub fn register(systems: &mut SystemExecutor) { systems @@ -9,8 +9,8 @@ pub fn register(systems: &mut SystemExecutor) { } fn send_plugin_message_packets(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (&client_id, event)) in game.ecs.query::<(&ClientId, &PluginMessageEvent)>().iter() { - if let Some(client) = server.clients.get(client_id) { + for (_, (client_id, event)) in game.ecs.query::<(&ClientId, &PluginMessageEvent)>().iter() { + if let Some(client) = server.clients.get(*client_id) { client.send_plugin_message(event.channel.clone(), event.data.clone()); } } diff --git a/feather/server/src/systems/tablist.rs b/feather/server/src/systems/tablist.rs index 047ac19c6..c18dd1cd8 100644 --- a/feather/server/src/systems/tablist.rs +++ b/feather/server/src/systems/tablist.rs @@ -1,12 +1,12 @@ //! Sends tablist info to clients via the Player Info packet. -use uuid::Uuid; +use common::entities::player::PlayerProfile; +use quill::components::{EntityUuid, PlayerGamemode}; -use base::{Gamemode, ProfileProperty}; use common::Game; -use ecs::{SysResult, SystemExecutor}; -use quill_common::events::{EntityRemoveEvent, GamemodeEvent, PlayerJoinEvent}; -use quill_common::{components::Name, entities::Player}; +use quill::events::{EntityRemoveEvent, GamemodeEvent, PlayerJoinEvent}; +use quill::{components::Name, entities::Player}; +use vane::{SysResult, SystemExecutor}; use crate::{ClientId, Server}; @@ -19,43 +19,43 @@ pub fn register(systems: &mut SystemExecutor) { } fn remove_tablist_players(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (_event, _player, &uuid)) in game + for (_, (_event, _player, uuid)) in game .ecs - .query::<(&EntityRemoveEvent, &Player, &Uuid)>() + .query::<(&EntityRemoveEvent, &Player, &EntityUuid)>() .iter() { - server.broadcast_with(|client| client.remove_tablist_player(uuid)); + server.broadcast_with(|client| client.remove_tablist_player(uuid.0)); } Ok(()) } fn add_tablist_players(game: &mut Game, server: &mut Server) -> SysResult { - for (player, (_, &client_id, &uuid, name, &gamemode, profile)) in game + for (player, (_, client_id, uuid, name, gamemode, profile)) in game .ecs .query::<( &PlayerJoinEvent, &ClientId, - &Uuid, + &EntityUuid, &Name, - &Gamemode, - &Vec, + &PlayerGamemode, + &PlayerProfile, )>() .iter() { // Add this player to other players' tablists server.broadcast_with(|client| { - client.add_tablist_player(uuid, name.to_string(), profile, gamemode) + client.add_tablist_player(uuid.0, name.to_string(), &profile.0, gamemode.0) }); // Add other players to this player's tablist - for (other_player, (&uuid, name, &gamemode, profile)) in game + for (other_player, (uuid, name, gamemode, profile)) in game .ecs - .query::<(&Uuid, &Name, &Gamemode, &Vec)>() + .query::<(&EntityUuid, &Name, &PlayerGamemode, &PlayerProfile)>() .iter() { - if let Some(client) = server.clients.get(client_id) { + if let Some(client) = server.clients.get(*client_id) { if other_player != player { - client.add_tablist_player(uuid, name.to_string(), profile, gamemode); + client.add_tablist_player(uuid.0, name.to_string(), &profile.0, gamemode.0); } } } @@ -64,9 +64,9 @@ fn add_tablist_players(game: &mut Game, server: &mut Server) -> SysResult { } fn change_tablist_player_gamemode(game: &mut Game, server: &mut Server) -> SysResult { - for (_, (event, &uuid)) in game.ecs.query::<(&GamemodeEvent, &Uuid)>().iter() { + for (_, (event, uuid)) in game.ecs.query::<(&GamemodeEvent, &EntityUuid)>().iter() { // Change this player's gamemode in players' tablists - server.broadcast_with(|client| client.change_player_tablist_gamemode(uuid, **event)); + server.broadcast_with(|client| client.change_player_tablist_gamemode(uuid.0, event.0)); } Ok(()) } diff --git a/feather/server/src/systems/view.rs b/feather/server/src/systems/view.rs index 5d43a3eee..3e3d4bbf7 100644 --- a/feather/server/src/systems/view.rs +++ b/feather/server/src/systems/view.rs @@ -3,76 +3,38 @@ //! The entities and chunks visible to each client are //! determined based on the player's [`common::view::View`]. -use ahash::AHashMap; -use base::{ChunkPosition, Position}; -use common::{ - events::{ChunkLoadEvent, ViewUpdateEvent}, - Game, -}; -use ecs::{Entity, SysResult, SystemExecutor}; +use common::{events::ViewUpdateEvent, Game}; +use quill::components::EntityPosition; +use vane::{SysResult, SystemExecutor}; use crate::{Client, ClientId, Server}; pub fn register(_game: &mut Game, systems: &mut SystemExecutor) { - systems - .group::() - .add_system(send_new_chunks) - .add_system(send_loaded_chunks); -} - -/// Stores the players waiting on chunks that are currently being loaded. -#[derive(Default)] -pub struct WaitingChunks(AHashMap>); - -impl WaitingChunks { - pub fn drain_players_waiting_for(&mut self, chunk: ChunkPosition) -> Vec { - self.0.remove(&chunk).unwrap_or_default() - } - - pub fn insert(&mut self, player: Entity, chunk: ChunkPosition) { - self.0.entry(chunk).or_default().push(player); - } + systems.group::().add_system(send_new_chunks); } fn send_new_chunks(game: &mut Game, server: &mut Server) -> SysResult { - for (player, (&client_id, event, &position)) in game + for (_player, (client_id, event, _position)) in game .ecs - .query::<(&ClientId, &ViewUpdateEvent, &Position)>() + .query::<(&ClientId, &ViewUpdateEvent, &EntityPosition)>() .iter() { // As ecs removes the client one tick after it gets removed here, it can // happen that a client is still listed in the ecs but actually removed here so // we need to check if the client is actually still there. - if let Some(client) = server.clients.get(client_id) { + if let Some(client) = server.clients.get_mut(*client_id) { client.update_own_chunk(event.new_view.center()); - update_chunks( - game, - player, - client, - event, - position, - &mut server.waiting_chunks, - )?; + update_chunks(client, &event)?; } } + Ok(()) } -fn update_chunks( - game: &Game, - player: Entity, - client: &Client, - event: &ViewUpdateEvent, - position: Position, - waiting_chunks: &mut WaitingChunks, -) -> SysResult { +fn update_chunks(client: &mut Client, event: &ViewUpdateEvent) -> SysResult { // Send chunks that are in the new view but not the old view. for &pos in &event.new_chunks { - if let Some(chunk) = game.world.chunk_map().chunk_handle_at(pos) { - client.send_chunk(&chunk); - } else { - waiting_chunks.insert(player, pos); - } + client.queue_send_chunk(pos); } // Unsend the chunks that are in the old view but not the new view. @@ -80,33 +42,5 @@ fn update_chunks( client.unload_chunk(pos); } - spawn_client_if_needed(client, position); - Ok(()) } - -/// Sends newly loaded chunks to players currently -/// waiting for those chunks to load. -fn send_loaded_chunks(game: &mut Game, server: &mut Server) -> SysResult { - for (_, event) in game.ecs.query::<&ChunkLoadEvent>().iter() { - for player in server - .waiting_chunks - .drain_players_waiting_for(event.position) - { - if let Ok(client_id) = game.ecs.get::(player) { - if let Some(client) = server.clients.get(*client_id) { - client.send_chunk(&event.chunk); - spawn_client_if_needed(client, *game.ecs.get::(player)?); - } - } - } - } - Ok(()) -} - -fn spawn_client_if_needed(client: &Client, pos: Position) { - if !client.knows_own_position() && client.known_chunks() >= 9 * 9 { - log::debug!("Sent all chunks to {}; now spawning", client.username()); - client.update_own_position(pos); - } -} diff --git a/feather/utils/Cargo.toml b/feather/utils/Cargo.toml index a8e34a1ab..ee666c651 100644 --- a/feather/utils/Cargo.toml +++ b/feather/utils/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "feather-utils" version = "0.1.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" [dependencies] diff --git a/feather/utils/src/lib.rs b/feather/utils/src/lib.rs index ead41e358..6df6458e7 100644 --- a/feather/utils/src/lib.rs +++ b/feather/utils/src/lib.rs @@ -7,3 +7,13 @@ pub fn vec_remove_item(vec: &mut Vec, item: &T) { vec.swap_remove(index); } } + +#[macro_export] +macro_rules! continue_on_none { + ($expr:expr) => { + match $expr { + Some(s) => s, + None => continue, + } + }; +} diff --git a/feather/world-format/Cargo.toml b/feather/world-format/Cargo.toml new file mode 100644 index 000000000..2bdeb73c7 --- /dev/null +++ b/feather/world-format/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "feather-world-format" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1" +bitvec = "1" +byteorder = "1" +ciborium = "0.2" +libcraft = { path = "../../libcraft" } +log = "0.4" +serde = { version = "1", features = [ "derive" ] } +zstd = "0.11" + +[dev-dependencies] +tempfile = "3" diff --git a/feather/world-format/src/header.rs b/feather/world-format/src/header.rs new file mode 100644 index 000000000..2a4807ded --- /dev/null +++ b/feather/world-format/src/header.rs @@ -0,0 +1,95 @@ +use std::{ + fs::File, + io::{Cursor, Read, Seek, SeekFrom, Write}, +}; + +use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; +use libcraft::REGION_SIZE; + +use crate::SECTOR_OFFSET; + +pub const HEADER_SIZE: usize = 12 * 1024; +const NUM_CHUNKS: usize = REGION_SIZE * REGION_SIZE; + +#[derive(Debug, Clone)] +pub struct Header { + chunks: Vec, +} + +impl Default for Header { + fn default() -> Self { + Self { + chunks: vec![Entry::default(); NUM_CHUNKS], + } + } +} + +impl Header { + pub fn read_from(file: &mut File) -> anyhow::Result { + file.seek(SeekFrom::Start(0))?; + let mut buf = [0u8; HEADER_SIZE]; + file.read_exact(&mut buf)?; + + let mut cursor = Cursor::new(&buf[..]); + let mut chunks = Vec::with_capacity(NUM_CHUNKS); + for _ in 0..NUM_CHUNKS { + chunks.push(Entry { + offset_in_sectors: cursor.read_u32::()?, + size_in_bytes: cursor.read_u32::()?, + uncompressed_size_in_bytes: cursor.read_u32::()?, + }); + } + + Ok(Self { chunks }) + } + + pub fn write_to(&self, file: &mut File) -> anyhow::Result<()> { + let mut buf = [0u8; HEADER_SIZE]; + let mut cursor = Cursor::new(&mut buf[..]); + + for entry in &self.chunks { + cursor.write_u32::(entry.offset_in_sectors)?; + cursor.write_u32::(entry.size_in_bytes)?; + cursor.write_u32::(entry.uncompressed_size_in_bytes)?; + } + + file.seek(SeekFrom::Start(0))?; + file.write_all(&buf)?; + + Ok(()) + } + + /// Note that the chunk coordinates are relative to the region + /// (i.e., modulo 32) + pub fn get(&self, chunk_x: u32, chunk_z: u32) -> Entry { + self.chunks[self.index(chunk_x, chunk_z)] + } + + pub fn set(&mut self, chunk_x: u32, chunk_z: u32, entry: Entry) { + let index = self.index(chunk_x, chunk_z); + self.chunks[index] = entry; + } + + pub fn iter(&self) -> impl Iterator + '_ { + self.chunks.iter().copied() + } + + fn index(&self, chunk_x: u32, chunk_z: u32) -> usize { + assert!(chunk_x < REGION_SIZE as u32); + assert!(chunk_z < REGION_SIZE as u32); + (chunk_x as usize * REGION_SIZE) + chunk_z as usize + } +} + +#[derive(Copy, Clone, Debug, Default)] +pub struct Entry { + pub offset_in_sectors: u32, + pub size_in_bytes: u32, + pub uncompressed_size_in_bytes: u32, +} + +impl Entry { + pub fn exists(&self) -> bool { + self.offset_in_sectors >= SECTOR_OFFSET + } +} diff --git a/feather/world-format/src/lib.rs b/feather/world-format/src/lib.rs new file mode 100644 index 000000000..c4cc81bfa --- /dev/null +++ b/feather/world-format/src/lib.rs @@ -0,0 +1,325 @@ +//! Implements the modernized, efficient world format used +//! by default in Feather. +//! +//! # Comparison to vanilla (Anvil) format +//! * The format is currently much simpler, because Feather doesn't yet support +//! much of the data stored in vanilla saves. There are fewer fields to worry +//! about and fewer edge cases with missing data (which happens with upgraded world +//! saves in vanilla). +//! * The format uses `zstd` for compression instead of `zlib`, which improves +//! performance and compression rates. +//! * The format uses CBOR for encoding rather than NBT. CBOR can be slightly smaller +//! than NBT, and it is more widely supported. +//! +//! # Format specification +//! Similar to Anvil, we pack each 32x32 region of chunks into one file. +//! Also similar to Anvil, each file is divided into sectors of 1 KiB each. +//! +//! The file begins with a 12 KiB header containing metadata for each of the 1024 +//! chunks in the region. Each metadata entry consists of 8 bytes: +//! * bytes 0..4: the offset from the start of the file of the stored chunk, _in sectors_. +//! If set to a value less than 2 (which would point into the header), then the chunk does not exist. +//! * bytes 4..8: the size of the chunk in the file, _in bytes_. +//! * bytes 8..12: the uncompressed size of the chunk, _in bytes_. +//! Both values are encoded big-endian. + +use std::{ + fs::{self, File, OpenOptions}, + io::{Cursor, Read, Seek, SeekFrom, Write}, + iter, + ops::Range, + path::Path, + sync::Arc, +}; + +use anyhow::Context; +use header::{Entry, Header}; +use libcraft::{biome::BiomeList, Chunk, RegionPosition, Sections, REGION_SIZE}; +use model::ChunkModel; +use range_alloc::RangeAllocator; +use zstd::bulk::{Compressor, Decompressor}; + +mod header; +mod model; +mod range_alloc; + +const INITIAL_SECTORS: u32 = 256; +const SECTOR_GROWTH_FACTOR: u32 = 2; + +const SECTOR_OFFSET: u32 = 12; + +const SECTOR_SIZE: u64 = 1024; + +const COMPRESSION_LEVEL: i32 = 9; + +/// Handle to an open region file. +pub struct RegionHandle { + pos: RegionPosition, + file: File, + header: Header, + sector_allocator: RangeAllocator, + + biomes: Arc, + sections: Sections, + min_y: i32, + + buffer: Vec, + compression_buffer: Vec, + + compressor: Compressor<'static>, + decompressor: Decompressor<'static>, +} + +impl RegionHandle { + /// Opens a handle to the given region, creating it if allowed and + /// necessary. + /// + /// `dir` points to the directory where region files are stored. + pub fn open( + dir: impl AsRef, + region: RegionPosition, + allow_creation: bool, + biomes: Arc, + sections: Sections, + min_y: i32, + ) -> anyhow::Result { + if !dir.as_ref().exists() { + fs::create_dir_all(dir.as_ref()).ok(); + } + + let path = dir.as_ref().join(file_name(region)); + let was_created = !path.exists(); + let mut file = OpenOptions::new() + .write(true) + .read(true) + .append(false) + .create(allow_creation) + .open(path)?; + + let header = if was_created { + let header = Header::default(); + header.write_to(&mut file)?; + header + } else { + Header::read_from(&mut file)? + }; + + let size = if was_created { + INITIAL_SECTORS + } else { + u32::try_from(file.metadata()?.len() / SECTOR_SIZE)? - SECTOR_OFFSET + }; + + let mut sector_allocator = RangeAllocator::new(size); + for entry in header.iter() { + if entry.exists() { + sector_allocator.mark_used(entry_range(entry)); + } + } + + let mut this = Self { + pos: region, + file, + header, + sector_allocator, + biomes, + sections, + min_y, + buffer: Vec::with_capacity(2048), + compression_buffer: Vec::with_capacity(2048), + + compressor: Compressor::new(COMPRESSION_LEVEL)?, + decompressor: Decompressor::new()?, + }; + this.pad_file()?; + Ok(this) + } + + /// Writes a chunk into the region. + pub fn save(&mut self, chunk: &Chunk) -> anyhow::Result<()> { + let (chunk_x, chunk_z) = self + .pos + .chunk_offset(chunk.position()) + .context("chunk does not lie within this region")?; + let old_entry = self.header.get(chunk_x, chunk_z); + + let model = ChunkModel::from_chunk(chunk, &self.biomes); + ciborium::ser::into_writer(&model, &mut self.compression_buffer) + .context("failed to serialize chunk")?; + self.compressor + .compress_to_buffer(&self.compression_buffer, &mut self.buffer)?; + + let data_size = self.buffer.len() as u64; + let num_sectors: u32 = ((data_size + SECTOR_SIZE - 1) / SECTOR_SIZE).try_into()?; + let range = match self.sector_allocator.allocate(num_sectors) { + Some(r) => r, + None => { + let size = self.sector_allocator.size(); + self.sector_allocator.grow_to(size * SECTOR_GROWTH_FACTOR); + self.pad_file()?; + self.sector_allocator + .allocate(num_sectors) + .expect("did not grow enough") + } + }; + + // Write the data + self.file.seek(SeekFrom::Start( + (range.start + SECTOR_OFFSET) as u64 * SECTOR_SIZE, + ))?; + self.file.write_all(&self.buffer)?; + + // Update the header (in memory, not yet committed) + let new_entry = Entry { + offset_in_sectors: SECTOR_OFFSET + range.start, + size_in_bytes: self.buffer.len().try_into()?, + uncompressed_size_in_bytes: self.compression_buffer.len().try_into()?, + }; + self.header.set(chunk_x, chunk_z, new_entry); + + self.buffer.clear(); + self.compression_buffer.clear(); + + // NB: we've waited to free the old entry from the allocator until _after_ + // the new data has been written. This way, in the event of a crash, + // the old data remains intact and referenced in the header. (Otherwise, + // it would be overwritten because the space from the old data was reused.) + if old_entry.exists() { + self.sector_allocator.deallocate(entry_range(old_entry)); + } + + // Commit the header + self.header.write_to(&mut self.file)?; + + Ok(()) + } + + /// Reads a chunk from the region. + pub fn load(&mut self, chunk_x: u32, chunk_z: u32) -> anyhow::Result> { + assert!(chunk_x < REGION_SIZE as u32); + assert!(chunk_z < REGION_SIZE as u32); + let entry = self.header.get(chunk_x, chunk_z); + if !entry.exists() { + return Ok(None); + } + + self.buffer.clear(); + self.compression_buffer.clear(); + + let offset = entry.offset_in_sectors as u64 * SECTOR_SIZE; + self.file.seek(SeekFrom::Start(offset))?; + + // Prep the buffer + self.compression_buffer + .extend(iter::repeat(0).take(entry.size_in_bytes as usize)); + self.file.read_exact(&mut self.compression_buffer)?; + self.buffer + .reserve(entry.uncompressed_size_in_bytes as usize); + self.decompressor + .decompress_to_buffer(&self.compression_buffer, &mut self.buffer)?; + + let model: ChunkModel = ciborium::de::from_reader(Cursor::new(&self.buffer))?; + + self.buffer.clear(); + self.compression_buffer.clear(); + + let chunk = model + .to_chunk( + &self.biomes, + self.pos.chunk(chunk_x, chunk_z), + self.sections, + self.min_y, + ) + .context("malformed chunk")?; + + Ok(Some(chunk)) + } + + fn pad_file(&mut self) -> anyhow::Result<()> { + let min_size = + self.sector_allocator.size() as u64 * SECTOR_SIZE + SECTOR_SIZE * SECTOR_OFFSET as u64; + let current_size = self.file.metadata()?.len(); + + if current_size < min_size { + let num_zeros = min_size - current_size; + log::debug!("Growing region {:?} by {} KiB", self.pos, num_zeros / 1024); + let buf = vec![0u8; num_zeros.try_into()?]; + self.file.seek(SeekFrom::End(0))?; + self.file.write_all(&buf)?; + } + + Ok(()) + } +} + +fn entry_range(entry: Entry) -> Range { + assert!(entry.exists()); + Range { + start: entry.offset_in_sectors - SECTOR_OFFSET, + end: entry.offset_in_sectors - SECTOR_OFFSET + + (entry.size_in_bytes + SECTOR_SIZE as u32 - 1) / SECTOR_SIZE as u32, + } +} + +fn file_name(region: RegionPosition) -> String { + format!("r.{}.{}.freg", region.x, region.z) +} + +#[cfg(test)] +mod tests { + use libcraft::{BlockKind, BlockState, ChunkPosition}; + use tempfile::tempdir; + + use super::*; + + #[test] + fn read_write_single_chunk() { + let dir = tempdir().unwrap(); + + let mut region = RegionHandle::open( + dir.path(), + RegionPosition { x: 0, z: 0 }, + true, + Arc::new(BiomeList::vanilla()), + Sections(16), + 0, + ) + .unwrap(); + + let mut chunk = Chunk::new(ChunkPosition { x: 0, z: 0 }, Sections(16), 0); + for y in 0..64 { + for x in 0..16 { + for z in 0..16 { + chunk + .set_block_at(x, y, z, BlockState::new(BlockKind::OakWood), false) + .unwrap(); + } + } + } + + region.save(&chunk).unwrap(); + + let loaded_chunk = region.load(0, 0).unwrap().unwrap(); + for y in 0..64 { + for x in 0..16 { + for z in 0..16 { + assert_eq!( + loaded_chunk.block_at(x, y, z), + Some(BlockState::new(BlockKind::OakWood)) + ); + } + } + } + + assert!(region.load(0, 1).unwrap().is_none()); + + chunk.set_position(ChunkPosition { x: 0, z: 1 }); + region.save(&chunk).unwrap(); + region.load(0, 0).unwrap().unwrap(); + region.load(0, 1).unwrap().unwrap(); + chunk.set_position(ChunkPosition { x: 0, z: 0 }); + region.save(&chunk).unwrap(); + region.load(0, 0).unwrap(); + region.load(0, 1).unwrap(); + } +} diff --git a/feather/world-format/src/model.rs b/feather/world-format/src/model.rs new file mode 100644 index 000000000..3c4662b1d --- /dev/null +++ b/feather/world-format/src/model.rs @@ -0,0 +1,195 @@ +use anyhow::Context; +use libcraft::biome::BiomeList; +use libcraft::chunk::LightStore; +use libcraft::{ + chunk::{ + paletted_container::{Paletteable, PalettedContainer}, + PackedArray, + }, + BlockState, ChunkPosition, +}; +use libcraft::{Chunk, ChunkSection, Sections}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ChunkModel { + pub sections: Vec, +} + +impl ChunkModel { + pub fn from_chunk(chunk: &Chunk, biomes: &BiomeList) -> Self { + Self { + sections: chunk + .sections() + .iter() + .map(|section| ChunkSectionModel::from_chunk_section(section, biomes)) + .collect(), + } + } + + pub fn to_chunk( + &self, + biomes: &BiomeList, + pos: ChunkPosition, + sections: Sections, + min_y: i32, + ) -> Result { + let mut chunk = Chunk::new(pos, sections, min_y); + + for (model, section) in self.sections.iter().zip(chunk.sections_mut()) { + *section = model.to_chunk_section(biomes)?; + } + + Ok(chunk) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ChunkSectionModel { + pub sky_light: Option, + pub block_light: Option, + pub blocks: PalettedContainerModel, + pub biomes: PalettedContainerModel, + pub air_block_count: u32, +} + +impl ChunkSectionModel { + pub fn from_chunk_section(section: &ChunkSection, biomes: &BiomeList) -> Self { + Self { + sky_light: section.light().sky_light().map(Into::into), + block_light: section.light().block_light().map(Into::into), + blocks: PalettedContainerModel::from(section.blocks(), |state| { + BlockStateModel::from(*state) + }), + biomes: PalettedContainerModel::from(section.biomes(), |biome_id| { + biomes.get_by_id(biome_id).unwrap().0.clone() + }), + air_block_count: section.air_blocks(), + } + } + + pub fn to_chunk_section(&self, biomes: &BiomeList) -> Result { + Ok(ChunkSection::new( + self.blocks + .clone() + .into(|block| (&block).try_into().unwrap()), + self.biomes + .clone() + .into(|biome| biomes.get_id(&biome).unwrap()), + self.air_block_count, + LightStore::from_packed_arrays( + self.sky_light.clone().map(Into::into), + self.block_light.clone().map(Into::into), + ) + .unwrap(), + )) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BlockStateModel { + pub kind: String, + pub properties: Vec<(String, String)>, +} + +impl From for BlockStateModel { + fn from(state: BlockState) -> Self { + Self { + kind: state.namespaced_id().to_owned(), + properties: state + .property_values() + .map(|(a, b)| (a.to_owned(), b.to_owned())) + .collect(), + } + } +} + +impl TryFrom<&BlockStateModel> for BlockState { + type Error = anyhow::Error; + + fn try_from(model: &BlockStateModel) -> Result { + BlockState::from_namespaced_id_and_property_values( + &model.kind, + model + .properties + .iter() + .map(|(a, b)| (a.as_str(), b.as_str())), + ) + .context("invalid block state") + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum PalettedContainerModel { + SingleValue(T), + MultipleValues { + data: PackedArrayModel, + palette: Vec, + }, + GlobalPalette { + data: PackedArrayModel, + }, +} + +impl PalettedContainerModel { + pub fn from(container: &PalettedContainer, convert: impl Fn(&U) -> T) -> Self + where + U: Paletteable, + { + match container { + PalettedContainer::SingleValue(val) => { + PalettedContainerModel::SingleValue(convert(val)) + } + PalettedContainer::MultipleValues { data, palette } => { + PalettedContainerModel::MultipleValues { + data: data.into(), + palette: palette.iter().map(convert).collect(), + } + } + PalettedContainer::GlobalPalette { data } => { + PalettedContainerModel::GlobalPalette { data: data.into() } + } + } + } + + pub fn into(self, convert: impl Fn(T) -> U) -> PalettedContainer + where + U: Paletteable, + { + match self { + PalettedContainerModel::SingleValue(val) => { + PalettedContainer::SingleValue(convert(val)) + } + PalettedContainerModel::MultipleValues { data, palette } => { + PalettedContainer::MultipleValues { + data: data.into(), + palette: palette.into_iter().map(convert).collect(), + } + } + PalettedContainerModel::GlobalPalette { data } => { + PalettedContainer::GlobalPalette { data: data.into() } + } + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PackedArrayModel { + pub length: usize, + pub bits: Vec, +} + +impl<'a> From<&'a PackedArray> for PackedArrayModel { + fn from(packed: &'a PackedArray) -> Self { + Self { + length: packed.len(), + bits: packed.as_u64_slice().to_vec(), + } + } +} + +impl From for PackedArray { + fn from(model: PackedArrayModel) -> Self { + Self::from_u64_vec(model.bits, model.length) + } +} diff --git a/feather/world-format/src/range_alloc.rs b/feather/world-format/src/range_alloc.rs new file mode 100644 index 000000000..911407e3a --- /dev/null +++ b/feather/world-format/src/range_alloc.rs @@ -0,0 +1,102 @@ +use bitvec::prelude::*; + +pub type Range = std::ops::Range; + +/// An allocator over a fixed address space. +/// +/// Used to allocate sectors within region files. +pub struct RangeAllocator { + sectors: BitVec, +} + +impl RangeAllocator { + pub fn new(size: u32) -> Self { + let sectors = bitvec![usize, Lsb0; 0; size as usize]; + Self { sectors } + } + + pub fn size(&self) -> u32 { + self.sectors.len() as u32 + } + + /// Resizes the allocator. + pub fn grow_to(&mut self, new_size: u32) { + assert!(new_size >= self.size(), "cannot shrink a range allocator"); + let excess = new_size - self.size(); + let zeros = bitvec![usize, Lsb0; 0; excess as usize]; + self.sectors.extend_from_bitslice(&zeros); + assert_eq!(self.size(), new_size); + } + + /// Allocates a new range. + pub fn allocate(&mut self, size: u32) -> Option { + let mut slice = &mut self.sectors[..]; + let mut offset = 0; + while let Some(index) = slice.first_zero() { + if index + size as usize > slice.len() { + return None; + } + + // Check if there is enough space in this free block + for i in index..index + size as usize { + if slice[i] { + slice = &mut slice[i..]; + offset += i; + continue; + } + } + + // Mark sectors as used, then return the new range. + for i in index..index + size as usize { + slice.set(i, true); + } + + return Some(Range { + start: offset as u32 + index as u32, + end: offset as u32 + index as u32 + size, + }); + } + + None + } + + /// Deallocates a range. + pub fn deallocate(&mut self, range: Range) { + for i in range { + assert!(self.sectors[i as usize]); + self.sectors.set(i as usize, false); + } + } + + /// Marks the given block as used. + pub fn mark_used(&mut self, range: Range) { + for i in range { + self.sectors.set(i as usize, true); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn alloc_consecutive() { + let mut alloc = RangeAllocator::new(101); + + for i in 0..10 { + let block = alloc.allocate(10).unwrap(); + assert_eq!(block.start, i * 10); + assert_eq!(block.end, i * 10 + 10); + } + + assert!(alloc.allocate(10).is_none()); + + alloc.deallocate(90..100); + alloc.allocate(10).unwrap(); + + assert!(alloc.allocate(10).is_none()); + + alloc.allocate(1).unwrap(); + } +} diff --git a/feather/worldgen/Cargo.toml b/feather/worldgen/Cargo.toml index ac61648e3..5627b1b3e 100644 --- a/feather/worldgen/Cargo.toml +++ b/feather/worldgen/Cargo.toml @@ -1,20 +1,11 @@ [package] name = "feather-worldgen" version = "0.6.0" -authors = [ "caelunshun " ] -edition = "2018" +authors = ["caelunshun "] +edition = "2021" [dependencies] -base = { path = "../base", package = "feather-base" } -bitvec = "0.21" +libcraft = { path = "../../libcraft" } log = "0.4" -num-traits = "0.2" -once_cell = "1" -rand = "0.7" -rand_xorshift = "0.2" -simdnoise = { git = "https://github.com/jackmott/rust-simd-noise", rev = "3a4f3e6" } # needed for https://github.com/jackmott/rust-simd-noise/pull/31 and https://github.com/jackmott/rust-simd-noise/pull/36 -smallvec = "1" -strum = "0.21" - -[dev-dependencies] -approx = "0.3" +quill = { path = "../../quill" } +rand = "0.8" diff --git a/feather/worldgen/src/biomes/distorted_voronoi.rs b/feather/worldgen/src/biomes/distorted_voronoi.rs deleted file mode 100644 index 20f3d31d1..000000000 --- a/feather/worldgen/src/biomes/distorted_voronoi.rs +++ /dev/null @@ -1,137 +0,0 @@ -use crate::voronoi::VoronoiGrid; -use crate::BiomeGenerator; -use base::chunk::BiomeStore; -use base::{Biome, ChunkPosition}; -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; - -/// Biome grid generator based on a distorted Voronoi -/// noise. -#[derive(Default)] -pub struct DistortedVoronoiBiomeGenerator; - -impl BiomeGenerator for DistortedVoronoiBiomeGenerator { - fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> BiomeStore { - let mut voronoi = VoronoiGrid::new(384, seed); - - let mut biomes = BiomeStore::default(); // Will be overridden - - // Noise is used to distort each coordinate. - /*let x_noise = - NoiseBuilder::gradient_2d_offset(chunk.x as f32 * 16.0, 16, chunk.z as f32 * 16.0, 16) - .with_seed(seed as i32 + 1) - .generate_scaled(-4.0, 4.0); - let z_noise = - NoiseBuilder::gradient_2d_offset(chunk.x as f32 * 16.0, 16, chunk.z as f32 * 16.0, 16) - .with_seed(seed as i32 + 2) - .generate_scaled(-4.0, 4.0);*/ - - for x in 0..4 { - for z in 0..4 { - // Apply distortion to coordinate before passing to voronoi - // generator. - //let distort_x = x_noise[(z << 4) | x] as i32 * 8; - //let distort_z = z_noise[(z << 4) | x] as i32 * 8; - - let distort_x = 0; - let distort_z = 0; - - let (closest_x, closest_y) = voronoi.get( - (chunk.x * 16) + x as i32 * 4 + distort_x, - (chunk.z * 16) + z as i32 * 4 + distort_z, - ); - - // Shift around the closest_x and closest_y values - // and deterministically select a biome based on the - // computed value. Continue shifting the value until - // a valid biome is computed. - let combined = (i64::from(closest_x) << 32) | i64::from(closest_y); - let mut rng = XorShiftRng::seed_from_u64(combined as u64); - - loop { - let shifted: u32 = rng.gen(); - - let biome = Biome::from_id(shifted % 60).unwrap(); - if is_biome_allowed(biome) { - for y in 0..64 { - biomes.set(x, y, z, biome); - } - break; - } - } - } - } - - biomes - } -} - -/// Returns whether the given biome is allowed in the overworld. -fn is_biome_allowed(biome: Biome) -> bool { - !matches!( - biome, - Biome::TheEnd - | Biome::TheVoid - | Biome::NetherWastes - | Biome::CrimsonForest - | Biome::WarpedForest - | Biome::BasaltDeltas - | Biome::SmallEndIslands - | Biome::EndBarrens - | Biome::EndHighlands - | Biome::EndMidlands - ) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_not_all_plains() { - // Check that the `ChunkBiomes` was overridden correctly. - let gen = DistortedVoronoiBiomeGenerator::default(); - - let chunk = ChunkPosition::new(5433, 132); - - let biomes = gen.generate_for_chunk(chunk, 8344); - - println!("{:?}", biomes); - - let mut num_plains = 0; - for x in 0..4 { - for z in 0..4 { - for y in 0..64 { - if biomes.get(x, y, z) == Biome::Plains { - num_plains += 1; - } - } - } - } - - assert_ne!(num_plains, 4 * 64 * 4); - } - - #[test] - fn test_deterministic() { - // Check that the result is always deterministic. - let gen = DistortedVoronoiBiomeGenerator::default(); - - let chunk = ChunkPosition::new(0, 0); - - let seed = 52; - let first = gen.generate_for_chunk(chunk, seed); - - for _ in 0..5 { - let next = gen.generate_for_chunk(chunk, seed); - - for x in 0..4 { - for z in 0..4 { - for y in 0..64 { - assert_eq!(first.get(x, y, z), next.get(x, y, z)); - } - } - } - } - } -} diff --git a/feather/worldgen/src/biomes/mod.rs b/feather/worldgen/src/biomes/mod.rs deleted file mode 100644 index 666e9fd5e..000000000 --- a/feather/worldgen/src/biomes/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Biome grid creation. - -mod distorted_voronoi; -mod two_level; - -pub use distorted_voronoi::DistortedVoronoiBiomeGenerator; -pub use two_level::TwoLevelBiomeGenerator; diff --git a/feather/worldgen/src/biomes/two_level.rs b/feather/worldgen/src/biomes/two_level.rs deleted file mode 100644 index a14ae3fe4..000000000 --- a/feather/worldgen/src/biomes/two_level.rs +++ /dev/null @@ -1,77 +0,0 @@ -use crate::voronoi::VoronoiGrid; -use crate::{voronoi, BiomeGenerator}; -use base::chunk::BiomeStore; -use base::{Biome, ChunkPosition}; -use once_cell::sync::Lazy; - -/// Array of biome groups, each containing biomes -/// which may appear next to each other. This is used in the -/// two-level biome generator. -static BIOME_GROUPS: Lazy>> = Lazy::new(|| { - vec![ - vec![Biome::SnowyTundra, Biome::SnowyTaiga], - vec![ - Biome::Plains, - Biome::BirchForest, - Biome::Forest, - Biome::Taiga, - Biome::Mountains, - Biome::Swamp, - Biome::DarkForest, - ], - vec![Biome::Savanna, Biome::Desert], - ] -}); - -/// Biome grid generator which works using two layers -/// of Voronoi. The first layer defines the biome group, -/// and the second determines which biome inside that group -/// to use. This technique allows similar biomes to be grouped -/// together and prevents unrelated biomes from being neighbors. -#[derive(Default)] -pub struct TwoLevelBiomeGenerator; - -impl BiomeGenerator for TwoLevelBiomeGenerator { - fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> BiomeStore { - // Voronoi used to determine biome group - let mut group_voronoi = VoronoiGrid::new(1024, seed); - // Voronoi used to determine biome within group - let mut local_voronoi = VoronoiGrid::new(256, seed + 1); - - let mut biomes = BiomeStore::default(); // Will be overridden - - let num_groups = BIOME_GROUPS.len(); - - // TODO: distort voronoi - - for x in 0..4 { - for z in 0..4 { - // Compute biome group - let possible_biomes = { - let (closest_x, closest_z) = - group_voronoi.get(chunk.x * 16 + x * 4, chunk.z * 16 + z * 4); - - let group_index = voronoi::shuffle(closest_x, closest_z, 0, num_groups); - - &BIOME_GROUPS[group_index] - }; - - // Compute biome within group - let biome = { - let (closest_x, closest_z) = - local_voronoi.get(chunk.x * 16 + x * 4, chunk.z * 16 + z * 4); - - let biome_index = - voronoi::shuffle(closest_x, closest_z, 0, possible_biomes.len()); - - possible_biomes[biome_index] - }; - for y in 0..64 { - biomes.set(x as usize, y, z as usize, biome); - } - } - } - - biomes - } -} diff --git a/feather/worldgen/src/composition.rs b/feather/worldgen/src/composition.rs deleted file mode 100644 index 61bc6e14c..000000000 --- a/feather/worldgen/src/composition.rs +++ /dev/null @@ -1,206 +0,0 @@ -//! Composition generator, used to populate chunks with blocks -//! based on the density and biome values. - -use crate::{block_index, util, CompositionGenerator, SEA_LEVEL}; -use base::{chunk::BiomeStore, Biome, BlockId, Chunk, ChunkPosition}; -use bitvec::order::LocalBits; -use bitvec::slice::BitSlice; -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; -use std::cmp::min; - -/// A composition generator which generates basic -/// terrain based on biome values. -#[derive(Debug, Default)] -pub struct BasicCompositionGenerator; - -impl CompositionGenerator for BasicCompositionGenerator { - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - _pos: ChunkPosition, - biomes: &BiomeStore, - density: &BitSlice, - seed: u64, - ) { - // For each column in the chunk, go from top to - // bottom. The first time a block density value is set to `true`, - // set it and the next three blocks to dirt. After that, use - // stone. - for x in 0..16 { - for z in 0..16 { - basic_composition_for_column( - x, - z, - chunk, - density, - seed, - biomes.get_at_block(x, 0, z), - ); - } - } - } -} - -fn basic_composition_for_column( - x: usize, - z: usize, - chunk: &mut Chunk, - density: &BitSlice, - seed: u64, - biome: Biome, -) { - basic_composition_for_solid_biome(x, z, chunk, density, seed, biome); -} - -fn basic_composition_for_solid_biome( - x: usize, - z: usize, - chunk: &mut Chunk, - density: &BitSlice, - seed: u64, - biome: Biome, -) { - let mut rng = - XorShiftRng::seed_from_u64(util::shuffle_seed_for_column(seed, chunk.position(), x, z)); - - let top_soil = top_soil_block(biome); - - let mut topsoil_remaining = -1; - let mut water_level = 0; // `level` block data starts at 0 and skips to min(8+n, 15) for each level of water downward - for y in (0..256).rev() { - let mut block = BlockId::air(); - - let is_solid = density[block_index(x, y, z)]; - - let mut skip = false; - - if biome == Biome::Ocean { - if y <= SEA_LEVEL && !is_solid { - block = BlockId::water().with_water_level(water_level); - if water_level == 0 { - water_level = 8; - } else { - water_level = min(water_level + 1, 15); - } - skip = true; - } else if y >= SEA_LEVEL { - continue; // Leave at air - no blocks above sea level in ocean - } - } - - if !skip { - if y <= rng.gen_range(0, 4) { - block = BlockId::bedrock(); - } else { - block = if is_solid { - if topsoil_remaining == -1 { - topsoil_remaining = 3; - top_soil - } else if topsoil_remaining > 0 { - let block = underneath_top_soil_block(biome); - topsoil_remaining -= 1; - block - } else { - BlockId::stone() - } - } else { - topsoil_remaining = -1; - BlockId::air() - }; - } - } - - if !block.is_air() { - chunk.set_block_at(x, y, z, block); - } - } -} - -/// Returns the top soil block for the given biome. -fn top_soil_block(biome: Biome) -> BlockId { - match biome { - Biome::SnowyTundra - | Biome::IceSpikes - | Biome::SnowyTaiga - | Biome::SnowyTaigaMountains - | Biome::SnowyBeach => BlockId::grass_block().with_snowy(true), - Biome::GravellyMountains | Biome::ModifiedGravellyMountains => BlockId::gravel(), - Biome::StoneShore => BlockId::stone(), - Biome::Beach | Biome::Desert | Biome::DesertHills | Biome::DesertLakes => BlockId::sand(), - Biome::MushroomFields | Biome::MushroomFieldShore => BlockId::mycelium(), - - Biome::Badlands - | Biome::ErodedBadlands - | Biome::WoodedBadlandsPlateau - | Biome::BadlandsPlateau - | Biome::ModifiedBadlandsPlateau - | Biome::ModifiedWoodedBadlandsPlateau => BlockId::red_sand(), - Biome::Ocean => BlockId::sand(), - _ => BlockId::grass_block(), - } -} - -/// Returns the block under the top soil block for the given biome. -fn underneath_top_soil_block(biome: Biome) -> BlockId { - match biome { - Biome::SnowyBeach => BlockId::snow_block(), - Biome::GravellyMountains | Biome::ModifiedGravellyMountains => BlockId::gravel(), - Biome::StoneShore => BlockId::stone(), - Biome::Beach | Biome::Desert | Biome::DesertHills | Biome::DesertLakes => { - BlockId::sandstone() - } - Biome::MushroomFields | Biome::MushroomFieldShore => BlockId::dirt(), - Biome::Badlands - | Biome::ErodedBadlands - | Biome::WoodedBadlandsPlateau - | Biome::BadlandsPlateau - | Biome::ModifiedBadlandsPlateau - | Biome::ModifiedWoodedBadlandsPlateau => BlockId::red_sandstone(), - Biome::Ocean => BlockId::sand(), - _ => BlockId::dirt(), - } -} - -#[cfg(test)] -mod tests { - use super::*; - use bitvec::vec::BitVec; - - #[test] - fn test_basic_composition_for_column() { - let mut density = BitVec::from_vec(vec![0u8; 16 * 256 * 16 / 8]); - - let x = 0; - let z = 0; - - for y in 0..=32 { - density.set(block_index(x, y, z), true); - } - - for y in 40..=64 { - density.set(block_index(x, y, z), true); - } - - let mut chunk = Chunk::new(ChunkPosition::new(0, 0)); - basic_composition_for_column(x, z, &mut chunk, &density[..], 435, Biome::Plains); - - for y in 4..=28 { - assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockId::stone()); - } - - for y in 29..=31 { - assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockId::dirt()); - } - - for y in 33..40 { - assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockId::air()); - } - - for y in 40..=60 { - assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockId::stone()); - } - - assert_eq!(chunk.block_at(x, 64, z).unwrap(), BlockId::grass_block()); - } -} diff --git a/feather/worldgen/src/density_map/density.rs b/feather/worldgen/src/density_map/density.rs deleted file mode 100644 index 3d09f0f4f..000000000 --- a/feather/worldgen/src/density_map/density.rs +++ /dev/null @@ -1,262 +0,0 @@ -//! Implements a density map generator using 3D Perlin noise. -//! -//! Over the 2D height map generator, this has the advantage that terrain -//! is more interesting; overhangs and the like will be able to generate. - -use crate::{block_index, noise, DensityMapGenerator, NearbyBiomes, NoiseLerper}; -use base::{Biome, ChunkPosition}; -use bitvec::order::LocalBits; -use bitvec::vec::BitVec; -use once_cell::sync::Lazy; -use simdnoise::NoiseBuilder; - -/// A density map generator using 3D Perlin noise. -/// -/// This generator should be used over the height map generator -/// when seeking correct-looking worlds; -/// -/// # Implementation -/// Density calculation works as follows: -/// * Generate a base 3D Perlin nosie with settings depending -/// on the biome. Use linear interpolation on noise (this -/// is handled by `Wrapped3DPerlinNoise`)`. -/// * Depending on the density value from the noise, decide -/// whether the position is solid or air. -#[derive(Debug, Default)] -pub struct DensityMapGeneratorImpl; - -impl DensityMapGenerator for DensityMapGeneratorImpl { - fn generate_for_chunk( - &self, - chunk: ChunkPosition, - biomes: &NearbyBiomes, - seed: u64, - ) -> BitVec { - let mut density = BitVec::from_vec(vec![0u8; 16 * 256 * 16 / 8]); - - let uninterpolated_densities = generate_density(chunk, biomes, seed); - let noise = NoiseLerper::new(&uninterpolated_densities) - .with_offset(chunk.x, chunk.z) - .generate(); - - for x in 0..16 { - for y in 0..256 { - for z in 0..16 { - let value = noise[noise::index(x, y, z)]; - - let is_solid = value < 0.0; - let index = block_index(x, y, z); - density.set(index, is_solid); - } - } - } - - density - } -} - -const DENSITY_WIDTH: usize = 5; -const DENSITY_HEIGHT: usize = 33; - -/// Generates a 5x33x5 density array to pass to `NoiseLerper`. -/// -/// This is based on Cuberite's implementation of the same function. -/// It works by having two 3D density noises, with another noise -/// to interpolate between the values of each. It then uses -/// a vertical linear gradient to determine densities of the -/// subchunks at each given Y level for a column. -/// -/// # Notes -/// The density values emitted from this function should -/// be considered solid if less than 0 and air if greater -/// than 0. This is contrary to what might seem logical. -fn generate_density(chunk: ChunkPosition, biomes: &NearbyBiomes, seed: u64) -> Vec { - // TODO: generate based on biome - - let x_offset = (chunk.x * (DENSITY_WIDTH as i32 - 1)) as f32; - let y_offset = 0.0; - let z_offset = (chunk.z * (DENSITY_WIDTH as i32 - 1)) as f32; - let len = DENSITY_WIDTH; - let height = DENSITY_HEIGHT; - - let noise_seed = seed as i32; - - // Generate various noises. - let choice_noise = NoiseBuilder::fbm_3d_offset(x_offset, len, y_offset, height, z_offset, len) - .with_seed(noise_seed) - .with_octaves(2) - .with_freq(0.001) - .generate() - .0; - let density_noise_1 = - NoiseBuilder::fbm_3d_offset(x_offset, len, y_offset, height, z_offset, len) - .with_seed(noise_seed + 1) - .with_octaves(2) - .with_freq(0.2) - .generate() - .0; - let density_noise_2 = - NoiseBuilder::fbm_3d_offset(x_offset, len, y_offset, height, z_offset, len) - .with_seed(noise_seed + 2) - .with_octaves(2) - .with_freq(0.2) - .generate() - .0; - // Additional 2D height noise for extra detail. - let height_noise = NoiseBuilder::fbm_2d_offset(x_offset, len, z_offset, len) - .with_seed(noise_seed + 3) - .with_octaves(2) - .with_freq(0.08) - .generate() - .0; - - let mut result = vec![0.0; DENSITY_WIDTH * DENSITY_HEIGHT * DENSITY_WIDTH]; - - // Loop through subchunks and generate density for each. - for subx in 0..DENSITY_WIDTH { - for subz in 0..DENSITY_WIDTH { - // TODO: average nearby biome parameters - let (amplitude, midpoint) = column_parameters(biomes, subx, subz); - - let height = height_noise[(subz * len) + subx] * 3.0; - - // Loop through Y axis of this subchunk column. - for suby in 0..DENSITY_HEIGHT { - // Linear gradient used to offset based on height. - let mut height_offset = ((suby as f32 * 8.0) - midpoint) * amplitude; - - // If we are below the midpoint, increase the slope of the gradient. - // This creates smoother terrain. - if height_offset < 0.0 { - height_offset *= 4.0; - } - - // When we are near sky limit, decrease - // the slope. This ensures that very tall - // mountains don't artificially cut off - // at Y=256. - if suby > 26 { - height_offset += (suby as f32 - 28.0) / 4.0; - } - - let index = DENSITY_WIDTH * suby + subx + DENSITY_WIDTH * DENSITY_HEIGHT * subz; - - let choice = choice_noise[index] * 100.0; - let density_1 = density_noise_1[index] * 50.0; - let density_2 = density_noise_2[index] * 50.0; - - // Average between two density values based on choice weight. - result[index] = - lerp(density_1, density_2, choice) * 0.2 + height_offset * 2.0 + height; - } - } - } - - result -} - -/// Elevation height field, used to weight -/// the averaging of nearby biome heights. -static ELEVATION_WEIGHT: Lazy<[[f32; 19]; 19]> = Lazy::new(|| { - let mut array = [[0.0; 19]; 19]; - for (x, values) in array.iter_mut().enumerate() { - for (z, value) in values.iter_mut().enumerate() { - let mut x_squared = x as i32 - 9; - x_squared *= x_squared; - let mut z_sqaured = z as i32 - 9; - z_sqaured *= z_sqaured; - *value = 10.0 / (x_squared as f32 + z_sqaured as f32 + 0.2).sqrt(); - } - } - array -}); - -/// Computes the target amplitude and midpoint for the -/// given column, using a 9x9 grid of biomes -/// around the column to determine a weighted average. -/// -/// The X and Z parameters are the coordinates of the subchunk -/// within the chunk, not the block coordinate. -fn column_parameters(biomes: &NearbyBiomes, x: usize, z: usize) -> (f32, f32) { - let x = x as i32 * (DENSITY_WIDTH as i32 - 1); - let z = z as i32 * (DENSITY_WIDTH as i32 - 1); - - let mut sum_amplitudes = 0.0; - let mut sum_midpoints = 0.0; - let mut sum_weights = 0.0; - - // Loop through columns in 9x9 grid and compute weighted average of amplitudes - // and midpoints. - for block_x in -9..=9 { - for block_z in -9..=9 { - let abs_x = x + block_x; - let abs_z = z + block_z; - - let biome = biomes.get_at_block(abs_x, 0, abs_z); - let (amplitude, midpoint) = biome_parameters(biome); - - let weight = ELEVATION_WEIGHT[(block_x + 9) as usize][(block_z + 9) as usize]; - - sum_amplitudes += amplitude * weight; - sum_midpoints += midpoint * weight; - sum_weights += weight; - } - } - - sum_amplitudes /= sum_weights; - sum_midpoints /= sum_weights; - - (sum_amplitudes, sum_midpoints) -} - -/// Returns the amplitude and midpoint for a given biome -/// type as a tuple in that order. -/// -/// All original values were taken from Cuberite's source, -/// so all credit for this function goes to their team -/// for the presumably highly laborious effort -/// involved in finding these values. -fn biome_parameters(biome: Biome) -> (f32, f32) { - match biome { - Biome::Beach => (0.2, 60.0), - Biome::BirchForest => (0.1, 64.0), - Biome::BirchForestHills => (0.075, 64.0), - Biome::TallBirchHills => (0.075, 68.0), - Biome::TallBirchForest => (0.1, 64.0), - Biome::SnowyBeach => (0.3, 62.0), - Biome::Taiga => (0.3, 62.0), - Biome::TaigaHills => (0.075, 68.0), - Biome::DesertHills => (0.075, 68.0), - Biome::DeepOcean => (0.17, 35.0), - Biome::Desert => (0.15, 62.0), - Biome::Mountains => (0.045, 75.0), - Biome::MountainEdge => (0.1, 70.0), - Biome::WoodedMountains => (0.04, 80.0), - Biome::FlowerForest => (0.1, 64.0), - Biome::Forest => (0.1, 64.0), - Biome::Jungle => (0.1, 63.0), - Biome::Ocean => (0.12, 45.0), - Biome::Plains => (0.3, 62.0), - Biome::Savanna => (0.3, 62.0), - Biome::SavannaPlateau => (0.3, 85.0), - Biome::StoneShore => (0.075, 60.0), - Biome::SunflowerPlains => (0.3, 62.0), - Biome::Swamp => (0.25, 59.0), - // TODO: finish this list - _ => (0.3, 62.0), - } -} - -/// Interpolates between two values based on the given -/// weight. -/// -/// The weight is clamped to [0.0, 1.0]. -fn lerp(a: f32, b: f32, weight: f32) -> f32 { - if weight < 0.0 { - return a; - } else if weight > 1.0 { - return b; - } - - a + (b - a) * weight -} diff --git a/feather/worldgen/src/density_map/height.rs b/feather/worldgen/src/density_map/height.rs deleted file mode 100644 index c38bac35e..000000000 --- a/feather/worldgen/src/density_map/height.rs +++ /dev/null @@ -1,57 +0,0 @@ -//! Implements a basic height map generator using 2D Perlin noise. -//! A superior generator would use 3D noise to allow for overhangs. - -use crate::{block_index, DensityMapGenerator, NearbyBiomes, OCEAN_DEPTH, SKY_LIMIT}; -use base::{Biome, ChunkPosition}; -use bitvec::order::LocalBits; -use bitvec::vec::BitVec; -use simdnoise::NoiseBuilder; -use std::cmp::min; - -/// Density map generator which simply uses a height map -/// using two-dimensional Perlin noise. -#[derive(Debug, Default)] -pub struct HeightMapGenerator; - -impl DensityMapGenerator for HeightMapGenerator { - fn generate_for_chunk( - &self, - chunk: ChunkPosition, - biomes: &NearbyBiomes, - seed: u64, - ) -> BitVec { - let x_offset = (chunk.x * 16) as f32; - let y_offset = (chunk.z * 16) as f32; - - let dim = 16; - let (elevation, _, _) = NoiseBuilder::gradient_2d_offset(x_offset, dim, y_offset, dim) - .with_seed(seed as i32) - .with_freq(0.01) - .generate(); - let (detail, _, _) = NoiseBuilder::gradient_2d_offset(x_offset, dim, y_offset, dim) - .with_seed(seed as i32 + 1) - .generate(); - - let mut density_map = BitVec::from_vec(vec![0u8; 16 * 256 * 16 / 8]); - for x in 0..16 { - for z in 0..16 { - let biome = biomes.get_at_block(x, 0, z); - let index = (z << 4) | x; - let mut elevation = elevation[index].abs() * 400.0; - let detail = detail[index] * 50.0; - - if biome == Biome::Ocean { - elevation -= OCEAN_DEPTH as f32; - } - - let height = (elevation + detail + 64.0) as usize; - - for y in 0..min(height, SKY_LIMIT) { - density_map.set(block_index(x, y, z), true); - } - } - } - - density_map - } -} diff --git a/feather/worldgen/src/density_map/mod.rs b/feather/worldgen/src/density_map/mod.rs deleted file mode 100644 index 3a24e4bd8..000000000 --- a/feather/worldgen/src/density_map/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod density; -mod height; - -pub use density::DensityMapGeneratorImpl; -pub use height::HeightMapGenerator; diff --git a/feather/worldgen/src/finishers/clumped.rs b/feather/worldgen/src/finishers/clumped.rs deleted file mode 100644 index af8880f05..000000000 --- a/feather/worldgen/src/finishers/clumped.rs +++ /dev/null @@ -1,75 +0,0 @@ -use crate::util::shuffle_seed_for_chunk; -use crate::{BiomeStore, FinishingGenerator, TopBlocks}; -use base::{Biome, BlockId, Chunk}; -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; -use std::{cmp, iter}; - -/// Clumped foliage generator. -#[derive(Default)] -pub struct ClumpedFoliageFinisher; - -impl FinishingGenerator for ClumpedFoliageFinisher { - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - biomes: &BiomeStore, - top_blocks: &TopBlocks, - seed: u64, - ) { - // Generate clumps of foliage for the biome. - // Note that we currently use a hack - // to ensure that clumps are within one - // chunk. - // The algorithm should be changed in the future - // to allow for cross-chunk clumps. - - let mut rng = XorShiftRng::seed_from_u64(shuffle_seed_for_chunk(seed, chunk.position())); - - for x in 0..16 { - for z in 0..16 { - let biome = biomes.get_at_block(x, 0, z); - - if let Some(block) = biome_clump_block(biome) { - if rng.gen_range(0, 48) == 0 { - // Generate clump with center at this position. - iter::repeat(()).take(rng.gen_range(3, 6)).for_each(|_| { - let offset_x = rng.gen_range(-2, 3); - let offset_z = rng.gen_range(-2, 3); - - // Clamp value within chunk border - let pos_x = cmp::max(0, cmp::min(x as i32 + offset_x, 15)) as usize; - let pos_z = cmp::max(0, cmp::min(z as i32 + offset_z, 15)) as usize; - - if chunk.biomes().get_at_block(pos_x, 0, pos_z) != biome { - return; // Don't generate block outside this biome - } - - let top = top_blocks.top_block_at(pos_x, pos_z); - chunk.set_block_at(pos_x, top + 1, pos_z, block); - }); - } - } - } - } - } -} - -fn biome_clump_block(biome: Biome) -> Option { - match biome { - Biome::Plains - | Biome::SunflowerPlains - | Biome::WoodedMountains - | Biome::Mountains - | Biome::Savanna - | Biome::SavannaPlateau - | Biome::Forest - | Biome::DarkForest - | Biome::DarkForestHills - | Biome::BirchForest - | Biome::TallBirchForest - | Biome::BirchForestHills - | Biome::Swamp => Some(BlockId::grass()), - _ => None, - } -} diff --git a/feather/worldgen/src/finishers/mod.rs b/feather/worldgen/src/finishers/mod.rs deleted file mode 100644 index d9bfdb0c5..000000000 --- a/feather/worldgen/src/finishers/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Various finishers for world generation, such as grass, snow, and trees. - -mod clumped; -mod single; -mod snow; - -pub use clumped::ClumpedFoliageFinisher; -pub use single::SingleFoliageFinisher; -pub use snow::SnowFinisher; diff --git a/feather/worldgen/src/finishers/single.rs b/feather/worldgen/src/finishers/single.rs deleted file mode 100644 index 74bcaf005..000000000 --- a/feather/worldgen/src/finishers/single.rs +++ /dev/null @@ -1,58 +0,0 @@ -use crate::util::shuffle_seed_for_chunk; -use crate::{FinishingGenerator, TopBlocks}; -use base::chunk::BiomeStore; -use base::{Biome, BlockId, Chunk}; -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; - -/// Foliage including shrubs and lilypads. -#[derive(Default)] -pub struct SingleFoliageFinisher; - -impl FinishingGenerator for SingleFoliageFinisher { - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - biomes: &BiomeStore, - top_blocks: &TopBlocks, - seed: u64, - ) { - let mut rng = XorShiftRng::seed_from_u64(shuffle_seed_for_chunk(seed, chunk.position())); - for x in 0..16 { - for z in 0..16 { - let biome = biomes.get_at_block(x, 0, z); - - if let Some(foliage) = biome_foliage(biome) { - if chunk.block_at(x, top_blocks.top_block_at(x, z), z).unwrap() - == foliage.required - && rng.gen_range(0, 192) == 0 - { - chunk.set_block_at(x, top_blocks.top_block_at(x, z) + 1, z, foliage.block); - } - } - } - } - } -} - -struct Foliage { - /// The block required at the top of the column - /// for the foliage to generate. - required: BlockId, - /// The foliage block. - block: BlockId, -} - -impl Foliage { - fn new(required: BlockId, block: BlockId) -> Self { - Self { required, block } - } -} - -fn biome_foliage(biome: Biome) -> Option { - match biome { - Biome::Desert => Some(Foliage::new(BlockId::sand(), BlockId::dead_bush())), - Biome::Swamp => Some(Foliage::new(BlockId::water(), BlockId::lily_pad())), - _ => None, - } -} diff --git a/feather/worldgen/src/finishers/snow.rs b/feather/worldgen/src/finishers/snow.rs deleted file mode 100644 index 164d74970..000000000 --- a/feather/worldgen/src/finishers/snow.rs +++ /dev/null @@ -1,39 +0,0 @@ -use crate::{FinishingGenerator, TopBlocks}; -use base::{chunk::BiomeStore, Biome, BlockId, Chunk}; - -/// Finisher for generating snow on top of snow biomes. -#[derive(Default)] -pub struct SnowFinisher; - -impl FinishingGenerator for SnowFinisher { - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - biomes: &BiomeStore, - top_blocks: &TopBlocks, - _seed: u64, - ) { - for x in 0..16 { - for z in 0..16 { - if !is_snowy_biome(biomes.get_at_block(x, 0, z)) { - continue; - } - - chunk - .set_block_at(x, top_blocks.top_block_at(x, z) + 1, z, BlockId::snow()) - .unwrap(); - } - } - } -} - -fn is_snowy_biome(biome: Biome) -> bool { - matches!( - biome, - Biome::SnowyTundra - | Biome::IceSpikes - | Biome::SnowyTaiga - | Biome::SnowyTaigaMountains - | Biome::SnowyBeach - ) -} diff --git a/feather/worldgen/src/lib.rs b/feather/worldgen/src/lib.rs index 2e55c7ae7..33fcd8a56 100644 --- a/feather/worldgen/src/lib.rs +++ b/feather/worldgen/src/lib.rs @@ -5,467 +5,16 @@ //! Generation is primarily based around the `ComposableGenerator`, //! which allows configuration of a world generator pipeline. -mod biomes; -mod composition; -mod density_map; -mod finishers; -pub mod noise; -mod superflat; -mod util; -pub mod voronoi; - -use base::chunk::BiomeStore; -use base::{Biome, BlockId, Chunk, ChunkPosition}; -pub use biomes::{DistortedVoronoiBiomeGenerator, TwoLevelBiomeGenerator}; -use bitvec::vec::BitVec; -use bitvec::{order::LocalBits, slice::BitSlice}; -pub use composition::BasicCompositionGenerator; -pub use density_map::{DensityMapGeneratorImpl, HeightMapGenerator}; -use finishers::{ClumpedFoliageFinisher, SingleFoliageFinisher, SnowFinisher}; -pub use noise::NoiseLerper; -use num_traits::ToPrimitive; -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; -use smallvec::SmallVec; +use libcraft::biome::BiomeList; pub use superflat::SuperflatWorldGenerator; -/// Sea-level height. -pub const SEA_LEVEL: usize = 64; -/// Sky limit. -pub const SKY_LIMIT: usize = 255; -/// Depth of an ocean. -const OCEAN_DEPTH: usize = 30; - -pub trait WorldGenerator: Send + Sync { - /// Generates the chunk at the given position. - fn generate_chunk(&self, position: ChunkPosition) -> Chunk; -} - +use libcraft::WorldHeight; +mod superflat; pub struct VoidWorldGenerator; -impl WorldGenerator for VoidWorldGenerator { - fn generate_chunk(&self, position: ChunkPosition) -> Chunk { - Chunk::new(position) - } -} - -/// A "composable" world generator. -/// -/// This generator will generate the world based -/// on a pipeline, and each step in the pipeline passes -/// data to the next stage. -/// -/// The pipeline stages are as follows: -/// * Biomes - generates a biome grid. -/// * Terrain density - generates the terrain density values using Perlin noise. -/// * Terrain composition - sets the correct block types based on the biome and terrain density. -/// * Finishing generators - generates final elements, such as grass, snow, and trees. -/// -/// This generator is based on [this document](http://cuberite.xoft.cz/docs/Generator.html). -pub struct ComposableGenerator { - /// The biome generator. - biome: Box, - /// The height map generator. - density_map: Box, - /// The composition generator. - composition: Box, - /// A vector of finishing generators used - /// by this composable generator. - finishers: SmallVec<[Box; 8]>, - /// The world seed. - seed: u64, -} - -impl ComposableGenerator { - /// Creates a new `ComposableGenerator` with the given stages. - pub fn new( - biome: B, - density_map: D, - composition: C, - finishers: F, - seed: u64, - ) -> Self - where - B: BiomeGenerator + 'static, - D: DensityMapGenerator + 'static, - C: CompositionGenerator + 'static, - F: IntoIterator>, - { - Self { - biome: Box::new(biome), - density_map: Box::new(density_map), - composition: Box::new(composition), - finishers: finishers.into_iter().collect(), - seed, - } - } - - /// A default composable generator, used - /// for worlds with "default" world type. - pub fn default_with_seed(seed: u64) -> Self { - let finishers: Vec> = vec![ - Box::new(SnowFinisher::default()), - Box::new(SingleFoliageFinisher::default()), - Box::new(ClumpedFoliageFinisher::default()), - ]; - Self::new( - TwoLevelBiomeGenerator::default(), - DensityMapGeneratorImpl::default(), - BasicCompositionGenerator::default(), - finishers, - seed, - ) - } -} - -impl WorldGenerator for ComposableGenerator { - fn generate_chunk(&self, position: ChunkPosition) -> Chunk { - let mut seed_shuffler = XorShiftRng::seed_from_u64(self.seed); - - // Generate biomes for 3x3 grid of chunks around current chunk. - let biome_seed = seed_shuffler.gen(); - - let mut biomes = vec![]; - - for z in -1..=1 { - for x in -1..=1 { - let pos = ChunkPosition::new(position.x + x, position.z + z); - biomes.push(self.biome.generate_for_chunk(pos, biome_seed)); - } - } - let biomes = NearbyBiomes::from_slice(&biomes[..]).unwrap(); - - let density_map = - self.density_map - .generate_for_chunk(position, &biomes, seed_shuffler.gen()); - - let mut chunk = Chunk::new(position); - *chunk.biomes_mut() = *biomes.center(); - - self.composition.generate_for_chunk( - &mut chunk, - position, - &biomes.biome_stores[4], // Center chunk - density_map.as_bitslice(), - seed_shuffler.gen(), - ); - - // Calculate top blocks in chunk. - // TODO: perhaps this should be moved to `Chunk`? - let mut top_blocks = TopBlocks::new(); - for x in 0..16 { - for z in 0..16 { - for y in (0..256).rev() { - if chunk.block_at(x, y, z).unwrap() != BlockId::air() { - top_blocks.set_top_block_at(x, z, y); - break; - } - } - } - } - - chunk.recalculate_heightmaps(); - - // Finishers. - for finisher in &self.finishers { - finisher.generate_for_chunk( - &mut chunk, - &biomes.biome_stores[4], - &top_blocks, - seed_shuffler.gen(), - ); - } - - chunk - } -} - -/// A generator which generates the biome grid for a `ComposableGenerator`. -pub trait BiomeGenerator: Send + Sync { - /// Generates the biomes for a given chunk. - /// This function should be deterministic. - fn generate_for_chunk(&self, chunk: ChunkPosition, seed: u64) -> BiomeStore; -} - -/// A generator which generates the density map for a chunk. -/// Used in the `ComposableGenerator` pipeline. -pub trait DensityMapGenerator: Send + Sync { - /// Generates the density map for a given chunk. - /// A compact array of booleans is returned, indexable - /// by (y << 8) | (x << 4) | z. Those set to `true` will - /// contain solid blacks; those set to `false` will be air. - fn generate_for_chunk( - &self, - chunk: ChunkPosition, - biomes: &NearbyBiomes, - seed: u64, - ) -> BitVec; -} - -/// A generator which populates the given chunk using blocks -/// based on the given density map and biomes. -pub trait CompositionGenerator: Send + Sync { - /// Populates the given chunk with blocks based on the given - /// biomes and density map. - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - pos: ChunkPosition, - biomes: &BiomeStore, - density: &BitSlice, - seed: u64, - ); -} - -/// A generator, run after composition, -/// which can add finishing elements to chunks, -/// such as grass, trees, and snow. -pub trait FinishingGenerator: Send + Sync { - /// Populates the given chunk with any - /// finishing blocks. - fn generate_for_chunk( - &self, - chunk: &mut Chunk, - biomes: &BiomeStore, - top_blocks: &TopBlocks, - seed: u64, - ); -} - /// Returns an index into a one-dimensional array /// for the given x, y, and z values. -pub fn block_index(x: usize, y: usize, z: usize) -> usize { - assert!(x < 16 && y < 256 && z < 16); - (y << 8) | (x << 4) | z -} - -/// Represents the highest solid blocks in a chunk. -#[derive(Default)] -pub struct TopBlocks { - top_blocks: Vec, -} - -impl TopBlocks { - pub fn new() -> Self { - Self { - top_blocks: vec![0; 16 * 16], - } - } - - /// Fetches the highest solid blocks for the - /// given column coordinates (chunk-local). - pub fn top_block_at(&self, x: usize, z: usize) -> usize { - self.top_blocks[x + (z << 4)] as usize - } - - pub fn set_top_block_at(&mut self, x: usize, z: usize, top: usize) { - self.top_blocks[x + (z << 4)] = top as u8; - } -} -/// Represents the biomes in a 3x3 grid of chunks, -/// centered on the chunk currently being generated. -pub struct NearbyBiomes { - /// 2D array of chunk biomes. The chunk biomes - /// for a given chunk position relative to the center - /// chunk can be obtained using (x + 1) + (z + 1) * 3. - pub biome_stores: [BiomeStore; 3 * 3], -} - -impl NearbyBiomes { - pub fn from_slice(biome_store_slice: &[BiomeStore]) -> Option { - let mut biome_stores = [BiomeStore::new(Biome::Badlands); 9]; - if biome_store_slice.len() != biome_stores.len() { - return None; - } - - biome_stores.clone_from_slice(biome_store_slice); - Some(Self { biome_stores }) - } - - /// Gets the biome at the given coordinates. - /// - /// # Panics - /// Panics if `x >= 16`, `z >= 16`, or `y >= 256`. - pub fn get_at_block(&self, x: N, y: N, z: N) -> Biome { - let (index, local_x, local_y, local_z) = self.index(x, y, z); - - self.biome_stores[index].get_at_block(local_x, local_y, local_z) - } - - /// Gets the biome at the given coordinates, in multiples - /// of 4 blocks. - /// - /// # Panics - /// Panics if `x >= 4`, `z >= 4`, or `y >= 64`. - pub fn get(&self, x: N, y: N, z: N) -> Biome { - let (index, local_x, local_y, local_z) = self.index( - x.to_isize().unwrap() * 4, - y.to_isize().unwrap() * 4, - z.to_isize().unwrap() * 4, - ); - - self.biome_stores[index].get(local_x / 4, local_y / 4, local_z / 4) - } - - /// Sets the biome at the given coordinates, in multiples - /// of 4 blocks. - /// - /// # Panics - /// Panics if `x >= 4`, `z >= 4`, or `y >= 64`. - pub fn set(&mut self, x: N, y: N, z: N, biome: Biome) { - let (index, local_x, local_y, local_z) = self.index( - x.to_isize().unwrap() * 4, - y.to_isize().unwrap() * 4, - z.to_isize().unwrap() * 4, - ); - - self.biome_stores[index].set(local_x / 4, local_y / 4, local_z / 4, biome); - } - pub fn center(&self) -> &BiomeStore { - &self.biome_stores[4] - } - pub fn center_mut(&mut self) -> &mut BiomeStore { - &mut self.biome_stores[4] - } - /// Returns a tuple of (chunk_index, local_x, local_y, local_z) - fn index(&self, ox: N, oy: N, oz: N) -> (usize, usize, usize, usize) { - // FIXME: Does this function need to so complicated? - let ox = ox.to_isize().unwrap(); - let oy = oy.to_isize().unwrap(); - let oz = oz.to_isize().unwrap(); - - let x = ox + 16; - let z = oz + 16; - - let chunk_x = (x / 16) as usize; - let chunk_z = (z / 16) as usize; - - let mut local_x = (ox % 16).abs() as usize; - let local_y = (oy % 16).abs() as usize; - let mut local_z = (oz % 16).abs() as usize; - - if ox < 0 { - local_x = 16 - local_x; - } - if oz < 0 { - local_z = 16 - local_z; - } - - (chunk_x + chunk_z * 3, local_x, local_y, local_z) - } -} -/// A biome generator which always generates plains. -#[derive(Debug, Default)] -pub struct StaticBiomeGenerator; - -impl BiomeGenerator for StaticBiomeGenerator { - fn generate_for_chunk(&self, _chunk: ChunkPosition, _seed: u64) -> BiomeStore { - BiomeStore::new(Biome::Plains) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_reproducability() { - let seeds: [u64; 4] = [std::u64::MAX, 3243, 0, 100]; - - let chunks = [ - ChunkPosition::new(0, 0), - ChunkPosition::new(-1, -1), - ChunkPosition::new(1, 1), - ]; - - for seed in seeds.iter() { - let gen = ComposableGenerator::default_with_seed(*seed); - for chunk in chunks.iter() { - let first = gen.generate_chunk(*chunk); - - let second = gen.generate_chunk(*chunk); - - test_chunks_eq(&first, &second); - } - } - } - - fn test_chunks_eq(a: &Chunk, b: &Chunk) { - for x in 0..16 { - for z in 0..16 { - for y in 0..256 { - assert_eq!(a.block_at(x, y, z), b.block_at(x, y, z)); - } - } - } - for x in 0..4 { - for z in 0..4 { - for y in 0..64 { - assert_eq!(a.biomes().get(x, y, z), b.biomes().get(x, y, z)); - } - } - } - } - - #[test] - pub fn test_worldgen_void() { - let chunk_pos = ChunkPosition { x: 1, z: 2 }; - let generator = VoidWorldGenerator; - let chunk = generator.generate_chunk(chunk_pos); - - // No sections have been generated - assert!(chunk.sections().iter().all(|sec| sec.is_none())); - assert_eq!(chunk_pos, chunk.position()); - } - - #[test] - fn test_chunk_biomes() { - let mut biomes = BiomeStore::new(Biome::Plains); - - for x in 0..4 { - for z in 0..4 { - for y in 0..64 { - assert_eq!(biomes.get(x, y, z), Biome::Plains); - biomes.set(x, y, z, Biome::Ocean); - assert_eq!(biomes.get(x, y, z), Biome::Ocean); - } - } - } - } - - #[test] - fn test_static_biome_generator() { - let gen = StaticBiomeGenerator::default(); - - let biomes = gen.generate_for_chunk(ChunkPosition::new(0, 0), 0); - - for x in 0..4 { - for z in 0..4 { - for y in 0..64 { - assert_eq!(biomes.get(x, y, z), Biome::Plains); - } - } - } - } - - #[test] - fn test_nearby_biomes() { - let biomes = vec![ - BiomeStore::new(Biome::Plains), - BiomeStore::new(Biome::Swamp), - BiomeStore::new(Biome::Savanna), - BiomeStore::new(Biome::BirchForest), - BiomeStore::new(Biome::DarkForest), - BiomeStore::new(Biome::Mountains), - BiomeStore::new(Biome::Ocean), - BiomeStore::new(Biome::Desert), - BiomeStore::new(Biome::Taiga), - ]; - let biomes = NearbyBiomes::from_slice(&biomes[..]).unwrap(); - - assert_eq!(biomes.get_at_block(0, 0, 0), Biome::DarkForest); - assert_eq!(biomes.get_at_block(16, 0, 16), Biome::Taiga); - assert_eq!(biomes.get_at_block(-1, 0, -1), Biome::Plains); - assert_eq!(biomes.get_at_block(-1, 0, 0), Biome::BirchForest); - } +pub fn block_index(x: usize, y: i32, z: usize, world_height: WorldHeight, min_y: i32) -> usize { + assert!(x < 16 && y >= min_y && y < min_y + *world_height as i32 && z < 16); + (((y - min_y) as usize) << 8) | (x << 4) | z } diff --git a/feather/worldgen/src/noise.rs b/feather/worldgen/src/noise.rs deleted file mode 100644 index bdc98392a..000000000 --- a/feather/worldgen/src/noise.rs +++ /dev/null @@ -1,229 +0,0 @@ -use num_traits::ToPrimitive; - -/// Struct for applying linear interpolation to a 3D -/// density array. -pub struct NoiseLerper<'a> { - /// The density values. - densities: &'a [f32], - /// The size of the chunk to generate along X and Z axes. - size_horizontal: u32, - /// The size of the chunk to generate along the Y axis. - size_vertical: u32, - /// The offset along the X axis to generate. - offset_x: i32, - /// The offset along the Z axis to generate. - offset_z: i32, - /// The scale along the X and Z axes. Must be a divisor of size_horizontal. - scale_horizontal: u32, - /// The scale along the Y axis. Must be a divisor of size_vertical. - scale_vertical: u32, -} - -impl<'a> NoiseLerper<'a> { - /// Initializes with default settings and the given - /// density values. - /// - /// Default settings are intended to match the size - /// of chunks. Horizontal and vertical size and scale - /// are initialized to sane defaults. - pub fn new(densities: &'a [f32]) -> Self { - Self { - densities, - size_horizontal: 16, - size_vertical: 256, - offset_x: 0, - offset_z: 0, - scale_horizontal: 4, - scale_vertical: 8, - } - } - - /// Sets the size of the chunk to be generated. - pub fn with_size(mut self, xz: u32, y: u32) -> Self { - self.size_horizontal = xz; - self.size_vertical = y; - self - } - - /// Sets the X and Z offsets. - /// - /// # Notes - /// * The X and Z offsets are multiplied by the horizontal and vertical - /// sizes, respectively, to obtain the offset in absolute coordinates. - /// (This means there is no need to multiply the chunk coordinate by 16.) - pub fn with_offset(mut self, x: i32, z: i32) -> Self { - self.offset_x = x; - self.offset_z = z; - self - } - - /// Sets the scale of the noise. Linear interpolation - /// is used between values based on this scale. - pub fn with_scale(mut self, horizontal: u32, vertical: u32) -> Self { - self.scale_horizontal = horizontal; - self.size_vertical = vertical; - self - } - - /// Generates a linear-interpolated block of noise. - /// The returned vector will have length `size_horizontal^2 * size_vertical`, - /// indexable by `((y << 12) | z << 4) | x`. - pub fn generate(&self) -> Vec { - // If AVX2 is available, use it. Otherwise, - // default to a scalar impl. - // TODO: support SSE41, other SIMD instruction sets - - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] - { - if is_x86_feature_detected!("avx2") { - return self.generate_avx2(); - } - } - - self.generate_fallback() - } - - #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] - fn generate_avx2(&self) -> Vec { - // TODO: implement this. (Premature optimization is bad!) - self.generate_fallback() - } - - fn generate_fallback(&self) -> Vec { - // Loop through values offsetted by the scale. - // Then, loop through all coordinates inside - // that subchunk and apply linear interpolation. - - // This is based on Glowstone's OverworldGenerator.generateRawTerrain - // with a few modifications and superior variable names. - - // Number of subchunks in a chunk along each axis. - let subchunk_horizontal = self.size_horizontal / self.scale_horizontal; - let subchunk_vertical = self.size_vertical / self.scale_vertical; - - // Density noise, with one value every `scale` blocks along each axis. - // Indexing into this vector is done using `self.uninterpolated_index(x, y, z)`. - let densities = self.densities; - - // Buffer to emit final noise into. - // TODO: consider using Vec::set_len to avoid zeroing it out - let mut buf = - vec![0.0; (self.size_horizontal * self.size_horizontal * self.size_vertical) as usize]; - - let scale_vertical = self.scale_vertical as f32; - let scale_horizontal = self.scale_horizontal as f32; - - // Coordinates of the subchunk. The subchunk - // is the chunk within the chunk in which we - // only find the noise value for the corners - // and then apply interpolation in between. - - // Here, we loop through the subchunks and interpolate - // noise for each block within it. - for subx in 0..subchunk_horizontal { - for suby in 0..subchunk_vertical { - for subz in 0..subchunk_horizontal { - // Two grids of noise values: - // one for the four bottom corners - // of the subchunk, and one for the - // offsets along the Y axis to apply - // to those base corners each block increment. - - // These are mutated so that they are at the - // current Y position. - let mut base1 = densities[self.uninterpolated_index(subx, suby, subz)]; - let mut base2 = densities[self.uninterpolated_index(subx + 1, suby, subz)]; - let mut base3 = densities[self.uninterpolated_index(subx, suby, subz + 1)]; - let mut base4 = densities[self.uninterpolated_index(subx + 1, suby, subz + 1)]; - - // Offsets for each block along the Y axis from each corner above. - let offset1 = (densities[self.uninterpolated_index(subx, suby + 1, subz)] - - base1) - / scale_vertical; - let offset2 = (densities[self.uninterpolated_index(subx + 1, suby + 1, subz)] - - base2) - / scale_vertical; - let offset3 = (densities[self.uninterpolated_index(subx, suby + 1, subz + 1)] - - base3) - / scale_vertical; - let offset4 = (densities - [self.uninterpolated_index(subx + 1, suby + 1, subz + 1)] - - base4) - / scale_vertical; - - // Iterate through the blocks in this subchunk - // and apply interpolation before setting the - // noise value in the final buffer. - for blocky in 0..self.scale_vertical { - let mut z_base = base1; - let mut z_corner = base3; - for blockx in 0..self.scale_horizontal { - let mut density = z_base; - for blockz in 0..self.scale_horizontal { - // Set interpolated value in buffer. - buf[index( - blockx + (self.scale_horizontal * subx), - blocky + (self.scale_vertical * suby), - blockz + (self.scale_horizontal * subz), - )] = density; - - // Apply Z interpolation. - density += (z_corner - z_base) / scale_horizontal; - } - // Interpolation along X. - z_base += (base2 - base1) / scale_horizontal; - // Along Z again. - z_corner += (base4 - base3) / scale_horizontal; - } - - // Interpolation along Y. - base1 += offset1; - base2 += offset2; - base3 += offset3; - base4 += offset4; - } - } - } - } - - buf - } - - fn uninterpolated_index(&self, x: N, y: N, z: N) -> usize { - let length = (self.size_horizontal / self.scale_horizontal + 1) as usize; - let height = (self.size_vertical / self.scale_vertical + 1) as usize; - - let x = x.to_usize().unwrap(); - let y = y.to_usize().unwrap(); - let z = z.to_usize().unwrap(); - - y * length + x + height * length * z - } -} - -pub fn index(x: N, y: N, z: N) -> usize { - let x = x.to_usize().unwrap(); - let y = y.to_usize().unwrap(); - let z = z.to_usize().unwrap(); - - ((y << 8) | z << 4) | x -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn basic_test() { - let densities = [0.0; 5 * 33 * 5]; - let noise = NoiseLerper::new(&densities).with_offset(10, 16); - - let chunk = noise.generate(); - - assert_eq!(chunk.len(), 16 * 256 * 16); - - for x in chunk { - approx::assert_relative_eq!(x, 0.0); - } - } -} diff --git a/feather/worldgen/src/superflat.rs b/feather/worldgen/src/superflat.rs index 69aaf2c0a..635bbb355 100644 --- a/feather/worldgen/src/superflat.rs +++ b/feather/worldgen/src/superflat.rs @@ -1,34 +1,69 @@ -use base::{anvil::level::SuperflatGeneratorOptions, Biome, BlockId, Chunk, ChunkPosition}; +use std::sync::Arc; -use crate::WorldGenerator; +use libcraft::anvil::level::SuperflatGeneratorOptions; +use libcraft::chunk::Chunk; +use libcraft::Sections; +use libcraft::{BlockKind, BlockState, ChunkPosition, CHUNK_WIDTH}; +use quill::saveload::worldgen::WorldGenerator; + +use crate::BiomeList; pub struct SuperflatWorldGenerator { - pub options: SuperflatGeneratorOptions, + biomes: Arc, + options: SuperflatGeneratorOptions, + sections: Sections, + min_y: i32, } impl SuperflatWorldGenerator { - pub fn new(options: SuperflatGeneratorOptions) -> Self { - Self { options } + pub fn new( + options: SuperflatGeneratorOptions, + biomes: Arc, + sections: Sections, + min_y: i32, + ) -> Self { + Self { + options, + biomes, + sections, + min_y, + } } } impl WorldGenerator for SuperflatWorldGenerator { fn generate_chunk(&self, position: ChunkPosition) -> Chunk { - let biome = Biome::from_name(self.options.biome.as_str()).unwrap_or(Biome::Plains); - let mut chunk = Chunk::new_with_default_biome(position, biome); + let biome = self + .biomes + .get_id(&self.options.biome) + .unwrap_or_else(|| panic!("Biome does not exist: {}", self.options.biome)); + let mut chunk = Chunk::new(position, self.sections, self.min_y / 16); + chunk + .sections_mut() + .iter_mut() + .for_each(|s| s.biomes_mut().fill(biome)); - let mut y_counter = 0; + let mut y_counter = self.min_y; for layer in self.options.clone().layers { if layer.height == 0 { continue; } - // FIXME: get rid of this hack by having a consistent naming convention - Item::name() returns `stone` but BlockId::from_identifier requires `minecraft:stone` - let layer_block = BlockId::from_identifier(&format!("minecraft:{}", layer.block)); + // FIXME: get rid of this hack by having a consistent naming convention - Item::name() returns `stone` but BlockState::from_namespaced_id requires `minecraft:stone` + let layer_block = BlockKind::from_namespaced_id(&format!("minecraft:{}", layer.block)) + .map(BlockState::new); if let Some(layer_block) = layer_block { - for y in y_counter..(y_counter + layer.height) { - for x in 0..16 { - for z in 0..16 { - chunk.set_block_at(x as usize, y as usize, z as usize, layer_block); + for y in y_counter..(y_counter + layer.height as i32) { + for x in 0..CHUNK_WIDTH { + for z in 0..CHUNK_WIDTH { + chunk + .set_block_at( + x as usize, + (y - self.min_y) as usize, + z as usize, + layer_block, + false, + ) + .unwrap(); } } } @@ -37,7 +72,7 @@ impl WorldGenerator for SuperflatWorldGenerator { log::warn!("Failed to generate layer: unknown block {}", layer.block); } - y_counter += layer.height; + y_counter += layer.height as i32; } chunk.recalculate_heightmaps(); @@ -45,41 +80,3 @@ impl WorldGenerator for SuperflatWorldGenerator { chunk } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - pub fn test_worldgen_flat() { - let options = SuperflatGeneratorOptions { - biome: Biome::Mountains.name().to_owned(), - ..Default::default() - }; - - let chunk_pos = ChunkPosition { x: 1, z: 2 }; - let generator = SuperflatWorldGenerator { options }; - let chunk = generator.generate_chunk(chunk_pos); - - assert_eq!(chunk.position(), chunk_pos); - for x in 0usize..16 { - for z in 0usize..16 { - for (y, block) in &[ - (0usize, BlockId::bedrock()), - (1usize, BlockId::dirt()), - (2usize, BlockId::dirt()), - (3usize, BlockId::grass_block()), - ] { - assert_eq!(chunk.block_at(x, *y, z).unwrap(), *block); - } - for y in 4..256 { - assert_eq!( - chunk.block_at(x as usize, y as usize, z as usize).unwrap(), - BlockId::air() - ); - } - assert_eq!(chunk.biomes().get_at_block(x, 0, z), Biome::Mountains); - } - } - } -} diff --git a/feather/worldgen/src/util.rs b/feather/worldgen/src/util.rs deleted file mode 100644 index 5ba8edccd..000000000 --- a/feather/worldgen/src/util.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! Utilities for world generation. - -use base::ChunkPosition; - -/// Deterministically a seed for the given chunk. This allows -/// different seeds to be used for different chunk. -pub fn shuffle_seed_for_chunk(seed: u64, chunk: ChunkPosition) -> u64 { - seed.wrapping_mul((chunk.x as u64).wrapping_add(1)) - .wrapping_add((chunk.z as u64).wrapping_add(1)) -} - -/// Deterministically shuffles a seed for the given chunk and chunk column. -pub fn shuffle_seed_for_column(seed: u64, chunk: ChunkPosition, col_x: usize, col_z: usize) -> u64 { - shuffle_seed_for_chunk(seed, chunk) - .wrapping_add(2) - .wrapping_mul(((col_x as u64) << 4) + 4) - .wrapping_mul(col_z as u64 + 4) -} diff --git a/feather/worldgen/src/voronoi.rs b/feather/worldgen/src/voronoi.rs deleted file mode 100644 index 839dcb909..000000000 --- a/feather/worldgen/src/voronoi.rs +++ /dev/null @@ -1,144 +0,0 @@ -//! Basic Voronoi implementation. - -use rand::{Rng, SeedableRng}; -use rand_xorshift::XorShiftRng; - -/// Position of a cell. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct CellPos { - x: i32, - y: i32, -} - -/// Position of a seed. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -struct SeedPos { - x: i32, - y: i32, -} - -/// Representation of a Voronoi grid. -/// -/// Seeds around the most recently requested cell are cached. -/// -/// # Implementation -/// This Voronoi implementation works using a grid with jitter -/// offsets. A seed is allocated for each cell in the grid with -/// a random offset from the center of the cell based on a hash -/// function of the cell position. -/// -/// This allows the grid to be deterministic and efficient compared -/// to when using random cell positions. -pub struct VoronoiGrid { - /// Length and width of each grid square. - length: u32, - /// The seed used for generation. - seed: u64, - /// The currently cached cell position. - cached: CellPos, - /// The positions of the seeds around the cached cell position. - cached_seeds: [[SeedPos; 5]; 5], -} - -impl VoronoiGrid { - /// Creates a new voronoi grid with the given - /// length and seed. - /// - /// This function does not - /// actually compute any values. - pub fn new(length: u32, seed: u64) -> Self { - Self { - length, - seed, - cached: CellPos { - x: 999_999_999, - y: 999_999_999, - }, // Use values so that this will be replaced - cached_seeds: [[SeedPos { x: 0, y: 0 }; 5]; 5], - } - } - - /// Returns the position of the seed closest to the given - /// position. - pub fn get(&mut self, x: i32, y: i32) -> (i32, i32) { - let cell_pos = CellPos { - x: x / self.length as i32, - y: y / self.length as i32, - }; - - self.update_cache(cell_pos); - - // TODO: this is fairly inefficient. There is - // probably a way to optimize this. - let closest_seed = self - .cached_seeds - .iter() - .flatten() - .min_by_key(|seed| { - // Distance squared to cell position - square(seed.x - x) + square(seed.y - y) - }) - .unwrap(); // Safe - iterator is never empty - - (closest_seed.x, closest_seed.y) - } - - /// Updates the currently cached seed positions. - /// - /// If the given cell position is equal to the cached - /// cell position, this is a no-op. - fn update_cache(&mut self, cell: CellPos) { - if cell == self.cached { - return; - } - - self.cached = cell; - - let half_length = (self.length / 2) as i32; - - for x in -2..=2 { - for y in -2..=2 { - // Calculate center of grid position and then - // apply an offset based on a hash of the cell position. - - let cell_x = cell.x + x; - let cell_y = cell.y + y; - - let pos_x = cell_x * self.length as i32; - let pos_y = cell_y * self.length as i32; - - let mut rng = XorShiftRng::seed_from_u64( - self.seed ^ (((i64::from(cell_x)) << 32) | (i64::from(cell_y))) as u64, - ); - let offset = rng.gen_range(-half_length, half_length); - - let center_x = pos_x + half_length as i32; - let center_y = pos_y + half_length as i32; - - let offsetted_pos = SeedPos { - x: center_x + offset, - y: center_y + offset, - }; - self.cached_seeds[(x + 2) as usize][(y + 2) as usize] = offsetted_pos; - } - } - } -} - -/// Shuffles the given closest_x and closest_y values -/// and returns a deterministic random value in the given range based -/// on those values. -/// -/// This can be used to determine a value corresponding to a voronoi seed, -/// for example. -pub fn shuffle(closest_x: i32, closest_y: i32, min: usize, max: usize) -> usize { - let combined = ((closest_x as u64) << 32) | closest_y as u64; - - let mut rng = XorShiftRng::seed_from_u64(combined); - - rng.gen_range(min, max) -} - -fn square(x: i32) -> i32 { - x * x -} diff --git a/libcraft/generators/libcraft-data/entity_metadata.json b/libcraft-data/entity_metadata.json similarity index 100% rename from libcraft/generators/libcraft-data/entity_metadata.json rename to libcraft-data/entity_metadata.json diff --git a/libcraft/generators/libcraft-data/inventory.json b/libcraft-data/inventory.json similarity index 100% rename from libcraft/generators/libcraft-data/inventory.json rename to libcraft-data/inventory.json diff --git a/libcraft/generators/libcraft-data/simplified_block.json b/libcraft-data/simplified_block.json similarity index 100% rename from libcraft/generators/libcraft-data/simplified_block.json rename to libcraft-data/simplified_block.json diff --git a/libcraft/Cargo.toml b/libcraft/Cargo.toml new file mode 100644 index 000000000..bea029fb1 --- /dev/null +++ b/libcraft/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "libcraft" +version = "0.1.0" +authors = ["caelunshun "] +edition = "2021" + +[dependencies] +bincode = "2.0.0-rc.1" +bitflags = "1" +derive_more = "0.99" +flate2 = "1" +hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } +libcraft-anvil = { path = "anvil" } +libcraft-blocks = { path = "blocks" } +libcraft-chunk = { path = "chunk" } +libcraft-core = { path = "core" } +libcraft-inventory = { path = "inventory" } +libcraft-items = { path = "items" } +libcraft-particles = { path = "particles" } +libcraft-text = { path = "text" } +serde = { version = "1", features = ["derive"] } +uuid = "0.8" diff --git a/libcraft/anvil/Cargo.toml b/libcraft/anvil/Cargo.toml new file mode 100644 index 000000000..d900a0ae8 --- /dev/null +++ b/libcraft/anvil/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "libcraft-anvil" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1" +arrayvec = { version = "0.7", features = ["serde"] } +bitvec = "1" +bytemuck = "1" +byteorder = "1" +flate2 = "1" +hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } +libcraft-blocks = { path = "../blocks" } +libcraft-chunk = { path = "../chunk" } +libcraft-core = { path = "../core" } +libcraft-inventory = { path = "../inventory" } +libcraft-items = { path = "../items" } +serde = "1" +thiserror = "1" +uuid = "0.8" diff --git a/feather/base/src/anvil/block_entity.rs b/libcraft/anvil/src/block_entity.rs similarity index 100% rename from feather/base/src/anvil/block_entity.rs rename to libcraft/anvil/src/block_entity.rs diff --git a/feather/base/src/anvil/entity.rs b/libcraft/anvil/src/entity.rs similarity index 92% rename from feather/base/src/anvil/entity.rs rename to libcraft/anvil/src/entity.rs index d5239d6ca..eda3f314a 100644 --- a/feather/base/src/anvil/entity.rs +++ b/libcraft/anvil/src/entity.rs @@ -1,11 +1,10 @@ use arrayvec::ArrayVec; +use libcraft_core::{vec3, Position, Vec3d}; use libcraft_items::{Item, ItemStack, ItemStackBuilder}; use serde::ser::Error; use serde::{Deserialize, Serialize, Serializer}; use thiserror::Error; -use crate::{vec3, Position, Vec3d}; - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum EntityDataKind { Item, @@ -179,33 +178,6 @@ pub struct ItemData { pub nbt: Option, } -impl Default for ItemData { - fn default() -> Self { - Self { - count: 0, - item: Item::Air.name().to_owned(), - nbt: None, - } - } -} - -impl From for ItemStack { - fn from(item: ItemData) -> Self { - ItemStack::from(&item) - } -} - -// Can't do proper Borrow trait impl because of orphan rule -impl From<&ItemData> for ItemStack { - fn from(item: &ItemData) -> Self { - ItemNbt::item_stack( - &item.nbt, - Item::from_name(item.item.as_str()).unwrap_or(Item::Air), - item.count as u8, - ) - } -} - impl From for ItemData where S: std::borrow::Borrow, @@ -268,7 +240,7 @@ where } /// Data for an Item entity (`minecraft:item`). -#[derive(Clone, Default, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Deserialize, Debug)] pub struct ItemEntityData { // Inherit base entity data #[serde(flatten)] diff --git a/feather/base/src/inventory.rs b/libcraft/anvil/src/inventory_consts.rs similarity index 92% rename from feather/base/src/inventory.rs rename to libcraft/anvil/src/inventory_consts.rs index 1351f771d..246e0579b 100644 --- a/feather/base/src/inventory.rs +++ b/libcraft/anvil/src/inventory_consts.rs @@ -1,6 +1,5 @@ //! Constants representing various standard inventory slot indices -//! for the `Player` window -//! Deprecated; mainly exists for interop with world saves. +//! for the `Player` window. pub const SLOT_CRAFTING_OUTPUT: usize = 0; pub const SLOT_CRAFTING_INPUT_X0_Y0: usize = 1; diff --git a/feather/base/src/anvil/level.dat b/libcraft/anvil/src/level.dat similarity index 100% rename from feather/base/src/anvil/level.dat rename to libcraft/anvil/src/level.dat diff --git a/feather/base/src/anvil/level.rs b/libcraft/anvil/src/level.rs similarity index 93% rename from feather/base/src/anvil/level.rs rename to libcraft/anvil/src/level.rs index b312e5de3..d1ccfab6d 100644 --- a/feather/base/src/anvil/level.rs +++ b/libcraft/anvil/src/level.rs @@ -1,6 +1,5 @@ //! Implements level.dat file loading. -use libcraft_core::Biome; use libcraft_items::Item; use serde::{Deserialize, Serialize}; use std::io::{Cursor, Read, Write}; @@ -82,9 +81,9 @@ impl LevelData { let mut buf = vec![]; file.read_to_end(&mut buf)?; - nbt::from_gzip_reader::<_, Root>(Cursor::new(&buf)) + nbt::from_gzip_reader(Cursor::new(buf)) .map_err(Into::into) - .map(|root| root.data) + .map(|root: Root| root.data) } pub fn save_to_file(&self, file: &mut File) -> anyhow::Result<()> { @@ -137,7 +136,7 @@ impl Default for SuperflatGeneratorOptions { height: 1, }, ], - biome: Biome::Plains.name().to_string(), + biome: "minecraft:plains".to_string(), } } } @@ -145,7 +144,7 @@ impl Default for SuperflatGeneratorOptions { #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct SuperflatLayer { pub block: String, // TODO: Use "Block" enum and implement (de)serialization - pub height: u8, + pub height: u32, } /// The type of world generator for a level. @@ -176,13 +175,12 @@ impl LevelData { #[cfg(test)] mod tests { use super::*; - use std::io::Cursor; #[test] fn test_deserialize_level_file() { - let cursor = Cursor::new(include_bytes!("level.dat").to_vec()); - - let level = nbt::from_gzip_reader::<_, Root>(cursor).unwrap().data; + let level = nbt::from_gzip_reader::<_, Root>(Cursor::new(include_bytes!("level.dat"))) + .unwrap() + .data; assert!(!level.allow_commands); assert_eq!(level.clear_weather_time, 0); diff --git a/feather/base/src/anvil.rs b/libcraft/anvil/src/lib.rs similarity index 74% rename from feather/base/src/anvil.rs rename to libcraft/anvil/src/lib.rs index a03899dd8..bd40ac877 100644 --- a/feather/base/src/anvil.rs +++ b/libcraft/anvil/src/lib.rs @@ -1,9 +1,10 @@ -//! Loading and saving to/from +//! Loading and saving to/from Vanilla //! world saves. Currently includes region file loading, //! player data loading, and level data loading. pub mod block_entity; pub mod entity; +pub mod inventory_consts; pub mod level; pub mod player; pub mod region; diff --git a/feather/base/src/anvil/player.dat b/libcraft/anvil/src/player.dat similarity index 100% rename from feather/base/src/anvil/player.dat rename to libcraft/anvil/src/player.dat diff --git a/feather/base/src/anvil/player.rs b/libcraft/anvil/src/player.rs similarity index 81% rename from feather/base/src/anvil/player.rs rename to libcraft/anvil/src/player.rs index 2e6100eda..431f5d9ad 100644 --- a/feather/base/src/anvil/player.rs +++ b/libcraft/anvil/src/player.rs @@ -1,21 +1,17 @@ -use libcraft_items::{Item, ItemStack}; +use std::collections::HashMap; +use std::convert::TryFrom; use std::{ - collections::HashMap, fs, fs::File, path::{Path, PathBuf}, }; -use nbt::Value; use serde::{Deserialize, Serialize}; use uuid::Uuid; -use quill_common::components::{ - CanBuild, CanCreativeFly, CreativeFlying, CreativeFlyingSpeed, Instabreak, Invulnerable, - WalkSpeed, -}; +use libcraft_items::{Item, ItemStack}; -use crate::inventory::*; +use crate::inventory_consts::*; use super::entity::{AnimalData, ItemNbt}; @@ -30,6 +26,8 @@ pub struct PlayerData { pub gamemode: i32, #[serde(rename = "previousPlayerGameType")] pub previous_gamemode: i32, + #[serde(rename = "Dimension")] + pub dimension: String, #[serde(rename = "Inventory")] pub inventory: Vec, #[serde(rename = "SelectedItemSlot")] @@ -41,18 +39,18 @@ pub struct PlayerData { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PlayerAbilities { #[serde(rename = "walkSpeed")] - pub walk_speed: WalkSpeed, + pub walk_speed: f32, #[serde(rename = "flySpeed")] - pub fly_speed: CreativeFlyingSpeed, + pub fly_speed: f32, #[serde(rename = "mayfly")] - pub may_fly: CanCreativeFly, + pub may_fly: bool, #[serde(rename = "flying")] - pub is_flying: CreativeFlying, + pub is_flying: bool, #[serde(rename = "mayBuild")] - pub may_build: CanBuild, + pub may_build: bool, #[serde(rename = "instabuild")] - pub instabreak: Instabreak, - pub invulnerable: Invulnerable, + pub instabreak: bool, + pub invulnerable: bool, } /// Represents a single inventory slot (including position index). @@ -127,45 +125,52 @@ impl InventorySlot { } } - pub fn into_nbt_value(self) -> Value { + pub fn into_nbt_value(self) -> nbt::Value { let mut compound = HashMap::new(); - compound.insert(String::from("Count"), Value::Byte(self.count)); - compound.insert(String::from("id"), Value::String(self.item)); - compound.insert(String::from("Slot"), Value::Byte(self.slot)); + compound.insert(String::from("Count"), nbt::Value::Byte(self.count)); + compound.insert(String::from("id"), nbt::Value::String(self.item)); + compound.insert(String::from("Slot"), nbt::Value::Byte(self.slot)); let mut tags_compound = HashMap::new(); if let Some(nbt) = self.nbt { if let Some(damage) = nbt.damage { - tags_compound.insert(String::from("Damage"), Value::Int(damage)); + tags_compound.insert(String::from("Damage"), nbt::Value::Int(damage)); } } - compound.insert(String::from("tag"), Value::Compound(tags_compound)); - Value::Compound(compound) + compound.insert(String::from("tag"), nbt::Value::Compound(tags_compound)); + nbt::Value::Compound(compound) } } -impl From for ItemStack { - fn from(slot: InventorySlot) -> Self { - ItemStack::from(&slot) +#[derive(Debug)] +pub struct NoSuckItemError; + +impl TryFrom for ItemStack { + type Error = NoSuckItemError; + + fn try_from(slot: InventorySlot) -> Result { + ItemStack::try_from(&slot) } } // Can't do proper Borrow trait impl because of orphan rule -impl From<&InventorySlot> for ItemStack { - fn from(slot: &InventorySlot) -> Self { - ItemNbt::item_stack( +impl TryFrom<&InventorySlot> for ItemStack { + type Error = NoSuckItemError; + + fn try_from(slot: &InventorySlot) -> Result { + Ok(ItemNbt::item_stack( &slot.nbt, - Item::from_name(slot.item.as_str()).unwrap_or(Item::Air), + Item::from_name(slot.item.as_str()).ok_or(NoSuckItemError)?, slot.count as u8, - ) + )) } } -pub fn load_player_data(world_dir: &Path, uuid: Uuid) -> Result { +pub fn load_player_data(world_dir: &Path, uuid: Uuid) -> Result { let file_path = file_path(world_dir, uuid); - let mut file = File::open(file_path)?; - let data = nbt::from_gzip_reader(&mut file)?; + let file = File::open(file_path)?; + let data = nbt::from_gzip_reader(&file)?; Ok(data) } @@ -187,15 +192,12 @@ fn file_path(world_dir: &Path, uuid: Uuid) -> PathBuf { #[cfg(test)] mod tests { use std::collections::HashMap; + use std::convert::TryInto; use std::io::Cursor; + use libcraft_core::Gamemode; use num_traits::ToPrimitive; - use crate::{ - inventory::{SLOT_ARMOR_CHEST, SLOT_ARMOR_FEET, SLOT_ARMOR_HEAD, SLOT_ARMOR_LEGS}, - Gamemode, - }; - use super::*; #[test] @@ -221,7 +223,7 @@ mod tests { nbt: None, }; - let item_stack: ItemStack = slot.into(); + let item_stack: ItemStack = slot.try_into().unwrap(); assert_eq!(item_stack.item(), Item::Feather); assert_eq!(item_stack.count(), 1); } @@ -235,7 +237,7 @@ mod tests { nbt: Some(ItemNbt { damage: Some(42) }), }; - let item_stack: ItemStack = slot.into(); + let item_stack: ItemStack = slot.try_into().unwrap(); assert_eq!(item_stack.item(), Item::DiamondAxe); assert_eq!(item_stack.count(), 1); assert_eq!(item_stack.damage_taken(), Some(42)); @@ -250,8 +252,8 @@ mod tests { nbt: None, }; - let item_stack: ItemStack = slot.into(); - assert_eq!(item_stack.item(), Item::Air); + let item_stack: Result = slot.try_into(); + assert!(item_stack.is_err()); } #[test] diff --git a/feather/base/src/anvil/region.rs b/libcraft/anvil/src/region.rs similarity index 60% rename from feather/base/src/anvil/region.rs rename to libcraft/anvil/src/region.rs index c1901b53c..5d92bf6ea 100644 --- a/feather/base/src/anvil/region.rs +++ b/libcraft/anvil/src/region.rs @@ -1,112 +1,120 @@ //! This module implements the loading and saving //! of Anvil region files. -use crate::{ - chunk::{BlockStore, LightStore, PackedArray, Palette}, - Chunk, ChunkPosition, ChunkSection, -}; - -use super::{block_entity::BlockEntityData, entity::EntityData}; -use bitvec::{bitvec, vec::BitVec}; -use blocks::BlockId; -use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use libcraft_core::Biome; -use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::collections::BTreeMap; use std::fmt::{self, Display, Formatter}; use std::fs::{File, OpenOptions}; use std::io::prelude::*; -use std::io::{Cursor, SeekFrom}; -use std::ops::Deref; +use std::io::{SeekFrom, Write}; use std::path::{Path, PathBuf}; use std::{fs, io, iter}; -/// The length and width of a region, in chunks. -const REGION_SIZE: usize = 32; +use bitvec::vec::BitVec; +use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; +use libcraft_blocks::{BlockKind, BlockState}; +use libcraft_chunk::biome::{BiomeId, BiomeList}; +use libcraft_chunk::paletted_container::{Paletteable, PalettedContainer}; +use libcraft_chunk::{ + Chunk, ChunkSection, LightStore, PackedArray, BIOMES_PER_CHUNK_SECTION, SECTION_VOLUME, +}; +use libcraft_core::REGION_SIZE; +use libcraft_core::{ChunkPosition, WorldHeight, ANVIL_VERSION_RANGE}; +use serde::{Deserialize, Serialize}; + +use super::{block_entity::BlockEntityData, entity::EntityData}; -/// The data version supported by this code, currently corresponding -/// to 1.16.5. -const DATA_VERSION: i32 = 2586; +pub use libcraft_core::RegionPosition; /// Length, in bytes, of a sector. const SECTOR_BYTES: usize = 4096; -/// Represents the data for a chunk after the "Chunk [x, y]" tag. #[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "PascalCase")] -pub struct ChunkRoot { - level: ChunkLevel, +pub struct DataChunk { + #[serde(rename = "DataVersion")] data_version: i32, -} - -/// Represents the level data for a chunk. -#[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "PascalCase")] -pub struct ChunkLevel { - // TODO heightmaps, etc. #[serde(rename = "xPos")] x_pos: i32, #[serde(rename = "zPos")] z_pos: i32, + #[serde(rename = "yPos")] + min_y_section: i32, + #[serde(rename = "LastUpdate")] last_update: i64, - inhabited_time: i64, + #[serde(rename = "InhabitedTime")] #[serde(default)] + inhabited_time: i64, sections: Vec, - #[serde(serialize_with = "nbt::i32_array")] - biomes: Vec, #[serde(default)] entities: Vec, - #[serde(rename = "TileEntities")] #[serde(default)] block_entities: Vec, - #[serde(rename = "ToBeTicked")] - #[serde(default)] - awaiting_block_updates: Vec>, - #[serde(rename = "LiquidsToBeTicked")] - #[serde(default)] - awaiting_liquid_updates: Vec>, + #[serde(rename = "PostProcessing")] #[serde(default)] post_processing: Vec>, - #[serde(rename = "TileTicks")] - #[serde(default)] - scheduled_block_updates: Vec, - #[serde(rename = "LiquidTicks")] - #[serde(default)] - scheduled_liquid_updates: Vec, #[serde(rename = "Status")] - #[serde(default)] worldgen_status: Cow<'static, str>, } /// Represents a chunk section in a region file. #[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "PascalCase")] pub struct LevelSection { + #[serde(rename = "Y")] y: i8, - #[serde(serialize_with = "nbt::i64_array", rename = "BlockStates")] #[serde(default)] - states: Vec, - #[serde(default)] - palette: Vec, - #[serde(serialize_with = "nbt::i8_array")] - #[serde(default)] - block_light: Vec, - #[serde(serialize_with = "nbt::i8_array")] - #[serde(default)] - sky_light: Vec, + block_states: PaletteAndData, + #[serde(default = "default_biomes")] + biomes: PaletteAndData, + #[serde(rename = "SkyLight")] + sky_light: Option>, + #[serde(rename = "BlockLight")] + block_light: Option>, +} + +fn default_biomes() -> PaletteAndData { + PaletteAndData { + palette: vec!["minecraft:the_void".to_owned()], + data: None, + } +} + +#[derive(Serialize, Deserialize, Debug)] +struct PaletteAndData { + palette: Vec, + data: Option>, +} + +impl Default for PaletteAndData +where + T: Default, +{ + fn default() -> Self { + Self { + palette: vec![T::default()], + data: None, + } + } } /// Represents a palette entry in a region file. #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "PascalCase")] -pub struct LevelPaletteEntry { +pub struct SerializedBlockState { /// The identifier of the type of this block name: Cow<'static, str>, /// Optional properties for this block properties: Option, } +impl Default for SerializedBlockState { + fn default() -> Self { + Self { + name: Cow::Borrowed("minecraft:air"), + properties: None, + } + } +} + /// Represents the properties for a palette entry. #[derive(Serialize, Deserialize, Debug)] pub struct LevelProperties { @@ -147,6 +155,7 @@ pub struct RegionHandle { header: RegionHeader, /// Sector allocator to allocate sectors where we can store chunks. allocator: SectorAllocator, + world_height: WorldHeight, } impl RegionHandle { @@ -160,6 +169,7 @@ impl RegionHandle { pub fn load_chunk( &mut self, mut pos: ChunkPosition, + biomes: &BiomeList, ) -> Result<(Chunk, Vec, Vec), Error> { // Get a copy of the original position before clipping let original_pos = pos; @@ -207,40 +217,32 @@ impl RegionHandle { let compression_type = buf[0]; // Parse NBT data - let cursor = Cursor::new(&buf[1..]); - let mut root: ChunkRoot = match compression_type { - 1 => nbt::from_gzip_reader(cursor).map_err(Error::Nbt)?, - 2 => nbt::from_zlib_reader(cursor).map_err(Error::Nbt)?, + let bytes = &buf[1..]; + let mut data_chunk: DataChunk = match compression_type { + 1 => nbt::from_gzip_reader(bytes).map_err(Error::Nbt)?, + 2 => nbt::from_zlib_reader(bytes).map_err(Error::Nbt)?, _ => return Err(Error::InvalidCompression(compression_type)), }; // Check data version - if root.data_version != DATA_VERSION { - return Err(Error::UnsupportedDataVersion(root.data_version)); + if !ANVIL_VERSION_RANGE.contains(&data_chunk.data_version) { + return Err(Error::UnsupportedDataVersion(data_chunk.data_version)); } - let level = &mut root.level; - - let mut chunk = Chunk::new(original_pos); + let mut chunk = Chunk::new( + original_pos, + self.world_height.into(), + data_chunk.min_y_section, + ); // Read sections - for section in &mut level.sections { - read_section_into_chunk(section, &mut chunk)?; - } - - // Read biomes - if level.biomes.len() != 1024 { - return Err(Error::IndexOutOfBounds); - } - for index in 0..1024 { - let id = level.biomes[index]; - chunk.biomes_mut().as_slice_mut()[index] = - Biome::from_id(id as u32).ok_or(Error::InvalidBiomeId(id))?; + for section in std::mem::take(&mut data_chunk.sections) { + read_section_into_chunk(section, &mut chunk, data_chunk.min_y_section, biomes)?; } - // chunk.recalculate_heightmap(); + chunk.recalculate_heightmaps(); - Ok((chunk, level.entities.clone(), level.block_entities.clone())) + Ok((chunk, data_chunk.entities, data_chunk.block_entities)) } /// Checks if the specified chunk position is generated in this region. @@ -261,6 +263,7 @@ impl RegionHandle { chunk: &Chunk, entities: &[EntityData], block_entities: &[BlockEntityData], + biomes: &BiomeList, ) -> Result<(), Error> { let chunk_pos = chunk.position(); @@ -274,14 +277,14 @@ impl RegionHandle { self.allocator.free(location.0); } - // Write chunk to `ChunkRoot` tag. - let root = chunk_to_chunk_root(chunk, entities, block_entities); + // Write chunk to `ChunkData` tag. + let data_chunk = chunk_to_data_chunk(chunk, entities, block_entities, biomes); // Write to intermediate buffer, because we need to know the length. let mut buf = Vec::with_capacity(4096); buf.write_u8(2).map_err(Error::Io)?; // Compression type: zlib - nbt::to_zlib_writer(&mut buf, &root, None).map_err(Error::Nbt)?; + nbt::to_zlib_writer(&mut buf, &data_chunk, None).map_err(Error::Nbt)?; let total_len = buf.len() + 4; // 4 bytes for length header @@ -321,12 +324,15 @@ impl RegionHandle { } } -fn read_section_into_chunk(section: &mut LevelSection, chunk: &mut Chunk) -> Result<(), Error> { - let data = §ion.states; - - // Create palette - let mut palette = Palette::new(); - for entry in §ion.palette { +fn read_section_into_chunk( + mut section: LevelSection, + chunk: &mut Chunk, + min_y_section: i32, + biome_list: &BiomeList, +) -> Result<(), Error> { + // Create palettes + let mut block_palette = Vec::new(); + for entry in §ion.block_states.palette { // Construct properties map let mut props = BTreeMap::new(); if let Some(entry_props) = entry.properties.as_ref() { @@ -334,28 +340,121 @@ fn read_section_into_chunk(section: &mut LevelSection, chunk: &mut Chunk) -> Res entry_props .props .iter() - .map(|(k, v)| (k.clone().into_owned(), v.clone().into_owned())), + .map(|(k, v)| (k.clone().to_owned(), v.clone().to_owned())), ); } // Attempt to get block from the given values - let block = BlockId::from_identifier_and_properties(&entry.name, &props) - .ok_or_else(|| Error::InvalidBlock(entry.name.deref().to_owned()))?; - palette.index_or_insert(block); + let block = match &entry.properties { + Some(properties) => BlockState::from_namespaced_id_and_property_values( + &entry.name, + properties.props.iter().map(|(k, v)| (&**k, &**v)), + ), + None => BlockKind::from_namespaced_id(&entry.name).map(BlockState::new), + } + .ok_or_else(|| { + Error::InvalidBlockType(format!( + "{} with properties {:?}", + entry.name, entry.properties + )) + })?; + + block_palette.push(block); + } + + let mut block_palette_iter = block_palette.iter(); + let mut blocks = if let Some(block) = block_palette_iter.next() { + let mut blocks = PalettedContainer::SingleValue(*block); + for block in block_palette_iter { + blocks.index_or_insert(*block); + } + blocks + } else { + PalettedContainer::new() + }; + + let mut biome_palette = Vec::new(); + for biome in section.biomes.palette { + let biome = biome_list + .get_id(&biome) + .unwrap_or_else(|| panic!("Biome not found: {}", biome)) + .into(); + biome_palette.push(biome); } - // Create section - // TODO don't clone data - need way around this - let data = if data.is_empty() { - PackedArray::new(4096, 4) + let mut biome_palette_iter = biome_palette.iter(); + let mut biomes = if let Some(biome) = biome_palette_iter.next() { + let mut biomes = PalettedContainer::SingleValue(*biome); + for biome in biome_palette_iter { + biomes.index_or_insert(*biome); + } + biomes } else { - PackedArray::from_u64_vec(data.iter().map(|x| *x as u64).collect(), 4096) + PalettedContainer::new() }; + if let Some(mut blocks_data) = section + .block_states + .data + .map(|data| PackedArray::from_i64_vec(data, SECTION_VOLUME)) + { + // Correct the palette. + // For some reason, vanilla seems to write + // out-of-bounds palette indexes into the data array. We + // set these to 0. + + if let Some(palette) = blocks.palette() { + for i in 0..SECTION_VOLUME { + let block = blocks_data.get(i).unwrap(); + + if block as usize >= palette.len() { + blocks_data.set(i, 0); + } + } + } + + blocks.set_data( + if blocks_data.bits_per_value() > ::MAX_BITS_PER_ENTRY { + // Convert to GlobalPalette + let mut data = blocks_data + .resized(PalettedContainer::::global_palette_bits_per_value()); + PalettedContainer::::map_to_global_palette( + blocks.len(), + &block_palette, + &mut data, + ); + data + } else { + blocks_data + }, + ); + } + if let Some(biomes_data) = section + .biomes + .data + .map(|data| PackedArray::from_i64_vec(data, BIOMES_PER_CHUNK_SECTION)) + { + biomes.set_data( + if biomes_data.bits_per_value() > ::MAX_BITS_PER_ENTRY { + // Convert to GlobalPalette + let mut data = biomes_data + .resized(PalettedContainer::::global_palette_bits_per_value()); + PalettedContainer::::map_to_global_palette( + biomes.len(), + &biome_palette, + &mut data, + ); + data + } else { + biomes_data + }, + ); + } + // Light // convert raw lighting data (4bits / block) into a BitArray - let convert_light_data = |light_data: &Vec| { - let data = light_data + fn convert_light_data(light_data: &[i8]) -> PackedArray { + let data: Vec = light_data .chunks(8) .map(|chunk| { // not sure if there's a better (safe) way of doing this.. @@ -372,112 +471,155 @@ fn read_section_into_chunk(section: &mut LevelSection, chunk: &mut Chunk) -> Res u64::from_le_bytes(chunk) }) .collect(); - PackedArray::from_u64_vec(data, 4096) - }; - if section.sky_light.is_empty() { - section.sky_light = vec![0; 2048]; + PackedArray::from_u64_vec(data, SECTION_VOLUME) + } + + if section.sky_light.is_some() && section.sky_light.as_ref().unwrap().is_empty() { + section.sky_light = Some(vec![0; 2048]); } - if section.block_light.is_empty() { - section.block_light = vec![0; 2048]; + if section.block_light.is_some() && section.block_light.as_ref().unwrap().is_empty() { + section.block_light = Some(vec![0; 2048]); } - if section.block_light.len() != 2048 || section.sky_light.len() != 2048 { + if section.sky_light.is_some() && section.sky_light.as_ref().unwrap().len() != 2048 + || section.block_light.is_some() && section.block_light.as_ref().unwrap().len() != 2048 + { return Err(Error::IndexOutOfBounds); } - let block_light = convert_light_data(§ion.block_light); - let sky_light = convert_light_data(§ion.sky_light); + let sky_light = section + .sky_light + .as_ref() + .map(|light| convert_light_data(light)); + let block_light = section + .block_light + .as_ref() + .map(|light| convert_light_data(light)); let light = - LightStore::from_packed_arrays(block_light, sky_light).ok_or(Error::IndexOutOfBounds)?; - let blocks = BlockStore::from_raw_parts(Some(palette), data); + LightStore::from_packed_arrays(sky_light, block_light).ok_or(Error::IndexOutOfBounds)?; - let chunk_section = ChunkSection::new(blocks, light); + let air_blocks = ChunkSection::count_air_blocks(&blocks); + let chunk_section = ChunkSection::new(blocks, biomes, air_blocks, light); - chunk.set_section_at(section.y as isize, Some(chunk_section)); + chunk.set_section_at(section.y as isize - min_y_section as isize, chunk_section); Ok(()) } -fn chunk_to_chunk_root( +fn chunk_to_data_chunk( chunk: &Chunk, entities: &[EntityData], block_entities: &[BlockEntityData], -) -> ChunkRoot { - ChunkRoot { - level: ChunkLevel { - x_pos: chunk.position().x, - z_pos: chunk.position().z, - last_update: 0, // TODO - inhabited_time: 0, // TODO - block_entities: block_entities.into(), - sections: chunk - .sections() - .iter() - .enumerate() - .filter_map(|(y, sec)| sec.as_ref().map(|sec| (y, sec.clone()))) - .map(|(y, mut section)| { - let palette = convert_palette(&mut section); - LevelSection { - y: (y as i8) - 1, - states: section - .blocks() - .data() - .as_u64_slice() - .iter() - .map(|x| *x as i64) - .collect(), - palette, - block_light: slice_u64_to_i8(section.light().block_light().as_u64_slice()) - .to_vec(), - sky_light: slice_u64_to_i8(section.light().sky_light().as_u64_slice()) - .to_vec(), - } - }) - .collect(), - biomes: chunk - .biomes() - .as_slice() - .iter() - .map(|biome| biome.id() as i32) - .collect(), - entities: entities.into(), - awaiting_block_updates: vec![vec![]; 16], // TODO - awaiting_liquid_updates: vec![vec![]; 16], // TODO - scheduled_block_updates: vec![], // TODO - scheduled_liquid_updates: vec![], - post_processing: vec![vec![]; 16], - worldgen_status: "postprocessed".into(), - }, - data_version: DATA_VERSION, + biome_list: &BiomeList, +) -> DataChunk { + DataChunk { + data_version: *ANVIL_VERSION_RANGE.end(), + x_pos: chunk.position().x, + z_pos: chunk.position().z, + min_y_section: chunk.min_y_section(), + last_update: 0, // TODO + inhabited_time: 0, // TODO + block_entities: block_entities.into(), + sections: chunk + .sections() + .iter() + .enumerate() + .map(|(y, section)| { + LevelSection { + y: (y as i8) - 1, + block_states: match section.blocks() { + PalettedContainer::SingleValue(block) => PaletteAndData { + palette: vec![serialize_block_state(block)], + data: None, + }, + PalettedContainer::MultipleValues { data, palette } => PaletteAndData { + palette: palette.iter().map(serialize_block_state).collect(), + data: Some(bytemuck::cast_slice(data.as_u64_slice()).to_vec()), + }, + PalettedContainer::GlobalPalette { data } => { + // Convert to MultipleValues palette + let mut data = data.clone(); + let mut palette = Vec::new(); + data.iter().for_each(|value| { + let block = BlockState::from_default_palette(value as u32).unwrap(); + if !palette.contains(&block) { + palette.push(block); + } + }); + PalettedContainer::::map_from_global_palette( + section.blocks().len(), + &palette, + &mut data, + ); + let data = data.resized( + PalettedContainer::::palette_bits_per_value( + palette.len(), + ), + ); + PaletteAndData { + palette: palette.iter().map(serialize_block_state).collect(), + data: Some(bytemuck::cast_slice(data.as_u64_slice()).to_vec()), + } + } + }, + biomes: match section.biomes() { + PalettedContainer::SingleValue(biome) => PaletteAndData { + palette: vec![biome_list.get_by_id(biome).unwrap().0.into()], + data: None, + }, + PalettedContainer::MultipleValues { data, palette } => PaletteAndData { + palette: palette + .iter() + .map(|biome| biome_list.get_by_id(biome).unwrap().0.into()) + .collect(), + data: Some(bytemuck::cast_slice(data.as_u64_slice()).to_vec()), + }, + PalettedContainer::GlobalPalette { data } => { + // Convert to MultipleValues palette + let mut data = data.clone(); + let mut palette = Vec::new(); + data.iter().for_each(|value| { + let block = BiomeId::from_default_palette(value as u32).unwrap(); + if !palette.contains(&block) { + palette.push(block); + } + }); + PalettedContainer::::map_from_global_palette( + section.biomes().len(), + &palette, + &mut data, + ); + let data = data.resized( + PalettedContainer::::palette_bits_per_value(palette.len()), + ); + PaletteAndData { + palette: palette + .iter() + .map(|biome| biome_list.get_by_id(biome).unwrap().0.into()) + .collect(), + data: Some(bytemuck::cast_slice(data.as_u64_slice()).to_vec()), + } + } + }, + sky_light: section + .light() + .sky_light() + .map(|light| slice_u64_to_i8(light.as_u64_slice()).to_vec()), + block_light: section + .light() + .block_light() + .map(|light| slice_u64_to_i8(light.as_u64_slice()).to_vec()), + } + }) + .collect(), + entities: entities.into(), + post_processing: vec![vec![]; 16], + worldgen_status: "postprocessed".into(), } } -fn convert_palette(section: &mut ChunkSection) -> Vec { - raw_palette_to_palette_entries(section.blocks().palette().unwrap().as_slice()) -} - -fn raw_palette_to_palette_entries(palette: &[BlockId]) -> Vec { - palette - .iter() - .map(|block| { - let props = block.to_properties_map(); - let identifier = block.identifier(); - - LevelPaletteEntry { - name: identifier.into(), - properties: Some(LevelProperties { - props: props - .into_iter() - .map(|(k, v)| (Cow::from(k), Cow::from(v))) - .collect(), - }), - } - }) - .collect() -} - fn slice_u64_to_i8(input: &[u64]) -> &[i8] { // TODO: someone should check this isn't undefined behavior. // Pretty sure the alignment check makes this sound, @@ -504,7 +646,7 @@ impl SectorAllocator { /// Creates a `SectorAllocator` from the given file header /// and total file size __in sectors.__ pub fn new(header: &RegionHeader, file_size: u32) -> Self { - let mut used_sectors = bitvec![0; file_size as usize]; + let mut used_sectors: BitVec = (0..file_size as usize).map(|_| 0).collect(); // Detect used sectors for chunk_location in &header.locations { @@ -598,13 +740,13 @@ pub enum Error { /// An IO error occurred Io(io::Error), /// There was an invalid block in the chunk - InvalidBlock(String), + UnknownBlock(String), /// The chunk does not exist ChunkNotExist, /// The chunk uses an unsupported data version UnsupportedDataVersion(i32), /// The palette for the chunk contained in invalid block type - InvalidBlockType, + InvalidBlockType(String), /// The "Chunk [x, z]" tag was missing MissingRootTag, /// Chunk section index was out of bounds @@ -625,10 +767,10 @@ impl Display for Error { Error::InvalidCompression(id) => { f.write_str(&format!("Chunk uses invalid compression type {}", id))? } - Error::InvalidBlock(name) => f.write_str(&format!("Chunk contains invalid block {}", name))?, + Error::UnknownBlock(name) => f.write_str(&format!("Chunk contains invalid block {}", name))?, Error::ChunkNotExist => f.write_str("The chunk does not exist")?, - Error::UnsupportedDataVersion(_) => f.write_str("The chunk uses an unsupported data version. Feather currently only supports 1.16.5 region files.")?, - Error::InvalidBlockType => f.write_str("Chunk contains invalid block type")?, + Error::UnsupportedDataVersion(_) => f.write_str("The chunk uses an unsupported data version. Feather currently only supports 1.18.1-1.18.2 region files.")?, + Error::InvalidBlockType(s) => f.write_str(&format!("Chunk contains invalid block type {}", s))?, Error::MissingRootTag => f.write_str("Chunk is missing a root NBT tag")?, Error::IndexOutOfBounds => f.write_str("Section index out of bounds")?, Error::InvalidBiomeId(id) => write!(f, "Invalid biome ID {}", id)?, @@ -650,7 +792,11 @@ impl std::error::Error for Error {} /// This function does not actually load all the chunks /// in the region into memory; it only reads the file's /// header so that chunks can be retrieved later. -pub fn load_region(dir: &Path, pos: RegionPosition) -> Result { +pub fn load_region( + dir: &Path, + pos: RegionPosition, + world_height: WorldHeight, +) -> Result { let mut file = { let buf = region_file_path(dir, pos); @@ -671,6 +817,7 @@ pub fn load_region(dir: &Path, pos: RegionPosition) -> Result Result Result { +pub fn create_region( + dir: &Path, + pos: RegionPosition, + world_height: WorldHeight, +) -> Result { create_region_dir(dir).map_err(Error::Io)?; let mut file = { let buf = region_file_path(dir, pos); @@ -702,6 +853,7 @@ pub fn create_region(dir: &Path, pos: RegionPosition) -> Result Self { - Self { - x: chunk_coords.x >> 5, - z: chunk_coords.z >> 5, - } +fn serialize_block_state(block: &BlockState) -> SerializedBlockState { + SerializedBlockState { + name: block.kind().namespaced_id().into(), + properties: None, } } diff --git a/libcraft/assets/raw_block_properties.bc.gz b/libcraft/assets/raw_block_properties.bc.gz new file mode 100644 index 000000000..7b33e4859 Binary files /dev/null and b/libcraft/assets/raw_block_properties.bc.gz differ diff --git a/libcraft/assets/raw_block_states.bc.gz b/libcraft/assets/raw_block_states.bc.gz new file mode 100644 index 000000000..bad5837fa Binary files /dev/null and b/libcraft/assets/raw_block_states.bc.gz differ diff --git a/libcraft/assets/vanilla_biomes.bc.gz b/libcraft/assets/vanilla_biomes.bc.gz new file mode 100644 index 000000000..9632412cd Binary files /dev/null and b/libcraft/assets/vanilla_biomes.bc.gz differ diff --git a/libcraft/assets/vanilla_dimensions.bc.gz b/libcraft/assets/vanilla_dimensions.bc.gz new file mode 100644 index 000000000..b0a40f71f Binary files /dev/null and b/libcraft/assets/vanilla_dimensions.bc.gz differ diff --git a/libcraft/blocks/Cargo.toml b/libcraft/blocks/Cargo.toml index 67a068115..1d9f9496b 100644 --- a/libcraft/blocks/Cargo.toml +++ b/libcraft/blocks/Cargo.toml @@ -2,19 +2,19 @@ name = "libcraft-blocks" version = "0.1.0" authors = ["Caelum van Ispelen "] -edition = "2018" +edition = "2021" [dependencies] -libcraft-core = { path = "../core" } -libcraft-items = { path = "../items" } -libcraft-macros = { path = "../macros" } - ahash = "0.7" -bincode = "1" +bincode = "2.0.0-rc.1" bytemuck = { version = "1", features = ["derive"] } flate2 = "1" +libcraft-core = { path = "../core" } +libcraft-items = { path = "../items" } +libcraft-macros = { path = "../macros" } +num-derive = "0.3" +num-traits = "0.2" once_cell = "1" serde = { version = "1", features = ["derive"] } +smartstring = { version = "1", features = ["serde"] } thiserror = "1" -num-traits = "0.2" -num-derive = "0.3" diff --git a/libcraft/blocks/assets/raw_block_properties.bc.gz b/libcraft/blocks/assets/raw_block_properties.bc.gz deleted file mode 100644 index f2b9fa5ad..000000000 Binary files a/libcraft/blocks/assets/raw_block_properties.bc.gz and /dev/null differ diff --git a/libcraft/blocks/assets/raw_block_states.bc.gz b/libcraft/blocks/assets/raw_block_states.bc.gz deleted file mode 100644 index f5c1f6b90..000000000 Binary files a/libcraft/blocks/assets/raw_block_states.bc.gz and /dev/null differ diff --git a/libcraft/blocks/src/block.rs b/libcraft/blocks/src/block.rs index d80cc8ce1..9a6ca5af0 100644 --- a/libcraft/blocks/src/block.rs +++ b/libcraft/blocks/src/block.rs @@ -1,9 +1,161 @@ // This file is @generated. Please do not edit. +#[allow(dead_code)] +pub mod dig_multipliers { + pub const GOURD: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + ]; + pub const WOOL: &[(libcraft_items::Item, f32)] = &[(libcraft_items::Item::Shears, 5f32)]; + pub const LEAVES_AND_MINEABLE_WITH_HOE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::WoodenHoe, 2f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::StoneHoe, 4f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::GoldenHoe, 12f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::IronHoe, 6f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::DiamondHoe, 8f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::NetheriteHoe, 9f32), + (libcraft_items::Item::Shears, 15f32), + ]; + pub const MINEABLE_WITH_AXE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenAxe, 2f32), + (libcraft_items::Item::StoneAxe, 4f32), + (libcraft_items::Item::GoldenAxe, 12f32), + (libcraft_items::Item::IronAxe, 6f32), + (libcraft_items::Item::DiamondAxe, 8f32), + (libcraft_items::Item::NetheriteAxe, 9f32), + ]; + pub const COWEB: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 15f32), + (libcraft_items::Item::StoneSword, 15f32), + (libcraft_items::Item::GoldenSword, 15f32), + (libcraft_items::Item::IronSword, 15f32), + (libcraft_items::Item::DiamondSword, 15f32), + (libcraft_items::Item::NetheriteSword, 15f32), + (libcraft_items::Item::Shears, 15f32), + ]; + pub const DEFAULT: &[(libcraft_items::Item, f32)] = &[]; + pub const MINEABLE_WITH_SHOVEL: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenShovel, 2f32), + (libcraft_items::Item::StoneShovel, 4f32), + (libcraft_items::Item::GoldenShovel, 12f32), + (libcraft_items::Item::IronShovel, 6f32), + (libcraft_items::Item::DiamondShovel, 8f32), + (libcraft_items::Item::NetheriteShovel, 9f32), + ]; + pub const LEAVES: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::Shears, 15f32), + ]; + pub const PLANT: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + ]; + pub const MINEABLE_WITH_PICKAXE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenPickaxe, 2f32), + (libcraft_items::Item::StonePickaxe, 4f32), + (libcraft_items::Item::GoldenPickaxe, 12f32), + (libcraft_items::Item::IronPickaxe, 6f32), + (libcraft_items::Item::DiamondPickaxe, 8f32), + (libcraft_items::Item::NetheritePickaxe, 9f32), + ]; + pub const VINE_OR_GLOW_LICHEN: &[(libcraft_items::Item, f32)] = + &[(libcraft_items::Item::Shears, 2f32)]; + pub const MINEABLE_WITH_HOE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenHoe, 2f32), + (libcraft_items::Item::StoneHoe, 4f32), + (libcraft_items::Item::GoldenHoe, 12f32), + (libcraft_items::Item::IronHoe, 6f32), + (libcraft_items::Item::DiamondHoe, 8f32), + (libcraft_items::Item::NetheriteHoe, 9f32), + ]; + pub const GOURD_AND_MINEABLE_WITH_AXE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::WoodenAxe, 2f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::StoneAxe, 4f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::GoldenAxe, 12f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::IronAxe, 6f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::DiamondAxe, 8f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::NetheriteAxe, 9f32), + ]; + pub const PLANT_AND_MINEABLE_WITH_AXE: &[(libcraft_items::Item, f32)] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::WoodenAxe, 2f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::StoneAxe, 4f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::GoldenAxe, 12f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::IronAxe, 6f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::DiamondAxe, 8f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::NetheriteAxe, 9f32), + ]; + pub const VINE_OR_GLOW_LICHEN_AND_PLANT_AND_MINEABLE_WITH_AXE: &[( + libcraft_items::Item, + f32, + )] = &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::WoodenAxe, 2f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::StoneAxe, 4f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::GoldenAxe, 12f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::IronAxe, 6f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::DiamondAxe, 8f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::NetheriteAxe, 9f32), + (libcraft_items::Item::Shears, 2f32), + ]; + pub const LEAVES_AND_MINEABLE_WITH_AXE_AND_MINEABLE_WITH_HOE: &[(libcraft_items::Item, f32)] = + &[ + (libcraft_items::Item::WoodenSword, 1.5f32), + (libcraft_items::Item::WoodenAxe, 2f32), + (libcraft_items::Item::WoodenHoe, 2f32), + (libcraft_items::Item::StoneSword, 1.5f32), + (libcraft_items::Item::StoneAxe, 4f32), + (libcraft_items::Item::StoneHoe, 4f32), + (libcraft_items::Item::GoldenSword, 1.5f32), + (libcraft_items::Item::GoldenAxe, 12f32), + (libcraft_items::Item::GoldenHoe, 12f32), + (libcraft_items::Item::IronSword, 1.5f32), + (libcraft_items::Item::IronAxe, 6f32), + (libcraft_items::Item::IronHoe, 6f32), + (libcraft_items::Item::DiamondSword, 1.5f32), + (libcraft_items::Item::DiamondAxe, 8f32), + (libcraft_items::Item::DiamondHoe, 8f32), + (libcraft_items::Item::NetheriteSword, 1.5f32), + (libcraft_items::Item::NetheriteAxe, 9f32), + (libcraft_items::Item::NetheriteHoe, 9f32), + (libcraft_items::Item::Shears, 15f32), + ]; +} #[derive( - num_derive::FromPrimitive, - num_derive::ToPrimitive, - serde::Serialize, - serde::Deserialize, Copy, Clone, Debug, @@ -12,7 +164,14 @@ Hash, PartialOrd, Ord, + num_derive :: FromPrimitive, + num_derive :: ToPrimitive, + serde :: Serialize, + serde :: Deserialize, + bincode :: Encode, + bincode :: Decode, )] +#[serde(rename_all = "snake_case")] pub enum BlockKind { Air, Stone, @@ -46,8 +205,11 @@ pub enum BlockKind { RedSand, Gravel, GoldOre, + DeepslateGoldOre, IronOre, + DeepslateIronOre, CoalOre, + DeepslateCoalOre, NetherGoldOre, OakLog, SpruceLog, @@ -79,10 +241,13 @@ pub enum BlockKind { JungleLeaves, AcaciaLeaves, DarkOakLeaves, + AzaleaLeaves, + FloweringAzaleaLeaves, Sponge, WetSponge, Glass, LapisOre, + DeepslateLapisOre, LapisBlock, Dispenser, Sandstone, @@ -164,6 +329,7 @@ pub enum BlockKind { Chest, RedstoneWire, DiamondOre, + DeepslateDiamondOre, DiamondBlock, CraftingTable, Wheat, @@ -195,6 +361,7 @@ pub enum BlockKind { AcaciaPressurePlate, DarkOakPressurePlate, RedstoneOre, + DeepslateRedstoneOre, RedstoneTorch, RedstoneWallTorch, StoneButton, @@ -264,6 +431,7 @@ pub enum BlockKind { PumpkinStem, MelonStem, Vine, + GlowLichen, OakFenceGate, BrickStairs, StoneBrickStairs, @@ -276,6 +444,9 @@ pub enum BlockKind { EnchantingTable, BrewingStand, Cauldron, + WaterCauldron, + LavaCauldron, + PowderSnowCauldron, EndPortal, EndPortalFrame, EndStone, @@ -284,6 +455,7 @@ pub enum BlockKind { Cocoa, SandstoneStairs, EmeraldOre, + DeepslateEmeraldOre, EnderChest, TripwireHook, Tripwire, @@ -393,6 +565,7 @@ pub enum BlockKind { DarkOakStairs, SlimeBlock, Barrier, + Light, IronTrapdoor, Prismarine, PrismarineBricks, @@ -512,7 +685,7 @@ pub enum BlockKind { PurpurStairs, EndStoneBricks, Beetroots, - GrassPath, + DirtPath, EndGateway, RepeatingCommandBlock, ChainCommandBlock, @@ -777,1554 +950,2848 @@ pub enum BlockKind { ChiseledNetherBricks, CrackedNetherBricks, QuartzBricks, + Candle, + WhiteCandle, + OrangeCandle, + MagentaCandle, + LightBlueCandle, + YellowCandle, + LimeCandle, + PinkCandle, + GrayCandle, + LightGrayCandle, + CyanCandle, + PurpleCandle, + BlueCandle, + BrownCandle, + GreenCandle, + RedCandle, + BlackCandle, + CandleCake, + WhiteCandleCake, + OrangeCandleCake, + MagentaCandleCake, + LightBlueCandleCake, + YellowCandleCake, + LimeCandleCake, + PinkCandleCake, + GrayCandleCake, + LightGrayCandleCake, + CyanCandleCake, + PurpleCandleCake, + BlueCandleCake, + BrownCandleCake, + GreenCandleCake, + RedCandleCake, + BlackCandleCake, + AmethystBlock, + BuddingAmethyst, + AmethystCluster, + LargeAmethystBud, + MediumAmethystBud, + SmallAmethystBud, + Tuff, + Calcite, + TintedGlass, + PowderSnow, + SculkSensor, + OxidizedCopper, + WeatheredCopper, + ExposedCopper, + CopperBlock, + CopperOre, + DeepslateCopperOre, + OxidizedCutCopper, + WeatheredCutCopper, + ExposedCutCopper, + CutCopper, + OxidizedCutCopperStairs, + WeatheredCutCopperStairs, + ExposedCutCopperStairs, + CutCopperStairs, + OxidizedCutCopperSlab, + WeatheredCutCopperSlab, + ExposedCutCopperSlab, + CutCopperSlab, + WaxedCopperBlock, + WaxedWeatheredCopper, + WaxedExposedCopper, + WaxedOxidizedCopper, + WaxedOxidizedCutCopper, + WaxedWeatheredCutCopper, + WaxedExposedCutCopper, + WaxedCutCopper, + WaxedOxidizedCutCopperStairs, + WaxedWeatheredCutCopperStairs, + WaxedExposedCutCopperStairs, + WaxedCutCopperStairs, + WaxedOxidizedCutCopperSlab, + WaxedWeatheredCutCopperSlab, + WaxedExposedCutCopperSlab, + WaxedCutCopperSlab, + LightningRod, + PointedDripstone, + DripstoneBlock, + CaveVines, + CaveVinesPlant, + SporeBlossom, + Azalea, + FloweringAzalea, + MossCarpet, + MossBlock, + BigDripleaf, + BigDripleafStem, + SmallDripleaf, + HangingRoots, + RootedDirt, + Deepslate, + CobbledDeepslate, + CobbledDeepslateStairs, + CobbledDeepslateSlab, + CobbledDeepslateWall, + PolishedDeepslate, + PolishedDeepslateStairs, + PolishedDeepslateSlab, + PolishedDeepslateWall, + DeepslateTiles, + DeepslateTileStairs, + DeepslateTileSlab, + DeepslateTileWall, + DeepslateBricks, + DeepslateBrickStairs, + DeepslateBrickSlab, + DeepslateBrickWall, + ChiseledDeepslate, + CrackedDeepslateBricks, + CrackedDeepslateTiles, + InfestedDeepslate, + SmoothBasalt, + RawIronBlock, + RawCopperBlock, + RawGoldBlock, + PottedAzaleaBush, + PottedFloweringAzaleaBush, +} +impl BlockKind { + #[inline] + pub fn values() -> &'static [BlockKind] { + use BlockKind::*; + &[ + Air, + Stone, + Granite, + PolishedGranite, + Diorite, + PolishedDiorite, + Andesite, + PolishedAndesite, + GrassBlock, + Dirt, + CoarseDirt, + Podzol, + Cobblestone, + OakPlanks, + SprucePlanks, + BirchPlanks, + JunglePlanks, + AcaciaPlanks, + DarkOakPlanks, + OakSapling, + SpruceSapling, + BirchSapling, + JungleSapling, + AcaciaSapling, + DarkOakSapling, + Bedrock, + Water, + Lava, + Sand, + RedSand, + Gravel, + GoldOre, + DeepslateGoldOre, + IronOre, + DeepslateIronOre, + CoalOre, + DeepslateCoalOre, + NetherGoldOre, + OakLog, + SpruceLog, + BirchLog, + JungleLog, + AcaciaLog, + DarkOakLog, + StrippedSpruceLog, + StrippedBirchLog, + StrippedJungleLog, + StrippedAcaciaLog, + StrippedDarkOakLog, + StrippedOakLog, + OakWood, + SpruceWood, + BirchWood, + JungleWood, + AcaciaWood, + DarkOakWood, + StrippedOakWood, + StrippedSpruceWood, + StrippedBirchWood, + StrippedJungleWood, + StrippedAcaciaWood, + StrippedDarkOakWood, + OakLeaves, + SpruceLeaves, + BirchLeaves, + JungleLeaves, + AcaciaLeaves, + DarkOakLeaves, + AzaleaLeaves, + FloweringAzaleaLeaves, + Sponge, + WetSponge, + Glass, + LapisOre, + DeepslateLapisOre, + LapisBlock, + Dispenser, + Sandstone, + ChiseledSandstone, + CutSandstone, + NoteBlock, + WhiteBed, + OrangeBed, + MagentaBed, + LightBlueBed, + YellowBed, + LimeBed, + PinkBed, + GrayBed, + LightGrayBed, + CyanBed, + PurpleBed, + BlueBed, + BrownBed, + GreenBed, + RedBed, + BlackBed, + PoweredRail, + DetectorRail, + StickyPiston, + Cobweb, + Grass, + Fern, + DeadBush, + Seagrass, + TallSeagrass, + Piston, + PistonHead, + WhiteWool, + OrangeWool, + MagentaWool, + LightBlueWool, + YellowWool, + LimeWool, + PinkWool, + GrayWool, + LightGrayWool, + CyanWool, + PurpleWool, + BlueWool, + BrownWool, + GreenWool, + RedWool, + BlackWool, + MovingPiston, + Dandelion, + Poppy, + BlueOrchid, + Allium, + AzureBluet, + RedTulip, + OrangeTulip, + WhiteTulip, + PinkTulip, + OxeyeDaisy, + Cornflower, + WitherRose, + LilyOfTheValley, + BrownMushroom, + RedMushroom, + GoldBlock, + IronBlock, + Bricks, + Tnt, + Bookshelf, + MossyCobblestone, + Obsidian, + Torch, + WallTorch, + Fire, + SoulFire, + Spawner, + OakStairs, + Chest, + RedstoneWire, + DiamondOre, + DeepslateDiamondOre, + DiamondBlock, + CraftingTable, + Wheat, + Farmland, + Furnace, + OakSign, + SpruceSign, + BirchSign, + AcaciaSign, + JungleSign, + DarkOakSign, + OakDoor, + Ladder, + Rail, + CobblestoneStairs, + OakWallSign, + SpruceWallSign, + BirchWallSign, + AcaciaWallSign, + JungleWallSign, + DarkOakWallSign, + Lever, + StonePressurePlate, + IronDoor, + OakPressurePlate, + SprucePressurePlate, + BirchPressurePlate, + JunglePressurePlate, + AcaciaPressurePlate, + DarkOakPressurePlate, + RedstoneOre, + DeepslateRedstoneOre, + RedstoneTorch, + RedstoneWallTorch, + StoneButton, + Snow, + Ice, + SnowBlock, + Cactus, + Clay, + SugarCane, + Jukebox, + OakFence, + Pumpkin, + Netherrack, + SoulSand, + SoulSoil, + Basalt, + PolishedBasalt, + SoulTorch, + SoulWallTorch, + Glowstone, + NetherPortal, + CarvedPumpkin, + JackOLantern, + Cake, + Repeater, + WhiteStainedGlass, + OrangeStainedGlass, + MagentaStainedGlass, + LightBlueStainedGlass, + YellowStainedGlass, + LimeStainedGlass, + PinkStainedGlass, + GrayStainedGlass, + LightGrayStainedGlass, + CyanStainedGlass, + PurpleStainedGlass, + BlueStainedGlass, + BrownStainedGlass, + GreenStainedGlass, + RedStainedGlass, + BlackStainedGlass, + OakTrapdoor, + SpruceTrapdoor, + BirchTrapdoor, + JungleTrapdoor, + AcaciaTrapdoor, + DarkOakTrapdoor, + StoneBricks, + MossyStoneBricks, + CrackedStoneBricks, + ChiseledStoneBricks, + InfestedStone, + InfestedCobblestone, + InfestedStoneBricks, + InfestedMossyStoneBricks, + InfestedCrackedStoneBricks, + InfestedChiseledStoneBricks, + BrownMushroomBlock, + RedMushroomBlock, + MushroomStem, + IronBars, + Chain, + GlassPane, + Melon, + AttachedPumpkinStem, + AttachedMelonStem, + PumpkinStem, + MelonStem, + Vine, + GlowLichen, + OakFenceGate, + BrickStairs, + StoneBrickStairs, + Mycelium, + LilyPad, + NetherBricks, + NetherBrickFence, + NetherBrickStairs, + NetherWart, + EnchantingTable, + BrewingStand, + Cauldron, + WaterCauldron, + LavaCauldron, + PowderSnowCauldron, + EndPortal, + EndPortalFrame, + EndStone, + DragonEgg, + RedstoneLamp, + Cocoa, + SandstoneStairs, + EmeraldOre, + DeepslateEmeraldOre, + EnderChest, + TripwireHook, + Tripwire, + EmeraldBlock, + SpruceStairs, + BirchStairs, + JungleStairs, + CommandBlock, + Beacon, + CobblestoneWall, + MossyCobblestoneWall, + FlowerPot, + PottedOakSapling, + PottedSpruceSapling, + PottedBirchSapling, + PottedJungleSapling, + PottedAcaciaSapling, + PottedDarkOakSapling, + PottedFern, + PottedDandelion, + PottedPoppy, + PottedBlueOrchid, + PottedAllium, + PottedAzureBluet, + PottedRedTulip, + PottedOrangeTulip, + PottedWhiteTulip, + PottedPinkTulip, + PottedOxeyeDaisy, + PottedCornflower, + PottedLilyOfTheValley, + PottedWitherRose, + PottedRedMushroom, + PottedBrownMushroom, + PottedDeadBush, + PottedCactus, + Carrots, + Potatoes, + OakButton, + SpruceButton, + BirchButton, + JungleButton, + AcaciaButton, + DarkOakButton, + SkeletonSkull, + SkeletonWallSkull, + WitherSkeletonSkull, + WitherSkeletonWallSkull, + ZombieHead, + ZombieWallHead, + PlayerHead, + PlayerWallHead, + CreeperHead, + CreeperWallHead, + DragonHead, + DragonWallHead, + Anvil, + ChippedAnvil, + DamagedAnvil, + TrappedChest, + LightWeightedPressurePlate, + HeavyWeightedPressurePlate, + Comparator, + DaylightDetector, + RedstoneBlock, + NetherQuartzOre, + Hopper, + QuartzBlock, + ChiseledQuartzBlock, + QuartzPillar, + QuartzStairs, + ActivatorRail, + Dropper, + WhiteTerracotta, + OrangeTerracotta, + MagentaTerracotta, + LightBlueTerracotta, + YellowTerracotta, + LimeTerracotta, + PinkTerracotta, + GrayTerracotta, + LightGrayTerracotta, + CyanTerracotta, + PurpleTerracotta, + BlueTerracotta, + BrownTerracotta, + GreenTerracotta, + RedTerracotta, + BlackTerracotta, + WhiteStainedGlassPane, + OrangeStainedGlassPane, + MagentaStainedGlassPane, + LightBlueStainedGlassPane, + YellowStainedGlassPane, + LimeStainedGlassPane, + PinkStainedGlassPane, + GrayStainedGlassPane, + LightGrayStainedGlassPane, + CyanStainedGlassPane, + PurpleStainedGlassPane, + BlueStainedGlassPane, + BrownStainedGlassPane, + GreenStainedGlassPane, + RedStainedGlassPane, + BlackStainedGlassPane, + AcaciaStairs, + DarkOakStairs, + SlimeBlock, + Barrier, + Light, + IronTrapdoor, + Prismarine, + PrismarineBricks, + DarkPrismarine, + PrismarineStairs, + PrismarineBrickStairs, + DarkPrismarineStairs, + PrismarineSlab, + PrismarineBrickSlab, + DarkPrismarineSlab, + SeaLantern, + HayBlock, + WhiteCarpet, + OrangeCarpet, + MagentaCarpet, + LightBlueCarpet, + YellowCarpet, + LimeCarpet, + PinkCarpet, + GrayCarpet, + LightGrayCarpet, + CyanCarpet, + PurpleCarpet, + BlueCarpet, + BrownCarpet, + GreenCarpet, + RedCarpet, + BlackCarpet, + Terracotta, + CoalBlock, + PackedIce, + Sunflower, + Lilac, + RoseBush, + Peony, + TallGrass, + LargeFern, + WhiteBanner, + OrangeBanner, + MagentaBanner, + LightBlueBanner, + YellowBanner, + LimeBanner, + PinkBanner, + GrayBanner, + LightGrayBanner, + CyanBanner, + PurpleBanner, + BlueBanner, + BrownBanner, + GreenBanner, + RedBanner, + BlackBanner, + WhiteWallBanner, + OrangeWallBanner, + MagentaWallBanner, + LightBlueWallBanner, + YellowWallBanner, + LimeWallBanner, + PinkWallBanner, + GrayWallBanner, + LightGrayWallBanner, + CyanWallBanner, + PurpleWallBanner, + BlueWallBanner, + BrownWallBanner, + GreenWallBanner, + RedWallBanner, + BlackWallBanner, + RedSandstone, + ChiseledRedSandstone, + CutRedSandstone, + RedSandstoneStairs, + OakSlab, + SpruceSlab, + BirchSlab, + JungleSlab, + AcaciaSlab, + DarkOakSlab, + StoneSlab, + SmoothStoneSlab, + SandstoneSlab, + CutSandstoneSlab, + PetrifiedOakSlab, + CobblestoneSlab, + BrickSlab, + StoneBrickSlab, + NetherBrickSlab, + QuartzSlab, + RedSandstoneSlab, + CutRedSandstoneSlab, + PurpurSlab, + SmoothStone, + SmoothSandstone, + SmoothQuartz, + SmoothRedSandstone, + SpruceFenceGate, + BirchFenceGate, + JungleFenceGate, + AcaciaFenceGate, + DarkOakFenceGate, + SpruceFence, + BirchFence, + JungleFence, + AcaciaFence, + DarkOakFence, + SpruceDoor, + BirchDoor, + JungleDoor, + AcaciaDoor, + DarkOakDoor, + EndRod, + ChorusPlant, + ChorusFlower, + PurpurBlock, + PurpurPillar, + PurpurStairs, + EndStoneBricks, + Beetroots, + DirtPath, + EndGateway, + RepeatingCommandBlock, + ChainCommandBlock, + FrostedIce, + MagmaBlock, + NetherWartBlock, + RedNetherBricks, + BoneBlock, + StructureVoid, + Observer, + ShulkerBox, + WhiteShulkerBox, + OrangeShulkerBox, + MagentaShulkerBox, + LightBlueShulkerBox, + YellowShulkerBox, + LimeShulkerBox, + PinkShulkerBox, + GrayShulkerBox, + LightGrayShulkerBox, + CyanShulkerBox, + PurpleShulkerBox, + BlueShulkerBox, + BrownShulkerBox, + GreenShulkerBox, + RedShulkerBox, + BlackShulkerBox, + WhiteGlazedTerracotta, + OrangeGlazedTerracotta, + MagentaGlazedTerracotta, + LightBlueGlazedTerracotta, + YellowGlazedTerracotta, + LimeGlazedTerracotta, + PinkGlazedTerracotta, + GrayGlazedTerracotta, + LightGrayGlazedTerracotta, + CyanGlazedTerracotta, + PurpleGlazedTerracotta, + BlueGlazedTerracotta, + BrownGlazedTerracotta, + GreenGlazedTerracotta, + RedGlazedTerracotta, + BlackGlazedTerracotta, + WhiteConcrete, + OrangeConcrete, + MagentaConcrete, + LightBlueConcrete, + YellowConcrete, + LimeConcrete, + PinkConcrete, + GrayConcrete, + LightGrayConcrete, + CyanConcrete, + PurpleConcrete, + BlueConcrete, + BrownConcrete, + GreenConcrete, + RedConcrete, + BlackConcrete, + WhiteConcretePowder, + OrangeConcretePowder, + MagentaConcretePowder, + LightBlueConcretePowder, + YellowConcretePowder, + LimeConcretePowder, + PinkConcretePowder, + GrayConcretePowder, + LightGrayConcretePowder, + CyanConcretePowder, + PurpleConcretePowder, + BlueConcretePowder, + BrownConcretePowder, + GreenConcretePowder, + RedConcretePowder, + BlackConcretePowder, + Kelp, + KelpPlant, + DriedKelpBlock, + TurtleEgg, + DeadTubeCoralBlock, + DeadBrainCoralBlock, + DeadBubbleCoralBlock, + DeadFireCoralBlock, + DeadHornCoralBlock, + TubeCoralBlock, + BrainCoralBlock, + BubbleCoralBlock, + FireCoralBlock, + HornCoralBlock, + DeadTubeCoral, + DeadBrainCoral, + DeadBubbleCoral, + DeadFireCoral, + DeadHornCoral, + TubeCoral, + BrainCoral, + BubbleCoral, + FireCoral, + HornCoral, + DeadTubeCoralFan, + DeadBrainCoralFan, + DeadBubbleCoralFan, + DeadFireCoralFan, + DeadHornCoralFan, + TubeCoralFan, + BrainCoralFan, + BubbleCoralFan, + FireCoralFan, + HornCoralFan, + DeadTubeCoralWallFan, + DeadBrainCoralWallFan, + DeadBubbleCoralWallFan, + DeadFireCoralWallFan, + DeadHornCoralWallFan, + TubeCoralWallFan, + BrainCoralWallFan, + BubbleCoralWallFan, + FireCoralWallFan, + HornCoralWallFan, + SeaPickle, + BlueIce, + Conduit, + BambooSapling, + Bamboo, + PottedBamboo, + VoidAir, + CaveAir, + BubbleColumn, + PolishedGraniteStairs, + SmoothRedSandstoneStairs, + MossyStoneBrickStairs, + PolishedDioriteStairs, + MossyCobblestoneStairs, + EndStoneBrickStairs, + StoneStairs, + SmoothSandstoneStairs, + SmoothQuartzStairs, + GraniteStairs, + AndesiteStairs, + RedNetherBrickStairs, + PolishedAndesiteStairs, + DioriteStairs, + PolishedGraniteSlab, + SmoothRedSandstoneSlab, + MossyStoneBrickSlab, + PolishedDioriteSlab, + MossyCobblestoneSlab, + EndStoneBrickSlab, + SmoothSandstoneSlab, + SmoothQuartzSlab, + GraniteSlab, + AndesiteSlab, + RedNetherBrickSlab, + PolishedAndesiteSlab, + DioriteSlab, + BrickWall, + PrismarineWall, + RedSandstoneWall, + MossyStoneBrickWall, + GraniteWall, + StoneBrickWall, + NetherBrickWall, + AndesiteWall, + RedNetherBrickWall, + SandstoneWall, + EndStoneBrickWall, + DioriteWall, + Scaffolding, + Loom, + Barrel, + Smoker, + BlastFurnace, + CartographyTable, + FletchingTable, + Grindstone, + Lectern, + SmithingTable, + Stonecutter, + Bell, + Lantern, + SoulLantern, + Campfire, + SoulCampfire, + SweetBerryBush, + WarpedStem, + StrippedWarpedStem, + WarpedHyphae, + StrippedWarpedHyphae, + WarpedNylium, + WarpedFungus, + WarpedWartBlock, + WarpedRoots, + NetherSprouts, + CrimsonStem, + StrippedCrimsonStem, + CrimsonHyphae, + StrippedCrimsonHyphae, + CrimsonNylium, + CrimsonFungus, + Shroomlight, + WeepingVines, + WeepingVinesPlant, + TwistingVines, + TwistingVinesPlant, + CrimsonRoots, + CrimsonPlanks, + WarpedPlanks, + CrimsonSlab, + WarpedSlab, + CrimsonPressurePlate, + WarpedPressurePlate, + CrimsonFence, + WarpedFence, + CrimsonTrapdoor, + WarpedTrapdoor, + CrimsonFenceGate, + WarpedFenceGate, + CrimsonStairs, + WarpedStairs, + CrimsonButton, + WarpedButton, + CrimsonDoor, + WarpedDoor, + CrimsonSign, + WarpedSign, + CrimsonWallSign, + WarpedWallSign, + StructureBlock, + Jigsaw, + Composter, + Target, + BeeNest, + Beehive, + HoneyBlock, + HoneycombBlock, + NetheriteBlock, + AncientDebris, + CryingObsidian, + RespawnAnchor, + PottedCrimsonFungus, + PottedWarpedFungus, + PottedCrimsonRoots, + PottedWarpedRoots, + Lodestone, + Blackstone, + BlackstoneStairs, + BlackstoneWall, + BlackstoneSlab, + PolishedBlackstone, + PolishedBlackstoneBricks, + CrackedPolishedBlackstoneBricks, + ChiseledPolishedBlackstone, + PolishedBlackstoneBrickSlab, + PolishedBlackstoneBrickStairs, + PolishedBlackstoneBrickWall, + GildedBlackstone, + PolishedBlackstoneStairs, + PolishedBlackstoneSlab, + PolishedBlackstonePressurePlate, + PolishedBlackstoneButton, + PolishedBlackstoneWall, + ChiseledNetherBricks, + CrackedNetherBricks, + QuartzBricks, + Candle, + WhiteCandle, + OrangeCandle, + MagentaCandle, + LightBlueCandle, + YellowCandle, + LimeCandle, + PinkCandle, + GrayCandle, + LightGrayCandle, + CyanCandle, + PurpleCandle, + BlueCandle, + BrownCandle, + GreenCandle, + RedCandle, + BlackCandle, + CandleCake, + WhiteCandleCake, + OrangeCandleCake, + MagentaCandleCake, + LightBlueCandleCake, + YellowCandleCake, + LimeCandleCake, + PinkCandleCake, + GrayCandleCake, + LightGrayCandleCake, + CyanCandleCake, + PurpleCandleCake, + BlueCandleCake, + BrownCandleCake, + GreenCandleCake, + RedCandleCake, + BlackCandleCake, + AmethystBlock, + BuddingAmethyst, + AmethystCluster, + LargeAmethystBud, + MediumAmethystBud, + SmallAmethystBud, + Tuff, + Calcite, + TintedGlass, + PowderSnow, + SculkSensor, + OxidizedCopper, + WeatheredCopper, + ExposedCopper, + CopperBlock, + CopperOre, + DeepslateCopperOre, + OxidizedCutCopper, + WeatheredCutCopper, + ExposedCutCopper, + CutCopper, + OxidizedCutCopperStairs, + WeatheredCutCopperStairs, + ExposedCutCopperStairs, + CutCopperStairs, + OxidizedCutCopperSlab, + WeatheredCutCopperSlab, + ExposedCutCopperSlab, + CutCopperSlab, + WaxedCopperBlock, + WaxedWeatheredCopper, + WaxedExposedCopper, + WaxedOxidizedCopper, + WaxedOxidizedCutCopper, + WaxedWeatheredCutCopper, + WaxedExposedCutCopper, + WaxedCutCopper, + WaxedOxidizedCutCopperStairs, + WaxedWeatheredCutCopperStairs, + WaxedExposedCutCopperStairs, + WaxedCutCopperStairs, + WaxedOxidizedCutCopperSlab, + WaxedWeatheredCutCopperSlab, + WaxedExposedCutCopperSlab, + WaxedCutCopperSlab, + LightningRod, + PointedDripstone, + DripstoneBlock, + CaveVines, + CaveVinesPlant, + SporeBlossom, + Azalea, + FloweringAzalea, + MossCarpet, + MossBlock, + BigDripleaf, + BigDripleafStem, + SmallDripleaf, + HangingRoots, + RootedDirt, + Deepslate, + CobbledDeepslate, + CobbledDeepslateStairs, + CobbledDeepslateSlab, + CobbledDeepslateWall, + PolishedDeepslate, + PolishedDeepslateStairs, + PolishedDeepslateSlab, + PolishedDeepslateWall, + DeepslateTiles, + DeepslateTileStairs, + DeepslateTileSlab, + DeepslateTileWall, + DeepslateBricks, + DeepslateBrickStairs, + DeepslateBrickSlab, + DeepslateBrickWall, + ChiseledDeepslate, + CrackedDeepslateBricks, + CrackedDeepslateTiles, + InfestedDeepslate, + SmoothBasalt, + RawIronBlock, + RawCopperBlock, + RawGoldBlock, + PottedAzaleaBush, + PottedFloweringAzaleaBush, + ] + } } - -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `id` property of this `BlockKind`. + #[doc = "Returns the `id` property of this `BlockKind`."] + #[inline] pub fn id(&self) -> u32 { match self { - BlockKind::Air => 0, - BlockKind::Stone => 1, - BlockKind::Granite => 2, - BlockKind::PolishedGranite => 3, - BlockKind::Diorite => 4, - BlockKind::PolishedDiorite => 5, - BlockKind::Andesite => 6, - BlockKind::PolishedAndesite => 7, - BlockKind::GrassBlock => 8, - BlockKind::Dirt => 9, - BlockKind::CoarseDirt => 10, - BlockKind::Podzol => 11, - BlockKind::Cobblestone => 12, - BlockKind::OakPlanks => 13, - BlockKind::SprucePlanks => 14, - BlockKind::BirchPlanks => 15, - BlockKind::JunglePlanks => 16, - BlockKind::AcaciaPlanks => 17, - BlockKind::DarkOakPlanks => 18, - BlockKind::OakSapling => 19, - BlockKind::SpruceSapling => 20, - BlockKind::BirchSapling => 21, - BlockKind::JungleSapling => 22, - BlockKind::AcaciaSapling => 23, - BlockKind::DarkOakSapling => 24, - BlockKind::Bedrock => 25, - BlockKind::Water => 26, - BlockKind::Lava => 27, - BlockKind::Sand => 28, - BlockKind::RedSand => 29, - BlockKind::Gravel => 30, - BlockKind::GoldOre => 31, - BlockKind::IronOre => 32, - BlockKind::CoalOre => 33, - BlockKind::NetherGoldOre => 34, - BlockKind::OakLog => 35, - BlockKind::SpruceLog => 36, - BlockKind::BirchLog => 37, - BlockKind::JungleLog => 38, - BlockKind::AcaciaLog => 39, - BlockKind::DarkOakLog => 40, - BlockKind::StrippedSpruceLog => 41, - BlockKind::StrippedBirchLog => 42, - BlockKind::StrippedJungleLog => 43, - BlockKind::StrippedAcaciaLog => 44, - BlockKind::StrippedDarkOakLog => 45, - BlockKind::StrippedOakLog => 46, - BlockKind::OakWood => 47, - BlockKind::SpruceWood => 48, - BlockKind::BirchWood => 49, - BlockKind::JungleWood => 50, - BlockKind::AcaciaWood => 51, - BlockKind::DarkOakWood => 52, - BlockKind::StrippedOakWood => 53, - BlockKind::StrippedSpruceWood => 54, - BlockKind::StrippedBirchWood => 55, - BlockKind::StrippedJungleWood => 56, - BlockKind::StrippedAcaciaWood => 57, - BlockKind::StrippedDarkOakWood => 58, - BlockKind::OakLeaves => 59, - BlockKind::SpruceLeaves => 60, - BlockKind::BirchLeaves => 61, - BlockKind::JungleLeaves => 62, - BlockKind::AcaciaLeaves => 63, - BlockKind::DarkOakLeaves => 64, - BlockKind::Sponge => 65, - BlockKind::WetSponge => 66, - BlockKind::Glass => 67, - BlockKind::LapisOre => 68, - BlockKind::LapisBlock => 69, - BlockKind::Dispenser => 70, - BlockKind::Sandstone => 71, - BlockKind::ChiseledSandstone => 72, - BlockKind::CutSandstone => 73, - BlockKind::NoteBlock => 74, - BlockKind::WhiteBed => 75, - BlockKind::OrangeBed => 76, - BlockKind::MagentaBed => 77, - BlockKind::LightBlueBed => 78, - BlockKind::YellowBed => 79, - BlockKind::LimeBed => 80, - BlockKind::PinkBed => 81, - BlockKind::GrayBed => 82, - BlockKind::LightGrayBed => 83, - BlockKind::CyanBed => 84, - BlockKind::PurpleBed => 85, - BlockKind::BlueBed => 86, - BlockKind::BrownBed => 87, - BlockKind::GreenBed => 88, - BlockKind::RedBed => 89, - BlockKind::BlackBed => 90, - BlockKind::PoweredRail => 91, - BlockKind::DetectorRail => 92, - BlockKind::StickyPiston => 93, - BlockKind::Cobweb => 94, - BlockKind::Grass => 95, - BlockKind::Fern => 96, - BlockKind::DeadBush => 97, - BlockKind::Seagrass => 98, - BlockKind::TallSeagrass => 99, - BlockKind::Piston => 100, - BlockKind::PistonHead => 101, - BlockKind::WhiteWool => 102, - BlockKind::OrangeWool => 103, - BlockKind::MagentaWool => 104, - BlockKind::LightBlueWool => 105, - BlockKind::YellowWool => 106, - BlockKind::LimeWool => 107, - BlockKind::PinkWool => 108, - BlockKind::GrayWool => 109, - BlockKind::LightGrayWool => 110, - BlockKind::CyanWool => 111, - BlockKind::PurpleWool => 112, - BlockKind::BlueWool => 113, - BlockKind::BrownWool => 114, - BlockKind::GreenWool => 115, - BlockKind::RedWool => 116, - BlockKind::BlackWool => 117, - BlockKind::MovingPiston => 118, - BlockKind::Dandelion => 119, - BlockKind::Poppy => 120, - BlockKind::BlueOrchid => 121, - BlockKind::Allium => 122, - BlockKind::AzureBluet => 123, - BlockKind::RedTulip => 124, - BlockKind::OrangeTulip => 125, - BlockKind::WhiteTulip => 126, - BlockKind::PinkTulip => 127, - BlockKind::OxeyeDaisy => 128, - BlockKind::Cornflower => 129, - BlockKind::WitherRose => 130, - BlockKind::LilyOfTheValley => 131, - BlockKind::BrownMushroom => 132, - BlockKind::RedMushroom => 133, - BlockKind::GoldBlock => 134, - BlockKind::IronBlock => 135, - BlockKind::Bricks => 136, - BlockKind::Tnt => 137, - BlockKind::Bookshelf => 138, - BlockKind::MossyCobblestone => 139, - BlockKind::Obsidian => 140, - BlockKind::Torch => 141, - BlockKind::WallTorch => 142, - BlockKind::Fire => 143, - BlockKind::SoulFire => 144, - BlockKind::Spawner => 145, - BlockKind::OakStairs => 146, - BlockKind::Chest => 147, - BlockKind::RedstoneWire => 148, - BlockKind::DiamondOre => 149, - BlockKind::DiamondBlock => 150, - BlockKind::CraftingTable => 151, - BlockKind::Wheat => 152, - BlockKind::Farmland => 153, - BlockKind::Furnace => 154, - BlockKind::OakSign => 155, - BlockKind::SpruceSign => 156, - BlockKind::BirchSign => 157, - BlockKind::AcaciaSign => 158, - BlockKind::JungleSign => 159, - BlockKind::DarkOakSign => 160, - BlockKind::OakDoor => 161, - BlockKind::Ladder => 162, - BlockKind::Rail => 163, - BlockKind::CobblestoneStairs => 164, - BlockKind::OakWallSign => 165, - BlockKind::SpruceWallSign => 166, - BlockKind::BirchWallSign => 167, - BlockKind::AcaciaWallSign => 168, - BlockKind::JungleWallSign => 169, - BlockKind::DarkOakWallSign => 170, - BlockKind::Lever => 171, - BlockKind::StonePressurePlate => 172, - BlockKind::IronDoor => 173, - BlockKind::OakPressurePlate => 174, - BlockKind::SprucePressurePlate => 175, - BlockKind::BirchPressurePlate => 176, - BlockKind::JunglePressurePlate => 177, - BlockKind::AcaciaPressurePlate => 178, - BlockKind::DarkOakPressurePlate => 179, - BlockKind::RedstoneOre => 180, - BlockKind::RedstoneTorch => 181, - BlockKind::RedstoneWallTorch => 182, - BlockKind::StoneButton => 183, - BlockKind::Snow => 184, - BlockKind::Ice => 185, - BlockKind::SnowBlock => 186, - BlockKind::Cactus => 187, - BlockKind::Clay => 188, - BlockKind::SugarCane => 189, - BlockKind::Jukebox => 190, - BlockKind::OakFence => 191, - BlockKind::Pumpkin => 192, - BlockKind::Netherrack => 193, - BlockKind::SoulSand => 194, - BlockKind::SoulSoil => 195, - BlockKind::Basalt => 196, - BlockKind::PolishedBasalt => 197, - BlockKind::SoulTorch => 198, - BlockKind::SoulWallTorch => 199, - BlockKind::Glowstone => 200, - BlockKind::NetherPortal => 201, - BlockKind::CarvedPumpkin => 202, - BlockKind::JackOLantern => 203, - BlockKind::Cake => 204, - BlockKind::Repeater => 205, - BlockKind::WhiteStainedGlass => 206, - BlockKind::OrangeStainedGlass => 207, - BlockKind::MagentaStainedGlass => 208, - BlockKind::LightBlueStainedGlass => 209, - BlockKind::YellowStainedGlass => 210, - BlockKind::LimeStainedGlass => 211, - BlockKind::PinkStainedGlass => 212, - BlockKind::GrayStainedGlass => 213, - BlockKind::LightGrayStainedGlass => 214, - BlockKind::CyanStainedGlass => 215, - BlockKind::PurpleStainedGlass => 216, - BlockKind::BlueStainedGlass => 217, - BlockKind::BrownStainedGlass => 218, - BlockKind::GreenStainedGlass => 219, - BlockKind::RedStainedGlass => 220, - BlockKind::BlackStainedGlass => 221, - BlockKind::OakTrapdoor => 222, - BlockKind::SpruceTrapdoor => 223, - BlockKind::BirchTrapdoor => 224, - BlockKind::JungleTrapdoor => 225, - BlockKind::AcaciaTrapdoor => 226, - BlockKind::DarkOakTrapdoor => 227, - BlockKind::StoneBricks => 228, - BlockKind::MossyStoneBricks => 229, - BlockKind::CrackedStoneBricks => 230, - BlockKind::ChiseledStoneBricks => 231, - BlockKind::InfestedStone => 232, - BlockKind::InfestedCobblestone => 233, - BlockKind::InfestedStoneBricks => 234, - BlockKind::InfestedMossyStoneBricks => 235, - BlockKind::InfestedCrackedStoneBricks => 236, - BlockKind::InfestedChiseledStoneBricks => 237, - BlockKind::BrownMushroomBlock => 238, - BlockKind::RedMushroomBlock => 239, - BlockKind::MushroomStem => 240, - BlockKind::IronBars => 241, - BlockKind::Chain => 242, - BlockKind::GlassPane => 243, - BlockKind::Melon => 244, - BlockKind::AttachedPumpkinStem => 245, - BlockKind::AttachedMelonStem => 246, - BlockKind::PumpkinStem => 247, - BlockKind::MelonStem => 248, - BlockKind::Vine => 249, - BlockKind::OakFenceGate => 250, - BlockKind::BrickStairs => 251, - BlockKind::StoneBrickStairs => 252, - BlockKind::Mycelium => 253, - BlockKind::LilyPad => 254, - BlockKind::NetherBricks => 255, - BlockKind::NetherBrickFence => 256, - BlockKind::NetherBrickStairs => 257, - BlockKind::NetherWart => 258, - BlockKind::EnchantingTable => 259, - BlockKind::BrewingStand => 260, - BlockKind::Cauldron => 261, - BlockKind::EndPortal => 262, - BlockKind::EndPortalFrame => 263, - BlockKind::EndStone => 264, - BlockKind::DragonEgg => 265, - BlockKind::RedstoneLamp => 266, - BlockKind::Cocoa => 267, - BlockKind::SandstoneStairs => 268, - BlockKind::EmeraldOre => 269, - BlockKind::EnderChest => 270, - BlockKind::TripwireHook => 271, - BlockKind::Tripwire => 272, - BlockKind::EmeraldBlock => 273, - BlockKind::SpruceStairs => 274, - BlockKind::BirchStairs => 275, - BlockKind::JungleStairs => 276, - BlockKind::CommandBlock => 277, - BlockKind::Beacon => 278, - BlockKind::CobblestoneWall => 279, - BlockKind::MossyCobblestoneWall => 280, - BlockKind::FlowerPot => 281, - BlockKind::PottedOakSapling => 282, - BlockKind::PottedSpruceSapling => 283, - BlockKind::PottedBirchSapling => 284, - BlockKind::PottedJungleSapling => 285, - BlockKind::PottedAcaciaSapling => 286, - BlockKind::PottedDarkOakSapling => 287, - BlockKind::PottedFern => 288, - BlockKind::PottedDandelion => 289, - BlockKind::PottedPoppy => 290, - BlockKind::PottedBlueOrchid => 291, - BlockKind::PottedAllium => 292, - BlockKind::PottedAzureBluet => 293, - BlockKind::PottedRedTulip => 294, - BlockKind::PottedOrangeTulip => 295, - BlockKind::PottedWhiteTulip => 296, - BlockKind::PottedPinkTulip => 297, - BlockKind::PottedOxeyeDaisy => 298, - BlockKind::PottedCornflower => 299, - BlockKind::PottedLilyOfTheValley => 300, - BlockKind::PottedWitherRose => 301, - BlockKind::PottedRedMushroom => 302, - BlockKind::PottedBrownMushroom => 303, - BlockKind::PottedDeadBush => 304, - BlockKind::PottedCactus => 305, - BlockKind::Carrots => 306, - BlockKind::Potatoes => 307, - BlockKind::OakButton => 308, - BlockKind::SpruceButton => 309, - BlockKind::BirchButton => 310, - BlockKind::JungleButton => 311, - BlockKind::AcaciaButton => 312, - BlockKind::DarkOakButton => 313, - BlockKind::SkeletonSkull => 314, - BlockKind::SkeletonWallSkull => 315, - BlockKind::WitherSkeletonSkull => 316, - BlockKind::WitherSkeletonWallSkull => 317, - BlockKind::ZombieHead => 318, - BlockKind::ZombieWallHead => 319, - BlockKind::PlayerHead => 320, - BlockKind::PlayerWallHead => 321, - BlockKind::CreeperHead => 322, - BlockKind::CreeperWallHead => 323, - BlockKind::DragonHead => 324, - BlockKind::DragonWallHead => 325, - BlockKind::Anvil => 326, - BlockKind::ChippedAnvil => 327, - BlockKind::DamagedAnvil => 328, - BlockKind::TrappedChest => 329, - BlockKind::LightWeightedPressurePlate => 330, - BlockKind::HeavyWeightedPressurePlate => 331, - BlockKind::Comparator => 332, - BlockKind::DaylightDetector => 333, - BlockKind::RedstoneBlock => 334, - BlockKind::NetherQuartzOre => 335, - BlockKind::Hopper => 336, - BlockKind::QuartzBlock => 337, - BlockKind::ChiseledQuartzBlock => 338, - BlockKind::QuartzPillar => 339, - BlockKind::QuartzStairs => 340, - BlockKind::ActivatorRail => 341, - BlockKind::Dropper => 342, - BlockKind::WhiteTerracotta => 343, - BlockKind::OrangeTerracotta => 344, - BlockKind::MagentaTerracotta => 345, - BlockKind::LightBlueTerracotta => 346, - BlockKind::YellowTerracotta => 347, - BlockKind::LimeTerracotta => 348, - BlockKind::PinkTerracotta => 349, - BlockKind::GrayTerracotta => 350, - BlockKind::LightGrayTerracotta => 351, - BlockKind::CyanTerracotta => 352, - BlockKind::PurpleTerracotta => 353, - BlockKind::BlueTerracotta => 354, - BlockKind::BrownTerracotta => 355, - BlockKind::GreenTerracotta => 356, - BlockKind::RedTerracotta => 357, - BlockKind::BlackTerracotta => 358, - BlockKind::WhiteStainedGlassPane => 359, - BlockKind::OrangeStainedGlassPane => 360, - BlockKind::MagentaStainedGlassPane => 361, - BlockKind::LightBlueStainedGlassPane => 362, - BlockKind::YellowStainedGlassPane => 363, - BlockKind::LimeStainedGlassPane => 364, - BlockKind::PinkStainedGlassPane => 365, - BlockKind::GrayStainedGlassPane => 366, - BlockKind::LightGrayStainedGlassPane => 367, - BlockKind::CyanStainedGlassPane => 368, - BlockKind::PurpleStainedGlassPane => 369, - BlockKind::BlueStainedGlassPane => 370, - BlockKind::BrownStainedGlassPane => 371, - BlockKind::GreenStainedGlassPane => 372, - BlockKind::RedStainedGlassPane => 373, - BlockKind::BlackStainedGlassPane => 374, - BlockKind::AcaciaStairs => 375, - BlockKind::DarkOakStairs => 376, - BlockKind::SlimeBlock => 377, - BlockKind::Barrier => 378, - BlockKind::IronTrapdoor => 379, - BlockKind::Prismarine => 380, - BlockKind::PrismarineBricks => 381, - BlockKind::DarkPrismarine => 382, - BlockKind::PrismarineStairs => 383, - BlockKind::PrismarineBrickStairs => 384, - BlockKind::DarkPrismarineStairs => 385, - BlockKind::PrismarineSlab => 386, - BlockKind::PrismarineBrickSlab => 387, - BlockKind::DarkPrismarineSlab => 388, - BlockKind::SeaLantern => 389, - BlockKind::HayBlock => 390, - BlockKind::WhiteCarpet => 391, - BlockKind::OrangeCarpet => 392, - BlockKind::MagentaCarpet => 393, - BlockKind::LightBlueCarpet => 394, - BlockKind::YellowCarpet => 395, - BlockKind::LimeCarpet => 396, - BlockKind::PinkCarpet => 397, - BlockKind::GrayCarpet => 398, - BlockKind::LightGrayCarpet => 399, - BlockKind::CyanCarpet => 400, - BlockKind::PurpleCarpet => 401, - BlockKind::BlueCarpet => 402, - BlockKind::BrownCarpet => 403, - BlockKind::GreenCarpet => 404, - BlockKind::RedCarpet => 405, - BlockKind::BlackCarpet => 406, - BlockKind::Terracotta => 407, - BlockKind::CoalBlock => 408, - BlockKind::PackedIce => 409, - BlockKind::Sunflower => 410, - BlockKind::Lilac => 411, - BlockKind::RoseBush => 412, - BlockKind::Peony => 413, - BlockKind::TallGrass => 414, - BlockKind::LargeFern => 415, - BlockKind::WhiteBanner => 416, - BlockKind::OrangeBanner => 417, - BlockKind::MagentaBanner => 418, - BlockKind::LightBlueBanner => 419, - BlockKind::YellowBanner => 420, - BlockKind::LimeBanner => 421, - BlockKind::PinkBanner => 422, - BlockKind::GrayBanner => 423, - BlockKind::LightGrayBanner => 424, - BlockKind::CyanBanner => 425, - BlockKind::PurpleBanner => 426, - BlockKind::BlueBanner => 427, - BlockKind::BrownBanner => 428, - BlockKind::GreenBanner => 429, - BlockKind::RedBanner => 430, - BlockKind::BlackBanner => 431, - BlockKind::WhiteWallBanner => 432, - BlockKind::OrangeWallBanner => 433, - BlockKind::MagentaWallBanner => 434, - BlockKind::LightBlueWallBanner => 435, - BlockKind::YellowWallBanner => 436, - BlockKind::LimeWallBanner => 437, - BlockKind::PinkWallBanner => 438, - BlockKind::GrayWallBanner => 439, - BlockKind::LightGrayWallBanner => 440, - BlockKind::CyanWallBanner => 441, - BlockKind::PurpleWallBanner => 442, - BlockKind::BlueWallBanner => 443, - BlockKind::BrownWallBanner => 444, - BlockKind::GreenWallBanner => 445, - BlockKind::RedWallBanner => 446, - BlockKind::BlackWallBanner => 447, - BlockKind::RedSandstone => 448, - BlockKind::ChiseledRedSandstone => 449, - BlockKind::CutRedSandstone => 450, - BlockKind::RedSandstoneStairs => 451, - BlockKind::OakSlab => 452, - BlockKind::SpruceSlab => 453, - BlockKind::BirchSlab => 454, - BlockKind::JungleSlab => 455, - BlockKind::AcaciaSlab => 456, - BlockKind::DarkOakSlab => 457, - BlockKind::StoneSlab => 458, - BlockKind::SmoothStoneSlab => 459, - BlockKind::SandstoneSlab => 460, - BlockKind::CutSandstoneSlab => 461, - BlockKind::PetrifiedOakSlab => 462, - BlockKind::CobblestoneSlab => 463, - BlockKind::BrickSlab => 464, - BlockKind::StoneBrickSlab => 465, - BlockKind::NetherBrickSlab => 466, - BlockKind::QuartzSlab => 467, - BlockKind::RedSandstoneSlab => 468, - BlockKind::CutRedSandstoneSlab => 469, - BlockKind::PurpurSlab => 470, - BlockKind::SmoothStone => 471, - BlockKind::SmoothSandstone => 472, - BlockKind::SmoothQuartz => 473, - BlockKind::SmoothRedSandstone => 474, - BlockKind::SpruceFenceGate => 475, - BlockKind::BirchFenceGate => 476, - BlockKind::JungleFenceGate => 477, - BlockKind::AcaciaFenceGate => 478, - BlockKind::DarkOakFenceGate => 479, - BlockKind::SpruceFence => 480, - BlockKind::BirchFence => 481, - BlockKind::JungleFence => 482, - BlockKind::AcaciaFence => 483, - BlockKind::DarkOakFence => 484, - BlockKind::SpruceDoor => 485, - BlockKind::BirchDoor => 486, - BlockKind::JungleDoor => 487, - BlockKind::AcaciaDoor => 488, - BlockKind::DarkOakDoor => 489, - BlockKind::EndRod => 490, - BlockKind::ChorusPlant => 491, - BlockKind::ChorusFlower => 492, - BlockKind::PurpurBlock => 493, - BlockKind::PurpurPillar => 494, - BlockKind::PurpurStairs => 495, - BlockKind::EndStoneBricks => 496, - BlockKind::Beetroots => 497, - BlockKind::GrassPath => 498, - BlockKind::EndGateway => 499, - BlockKind::RepeatingCommandBlock => 500, - BlockKind::ChainCommandBlock => 501, - BlockKind::FrostedIce => 502, - BlockKind::MagmaBlock => 503, - BlockKind::NetherWartBlock => 504, - BlockKind::RedNetherBricks => 505, - BlockKind::BoneBlock => 506, - BlockKind::StructureVoid => 507, - BlockKind::Observer => 508, - BlockKind::ShulkerBox => 509, - BlockKind::WhiteShulkerBox => 510, - BlockKind::OrangeShulkerBox => 511, - BlockKind::MagentaShulkerBox => 512, - BlockKind::LightBlueShulkerBox => 513, - BlockKind::YellowShulkerBox => 514, - BlockKind::LimeShulkerBox => 515, - BlockKind::PinkShulkerBox => 516, - BlockKind::GrayShulkerBox => 517, - BlockKind::LightGrayShulkerBox => 518, - BlockKind::CyanShulkerBox => 519, - BlockKind::PurpleShulkerBox => 520, - BlockKind::BlueShulkerBox => 521, - BlockKind::BrownShulkerBox => 522, - BlockKind::GreenShulkerBox => 523, - BlockKind::RedShulkerBox => 524, - BlockKind::BlackShulkerBox => 525, - BlockKind::WhiteGlazedTerracotta => 526, - BlockKind::OrangeGlazedTerracotta => 527, - BlockKind::MagentaGlazedTerracotta => 528, - BlockKind::LightBlueGlazedTerracotta => 529, - BlockKind::YellowGlazedTerracotta => 530, - BlockKind::LimeGlazedTerracotta => 531, - BlockKind::PinkGlazedTerracotta => 532, - BlockKind::GrayGlazedTerracotta => 533, - BlockKind::LightGrayGlazedTerracotta => 534, - BlockKind::CyanGlazedTerracotta => 535, - BlockKind::PurpleGlazedTerracotta => 536, - BlockKind::BlueGlazedTerracotta => 537, - BlockKind::BrownGlazedTerracotta => 538, - BlockKind::GreenGlazedTerracotta => 539, - BlockKind::RedGlazedTerracotta => 540, - BlockKind::BlackGlazedTerracotta => 541, - BlockKind::WhiteConcrete => 542, - BlockKind::OrangeConcrete => 543, - BlockKind::MagentaConcrete => 544, - BlockKind::LightBlueConcrete => 545, - BlockKind::YellowConcrete => 546, - BlockKind::LimeConcrete => 547, - BlockKind::PinkConcrete => 548, - BlockKind::GrayConcrete => 549, - BlockKind::LightGrayConcrete => 550, - BlockKind::CyanConcrete => 551, - BlockKind::PurpleConcrete => 552, - BlockKind::BlueConcrete => 553, - BlockKind::BrownConcrete => 554, - BlockKind::GreenConcrete => 555, - BlockKind::RedConcrete => 556, - BlockKind::BlackConcrete => 557, - BlockKind::WhiteConcretePowder => 558, - BlockKind::OrangeConcretePowder => 559, - BlockKind::MagentaConcretePowder => 560, - BlockKind::LightBlueConcretePowder => 561, - BlockKind::YellowConcretePowder => 562, - BlockKind::LimeConcretePowder => 563, - BlockKind::PinkConcretePowder => 564, - BlockKind::GrayConcretePowder => 565, - BlockKind::LightGrayConcretePowder => 566, - BlockKind::CyanConcretePowder => 567, - BlockKind::PurpleConcretePowder => 568, - BlockKind::BlueConcretePowder => 569, - BlockKind::BrownConcretePowder => 570, - BlockKind::GreenConcretePowder => 571, - BlockKind::RedConcretePowder => 572, - BlockKind::BlackConcretePowder => 573, - BlockKind::Kelp => 574, - BlockKind::KelpPlant => 575, - BlockKind::DriedKelpBlock => 576, - BlockKind::TurtleEgg => 577, - BlockKind::DeadTubeCoralBlock => 578, - BlockKind::DeadBrainCoralBlock => 579, - BlockKind::DeadBubbleCoralBlock => 580, - BlockKind::DeadFireCoralBlock => 581, - BlockKind::DeadHornCoralBlock => 582, - BlockKind::TubeCoralBlock => 583, - BlockKind::BrainCoralBlock => 584, - BlockKind::BubbleCoralBlock => 585, - BlockKind::FireCoralBlock => 586, - BlockKind::HornCoralBlock => 587, - BlockKind::DeadTubeCoral => 588, - BlockKind::DeadBrainCoral => 589, - BlockKind::DeadBubbleCoral => 590, - BlockKind::DeadFireCoral => 591, - BlockKind::DeadHornCoral => 592, - BlockKind::TubeCoral => 593, - BlockKind::BrainCoral => 594, - BlockKind::BubbleCoral => 595, - BlockKind::FireCoral => 596, - BlockKind::HornCoral => 597, - BlockKind::DeadTubeCoralFan => 598, - BlockKind::DeadBrainCoralFan => 599, - BlockKind::DeadBubbleCoralFan => 600, - BlockKind::DeadFireCoralFan => 601, - BlockKind::DeadHornCoralFan => 602, - BlockKind::TubeCoralFan => 603, - BlockKind::BrainCoralFan => 604, - BlockKind::BubbleCoralFan => 605, - BlockKind::FireCoralFan => 606, - BlockKind::HornCoralFan => 607, - BlockKind::DeadTubeCoralWallFan => 608, - BlockKind::DeadBrainCoralWallFan => 609, - BlockKind::DeadBubbleCoralWallFan => 610, - BlockKind::DeadFireCoralWallFan => 611, - BlockKind::DeadHornCoralWallFan => 612, - BlockKind::TubeCoralWallFan => 613, - BlockKind::BrainCoralWallFan => 614, - BlockKind::BubbleCoralWallFan => 615, - BlockKind::FireCoralWallFan => 616, - BlockKind::HornCoralWallFan => 617, - BlockKind::SeaPickle => 618, - BlockKind::BlueIce => 619, - BlockKind::Conduit => 620, - BlockKind::BambooSapling => 621, - BlockKind::Bamboo => 622, - BlockKind::PottedBamboo => 623, - BlockKind::VoidAir => 624, - BlockKind::CaveAir => 625, - BlockKind::BubbleColumn => 626, - BlockKind::PolishedGraniteStairs => 627, - BlockKind::SmoothRedSandstoneStairs => 628, - BlockKind::MossyStoneBrickStairs => 629, - BlockKind::PolishedDioriteStairs => 630, - BlockKind::MossyCobblestoneStairs => 631, - BlockKind::EndStoneBrickStairs => 632, - BlockKind::StoneStairs => 633, - BlockKind::SmoothSandstoneStairs => 634, - BlockKind::SmoothQuartzStairs => 635, - BlockKind::GraniteStairs => 636, - BlockKind::AndesiteStairs => 637, - BlockKind::RedNetherBrickStairs => 638, - BlockKind::PolishedAndesiteStairs => 639, - BlockKind::DioriteStairs => 640, - BlockKind::PolishedGraniteSlab => 641, - BlockKind::SmoothRedSandstoneSlab => 642, - BlockKind::MossyStoneBrickSlab => 643, - BlockKind::PolishedDioriteSlab => 644, - BlockKind::MossyCobblestoneSlab => 645, - BlockKind::EndStoneBrickSlab => 646, - BlockKind::SmoothSandstoneSlab => 647, - BlockKind::SmoothQuartzSlab => 648, - BlockKind::GraniteSlab => 649, - BlockKind::AndesiteSlab => 650, - BlockKind::RedNetherBrickSlab => 651, - BlockKind::PolishedAndesiteSlab => 652, - BlockKind::DioriteSlab => 653, - BlockKind::BrickWall => 654, - BlockKind::PrismarineWall => 655, - BlockKind::RedSandstoneWall => 656, - BlockKind::MossyStoneBrickWall => 657, - BlockKind::GraniteWall => 658, - BlockKind::StoneBrickWall => 659, - BlockKind::NetherBrickWall => 660, - BlockKind::AndesiteWall => 661, - BlockKind::RedNetherBrickWall => 662, - BlockKind::SandstoneWall => 663, - BlockKind::EndStoneBrickWall => 664, - BlockKind::DioriteWall => 665, - BlockKind::Scaffolding => 666, - BlockKind::Loom => 667, - BlockKind::Barrel => 668, - BlockKind::Smoker => 669, - BlockKind::BlastFurnace => 670, - BlockKind::CartographyTable => 671, - BlockKind::FletchingTable => 672, - BlockKind::Grindstone => 673, - BlockKind::Lectern => 674, - BlockKind::SmithingTable => 675, - BlockKind::Stonecutter => 676, - BlockKind::Bell => 677, - BlockKind::Lantern => 678, - BlockKind::SoulLantern => 679, - BlockKind::Campfire => 680, - BlockKind::SoulCampfire => 681, - BlockKind::SweetBerryBush => 682, - BlockKind::WarpedStem => 683, - BlockKind::StrippedWarpedStem => 684, - BlockKind::WarpedHyphae => 685, - BlockKind::StrippedWarpedHyphae => 686, - BlockKind::WarpedNylium => 687, - BlockKind::WarpedFungus => 688, - BlockKind::WarpedWartBlock => 689, - BlockKind::WarpedRoots => 690, - BlockKind::NetherSprouts => 691, - BlockKind::CrimsonStem => 692, - BlockKind::StrippedCrimsonStem => 693, - BlockKind::CrimsonHyphae => 694, - BlockKind::StrippedCrimsonHyphae => 695, - BlockKind::CrimsonNylium => 696, - BlockKind::CrimsonFungus => 697, - BlockKind::Shroomlight => 698, - BlockKind::WeepingVines => 699, - BlockKind::WeepingVinesPlant => 700, - BlockKind::TwistingVines => 701, - BlockKind::TwistingVinesPlant => 702, - BlockKind::CrimsonRoots => 703, - BlockKind::CrimsonPlanks => 704, - BlockKind::WarpedPlanks => 705, - BlockKind::CrimsonSlab => 706, - BlockKind::WarpedSlab => 707, - BlockKind::CrimsonPressurePlate => 708, - BlockKind::WarpedPressurePlate => 709, - BlockKind::CrimsonFence => 710, - BlockKind::WarpedFence => 711, - BlockKind::CrimsonTrapdoor => 712, - BlockKind::WarpedTrapdoor => 713, - BlockKind::CrimsonFenceGate => 714, - BlockKind::WarpedFenceGate => 715, - BlockKind::CrimsonStairs => 716, - BlockKind::WarpedStairs => 717, - BlockKind::CrimsonButton => 718, - BlockKind::WarpedButton => 719, - BlockKind::CrimsonDoor => 720, - BlockKind::WarpedDoor => 721, - BlockKind::CrimsonSign => 722, - BlockKind::WarpedSign => 723, - BlockKind::CrimsonWallSign => 724, - BlockKind::WarpedWallSign => 725, - BlockKind::StructureBlock => 726, - BlockKind::Jigsaw => 727, - BlockKind::Composter => 728, - BlockKind::Target => 729, - BlockKind::BeeNest => 730, - BlockKind::Beehive => 731, - BlockKind::HoneyBlock => 732, - BlockKind::HoneycombBlock => 733, - BlockKind::NetheriteBlock => 734, - BlockKind::AncientDebris => 735, - BlockKind::CryingObsidian => 736, - BlockKind::RespawnAnchor => 737, - BlockKind::PottedCrimsonFungus => 738, - BlockKind::PottedWarpedFungus => 739, - BlockKind::PottedCrimsonRoots => 740, - BlockKind::PottedWarpedRoots => 741, - BlockKind::Lodestone => 742, - BlockKind::Blackstone => 743, - BlockKind::BlackstoneStairs => 744, - BlockKind::BlackstoneWall => 745, - BlockKind::BlackstoneSlab => 746, - BlockKind::PolishedBlackstone => 747, - BlockKind::PolishedBlackstoneBricks => 748, - BlockKind::CrackedPolishedBlackstoneBricks => 749, - BlockKind::ChiseledPolishedBlackstone => 750, - BlockKind::PolishedBlackstoneBrickSlab => 751, - BlockKind::PolishedBlackstoneBrickStairs => 752, - BlockKind::PolishedBlackstoneBrickWall => 753, - BlockKind::GildedBlackstone => 754, - BlockKind::PolishedBlackstoneStairs => 755, - BlockKind::PolishedBlackstoneSlab => 756, - BlockKind::PolishedBlackstonePressurePlate => 757, - BlockKind::PolishedBlackstoneButton => 758, - BlockKind::PolishedBlackstoneWall => 759, - BlockKind::ChiseledNetherBricks => 760, - BlockKind::CrackedNetherBricks => 761, - BlockKind::QuartzBricks => 762, + BlockKind::Air => 0u32, + BlockKind::Stone => 1u32, + BlockKind::Granite => 2u32, + BlockKind::PolishedGranite => 3u32, + BlockKind::Diorite => 4u32, + BlockKind::PolishedDiorite => 5u32, + BlockKind::Andesite => 6u32, + BlockKind::PolishedAndesite => 7u32, + BlockKind::GrassBlock => 8u32, + BlockKind::Dirt => 9u32, + BlockKind::CoarseDirt => 10u32, + BlockKind::Podzol => 11u32, + BlockKind::Cobblestone => 12u32, + BlockKind::OakPlanks => 13u32, + BlockKind::SprucePlanks => 14u32, + BlockKind::BirchPlanks => 15u32, + BlockKind::JunglePlanks => 16u32, + BlockKind::AcaciaPlanks => 17u32, + BlockKind::DarkOakPlanks => 18u32, + BlockKind::OakSapling => 19u32, + BlockKind::SpruceSapling => 20u32, + BlockKind::BirchSapling => 21u32, + BlockKind::JungleSapling => 22u32, + BlockKind::AcaciaSapling => 23u32, + BlockKind::DarkOakSapling => 24u32, + BlockKind::Bedrock => 25u32, + BlockKind::Water => 26u32, + BlockKind::Lava => 27u32, + BlockKind::Sand => 28u32, + BlockKind::RedSand => 29u32, + BlockKind::Gravel => 30u32, + BlockKind::GoldOre => 31u32, + BlockKind::DeepslateGoldOre => 32u32, + BlockKind::IronOre => 33u32, + BlockKind::DeepslateIronOre => 34u32, + BlockKind::CoalOre => 35u32, + BlockKind::DeepslateCoalOre => 36u32, + BlockKind::NetherGoldOre => 37u32, + BlockKind::OakLog => 38u32, + BlockKind::SpruceLog => 39u32, + BlockKind::BirchLog => 40u32, + BlockKind::JungleLog => 41u32, + BlockKind::AcaciaLog => 42u32, + BlockKind::DarkOakLog => 43u32, + BlockKind::StrippedSpruceLog => 44u32, + BlockKind::StrippedBirchLog => 45u32, + BlockKind::StrippedJungleLog => 46u32, + BlockKind::StrippedAcaciaLog => 47u32, + BlockKind::StrippedDarkOakLog => 48u32, + BlockKind::StrippedOakLog => 49u32, + BlockKind::OakWood => 50u32, + BlockKind::SpruceWood => 51u32, + BlockKind::BirchWood => 52u32, + BlockKind::JungleWood => 53u32, + BlockKind::AcaciaWood => 54u32, + BlockKind::DarkOakWood => 55u32, + BlockKind::StrippedOakWood => 56u32, + BlockKind::StrippedSpruceWood => 57u32, + BlockKind::StrippedBirchWood => 58u32, + BlockKind::StrippedJungleWood => 59u32, + BlockKind::StrippedAcaciaWood => 60u32, + BlockKind::StrippedDarkOakWood => 61u32, + BlockKind::OakLeaves => 62u32, + BlockKind::SpruceLeaves => 63u32, + BlockKind::BirchLeaves => 64u32, + BlockKind::JungleLeaves => 65u32, + BlockKind::AcaciaLeaves => 66u32, + BlockKind::DarkOakLeaves => 67u32, + BlockKind::AzaleaLeaves => 68u32, + BlockKind::FloweringAzaleaLeaves => 69u32, + BlockKind::Sponge => 70u32, + BlockKind::WetSponge => 71u32, + BlockKind::Glass => 72u32, + BlockKind::LapisOre => 73u32, + BlockKind::DeepslateLapisOre => 74u32, + BlockKind::LapisBlock => 75u32, + BlockKind::Dispenser => 76u32, + BlockKind::Sandstone => 77u32, + BlockKind::ChiseledSandstone => 78u32, + BlockKind::CutSandstone => 79u32, + BlockKind::NoteBlock => 80u32, + BlockKind::WhiteBed => 81u32, + BlockKind::OrangeBed => 82u32, + BlockKind::MagentaBed => 83u32, + BlockKind::LightBlueBed => 84u32, + BlockKind::YellowBed => 85u32, + BlockKind::LimeBed => 86u32, + BlockKind::PinkBed => 87u32, + BlockKind::GrayBed => 88u32, + BlockKind::LightGrayBed => 89u32, + BlockKind::CyanBed => 90u32, + BlockKind::PurpleBed => 91u32, + BlockKind::BlueBed => 92u32, + BlockKind::BrownBed => 93u32, + BlockKind::GreenBed => 94u32, + BlockKind::RedBed => 95u32, + BlockKind::BlackBed => 96u32, + BlockKind::PoweredRail => 97u32, + BlockKind::DetectorRail => 98u32, + BlockKind::StickyPiston => 99u32, + BlockKind::Cobweb => 100u32, + BlockKind::Grass => 101u32, + BlockKind::Fern => 102u32, + BlockKind::DeadBush => 103u32, + BlockKind::Seagrass => 104u32, + BlockKind::TallSeagrass => 105u32, + BlockKind::Piston => 106u32, + BlockKind::PistonHead => 107u32, + BlockKind::WhiteWool => 108u32, + BlockKind::OrangeWool => 109u32, + BlockKind::MagentaWool => 110u32, + BlockKind::LightBlueWool => 111u32, + BlockKind::YellowWool => 112u32, + BlockKind::LimeWool => 113u32, + BlockKind::PinkWool => 114u32, + BlockKind::GrayWool => 115u32, + BlockKind::LightGrayWool => 116u32, + BlockKind::CyanWool => 117u32, + BlockKind::PurpleWool => 118u32, + BlockKind::BlueWool => 119u32, + BlockKind::BrownWool => 120u32, + BlockKind::GreenWool => 121u32, + BlockKind::RedWool => 122u32, + BlockKind::BlackWool => 123u32, + BlockKind::MovingPiston => 124u32, + BlockKind::Dandelion => 125u32, + BlockKind::Poppy => 126u32, + BlockKind::BlueOrchid => 127u32, + BlockKind::Allium => 128u32, + BlockKind::AzureBluet => 129u32, + BlockKind::RedTulip => 130u32, + BlockKind::OrangeTulip => 131u32, + BlockKind::WhiteTulip => 132u32, + BlockKind::PinkTulip => 133u32, + BlockKind::OxeyeDaisy => 134u32, + BlockKind::Cornflower => 135u32, + BlockKind::WitherRose => 136u32, + BlockKind::LilyOfTheValley => 137u32, + BlockKind::BrownMushroom => 138u32, + BlockKind::RedMushroom => 139u32, + BlockKind::GoldBlock => 140u32, + BlockKind::IronBlock => 141u32, + BlockKind::Bricks => 142u32, + BlockKind::Tnt => 143u32, + BlockKind::Bookshelf => 144u32, + BlockKind::MossyCobblestone => 145u32, + BlockKind::Obsidian => 146u32, + BlockKind::Torch => 147u32, + BlockKind::WallTorch => 148u32, + BlockKind::Fire => 149u32, + BlockKind::SoulFire => 150u32, + BlockKind::Spawner => 151u32, + BlockKind::OakStairs => 152u32, + BlockKind::Chest => 153u32, + BlockKind::RedstoneWire => 154u32, + BlockKind::DiamondOre => 155u32, + BlockKind::DeepslateDiamondOre => 156u32, + BlockKind::DiamondBlock => 157u32, + BlockKind::CraftingTable => 158u32, + BlockKind::Wheat => 159u32, + BlockKind::Farmland => 160u32, + BlockKind::Furnace => 161u32, + BlockKind::OakSign => 162u32, + BlockKind::SpruceSign => 163u32, + BlockKind::BirchSign => 164u32, + BlockKind::AcaciaSign => 165u32, + BlockKind::JungleSign => 166u32, + BlockKind::DarkOakSign => 167u32, + BlockKind::OakDoor => 168u32, + BlockKind::Ladder => 169u32, + BlockKind::Rail => 170u32, + BlockKind::CobblestoneStairs => 171u32, + BlockKind::OakWallSign => 172u32, + BlockKind::SpruceWallSign => 173u32, + BlockKind::BirchWallSign => 174u32, + BlockKind::AcaciaWallSign => 175u32, + BlockKind::JungleWallSign => 176u32, + BlockKind::DarkOakWallSign => 177u32, + BlockKind::Lever => 178u32, + BlockKind::StonePressurePlate => 179u32, + BlockKind::IronDoor => 180u32, + BlockKind::OakPressurePlate => 181u32, + BlockKind::SprucePressurePlate => 182u32, + BlockKind::BirchPressurePlate => 183u32, + BlockKind::JunglePressurePlate => 184u32, + BlockKind::AcaciaPressurePlate => 185u32, + BlockKind::DarkOakPressurePlate => 186u32, + BlockKind::RedstoneOre => 187u32, + BlockKind::DeepslateRedstoneOre => 188u32, + BlockKind::RedstoneTorch => 189u32, + BlockKind::RedstoneWallTorch => 190u32, + BlockKind::StoneButton => 191u32, + BlockKind::Snow => 192u32, + BlockKind::Ice => 193u32, + BlockKind::SnowBlock => 194u32, + BlockKind::Cactus => 195u32, + BlockKind::Clay => 196u32, + BlockKind::SugarCane => 197u32, + BlockKind::Jukebox => 198u32, + BlockKind::OakFence => 199u32, + BlockKind::Pumpkin => 200u32, + BlockKind::Netherrack => 201u32, + BlockKind::SoulSand => 202u32, + BlockKind::SoulSoil => 203u32, + BlockKind::Basalt => 204u32, + BlockKind::PolishedBasalt => 205u32, + BlockKind::SoulTorch => 206u32, + BlockKind::SoulWallTorch => 207u32, + BlockKind::Glowstone => 208u32, + BlockKind::NetherPortal => 209u32, + BlockKind::CarvedPumpkin => 210u32, + BlockKind::JackOLantern => 211u32, + BlockKind::Cake => 212u32, + BlockKind::Repeater => 213u32, + BlockKind::WhiteStainedGlass => 214u32, + BlockKind::OrangeStainedGlass => 215u32, + BlockKind::MagentaStainedGlass => 216u32, + BlockKind::LightBlueStainedGlass => 217u32, + BlockKind::YellowStainedGlass => 218u32, + BlockKind::LimeStainedGlass => 219u32, + BlockKind::PinkStainedGlass => 220u32, + BlockKind::GrayStainedGlass => 221u32, + BlockKind::LightGrayStainedGlass => 222u32, + BlockKind::CyanStainedGlass => 223u32, + BlockKind::PurpleStainedGlass => 224u32, + BlockKind::BlueStainedGlass => 225u32, + BlockKind::BrownStainedGlass => 226u32, + BlockKind::GreenStainedGlass => 227u32, + BlockKind::RedStainedGlass => 228u32, + BlockKind::BlackStainedGlass => 229u32, + BlockKind::OakTrapdoor => 230u32, + BlockKind::SpruceTrapdoor => 231u32, + BlockKind::BirchTrapdoor => 232u32, + BlockKind::JungleTrapdoor => 233u32, + BlockKind::AcaciaTrapdoor => 234u32, + BlockKind::DarkOakTrapdoor => 235u32, + BlockKind::StoneBricks => 236u32, + BlockKind::MossyStoneBricks => 237u32, + BlockKind::CrackedStoneBricks => 238u32, + BlockKind::ChiseledStoneBricks => 239u32, + BlockKind::InfestedStone => 240u32, + BlockKind::InfestedCobblestone => 241u32, + BlockKind::InfestedStoneBricks => 242u32, + BlockKind::InfestedMossyStoneBricks => 243u32, + BlockKind::InfestedCrackedStoneBricks => 244u32, + BlockKind::InfestedChiseledStoneBricks => 245u32, + BlockKind::BrownMushroomBlock => 246u32, + BlockKind::RedMushroomBlock => 247u32, + BlockKind::MushroomStem => 248u32, + BlockKind::IronBars => 249u32, + BlockKind::Chain => 250u32, + BlockKind::GlassPane => 251u32, + BlockKind::Melon => 252u32, + BlockKind::AttachedPumpkinStem => 253u32, + BlockKind::AttachedMelonStem => 254u32, + BlockKind::PumpkinStem => 255u32, + BlockKind::MelonStem => 256u32, + BlockKind::Vine => 257u32, + BlockKind::GlowLichen => 258u32, + BlockKind::OakFenceGate => 259u32, + BlockKind::BrickStairs => 260u32, + BlockKind::StoneBrickStairs => 261u32, + BlockKind::Mycelium => 262u32, + BlockKind::LilyPad => 263u32, + BlockKind::NetherBricks => 264u32, + BlockKind::NetherBrickFence => 265u32, + BlockKind::NetherBrickStairs => 266u32, + BlockKind::NetherWart => 267u32, + BlockKind::EnchantingTable => 268u32, + BlockKind::BrewingStand => 269u32, + BlockKind::Cauldron => 270u32, + BlockKind::WaterCauldron => 271u32, + BlockKind::LavaCauldron => 272u32, + BlockKind::PowderSnowCauldron => 273u32, + BlockKind::EndPortal => 274u32, + BlockKind::EndPortalFrame => 275u32, + BlockKind::EndStone => 276u32, + BlockKind::DragonEgg => 277u32, + BlockKind::RedstoneLamp => 278u32, + BlockKind::Cocoa => 279u32, + BlockKind::SandstoneStairs => 280u32, + BlockKind::EmeraldOre => 281u32, + BlockKind::DeepslateEmeraldOre => 282u32, + BlockKind::EnderChest => 283u32, + BlockKind::TripwireHook => 284u32, + BlockKind::Tripwire => 285u32, + BlockKind::EmeraldBlock => 286u32, + BlockKind::SpruceStairs => 287u32, + BlockKind::BirchStairs => 288u32, + BlockKind::JungleStairs => 289u32, + BlockKind::CommandBlock => 290u32, + BlockKind::Beacon => 291u32, + BlockKind::CobblestoneWall => 292u32, + BlockKind::MossyCobblestoneWall => 293u32, + BlockKind::FlowerPot => 294u32, + BlockKind::PottedOakSapling => 295u32, + BlockKind::PottedSpruceSapling => 296u32, + BlockKind::PottedBirchSapling => 297u32, + BlockKind::PottedJungleSapling => 298u32, + BlockKind::PottedAcaciaSapling => 299u32, + BlockKind::PottedDarkOakSapling => 300u32, + BlockKind::PottedFern => 301u32, + BlockKind::PottedDandelion => 302u32, + BlockKind::PottedPoppy => 303u32, + BlockKind::PottedBlueOrchid => 304u32, + BlockKind::PottedAllium => 305u32, + BlockKind::PottedAzureBluet => 306u32, + BlockKind::PottedRedTulip => 307u32, + BlockKind::PottedOrangeTulip => 308u32, + BlockKind::PottedWhiteTulip => 309u32, + BlockKind::PottedPinkTulip => 310u32, + BlockKind::PottedOxeyeDaisy => 311u32, + BlockKind::PottedCornflower => 312u32, + BlockKind::PottedLilyOfTheValley => 313u32, + BlockKind::PottedWitherRose => 314u32, + BlockKind::PottedRedMushroom => 315u32, + BlockKind::PottedBrownMushroom => 316u32, + BlockKind::PottedDeadBush => 317u32, + BlockKind::PottedCactus => 318u32, + BlockKind::Carrots => 319u32, + BlockKind::Potatoes => 320u32, + BlockKind::OakButton => 321u32, + BlockKind::SpruceButton => 322u32, + BlockKind::BirchButton => 323u32, + BlockKind::JungleButton => 324u32, + BlockKind::AcaciaButton => 325u32, + BlockKind::DarkOakButton => 326u32, + BlockKind::SkeletonSkull => 327u32, + BlockKind::SkeletonWallSkull => 328u32, + BlockKind::WitherSkeletonSkull => 329u32, + BlockKind::WitherSkeletonWallSkull => 330u32, + BlockKind::ZombieHead => 331u32, + BlockKind::ZombieWallHead => 332u32, + BlockKind::PlayerHead => 333u32, + BlockKind::PlayerWallHead => 334u32, + BlockKind::CreeperHead => 335u32, + BlockKind::CreeperWallHead => 336u32, + BlockKind::DragonHead => 337u32, + BlockKind::DragonWallHead => 338u32, + BlockKind::Anvil => 339u32, + BlockKind::ChippedAnvil => 340u32, + BlockKind::DamagedAnvil => 341u32, + BlockKind::TrappedChest => 342u32, + BlockKind::LightWeightedPressurePlate => 343u32, + BlockKind::HeavyWeightedPressurePlate => 344u32, + BlockKind::Comparator => 345u32, + BlockKind::DaylightDetector => 346u32, + BlockKind::RedstoneBlock => 347u32, + BlockKind::NetherQuartzOre => 348u32, + BlockKind::Hopper => 349u32, + BlockKind::QuartzBlock => 350u32, + BlockKind::ChiseledQuartzBlock => 351u32, + BlockKind::QuartzPillar => 352u32, + BlockKind::QuartzStairs => 353u32, + BlockKind::ActivatorRail => 354u32, + BlockKind::Dropper => 355u32, + BlockKind::WhiteTerracotta => 356u32, + BlockKind::OrangeTerracotta => 357u32, + BlockKind::MagentaTerracotta => 358u32, + BlockKind::LightBlueTerracotta => 359u32, + BlockKind::YellowTerracotta => 360u32, + BlockKind::LimeTerracotta => 361u32, + BlockKind::PinkTerracotta => 362u32, + BlockKind::GrayTerracotta => 363u32, + BlockKind::LightGrayTerracotta => 364u32, + BlockKind::CyanTerracotta => 365u32, + BlockKind::PurpleTerracotta => 366u32, + BlockKind::BlueTerracotta => 367u32, + BlockKind::BrownTerracotta => 368u32, + BlockKind::GreenTerracotta => 369u32, + BlockKind::RedTerracotta => 370u32, + BlockKind::BlackTerracotta => 371u32, + BlockKind::WhiteStainedGlassPane => 372u32, + BlockKind::OrangeStainedGlassPane => 373u32, + BlockKind::MagentaStainedGlassPane => 374u32, + BlockKind::LightBlueStainedGlassPane => 375u32, + BlockKind::YellowStainedGlassPane => 376u32, + BlockKind::LimeStainedGlassPane => 377u32, + BlockKind::PinkStainedGlassPane => 378u32, + BlockKind::GrayStainedGlassPane => 379u32, + BlockKind::LightGrayStainedGlassPane => 380u32, + BlockKind::CyanStainedGlassPane => 381u32, + BlockKind::PurpleStainedGlassPane => 382u32, + BlockKind::BlueStainedGlassPane => 383u32, + BlockKind::BrownStainedGlassPane => 384u32, + BlockKind::GreenStainedGlassPane => 385u32, + BlockKind::RedStainedGlassPane => 386u32, + BlockKind::BlackStainedGlassPane => 387u32, + BlockKind::AcaciaStairs => 388u32, + BlockKind::DarkOakStairs => 389u32, + BlockKind::SlimeBlock => 390u32, + BlockKind::Barrier => 391u32, + BlockKind::Light => 392u32, + BlockKind::IronTrapdoor => 393u32, + BlockKind::Prismarine => 394u32, + BlockKind::PrismarineBricks => 395u32, + BlockKind::DarkPrismarine => 396u32, + BlockKind::PrismarineStairs => 397u32, + BlockKind::PrismarineBrickStairs => 398u32, + BlockKind::DarkPrismarineStairs => 399u32, + BlockKind::PrismarineSlab => 400u32, + BlockKind::PrismarineBrickSlab => 401u32, + BlockKind::DarkPrismarineSlab => 402u32, + BlockKind::SeaLantern => 403u32, + BlockKind::HayBlock => 404u32, + BlockKind::WhiteCarpet => 405u32, + BlockKind::OrangeCarpet => 406u32, + BlockKind::MagentaCarpet => 407u32, + BlockKind::LightBlueCarpet => 408u32, + BlockKind::YellowCarpet => 409u32, + BlockKind::LimeCarpet => 410u32, + BlockKind::PinkCarpet => 411u32, + BlockKind::GrayCarpet => 412u32, + BlockKind::LightGrayCarpet => 413u32, + BlockKind::CyanCarpet => 414u32, + BlockKind::PurpleCarpet => 415u32, + BlockKind::BlueCarpet => 416u32, + BlockKind::BrownCarpet => 417u32, + BlockKind::GreenCarpet => 418u32, + BlockKind::RedCarpet => 419u32, + BlockKind::BlackCarpet => 420u32, + BlockKind::Terracotta => 421u32, + BlockKind::CoalBlock => 422u32, + BlockKind::PackedIce => 423u32, + BlockKind::Sunflower => 424u32, + BlockKind::Lilac => 425u32, + BlockKind::RoseBush => 426u32, + BlockKind::Peony => 427u32, + BlockKind::TallGrass => 428u32, + BlockKind::LargeFern => 429u32, + BlockKind::WhiteBanner => 430u32, + BlockKind::OrangeBanner => 431u32, + BlockKind::MagentaBanner => 432u32, + BlockKind::LightBlueBanner => 433u32, + BlockKind::YellowBanner => 434u32, + BlockKind::LimeBanner => 435u32, + BlockKind::PinkBanner => 436u32, + BlockKind::GrayBanner => 437u32, + BlockKind::LightGrayBanner => 438u32, + BlockKind::CyanBanner => 439u32, + BlockKind::PurpleBanner => 440u32, + BlockKind::BlueBanner => 441u32, + BlockKind::BrownBanner => 442u32, + BlockKind::GreenBanner => 443u32, + BlockKind::RedBanner => 444u32, + BlockKind::BlackBanner => 445u32, + BlockKind::WhiteWallBanner => 446u32, + BlockKind::OrangeWallBanner => 447u32, + BlockKind::MagentaWallBanner => 448u32, + BlockKind::LightBlueWallBanner => 449u32, + BlockKind::YellowWallBanner => 450u32, + BlockKind::LimeWallBanner => 451u32, + BlockKind::PinkWallBanner => 452u32, + BlockKind::GrayWallBanner => 453u32, + BlockKind::LightGrayWallBanner => 454u32, + BlockKind::CyanWallBanner => 455u32, + BlockKind::PurpleWallBanner => 456u32, + BlockKind::BlueWallBanner => 457u32, + BlockKind::BrownWallBanner => 458u32, + BlockKind::GreenWallBanner => 459u32, + BlockKind::RedWallBanner => 460u32, + BlockKind::BlackWallBanner => 461u32, + BlockKind::RedSandstone => 462u32, + BlockKind::ChiseledRedSandstone => 463u32, + BlockKind::CutRedSandstone => 464u32, + BlockKind::RedSandstoneStairs => 465u32, + BlockKind::OakSlab => 466u32, + BlockKind::SpruceSlab => 467u32, + BlockKind::BirchSlab => 468u32, + BlockKind::JungleSlab => 469u32, + BlockKind::AcaciaSlab => 470u32, + BlockKind::DarkOakSlab => 471u32, + BlockKind::StoneSlab => 472u32, + BlockKind::SmoothStoneSlab => 473u32, + BlockKind::SandstoneSlab => 474u32, + BlockKind::CutSandstoneSlab => 475u32, + BlockKind::PetrifiedOakSlab => 476u32, + BlockKind::CobblestoneSlab => 477u32, + BlockKind::BrickSlab => 478u32, + BlockKind::StoneBrickSlab => 479u32, + BlockKind::NetherBrickSlab => 480u32, + BlockKind::QuartzSlab => 481u32, + BlockKind::RedSandstoneSlab => 482u32, + BlockKind::CutRedSandstoneSlab => 483u32, + BlockKind::PurpurSlab => 484u32, + BlockKind::SmoothStone => 485u32, + BlockKind::SmoothSandstone => 486u32, + BlockKind::SmoothQuartz => 487u32, + BlockKind::SmoothRedSandstone => 488u32, + BlockKind::SpruceFenceGate => 489u32, + BlockKind::BirchFenceGate => 490u32, + BlockKind::JungleFenceGate => 491u32, + BlockKind::AcaciaFenceGate => 492u32, + BlockKind::DarkOakFenceGate => 493u32, + BlockKind::SpruceFence => 494u32, + BlockKind::BirchFence => 495u32, + BlockKind::JungleFence => 496u32, + BlockKind::AcaciaFence => 497u32, + BlockKind::DarkOakFence => 498u32, + BlockKind::SpruceDoor => 499u32, + BlockKind::BirchDoor => 500u32, + BlockKind::JungleDoor => 501u32, + BlockKind::AcaciaDoor => 502u32, + BlockKind::DarkOakDoor => 503u32, + BlockKind::EndRod => 504u32, + BlockKind::ChorusPlant => 505u32, + BlockKind::ChorusFlower => 506u32, + BlockKind::PurpurBlock => 507u32, + BlockKind::PurpurPillar => 508u32, + BlockKind::PurpurStairs => 509u32, + BlockKind::EndStoneBricks => 510u32, + BlockKind::Beetroots => 511u32, + BlockKind::DirtPath => 512u32, + BlockKind::EndGateway => 513u32, + BlockKind::RepeatingCommandBlock => 514u32, + BlockKind::ChainCommandBlock => 515u32, + BlockKind::FrostedIce => 516u32, + BlockKind::MagmaBlock => 517u32, + BlockKind::NetherWartBlock => 518u32, + BlockKind::RedNetherBricks => 519u32, + BlockKind::BoneBlock => 520u32, + BlockKind::StructureVoid => 521u32, + BlockKind::Observer => 522u32, + BlockKind::ShulkerBox => 523u32, + BlockKind::WhiteShulkerBox => 524u32, + BlockKind::OrangeShulkerBox => 525u32, + BlockKind::MagentaShulkerBox => 526u32, + BlockKind::LightBlueShulkerBox => 527u32, + BlockKind::YellowShulkerBox => 528u32, + BlockKind::LimeShulkerBox => 529u32, + BlockKind::PinkShulkerBox => 530u32, + BlockKind::GrayShulkerBox => 531u32, + BlockKind::LightGrayShulkerBox => 532u32, + BlockKind::CyanShulkerBox => 533u32, + BlockKind::PurpleShulkerBox => 534u32, + BlockKind::BlueShulkerBox => 535u32, + BlockKind::BrownShulkerBox => 536u32, + BlockKind::GreenShulkerBox => 537u32, + BlockKind::RedShulkerBox => 538u32, + BlockKind::BlackShulkerBox => 539u32, + BlockKind::WhiteGlazedTerracotta => 540u32, + BlockKind::OrangeGlazedTerracotta => 541u32, + BlockKind::MagentaGlazedTerracotta => 542u32, + BlockKind::LightBlueGlazedTerracotta => 543u32, + BlockKind::YellowGlazedTerracotta => 544u32, + BlockKind::LimeGlazedTerracotta => 545u32, + BlockKind::PinkGlazedTerracotta => 546u32, + BlockKind::GrayGlazedTerracotta => 547u32, + BlockKind::LightGrayGlazedTerracotta => 548u32, + BlockKind::CyanGlazedTerracotta => 549u32, + BlockKind::PurpleGlazedTerracotta => 550u32, + BlockKind::BlueGlazedTerracotta => 551u32, + BlockKind::BrownGlazedTerracotta => 552u32, + BlockKind::GreenGlazedTerracotta => 553u32, + BlockKind::RedGlazedTerracotta => 554u32, + BlockKind::BlackGlazedTerracotta => 555u32, + BlockKind::WhiteConcrete => 556u32, + BlockKind::OrangeConcrete => 557u32, + BlockKind::MagentaConcrete => 558u32, + BlockKind::LightBlueConcrete => 559u32, + BlockKind::YellowConcrete => 560u32, + BlockKind::LimeConcrete => 561u32, + BlockKind::PinkConcrete => 562u32, + BlockKind::GrayConcrete => 563u32, + BlockKind::LightGrayConcrete => 564u32, + BlockKind::CyanConcrete => 565u32, + BlockKind::PurpleConcrete => 566u32, + BlockKind::BlueConcrete => 567u32, + BlockKind::BrownConcrete => 568u32, + BlockKind::GreenConcrete => 569u32, + BlockKind::RedConcrete => 570u32, + BlockKind::BlackConcrete => 571u32, + BlockKind::WhiteConcretePowder => 572u32, + BlockKind::OrangeConcretePowder => 573u32, + BlockKind::MagentaConcretePowder => 574u32, + BlockKind::LightBlueConcretePowder => 575u32, + BlockKind::YellowConcretePowder => 576u32, + BlockKind::LimeConcretePowder => 577u32, + BlockKind::PinkConcretePowder => 578u32, + BlockKind::GrayConcretePowder => 579u32, + BlockKind::LightGrayConcretePowder => 580u32, + BlockKind::CyanConcretePowder => 581u32, + BlockKind::PurpleConcretePowder => 582u32, + BlockKind::BlueConcretePowder => 583u32, + BlockKind::BrownConcretePowder => 584u32, + BlockKind::GreenConcretePowder => 585u32, + BlockKind::RedConcretePowder => 586u32, + BlockKind::BlackConcretePowder => 587u32, + BlockKind::Kelp => 588u32, + BlockKind::KelpPlant => 589u32, + BlockKind::DriedKelpBlock => 590u32, + BlockKind::TurtleEgg => 591u32, + BlockKind::DeadTubeCoralBlock => 592u32, + BlockKind::DeadBrainCoralBlock => 593u32, + BlockKind::DeadBubbleCoralBlock => 594u32, + BlockKind::DeadFireCoralBlock => 595u32, + BlockKind::DeadHornCoralBlock => 596u32, + BlockKind::TubeCoralBlock => 597u32, + BlockKind::BrainCoralBlock => 598u32, + BlockKind::BubbleCoralBlock => 599u32, + BlockKind::FireCoralBlock => 600u32, + BlockKind::HornCoralBlock => 601u32, + BlockKind::DeadTubeCoral => 602u32, + BlockKind::DeadBrainCoral => 603u32, + BlockKind::DeadBubbleCoral => 604u32, + BlockKind::DeadFireCoral => 605u32, + BlockKind::DeadHornCoral => 606u32, + BlockKind::TubeCoral => 607u32, + BlockKind::BrainCoral => 608u32, + BlockKind::BubbleCoral => 609u32, + BlockKind::FireCoral => 610u32, + BlockKind::HornCoral => 611u32, + BlockKind::DeadTubeCoralFan => 612u32, + BlockKind::DeadBrainCoralFan => 613u32, + BlockKind::DeadBubbleCoralFan => 614u32, + BlockKind::DeadFireCoralFan => 615u32, + BlockKind::DeadHornCoralFan => 616u32, + BlockKind::TubeCoralFan => 617u32, + BlockKind::BrainCoralFan => 618u32, + BlockKind::BubbleCoralFan => 619u32, + BlockKind::FireCoralFan => 620u32, + BlockKind::HornCoralFan => 621u32, + BlockKind::DeadTubeCoralWallFan => 622u32, + BlockKind::DeadBrainCoralWallFan => 623u32, + BlockKind::DeadBubbleCoralWallFan => 624u32, + BlockKind::DeadFireCoralWallFan => 625u32, + BlockKind::DeadHornCoralWallFan => 626u32, + BlockKind::TubeCoralWallFan => 627u32, + BlockKind::BrainCoralWallFan => 628u32, + BlockKind::BubbleCoralWallFan => 629u32, + BlockKind::FireCoralWallFan => 630u32, + BlockKind::HornCoralWallFan => 631u32, + BlockKind::SeaPickle => 632u32, + BlockKind::BlueIce => 633u32, + BlockKind::Conduit => 634u32, + BlockKind::BambooSapling => 635u32, + BlockKind::Bamboo => 636u32, + BlockKind::PottedBamboo => 637u32, + BlockKind::VoidAir => 638u32, + BlockKind::CaveAir => 639u32, + BlockKind::BubbleColumn => 640u32, + BlockKind::PolishedGraniteStairs => 641u32, + BlockKind::SmoothRedSandstoneStairs => 642u32, + BlockKind::MossyStoneBrickStairs => 643u32, + BlockKind::PolishedDioriteStairs => 644u32, + BlockKind::MossyCobblestoneStairs => 645u32, + BlockKind::EndStoneBrickStairs => 646u32, + BlockKind::StoneStairs => 647u32, + BlockKind::SmoothSandstoneStairs => 648u32, + BlockKind::SmoothQuartzStairs => 649u32, + BlockKind::GraniteStairs => 650u32, + BlockKind::AndesiteStairs => 651u32, + BlockKind::RedNetherBrickStairs => 652u32, + BlockKind::PolishedAndesiteStairs => 653u32, + BlockKind::DioriteStairs => 654u32, + BlockKind::PolishedGraniteSlab => 655u32, + BlockKind::SmoothRedSandstoneSlab => 656u32, + BlockKind::MossyStoneBrickSlab => 657u32, + BlockKind::PolishedDioriteSlab => 658u32, + BlockKind::MossyCobblestoneSlab => 659u32, + BlockKind::EndStoneBrickSlab => 660u32, + BlockKind::SmoothSandstoneSlab => 661u32, + BlockKind::SmoothQuartzSlab => 662u32, + BlockKind::GraniteSlab => 663u32, + BlockKind::AndesiteSlab => 664u32, + BlockKind::RedNetherBrickSlab => 665u32, + BlockKind::PolishedAndesiteSlab => 666u32, + BlockKind::DioriteSlab => 667u32, + BlockKind::BrickWall => 668u32, + BlockKind::PrismarineWall => 669u32, + BlockKind::RedSandstoneWall => 670u32, + BlockKind::MossyStoneBrickWall => 671u32, + BlockKind::GraniteWall => 672u32, + BlockKind::StoneBrickWall => 673u32, + BlockKind::NetherBrickWall => 674u32, + BlockKind::AndesiteWall => 675u32, + BlockKind::RedNetherBrickWall => 676u32, + BlockKind::SandstoneWall => 677u32, + BlockKind::EndStoneBrickWall => 678u32, + BlockKind::DioriteWall => 679u32, + BlockKind::Scaffolding => 680u32, + BlockKind::Loom => 681u32, + BlockKind::Barrel => 682u32, + BlockKind::Smoker => 683u32, + BlockKind::BlastFurnace => 684u32, + BlockKind::CartographyTable => 685u32, + BlockKind::FletchingTable => 686u32, + BlockKind::Grindstone => 687u32, + BlockKind::Lectern => 688u32, + BlockKind::SmithingTable => 689u32, + BlockKind::Stonecutter => 690u32, + BlockKind::Bell => 691u32, + BlockKind::Lantern => 692u32, + BlockKind::SoulLantern => 693u32, + BlockKind::Campfire => 694u32, + BlockKind::SoulCampfire => 695u32, + BlockKind::SweetBerryBush => 696u32, + BlockKind::WarpedStem => 697u32, + BlockKind::StrippedWarpedStem => 698u32, + BlockKind::WarpedHyphae => 699u32, + BlockKind::StrippedWarpedHyphae => 700u32, + BlockKind::WarpedNylium => 701u32, + BlockKind::WarpedFungus => 702u32, + BlockKind::WarpedWartBlock => 703u32, + BlockKind::WarpedRoots => 704u32, + BlockKind::NetherSprouts => 705u32, + BlockKind::CrimsonStem => 706u32, + BlockKind::StrippedCrimsonStem => 707u32, + BlockKind::CrimsonHyphae => 708u32, + BlockKind::StrippedCrimsonHyphae => 709u32, + BlockKind::CrimsonNylium => 710u32, + BlockKind::CrimsonFungus => 711u32, + BlockKind::Shroomlight => 712u32, + BlockKind::WeepingVines => 713u32, + BlockKind::WeepingVinesPlant => 714u32, + BlockKind::TwistingVines => 715u32, + BlockKind::TwistingVinesPlant => 716u32, + BlockKind::CrimsonRoots => 717u32, + BlockKind::CrimsonPlanks => 718u32, + BlockKind::WarpedPlanks => 719u32, + BlockKind::CrimsonSlab => 720u32, + BlockKind::WarpedSlab => 721u32, + BlockKind::CrimsonPressurePlate => 722u32, + BlockKind::WarpedPressurePlate => 723u32, + BlockKind::CrimsonFence => 724u32, + BlockKind::WarpedFence => 725u32, + BlockKind::CrimsonTrapdoor => 726u32, + BlockKind::WarpedTrapdoor => 727u32, + BlockKind::CrimsonFenceGate => 728u32, + BlockKind::WarpedFenceGate => 729u32, + BlockKind::CrimsonStairs => 730u32, + BlockKind::WarpedStairs => 731u32, + BlockKind::CrimsonButton => 732u32, + BlockKind::WarpedButton => 733u32, + BlockKind::CrimsonDoor => 734u32, + BlockKind::WarpedDoor => 735u32, + BlockKind::CrimsonSign => 736u32, + BlockKind::WarpedSign => 737u32, + BlockKind::CrimsonWallSign => 738u32, + BlockKind::WarpedWallSign => 739u32, + BlockKind::StructureBlock => 740u32, + BlockKind::Jigsaw => 741u32, + BlockKind::Composter => 742u32, + BlockKind::Target => 743u32, + BlockKind::BeeNest => 744u32, + BlockKind::Beehive => 745u32, + BlockKind::HoneyBlock => 746u32, + BlockKind::HoneycombBlock => 747u32, + BlockKind::NetheriteBlock => 748u32, + BlockKind::AncientDebris => 749u32, + BlockKind::CryingObsidian => 750u32, + BlockKind::RespawnAnchor => 751u32, + BlockKind::PottedCrimsonFungus => 752u32, + BlockKind::PottedWarpedFungus => 753u32, + BlockKind::PottedCrimsonRoots => 754u32, + BlockKind::PottedWarpedRoots => 755u32, + BlockKind::Lodestone => 756u32, + BlockKind::Blackstone => 757u32, + BlockKind::BlackstoneStairs => 758u32, + BlockKind::BlackstoneWall => 759u32, + BlockKind::BlackstoneSlab => 760u32, + BlockKind::PolishedBlackstone => 761u32, + BlockKind::PolishedBlackstoneBricks => 762u32, + BlockKind::CrackedPolishedBlackstoneBricks => 763u32, + BlockKind::ChiseledPolishedBlackstone => 764u32, + BlockKind::PolishedBlackstoneBrickSlab => 765u32, + BlockKind::PolishedBlackstoneBrickStairs => 766u32, + BlockKind::PolishedBlackstoneBrickWall => 767u32, + BlockKind::GildedBlackstone => 768u32, + BlockKind::PolishedBlackstoneStairs => 769u32, + BlockKind::PolishedBlackstoneSlab => 770u32, + BlockKind::PolishedBlackstonePressurePlate => 771u32, + BlockKind::PolishedBlackstoneButton => 772u32, + BlockKind::PolishedBlackstoneWall => 773u32, + BlockKind::ChiseledNetherBricks => 774u32, + BlockKind::CrackedNetherBricks => 775u32, + BlockKind::QuartzBricks => 776u32, + BlockKind::Candle => 777u32, + BlockKind::WhiteCandle => 778u32, + BlockKind::OrangeCandle => 779u32, + BlockKind::MagentaCandle => 780u32, + BlockKind::LightBlueCandle => 781u32, + BlockKind::YellowCandle => 782u32, + BlockKind::LimeCandle => 783u32, + BlockKind::PinkCandle => 784u32, + BlockKind::GrayCandle => 785u32, + BlockKind::LightGrayCandle => 786u32, + BlockKind::CyanCandle => 787u32, + BlockKind::PurpleCandle => 788u32, + BlockKind::BlueCandle => 789u32, + BlockKind::BrownCandle => 790u32, + BlockKind::GreenCandle => 791u32, + BlockKind::RedCandle => 792u32, + BlockKind::BlackCandle => 793u32, + BlockKind::CandleCake => 794u32, + BlockKind::WhiteCandleCake => 795u32, + BlockKind::OrangeCandleCake => 796u32, + BlockKind::MagentaCandleCake => 797u32, + BlockKind::LightBlueCandleCake => 798u32, + BlockKind::YellowCandleCake => 799u32, + BlockKind::LimeCandleCake => 800u32, + BlockKind::PinkCandleCake => 801u32, + BlockKind::GrayCandleCake => 802u32, + BlockKind::LightGrayCandleCake => 803u32, + BlockKind::CyanCandleCake => 804u32, + BlockKind::PurpleCandleCake => 805u32, + BlockKind::BlueCandleCake => 806u32, + BlockKind::BrownCandleCake => 807u32, + BlockKind::GreenCandleCake => 808u32, + BlockKind::RedCandleCake => 809u32, + BlockKind::BlackCandleCake => 810u32, + BlockKind::AmethystBlock => 811u32, + BlockKind::BuddingAmethyst => 812u32, + BlockKind::AmethystCluster => 813u32, + BlockKind::LargeAmethystBud => 814u32, + BlockKind::MediumAmethystBud => 815u32, + BlockKind::SmallAmethystBud => 816u32, + BlockKind::Tuff => 817u32, + BlockKind::Calcite => 818u32, + BlockKind::TintedGlass => 819u32, + BlockKind::PowderSnow => 820u32, + BlockKind::SculkSensor => 821u32, + BlockKind::OxidizedCopper => 822u32, + BlockKind::WeatheredCopper => 823u32, + BlockKind::ExposedCopper => 824u32, + BlockKind::CopperBlock => 825u32, + BlockKind::CopperOre => 826u32, + BlockKind::DeepslateCopperOre => 827u32, + BlockKind::OxidizedCutCopper => 828u32, + BlockKind::WeatheredCutCopper => 829u32, + BlockKind::ExposedCutCopper => 830u32, + BlockKind::CutCopper => 831u32, + BlockKind::OxidizedCutCopperStairs => 832u32, + BlockKind::WeatheredCutCopperStairs => 833u32, + BlockKind::ExposedCutCopperStairs => 834u32, + BlockKind::CutCopperStairs => 835u32, + BlockKind::OxidizedCutCopperSlab => 836u32, + BlockKind::WeatheredCutCopperSlab => 837u32, + BlockKind::ExposedCutCopperSlab => 838u32, + BlockKind::CutCopperSlab => 839u32, + BlockKind::WaxedCopperBlock => 840u32, + BlockKind::WaxedWeatheredCopper => 841u32, + BlockKind::WaxedExposedCopper => 842u32, + BlockKind::WaxedOxidizedCopper => 843u32, + BlockKind::WaxedOxidizedCutCopper => 844u32, + BlockKind::WaxedWeatheredCutCopper => 845u32, + BlockKind::WaxedExposedCutCopper => 846u32, + BlockKind::WaxedCutCopper => 847u32, + BlockKind::WaxedOxidizedCutCopperStairs => 848u32, + BlockKind::WaxedWeatheredCutCopperStairs => 849u32, + BlockKind::WaxedExposedCutCopperStairs => 850u32, + BlockKind::WaxedCutCopperStairs => 851u32, + BlockKind::WaxedOxidizedCutCopperSlab => 852u32, + BlockKind::WaxedWeatheredCutCopperSlab => 853u32, + BlockKind::WaxedExposedCutCopperSlab => 854u32, + BlockKind::WaxedCutCopperSlab => 855u32, + BlockKind::LightningRod => 856u32, + BlockKind::PointedDripstone => 857u32, + BlockKind::DripstoneBlock => 858u32, + BlockKind::CaveVines => 859u32, + BlockKind::CaveVinesPlant => 860u32, + BlockKind::SporeBlossom => 861u32, + BlockKind::Azalea => 862u32, + BlockKind::FloweringAzalea => 863u32, + BlockKind::MossCarpet => 864u32, + BlockKind::MossBlock => 865u32, + BlockKind::BigDripleaf => 866u32, + BlockKind::BigDripleafStem => 867u32, + BlockKind::SmallDripleaf => 868u32, + BlockKind::HangingRoots => 869u32, + BlockKind::RootedDirt => 870u32, + BlockKind::Deepslate => 871u32, + BlockKind::CobbledDeepslate => 872u32, + BlockKind::CobbledDeepslateStairs => 873u32, + BlockKind::CobbledDeepslateSlab => 874u32, + BlockKind::CobbledDeepslateWall => 875u32, + BlockKind::PolishedDeepslate => 876u32, + BlockKind::PolishedDeepslateStairs => 877u32, + BlockKind::PolishedDeepslateSlab => 878u32, + BlockKind::PolishedDeepslateWall => 879u32, + BlockKind::DeepslateTiles => 880u32, + BlockKind::DeepslateTileStairs => 881u32, + BlockKind::DeepslateTileSlab => 882u32, + BlockKind::DeepslateTileWall => 883u32, + BlockKind::DeepslateBricks => 884u32, + BlockKind::DeepslateBrickStairs => 885u32, + BlockKind::DeepslateBrickSlab => 886u32, + BlockKind::DeepslateBrickWall => 887u32, + BlockKind::ChiseledDeepslate => 888u32, + BlockKind::CrackedDeepslateBricks => 889u32, + BlockKind::CrackedDeepslateTiles => 890u32, + BlockKind::InfestedDeepslate => 891u32, + BlockKind::SmoothBasalt => 892u32, + BlockKind::RawIronBlock => 893u32, + BlockKind::RawCopperBlock => 894u32, + BlockKind::RawGoldBlock => 895u32, + BlockKind::PottedAzaleaBush => 896u32, + BlockKind::PottedFloweringAzaleaBush => 897u32, } } - - /// Gets a `BlockKind` by its `id`. + #[doc = "Gets a `BlockKind` by its `id`."] + #[inline] pub fn from_id(id: u32) -> Option { match id { - 0 => Some(BlockKind::Air), - 1 => Some(BlockKind::Stone), - 2 => Some(BlockKind::Granite), - 3 => Some(BlockKind::PolishedGranite), - 4 => Some(BlockKind::Diorite), - 5 => Some(BlockKind::PolishedDiorite), - 6 => Some(BlockKind::Andesite), - 7 => Some(BlockKind::PolishedAndesite), - 8 => Some(BlockKind::GrassBlock), - 9 => Some(BlockKind::Dirt), - 10 => Some(BlockKind::CoarseDirt), - 11 => Some(BlockKind::Podzol), - 12 => Some(BlockKind::Cobblestone), - 13 => Some(BlockKind::OakPlanks), - 14 => Some(BlockKind::SprucePlanks), - 15 => Some(BlockKind::BirchPlanks), - 16 => Some(BlockKind::JunglePlanks), - 17 => Some(BlockKind::AcaciaPlanks), - 18 => Some(BlockKind::DarkOakPlanks), - 19 => Some(BlockKind::OakSapling), - 20 => Some(BlockKind::SpruceSapling), - 21 => Some(BlockKind::BirchSapling), - 22 => Some(BlockKind::JungleSapling), - 23 => Some(BlockKind::AcaciaSapling), - 24 => Some(BlockKind::DarkOakSapling), - 25 => Some(BlockKind::Bedrock), - 26 => Some(BlockKind::Water), - 27 => Some(BlockKind::Lava), - 28 => Some(BlockKind::Sand), - 29 => Some(BlockKind::RedSand), - 30 => Some(BlockKind::Gravel), - 31 => Some(BlockKind::GoldOre), - 32 => Some(BlockKind::IronOre), - 33 => Some(BlockKind::CoalOre), - 34 => Some(BlockKind::NetherGoldOre), - 35 => Some(BlockKind::OakLog), - 36 => Some(BlockKind::SpruceLog), - 37 => Some(BlockKind::BirchLog), - 38 => Some(BlockKind::JungleLog), - 39 => Some(BlockKind::AcaciaLog), - 40 => Some(BlockKind::DarkOakLog), - 41 => Some(BlockKind::StrippedSpruceLog), - 42 => Some(BlockKind::StrippedBirchLog), - 43 => Some(BlockKind::StrippedJungleLog), - 44 => Some(BlockKind::StrippedAcaciaLog), - 45 => Some(BlockKind::StrippedDarkOakLog), - 46 => Some(BlockKind::StrippedOakLog), - 47 => Some(BlockKind::OakWood), - 48 => Some(BlockKind::SpruceWood), - 49 => Some(BlockKind::BirchWood), - 50 => Some(BlockKind::JungleWood), - 51 => Some(BlockKind::AcaciaWood), - 52 => Some(BlockKind::DarkOakWood), - 53 => Some(BlockKind::StrippedOakWood), - 54 => Some(BlockKind::StrippedSpruceWood), - 55 => Some(BlockKind::StrippedBirchWood), - 56 => Some(BlockKind::StrippedJungleWood), - 57 => Some(BlockKind::StrippedAcaciaWood), - 58 => Some(BlockKind::StrippedDarkOakWood), - 59 => Some(BlockKind::OakLeaves), - 60 => Some(BlockKind::SpruceLeaves), - 61 => Some(BlockKind::BirchLeaves), - 62 => Some(BlockKind::JungleLeaves), - 63 => Some(BlockKind::AcaciaLeaves), - 64 => Some(BlockKind::DarkOakLeaves), - 65 => Some(BlockKind::Sponge), - 66 => Some(BlockKind::WetSponge), - 67 => Some(BlockKind::Glass), - 68 => Some(BlockKind::LapisOre), - 69 => Some(BlockKind::LapisBlock), - 70 => Some(BlockKind::Dispenser), - 71 => Some(BlockKind::Sandstone), - 72 => Some(BlockKind::ChiseledSandstone), - 73 => Some(BlockKind::CutSandstone), - 74 => Some(BlockKind::NoteBlock), - 75 => Some(BlockKind::WhiteBed), - 76 => Some(BlockKind::OrangeBed), - 77 => Some(BlockKind::MagentaBed), - 78 => Some(BlockKind::LightBlueBed), - 79 => Some(BlockKind::YellowBed), - 80 => Some(BlockKind::LimeBed), - 81 => Some(BlockKind::PinkBed), - 82 => Some(BlockKind::GrayBed), - 83 => Some(BlockKind::LightGrayBed), - 84 => Some(BlockKind::CyanBed), - 85 => Some(BlockKind::PurpleBed), - 86 => Some(BlockKind::BlueBed), - 87 => Some(BlockKind::BrownBed), - 88 => Some(BlockKind::GreenBed), - 89 => Some(BlockKind::RedBed), - 90 => Some(BlockKind::BlackBed), - 91 => Some(BlockKind::PoweredRail), - 92 => Some(BlockKind::DetectorRail), - 93 => Some(BlockKind::StickyPiston), - 94 => Some(BlockKind::Cobweb), - 95 => Some(BlockKind::Grass), - 96 => Some(BlockKind::Fern), - 97 => Some(BlockKind::DeadBush), - 98 => Some(BlockKind::Seagrass), - 99 => Some(BlockKind::TallSeagrass), - 100 => Some(BlockKind::Piston), - 101 => Some(BlockKind::PistonHead), - 102 => Some(BlockKind::WhiteWool), - 103 => Some(BlockKind::OrangeWool), - 104 => Some(BlockKind::MagentaWool), - 105 => Some(BlockKind::LightBlueWool), - 106 => Some(BlockKind::YellowWool), - 107 => Some(BlockKind::LimeWool), - 108 => Some(BlockKind::PinkWool), - 109 => Some(BlockKind::GrayWool), - 110 => Some(BlockKind::LightGrayWool), - 111 => Some(BlockKind::CyanWool), - 112 => Some(BlockKind::PurpleWool), - 113 => Some(BlockKind::BlueWool), - 114 => Some(BlockKind::BrownWool), - 115 => Some(BlockKind::GreenWool), - 116 => Some(BlockKind::RedWool), - 117 => Some(BlockKind::BlackWool), - 118 => Some(BlockKind::MovingPiston), - 119 => Some(BlockKind::Dandelion), - 120 => Some(BlockKind::Poppy), - 121 => Some(BlockKind::BlueOrchid), - 122 => Some(BlockKind::Allium), - 123 => Some(BlockKind::AzureBluet), - 124 => Some(BlockKind::RedTulip), - 125 => Some(BlockKind::OrangeTulip), - 126 => Some(BlockKind::WhiteTulip), - 127 => Some(BlockKind::PinkTulip), - 128 => Some(BlockKind::OxeyeDaisy), - 129 => Some(BlockKind::Cornflower), - 130 => Some(BlockKind::WitherRose), - 131 => Some(BlockKind::LilyOfTheValley), - 132 => Some(BlockKind::BrownMushroom), - 133 => Some(BlockKind::RedMushroom), - 134 => Some(BlockKind::GoldBlock), - 135 => Some(BlockKind::IronBlock), - 136 => Some(BlockKind::Bricks), - 137 => Some(BlockKind::Tnt), - 138 => Some(BlockKind::Bookshelf), - 139 => Some(BlockKind::MossyCobblestone), - 140 => Some(BlockKind::Obsidian), - 141 => Some(BlockKind::Torch), - 142 => Some(BlockKind::WallTorch), - 143 => Some(BlockKind::Fire), - 144 => Some(BlockKind::SoulFire), - 145 => Some(BlockKind::Spawner), - 146 => Some(BlockKind::OakStairs), - 147 => Some(BlockKind::Chest), - 148 => Some(BlockKind::RedstoneWire), - 149 => Some(BlockKind::DiamondOre), - 150 => Some(BlockKind::DiamondBlock), - 151 => Some(BlockKind::CraftingTable), - 152 => Some(BlockKind::Wheat), - 153 => Some(BlockKind::Farmland), - 154 => Some(BlockKind::Furnace), - 155 => Some(BlockKind::OakSign), - 156 => Some(BlockKind::SpruceSign), - 157 => Some(BlockKind::BirchSign), - 158 => Some(BlockKind::AcaciaSign), - 159 => Some(BlockKind::JungleSign), - 160 => Some(BlockKind::DarkOakSign), - 161 => Some(BlockKind::OakDoor), - 162 => Some(BlockKind::Ladder), - 163 => Some(BlockKind::Rail), - 164 => Some(BlockKind::CobblestoneStairs), - 165 => Some(BlockKind::OakWallSign), - 166 => Some(BlockKind::SpruceWallSign), - 167 => Some(BlockKind::BirchWallSign), - 168 => Some(BlockKind::AcaciaWallSign), - 169 => Some(BlockKind::JungleWallSign), - 170 => Some(BlockKind::DarkOakWallSign), - 171 => Some(BlockKind::Lever), - 172 => Some(BlockKind::StonePressurePlate), - 173 => Some(BlockKind::IronDoor), - 174 => Some(BlockKind::OakPressurePlate), - 175 => Some(BlockKind::SprucePressurePlate), - 176 => Some(BlockKind::BirchPressurePlate), - 177 => Some(BlockKind::JunglePressurePlate), - 178 => Some(BlockKind::AcaciaPressurePlate), - 179 => Some(BlockKind::DarkOakPressurePlate), - 180 => Some(BlockKind::RedstoneOre), - 181 => Some(BlockKind::RedstoneTorch), - 182 => Some(BlockKind::RedstoneWallTorch), - 183 => Some(BlockKind::StoneButton), - 184 => Some(BlockKind::Snow), - 185 => Some(BlockKind::Ice), - 186 => Some(BlockKind::SnowBlock), - 187 => Some(BlockKind::Cactus), - 188 => Some(BlockKind::Clay), - 189 => Some(BlockKind::SugarCane), - 190 => Some(BlockKind::Jukebox), - 191 => Some(BlockKind::OakFence), - 192 => Some(BlockKind::Pumpkin), - 193 => Some(BlockKind::Netherrack), - 194 => Some(BlockKind::SoulSand), - 195 => Some(BlockKind::SoulSoil), - 196 => Some(BlockKind::Basalt), - 197 => Some(BlockKind::PolishedBasalt), - 198 => Some(BlockKind::SoulTorch), - 199 => Some(BlockKind::SoulWallTorch), - 200 => Some(BlockKind::Glowstone), - 201 => Some(BlockKind::NetherPortal), - 202 => Some(BlockKind::CarvedPumpkin), - 203 => Some(BlockKind::JackOLantern), - 204 => Some(BlockKind::Cake), - 205 => Some(BlockKind::Repeater), - 206 => Some(BlockKind::WhiteStainedGlass), - 207 => Some(BlockKind::OrangeStainedGlass), - 208 => Some(BlockKind::MagentaStainedGlass), - 209 => Some(BlockKind::LightBlueStainedGlass), - 210 => Some(BlockKind::YellowStainedGlass), - 211 => Some(BlockKind::LimeStainedGlass), - 212 => Some(BlockKind::PinkStainedGlass), - 213 => Some(BlockKind::GrayStainedGlass), - 214 => Some(BlockKind::LightGrayStainedGlass), - 215 => Some(BlockKind::CyanStainedGlass), - 216 => Some(BlockKind::PurpleStainedGlass), - 217 => Some(BlockKind::BlueStainedGlass), - 218 => Some(BlockKind::BrownStainedGlass), - 219 => Some(BlockKind::GreenStainedGlass), - 220 => Some(BlockKind::RedStainedGlass), - 221 => Some(BlockKind::BlackStainedGlass), - 222 => Some(BlockKind::OakTrapdoor), - 223 => Some(BlockKind::SpruceTrapdoor), - 224 => Some(BlockKind::BirchTrapdoor), - 225 => Some(BlockKind::JungleTrapdoor), - 226 => Some(BlockKind::AcaciaTrapdoor), - 227 => Some(BlockKind::DarkOakTrapdoor), - 228 => Some(BlockKind::StoneBricks), - 229 => Some(BlockKind::MossyStoneBricks), - 230 => Some(BlockKind::CrackedStoneBricks), - 231 => Some(BlockKind::ChiseledStoneBricks), - 232 => Some(BlockKind::InfestedStone), - 233 => Some(BlockKind::InfestedCobblestone), - 234 => Some(BlockKind::InfestedStoneBricks), - 235 => Some(BlockKind::InfestedMossyStoneBricks), - 236 => Some(BlockKind::InfestedCrackedStoneBricks), - 237 => Some(BlockKind::InfestedChiseledStoneBricks), - 238 => Some(BlockKind::BrownMushroomBlock), - 239 => Some(BlockKind::RedMushroomBlock), - 240 => Some(BlockKind::MushroomStem), - 241 => Some(BlockKind::IronBars), - 242 => Some(BlockKind::Chain), - 243 => Some(BlockKind::GlassPane), - 244 => Some(BlockKind::Melon), - 245 => Some(BlockKind::AttachedPumpkinStem), - 246 => Some(BlockKind::AttachedMelonStem), - 247 => Some(BlockKind::PumpkinStem), - 248 => Some(BlockKind::MelonStem), - 249 => Some(BlockKind::Vine), - 250 => Some(BlockKind::OakFenceGate), - 251 => Some(BlockKind::BrickStairs), - 252 => Some(BlockKind::StoneBrickStairs), - 253 => Some(BlockKind::Mycelium), - 254 => Some(BlockKind::LilyPad), - 255 => Some(BlockKind::NetherBricks), - 256 => Some(BlockKind::NetherBrickFence), - 257 => Some(BlockKind::NetherBrickStairs), - 258 => Some(BlockKind::NetherWart), - 259 => Some(BlockKind::EnchantingTable), - 260 => Some(BlockKind::BrewingStand), - 261 => Some(BlockKind::Cauldron), - 262 => Some(BlockKind::EndPortal), - 263 => Some(BlockKind::EndPortalFrame), - 264 => Some(BlockKind::EndStone), - 265 => Some(BlockKind::DragonEgg), - 266 => Some(BlockKind::RedstoneLamp), - 267 => Some(BlockKind::Cocoa), - 268 => Some(BlockKind::SandstoneStairs), - 269 => Some(BlockKind::EmeraldOre), - 270 => Some(BlockKind::EnderChest), - 271 => Some(BlockKind::TripwireHook), - 272 => Some(BlockKind::Tripwire), - 273 => Some(BlockKind::EmeraldBlock), - 274 => Some(BlockKind::SpruceStairs), - 275 => Some(BlockKind::BirchStairs), - 276 => Some(BlockKind::JungleStairs), - 277 => Some(BlockKind::CommandBlock), - 278 => Some(BlockKind::Beacon), - 279 => Some(BlockKind::CobblestoneWall), - 280 => Some(BlockKind::MossyCobblestoneWall), - 281 => Some(BlockKind::FlowerPot), - 282 => Some(BlockKind::PottedOakSapling), - 283 => Some(BlockKind::PottedSpruceSapling), - 284 => Some(BlockKind::PottedBirchSapling), - 285 => Some(BlockKind::PottedJungleSapling), - 286 => Some(BlockKind::PottedAcaciaSapling), - 287 => Some(BlockKind::PottedDarkOakSapling), - 288 => Some(BlockKind::PottedFern), - 289 => Some(BlockKind::PottedDandelion), - 290 => Some(BlockKind::PottedPoppy), - 291 => Some(BlockKind::PottedBlueOrchid), - 292 => Some(BlockKind::PottedAllium), - 293 => Some(BlockKind::PottedAzureBluet), - 294 => Some(BlockKind::PottedRedTulip), - 295 => Some(BlockKind::PottedOrangeTulip), - 296 => Some(BlockKind::PottedWhiteTulip), - 297 => Some(BlockKind::PottedPinkTulip), - 298 => Some(BlockKind::PottedOxeyeDaisy), - 299 => Some(BlockKind::PottedCornflower), - 300 => Some(BlockKind::PottedLilyOfTheValley), - 301 => Some(BlockKind::PottedWitherRose), - 302 => Some(BlockKind::PottedRedMushroom), - 303 => Some(BlockKind::PottedBrownMushroom), - 304 => Some(BlockKind::PottedDeadBush), - 305 => Some(BlockKind::PottedCactus), - 306 => Some(BlockKind::Carrots), - 307 => Some(BlockKind::Potatoes), - 308 => Some(BlockKind::OakButton), - 309 => Some(BlockKind::SpruceButton), - 310 => Some(BlockKind::BirchButton), - 311 => Some(BlockKind::JungleButton), - 312 => Some(BlockKind::AcaciaButton), - 313 => Some(BlockKind::DarkOakButton), - 314 => Some(BlockKind::SkeletonSkull), - 315 => Some(BlockKind::SkeletonWallSkull), - 316 => Some(BlockKind::WitherSkeletonSkull), - 317 => Some(BlockKind::WitherSkeletonWallSkull), - 318 => Some(BlockKind::ZombieHead), - 319 => Some(BlockKind::ZombieWallHead), - 320 => Some(BlockKind::PlayerHead), - 321 => Some(BlockKind::PlayerWallHead), - 322 => Some(BlockKind::CreeperHead), - 323 => Some(BlockKind::CreeperWallHead), - 324 => Some(BlockKind::DragonHead), - 325 => Some(BlockKind::DragonWallHead), - 326 => Some(BlockKind::Anvil), - 327 => Some(BlockKind::ChippedAnvil), - 328 => Some(BlockKind::DamagedAnvil), - 329 => Some(BlockKind::TrappedChest), - 330 => Some(BlockKind::LightWeightedPressurePlate), - 331 => Some(BlockKind::HeavyWeightedPressurePlate), - 332 => Some(BlockKind::Comparator), - 333 => Some(BlockKind::DaylightDetector), - 334 => Some(BlockKind::RedstoneBlock), - 335 => Some(BlockKind::NetherQuartzOre), - 336 => Some(BlockKind::Hopper), - 337 => Some(BlockKind::QuartzBlock), - 338 => Some(BlockKind::ChiseledQuartzBlock), - 339 => Some(BlockKind::QuartzPillar), - 340 => Some(BlockKind::QuartzStairs), - 341 => Some(BlockKind::ActivatorRail), - 342 => Some(BlockKind::Dropper), - 343 => Some(BlockKind::WhiteTerracotta), - 344 => Some(BlockKind::OrangeTerracotta), - 345 => Some(BlockKind::MagentaTerracotta), - 346 => Some(BlockKind::LightBlueTerracotta), - 347 => Some(BlockKind::YellowTerracotta), - 348 => Some(BlockKind::LimeTerracotta), - 349 => Some(BlockKind::PinkTerracotta), - 350 => Some(BlockKind::GrayTerracotta), - 351 => Some(BlockKind::LightGrayTerracotta), - 352 => Some(BlockKind::CyanTerracotta), - 353 => Some(BlockKind::PurpleTerracotta), - 354 => Some(BlockKind::BlueTerracotta), - 355 => Some(BlockKind::BrownTerracotta), - 356 => Some(BlockKind::GreenTerracotta), - 357 => Some(BlockKind::RedTerracotta), - 358 => Some(BlockKind::BlackTerracotta), - 359 => Some(BlockKind::WhiteStainedGlassPane), - 360 => Some(BlockKind::OrangeStainedGlassPane), - 361 => Some(BlockKind::MagentaStainedGlassPane), - 362 => Some(BlockKind::LightBlueStainedGlassPane), - 363 => Some(BlockKind::YellowStainedGlassPane), - 364 => Some(BlockKind::LimeStainedGlassPane), - 365 => Some(BlockKind::PinkStainedGlassPane), - 366 => Some(BlockKind::GrayStainedGlassPane), - 367 => Some(BlockKind::LightGrayStainedGlassPane), - 368 => Some(BlockKind::CyanStainedGlassPane), - 369 => Some(BlockKind::PurpleStainedGlassPane), - 370 => Some(BlockKind::BlueStainedGlassPane), - 371 => Some(BlockKind::BrownStainedGlassPane), - 372 => Some(BlockKind::GreenStainedGlassPane), - 373 => Some(BlockKind::RedStainedGlassPane), - 374 => Some(BlockKind::BlackStainedGlassPane), - 375 => Some(BlockKind::AcaciaStairs), - 376 => Some(BlockKind::DarkOakStairs), - 377 => Some(BlockKind::SlimeBlock), - 378 => Some(BlockKind::Barrier), - 379 => Some(BlockKind::IronTrapdoor), - 380 => Some(BlockKind::Prismarine), - 381 => Some(BlockKind::PrismarineBricks), - 382 => Some(BlockKind::DarkPrismarine), - 383 => Some(BlockKind::PrismarineStairs), - 384 => Some(BlockKind::PrismarineBrickStairs), - 385 => Some(BlockKind::DarkPrismarineStairs), - 386 => Some(BlockKind::PrismarineSlab), - 387 => Some(BlockKind::PrismarineBrickSlab), - 388 => Some(BlockKind::DarkPrismarineSlab), - 389 => Some(BlockKind::SeaLantern), - 390 => Some(BlockKind::HayBlock), - 391 => Some(BlockKind::WhiteCarpet), - 392 => Some(BlockKind::OrangeCarpet), - 393 => Some(BlockKind::MagentaCarpet), - 394 => Some(BlockKind::LightBlueCarpet), - 395 => Some(BlockKind::YellowCarpet), - 396 => Some(BlockKind::LimeCarpet), - 397 => Some(BlockKind::PinkCarpet), - 398 => Some(BlockKind::GrayCarpet), - 399 => Some(BlockKind::LightGrayCarpet), - 400 => Some(BlockKind::CyanCarpet), - 401 => Some(BlockKind::PurpleCarpet), - 402 => Some(BlockKind::BlueCarpet), - 403 => Some(BlockKind::BrownCarpet), - 404 => Some(BlockKind::GreenCarpet), - 405 => Some(BlockKind::RedCarpet), - 406 => Some(BlockKind::BlackCarpet), - 407 => Some(BlockKind::Terracotta), - 408 => Some(BlockKind::CoalBlock), - 409 => Some(BlockKind::PackedIce), - 410 => Some(BlockKind::Sunflower), - 411 => Some(BlockKind::Lilac), - 412 => Some(BlockKind::RoseBush), - 413 => Some(BlockKind::Peony), - 414 => Some(BlockKind::TallGrass), - 415 => Some(BlockKind::LargeFern), - 416 => Some(BlockKind::WhiteBanner), - 417 => Some(BlockKind::OrangeBanner), - 418 => Some(BlockKind::MagentaBanner), - 419 => Some(BlockKind::LightBlueBanner), - 420 => Some(BlockKind::YellowBanner), - 421 => Some(BlockKind::LimeBanner), - 422 => Some(BlockKind::PinkBanner), - 423 => Some(BlockKind::GrayBanner), - 424 => Some(BlockKind::LightGrayBanner), - 425 => Some(BlockKind::CyanBanner), - 426 => Some(BlockKind::PurpleBanner), - 427 => Some(BlockKind::BlueBanner), - 428 => Some(BlockKind::BrownBanner), - 429 => Some(BlockKind::GreenBanner), - 430 => Some(BlockKind::RedBanner), - 431 => Some(BlockKind::BlackBanner), - 432 => Some(BlockKind::WhiteWallBanner), - 433 => Some(BlockKind::OrangeWallBanner), - 434 => Some(BlockKind::MagentaWallBanner), - 435 => Some(BlockKind::LightBlueWallBanner), - 436 => Some(BlockKind::YellowWallBanner), - 437 => Some(BlockKind::LimeWallBanner), - 438 => Some(BlockKind::PinkWallBanner), - 439 => Some(BlockKind::GrayWallBanner), - 440 => Some(BlockKind::LightGrayWallBanner), - 441 => Some(BlockKind::CyanWallBanner), - 442 => Some(BlockKind::PurpleWallBanner), - 443 => Some(BlockKind::BlueWallBanner), - 444 => Some(BlockKind::BrownWallBanner), - 445 => Some(BlockKind::GreenWallBanner), - 446 => Some(BlockKind::RedWallBanner), - 447 => Some(BlockKind::BlackWallBanner), - 448 => Some(BlockKind::RedSandstone), - 449 => Some(BlockKind::ChiseledRedSandstone), - 450 => Some(BlockKind::CutRedSandstone), - 451 => Some(BlockKind::RedSandstoneStairs), - 452 => Some(BlockKind::OakSlab), - 453 => Some(BlockKind::SpruceSlab), - 454 => Some(BlockKind::BirchSlab), - 455 => Some(BlockKind::JungleSlab), - 456 => Some(BlockKind::AcaciaSlab), - 457 => Some(BlockKind::DarkOakSlab), - 458 => Some(BlockKind::StoneSlab), - 459 => Some(BlockKind::SmoothStoneSlab), - 460 => Some(BlockKind::SandstoneSlab), - 461 => Some(BlockKind::CutSandstoneSlab), - 462 => Some(BlockKind::PetrifiedOakSlab), - 463 => Some(BlockKind::CobblestoneSlab), - 464 => Some(BlockKind::BrickSlab), - 465 => Some(BlockKind::StoneBrickSlab), - 466 => Some(BlockKind::NetherBrickSlab), - 467 => Some(BlockKind::QuartzSlab), - 468 => Some(BlockKind::RedSandstoneSlab), - 469 => Some(BlockKind::CutRedSandstoneSlab), - 470 => Some(BlockKind::PurpurSlab), - 471 => Some(BlockKind::SmoothStone), - 472 => Some(BlockKind::SmoothSandstone), - 473 => Some(BlockKind::SmoothQuartz), - 474 => Some(BlockKind::SmoothRedSandstone), - 475 => Some(BlockKind::SpruceFenceGate), - 476 => Some(BlockKind::BirchFenceGate), - 477 => Some(BlockKind::JungleFenceGate), - 478 => Some(BlockKind::AcaciaFenceGate), - 479 => Some(BlockKind::DarkOakFenceGate), - 480 => Some(BlockKind::SpruceFence), - 481 => Some(BlockKind::BirchFence), - 482 => Some(BlockKind::JungleFence), - 483 => Some(BlockKind::AcaciaFence), - 484 => Some(BlockKind::DarkOakFence), - 485 => Some(BlockKind::SpruceDoor), - 486 => Some(BlockKind::BirchDoor), - 487 => Some(BlockKind::JungleDoor), - 488 => Some(BlockKind::AcaciaDoor), - 489 => Some(BlockKind::DarkOakDoor), - 490 => Some(BlockKind::EndRod), - 491 => Some(BlockKind::ChorusPlant), - 492 => Some(BlockKind::ChorusFlower), - 493 => Some(BlockKind::PurpurBlock), - 494 => Some(BlockKind::PurpurPillar), - 495 => Some(BlockKind::PurpurStairs), - 496 => Some(BlockKind::EndStoneBricks), - 497 => Some(BlockKind::Beetroots), - 498 => Some(BlockKind::GrassPath), - 499 => Some(BlockKind::EndGateway), - 500 => Some(BlockKind::RepeatingCommandBlock), - 501 => Some(BlockKind::ChainCommandBlock), - 502 => Some(BlockKind::FrostedIce), - 503 => Some(BlockKind::MagmaBlock), - 504 => Some(BlockKind::NetherWartBlock), - 505 => Some(BlockKind::RedNetherBricks), - 506 => Some(BlockKind::BoneBlock), - 507 => Some(BlockKind::StructureVoid), - 508 => Some(BlockKind::Observer), - 509 => Some(BlockKind::ShulkerBox), - 510 => Some(BlockKind::WhiteShulkerBox), - 511 => Some(BlockKind::OrangeShulkerBox), - 512 => Some(BlockKind::MagentaShulkerBox), - 513 => Some(BlockKind::LightBlueShulkerBox), - 514 => Some(BlockKind::YellowShulkerBox), - 515 => Some(BlockKind::LimeShulkerBox), - 516 => Some(BlockKind::PinkShulkerBox), - 517 => Some(BlockKind::GrayShulkerBox), - 518 => Some(BlockKind::LightGrayShulkerBox), - 519 => Some(BlockKind::CyanShulkerBox), - 520 => Some(BlockKind::PurpleShulkerBox), - 521 => Some(BlockKind::BlueShulkerBox), - 522 => Some(BlockKind::BrownShulkerBox), - 523 => Some(BlockKind::GreenShulkerBox), - 524 => Some(BlockKind::RedShulkerBox), - 525 => Some(BlockKind::BlackShulkerBox), - 526 => Some(BlockKind::WhiteGlazedTerracotta), - 527 => Some(BlockKind::OrangeGlazedTerracotta), - 528 => Some(BlockKind::MagentaGlazedTerracotta), - 529 => Some(BlockKind::LightBlueGlazedTerracotta), - 530 => Some(BlockKind::YellowGlazedTerracotta), - 531 => Some(BlockKind::LimeGlazedTerracotta), - 532 => Some(BlockKind::PinkGlazedTerracotta), - 533 => Some(BlockKind::GrayGlazedTerracotta), - 534 => Some(BlockKind::LightGrayGlazedTerracotta), - 535 => Some(BlockKind::CyanGlazedTerracotta), - 536 => Some(BlockKind::PurpleGlazedTerracotta), - 537 => Some(BlockKind::BlueGlazedTerracotta), - 538 => Some(BlockKind::BrownGlazedTerracotta), - 539 => Some(BlockKind::GreenGlazedTerracotta), - 540 => Some(BlockKind::RedGlazedTerracotta), - 541 => Some(BlockKind::BlackGlazedTerracotta), - 542 => Some(BlockKind::WhiteConcrete), - 543 => Some(BlockKind::OrangeConcrete), - 544 => Some(BlockKind::MagentaConcrete), - 545 => Some(BlockKind::LightBlueConcrete), - 546 => Some(BlockKind::YellowConcrete), - 547 => Some(BlockKind::LimeConcrete), - 548 => Some(BlockKind::PinkConcrete), - 549 => Some(BlockKind::GrayConcrete), - 550 => Some(BlockKind::LightGrayConcrete), - 551 => Some(BlockKind::CyanConcrete), - 552 => Some(BlockKind::PurpleConcrete), - 553 => Some(BlockKind::BlueConcrete), - 554 => Some(BlockKind::BrownConcrete), - 555 => Some(BlockKind::GreenConcrete), - 556 => Some(BlockKind::RedConcrete), - 557 => Some(BlockKind::BlackConcrete), - 558 => Some(BlockKind::WhiteConcretePowder), - 559 => Some(BlockKind::OrangeConcretePowder), - 560 => Some(BlockKind::MagentaConcretePowder), - 561 => Some(BlockKind::LightBlueConcretePowder), - 562 => Some(BlockKind::YellowConcretePowder), - 563 => Some(BlockKind::LimeConcretePowder), - 564 => Some(BlockKind::PinkConcretePowder), - 565 => Some(BlockKind::GrayConcretePowder), - 566 => Some(BlockKind::LightGrayConcretePowder), - 567 => Some(BlockKind::CyanConcretePowder), - 568 => Some(BlockKind::PurpleConcretePowder), - 569 => Some(BlockKind::BlueConcretePowder), - 570 => Some(BlockKind::BrownConcretePowder), - 571 => Some(BlockKind::GreenConcretePowder), - 572 => Some(BlockKind::RedConcretePowder), - 573 => Some(BlockKind::BlackConcretePowder), - 574 => Some(BlockKind::Kelp), - 575 => Some(BlockKind::KelpPlant), - 576 => Some(BlockKind::DriedKelpBlock), - 577 => Some(BlockKind::TurtleEgg), - 578 => Some(BlockKind::DeadTubeCoralBlock), - 579 => Some(BlockKind::DeadBrainCoralBlock), - 580 => Some(BlockKind::DeadBubbleCoralBlock), - 581 => Some(BlockKind::DeadFireCoralBlock), - 582 => Some(BlockKind::DeadHornCoralBlock), - 583 => Some(BlockKind::TubeCoralBlock), - 584 => Some(BlockKind::BrainCoralBlock), - 585 => Some(BlockKind::BubbleCoralBlock), - 586 => Some(BlockKind::FireCoralBlock), - 587 => Some(BlockKind::HornCoralBlock), - 588 => Some(BlockKind::DeadTubeCoral), - 589 => Some(BlockKind::DeadBrainCoral), - 590 => Some(BlockKind::DeadBubbleCoral), - 591 => Some(BlockKind::DeadFireCoral), - 592 => Some(BlockKind::DeadHornCoral), - 593 => Some(BlockKind::TubeCoral), - 594 => Some(BlockKind::BrainCoral), - 595 => Some(BlockKind::BubbleCoral), - 596 => Some(BlockKind::FireCoral), - 597 => Some(BlockKind::HornCoral), - 598 => Some(BlockKind::DeadTubeCoralFan), - 599 => Some(BlockKind::DeadBrainCoralFan), - 600 => Some(BlockKind::DeadBubbleCoralFan), - 601 => Some(BlockKind::DeadFireCoralFan), - 602 => Some(BlockKind::DeadHornCoralFan), - 603 => Some(BlockKind::TubeCoralFan), - 604 => Some(BlockKind::BrainCoralFan), - 605 => Some(BlockKind::BubbleCoralFan), - 606 => Some(BlockKind::FireCoralFan), - 607 => Some(BlockKind::HornCoralFan), - 608 => Some(BlockKind::DeadTubeCoralWallFan), - 609 => Some(BlockKind::DeadBrainCoralWallFan), - 610 => Some(BlockKind::DeadBubbleCoralWallFan), - 611 => Some(BlockKind::DeadFireCoralWallFan), - 612 => Some(BlockKind::DeadHornCoralWallFan), - 613 => Some(BlockKind::TubeCoralWallFan), - 614 => Some(BlockKind::BrainCoralWallFan), - 615 => Some(BlockKind::BubbleCoralWallFan), - 616 => Some(BlockKind::FireCoralWallFan), - 617 => Some(BlockKind::HornCoralWallFan), - 618 => Some(BlockKind::SeaPickle), - 619 => Some(BlockKind::BlueIce), - 620 => Some(BlockKind::Conduit), - 621 => Some(BlockKind::BambooSapling), - 622 => Some(BlockKind::Bamboo), - 623 => Some(BlockKind::PottedBamboo), - 624 => Some(BlockKind::VoidAir), - 625 => Some(BlockKind::CaveAir), - 626 => Some(BlockKind::BubbleColumn), - 627 => Some(BlockKind::PolishedGraniteStairs), - 628 => Some(BlockKind::SmoothRedSandstoneStairs), - 629 => Some(BlockKind::MossyStoneBrickStairs), - 630 => Some(BlockKind::PolishedDioriteStairs), - 631 => Some(BlockKind::MossyCobblestoneStairs), - 632 => Some(BlockKind::EndStoneBrickStairs), - 633 => Some(BlockKind::StoneStairs), - 634 => Some(BlockKind::SmoothSandstoneStairs), - 635 => Some(BlockKind::SmoothQuartzStairs), - 636 => Some(BlockKind::GraniteStairs), - 637 => Some(BlockKind::AndesiteStairs), - 638 => Some(BlockKind::RedNetherBrickStairs), - 639 => Some(BlockKind::PolishedAndesiteStairs), - 640 => Some(BlockKind::DioriteStairs), - 641 => Some(BlockKind::PolishedGraniteSlab), - 642 => Some(BlockKind::SmoothRedSandstoneSlab), - 643 => Some(BlockKind::MossyStoneBrickSlab), - 644 => Some(BlockKind::PolishedDioriteSlab), - 645 => Some(BlockKind::MossyCobblestoneSlab), - 646 => Some(BlockKind::EndStoneBrickSlab), - 647 => Some(BlockKind::SmoothSandstoneSlab), - 648 => Some(BlockKind::SmoothQuartzSlab), - 649 => Some(BlockKind::GraniteSlab), - 650 => Some(BlockKind::AndesiteSlab), - 651 => Some(BlockKind::RedNetherBrickSlab), - 652 => Some(BlockKind::PolishedAndesiteSlab), - 653 => Some(BlockKind::DioriteSlab), - 654 => Some(BlockKind::BrickWall), - 655 => Some(BlockKind::PrismarineWall), - 656 => Some(BlockKind::RedSandstoneWall), - 657 => Some(BlockKind::MossyStoneBrickWall), - 658 => Some(BlockKind::GraniteWall), - 659 => Some(BlockKind::StoneBrickWall), - 660 => Some(BlockKind::NetherBrickWall), - 661 => Some(BlockKind::AndesiteWall), - 662 => Some(BlockKind::RedNetherBrickWall), - 663 => Some(BlockKind::SandstoneWall), - 664 => Some(BlockKind::EndStoneBrickWall), - 665 => Some(BlockKind::DioriteWall), - 666 => Some(BlockKind::Scaffolding), - 667 => Some(BlockKind::Loom), - 668 => Some(BlockKind::Barrel), - 669 => Some(BlockKind::Smoker), - 670 => Some(BlockKind::BlastFurnace), - 671 => Some(BlockKind::CartographyTable), - 672 => Some(BlockKind::FletchingTable), - 673 => Some(BlockKind::Grindstone), - 674 => Some(BlockKind::Lectern), - 675 => Some(BlockKind::SmithingTable), - 676 => Some(BlockKind::Stonecutter), - 677 => Some(BlockKind::Bell), - 678 => Some(BlockKind::Lantern), - 679 => Some(BlockKind::SoulLantern), - 680 => Some(BlockKind::Campfire), - 681 => Some(BlockKind::SoulCampfire), - 682 => Some(BlockKind::SweetBerryBush), - 683 => Some(BlockKind::WarpedStem), - 684 => Some(BlockKind::StrippedWarpedStem), - 685 => Some(BlockKind::WarpedHyphae), - 686 => Some(BlockKind::StrippedWarpedHyphae), - 687 => Some(BlockKind::WarpedNylium), - 688 => Some(BlockKind::WarpedFungus), - 689 => Some(BlockKind::WarpedWartBlock), - 690 => Some(BlockKind::WarpedRoots), - 691 => Some(BlockKind::NetherSprouts), - 692 => Some(BlockKind::CrimsonStem), - 693 => Some(BlockKind::StrippedCrimsonStem), - 694 => Some(BlockKind::CrimsonHyphae), - 695 => Some(BlockKind::StrippedCrimsonHyphae), - 696 => Some(BlockKind::CrimsonNylium), - 697 => Some(BlockKind::CrimsonFungus), - 698 => Some(BlockKind::Shroomlight), - 699 => Some(BlockKind::WeepingVines), - 700 => Some(BlockKind::WeepingVinesPlant), - 701 => Some(BlockKind::TwistingVines), - 702 => Some(BlockKind::TwistingVinesPlant), - 703 => Some(BlockKind::CrimsonRoots), - 704 => Some(BlockKind::CrimsonPlanks), - 705 => Some(BlockKind::WarpedPlanks), - 706 => Some(BlockKind::CrimsonSlab), - 707 => Some(BlockKind::WarpedSlab), - 708 => Some(BlockKind::CrimsonPressurePlate), - 709 => Some(BlockKind::WarpedPressurePlate), - 710 => Some(BlockKind::CrimsonFence), - 711 => Some(BlockKind::WarpedFence), - 712 => Some(BlockKind::CrimsonTrapdoor), - 713 => Some(BlockKind::WarpedTrapdoor), - 714 => Some(BlockKind::CrimsonFenceGate), - 715 => Some(BlockKind::WarpedFenceGate), - 716 => Some(BlockKind::CrimsonStairs), - 717 => Some(BlockKind::WarpedStairs), - 718 => Some(BlockKind::CrimsonButton), - 719 => Some(BlockKind::WarpedButton), - 720 => Some(BlockKind::CrimsonDoor), - 721 => Some(BlockKind::WarpedDoor), - 722 => Some(BlockKind::CrimsonSign), - 723 => Some(BlockKind::WarpedSign), - 724 => Some(BlockKind::CrimsonWallSign), - 725 => Some(BlockKind::WarpedWallSign), - 726 => Some(BlockKind::StructureBlock), - 727 => Some(BlockKind::Jigsaw), - 728 => Some(BlockKind::Composter), - 729 => Some(BlockKind::Target), - 730 => Some(BlockKind::BeeNest), - 731 => Some(BlockKind::Beehive), - 732 => Some(BlockKind::HoneyBlock), - 733 => Some(BlockKind::HoneycombBlock), - 734 => Some(BlockKind::NetheriteBlock), - 735 => Some(BlockKind::AncientDebris), - 736 => Some(BlockKind::CryingObsidian), - 737 => Some(BlockKind::RespawnAnchor), - 738 => Some(BlockKind::PottedCrimsonFungus), - 739 => Some(BlockKind::PottedWarpedFungus), - 740 => Some(BlockKind::PottedCrimsonRoots), - 741 => Some(BlockKind::PottedWarpedRoots), - 742 => Some(BlockKind::Lodestone), - 743 => Some(BlockKind::Blackstone), - 744 => Some(BlockKind::BlackstoneStairs), - 745 => Some(BlockKind::BlackstoneWall), - 746 => Some(BlockKind::BlackstoneSlab), - 747 => Some(BlockKind::PolishedBlackstone), - 748 => Some(BlockKind::PolishedBlackstoneBricks), - 749 => Some(BlockKind::CrackedPolishedBlackstoneBricks), - 750 => Some(BlockKind::ChiseledPolishedBlackstone), - 751 => Some(BlockKind::PolishedBlackstoneBrickSlab), - 752 => Some(BlockKind::PolishedBlackstoneBrickStairs), - 753 => Some(BlockKind::PolishedBlackstoneBrickWall), - 754 => Some(BlockKind::GildedBlackstone), - 755 => Some(BlockKind::PolishedBlackstoneStairs), - 756 => Some(BlockKind::PolishedBlackstoneSlab), - 757 => Some(BlockKind::PolishedBlackstonePressurePlate), - 758 => Some(BlockKind::PolishedBlackstoneButton), - 759 => Some(BlockKind::PolishedBlackstoneWall), - 760 => Some(BlockKind::ChiseledNetherBricks), - 761 => Some(BlockKind::CrackedNetherBricks), - 762 => Some(BlockKind::QuartzBricks), + 0u32 => Some(BlockKind::Air), + 1u32 => Some(BlockKind::Stone), + 2u32 => Some(BlockKind::Granite), + 3u32 => Some(BlockKind::PolishedGranite), + 4u32 => Some(BlockKind::Diorite), + 5u32 => Some(BlockKind::PolishedDiorite), + 6u32 => Some(BlockKind::Andesite), + 7u32 => Some(BlockKind::PolishedAndesite), + 8u32 => Some(BlockKind::GrassBlock), + 9u32 => Some(BlockKind::Dirt), + 10u32 => Some(BlockKind::CoarseDirt), + 11u32 => Some(BlockKind::Podzol), + 12u32 => Some(BlockKind::Cobblestone), + 13u32 => Some(BlockKind::OakPlanks), + 14u32 => Some(BlockKind::SprucePlanks), + 15u32 => Some(BlockKind::BirchPlanks), + 16u32 => Some(BlockKind::JunglePlanks), + 17u32 => Some(BlockKind::AcaciaPlanks), + 18u32 => Some(BlockKind::DarkOakPlanks), + 19u32 => Some(BlockKind::OakSapling), + 20u32 => Some(BlockKind::SpruceSapling), + 21u32 => Some(BlockKind::BirchSapling), + 22u32 => Some(BlockKind::JungleSapling), + 23u32 => Some(BlockKind::AcaciaSapling), + 24u32 => Some(BlockKind::DarkOakSapling), + 25u32 => Some(BlockKind::Bedrock), + 26u32 => Some(BlockKind::Water), + 27u32 => Some(BlockKind::Lava), + 28u32 => Some(BlockKind::Sand), + 29u32 => Some(BlockKind::RedSand), + 30u32 => Some(BlockKind::Gravel), + 31u32 => Some(BlockKind::GoldOre), + 32u32 => Some(BlockKind::DeepslateGoldOre), + 33u32 => Some(BlockKind::IronOre), + 34u32 => Some(BlockKind::DeepslateIronOre), + 35u32 => Some(BlockKind::CoalOre), + 36u32 => Some(BlockKind::DeepslateCoalOre), + 37u32 => Some(BlockKind::NetherGoldOre), + 38u32 => Some(BlockKind::OakLog), + 39u32 => Some(BlockKind::SpruceLog), + 40u32 => Some(BlockKind::BirchLog), + 41u32 => Some(BlockKind::JungleLog), + 42u32 => Some(BlockKind::AcaciaLog), + 43u32 => Some(BlockKind::DarkOakLog), + 44u32 => Some(BlockKind::StrippedSpruceLog), + 45u32 => Some(BlockKind::StrippedBirchLog), + 46u32 => Some(BlockKind::StrippedJungleLog), + 47u32 => Some(BlockKind::StrippedAcaciaLog), + 48u32 => Some(BlockKind::StrippedDarkOakLog), + 49u32 => Some(BlockKind::StrippedOakLog), + 50u32 => Some(BlockKind::OakWood), + 51u32 => Some(BlockKind::SpruceWood), + 52u32 => Some(BlockKind::BirchWood), + 53u32 => Some(BlockKind::JungleWood), + 54u32 => Some(BlockKind::AcaciaWood), + 55u32 => Some(BlockKind::DarkOakWood), + 56u32 => Some(BlockKind::StrippedOakWood), + 57u32 => Some(BlockKind::StrippedSpruceWood), + 58u32 => Some(BlockKind::StrippedBirchWood), + 59u32 => Some(BlockKind::StrippedJungleWood), + 60u32 => Some(BlockKind::StrippedAcaciaWood), + 61u32 => Some(BlockKind::StrippedDarkOakWood), + 62u32 => Some(BlockKind::OakLeaves), + 63u32 => Some(BlockKind::SpruceLeaves), + 64u32 => Some(BlockKind::BirchLeaves), + 65u32 => Some(BlockKind::JungleLeaves), + 66u32 => Some(BlockKind::AcaciaLeaves), + 67u32 => Some(BlockKind::DarkOakLeaves), + 68u32 => Some(BlockKind::AzaleaLeaves), + 69u32 => Some(BlockKind::FloweringAzaleaLeaves), + 70u32 => Some(BlockKind::Sponge), + 71u32 => Some(BlockKind::WetSponge), + 72u32 => Some(BlockKind::Glass), + 73u32 => Some(BlockKind::LapisOre), + 74u32 => Some(BlockKind::DeepslateLapisOre), + 75u32 => Some(BlockKind::LapisBlock), + 76u32 => Some(BlockKind::Dispenser), + 77u32 => Some(BlockKind::Sandstone), + 78u32 => Some(BlockKind::ChiseledSandstone), + 79u32 => Some(BlockKind::CutSandstone), + 80u32 => Some(BlockKind::NoteBlock), + 81u32 => Some(BlockKind::WhiteBed), + 82u32 => Some(BlockKind::OrangeBed), + 83u32 => Some(BlockKind::MagentaBed), + 84u32 => Some(BlockKind::LightBlueBed), + 85u32 => Some(BlockKind::YellowBed), + 86u32 => Some(BlockKind::LimeBed), + 87u32 => Some(BlockKind::PinkBed), + 88u32 => Some(BlockKind::GrayBed), + 89u32 => Some(BlockKind::LightGrayBed), + 90u32 => Some(BlockKind::CyanBed), + 91u32 => Some(BlockKind::PurpleBed), + 92u32 => Some(BlockKind::BlueBed), + 93u32 => Some(BlockKind::BrownBed), + 94u32 => Some(BlockKind::GreenBed), + 95u32 => Some(BlockKind::RedBed), + 96u32 => Some(BlockKind::BlackBed), + 97u32 => Some(BlockKind::PoweredRail), + 98u32 => Some(BlockKind::DetectorRail), + 99u32 => Some(BlockKind::StickyPiston), + 100u32 => Some(BlockKind::Cobweb), + 101u32 => Some(BlockKind::Grass), + 102u32 => Some(BlockKind::Fern), + 103u32 => Some(BlockKind::DeadBush), + 104u32 => Some(BlockKind::Seagrass), + 105u32 => Some(BlockKind::TallSeagrass), + 106u32 => Some(BlockKind::Piston), + 107u32 => Some(BlockKind::PistonHead), + 108u32 => Some(BlockKind::WhiteWool), + 109u32 => Some(BlockKind::OrangeWool), + 110u32 => Some(BlockKind::MagentaWool), + 111u32 => Some(BlockKind::LightBlueWool), + 112u32 => Some(BlockKind::YellowWool), + 113u32 => Some(BlockKind::LimeWool), + 114u32 => Some(BlockKind::PinkWool), + 115u32 => Some(BlockKind::GrayWool), + 116u32 => Some(BlockKind::LightGrayWool), + 117u32 => Some(BlockKind::CyanWool), + 118u32 => Some(BlockKind::PurpleWool), + 119u32 => Some(BlockKind::BlueWool), + 120u32 => Some(BlockKind::BrownWool), + 121u32 => Some(BlockKind::GreenWool), + 122u32 => Some(BlockKind::RedWool), + 123u32 => Some(BlockKind::BlackWool), + 124u32 => Some(BlockKind::MovingPiston), + 125u32 => Some(BlockKind::Dandelion), + 126u32 => Some(BlockKind::Poppy), + 127u32 => Some(BlockKind::BlueOrchid), + 128u32 => Some(BlockKind::Allium), + 129u32 => Some(BlockKind::AzureBluet), + 130u32 => Some(BlockKind::RedTulip), + 131u32 => Some(BlockKind::OrangeTulip), + 132u32 => Some(BlockKind::WhiteTulip), + 133u32 => Some(BlockKind::PinkTulip), + 134u32 => Some(BlockKind::OxeyeDaisy), + 135u32 => Some(BlockKind::Cornflower), + 136u32 => Some(BlockKind::WitherRose), + 137u32 => Some(BlockKind::LilyOfTheValley), + 138u32 => Some(BlockKind::BrownMushroom), + 139u32 => Some(BlockKind::RedMushroom), + 140u32 => Some(BlockKind::GoldBlock), + 141u32 => Some(BlockKind::IronBlock), + 142u32 => Some(BlockKind::Bricks), + 143u32 => Some(BlockKind::Tnt), + 144u32 => Some(BlockKind::Bookshelf), + 145u32 => Some(BlockKind::MossyCobblestone), + 146u32 => Some(BlockKind::Obsidian), + 147u32 => Some(BlockKind::Torch), + 148u32 => Some(BlockKind::WallTorch), + 149u32 => Some(BlockKind::Fire), + 150u32 => Some(BlockKind::SoulFire), + 151u32 => Some(BlockKind::Spawner), + 152u32 => Some(BlockKind::OakStairs), + 153u32 => Some(BlockKind::Chest), + 154u32 => Some(BlockKind::RedstoneWire), + 155u32 => Some(BlockKind::DiamondOre), + 156u32 => Some(BlockKind::DeepslateDiamondOre), + 157u32 => Some(BlockKind::DiamondBlock), + 158u32 => Some(BlockKind::CraftingTable), + 159u32 => Some(BlockKind::Wheat), + 160u32 => Some(BlockKind::Farmland), + 161u32 => Some(BlockKind::Furnace), + 162u32 => Some(BlockKind::OakSign), + 163u32 => Some(BlockKind::SpruceSign), + 164u32 => Some(BlockKind::BirchSign), + 165u32 => Some(BlockKind::AcaciaSign), + 166u32 => Some(BlockKind::JungleSign), + 167u32 => Some(BlockKind::DarkOakSign), + 168u32 => Some(BlockKind::OakDoor), + 169u32 => Some(BlockKind::Ladder), + 170u32 => Some(BlockKind::Rail), + 171u32 => Some(BlockKind::CobblestoneStairs), + 172u32 => Some(BlockKind::OakWallSign), + 173u32 => Some(BlockKind::SpruceWallSign), + 174u32 => Some(BlockKind::BirchWallSign), + 175u32 => Some(BlockKind::AcaciaWallSign), + 176u32 => Some(BlockKind::JungleWallSign), + 177u32 => Some(BlockKind::DarkOakWallSign), + 178u32 => Some(BlockKind::Lever), + 179u32 => Some(BlockKind::StonePressurePlate), + 180u32 => Some(BlockKind::IronDoor), + 181u32 => Some(BlockKind::OakPressurePlate), + 182u32 => Some(BlockKind::SprucePressurePlate), + 183u32 => Some(BlockKind::BirchPressurePlate), + 184u32 => Some(BlockKind::JunglePressurePlate), + 185u32 => Some(BlockKind::AcaciaPressurePlate), + 186u32 => Some(BlockKind::DarkOakPressurePlate), + 187u32 => Some(BlockKind::RedstoneOre), + 188u32 => Some(BlockKind::DeepslateRedstoneOre), + 189u32 => Some(BlockKind::RedstoneTorch), + 190u32 => Some(BlockKind::RedstoneWallTorch), + 191u32 => Some(BlockKind::StoneButton), + 192u32 => Some(BlockKind::Snow), + 193u32 => Some(BlockKind::Ice), + 194u32 => Some(BlockKind::SnowBlock), + 195u32 => Some(BlockKind::Cactus), + 196u32 => Some(BlockKind::Clay), + 197u32 => Some(BlockKind::SugarCane), + 198u32 => Some(BlockKind::Jukebox), + 199u32 => Some(BlockKind::OakFence), + 200u32 => Some(BlockKind::Pumpkin), + 201u32 => Some(BlockKind::Netherrack), + 202u32 => Some(BlockKind::SoulSand), + 203u32 => Some(BlockKind::SoulSoil), + 204u32 => Some(BlockKind::Basalt), + 205u32 => Some(BlockKind::PolishedBasalt), + 206u32 => Some(BlockKind::SoulTorch), + 207u32 => Some(BlockKind::SoulWallTorch), + 208u32 => Some(BlockKind::Glowstone), + 209u32 => Some(BlockKind::NetherPortal), + 210u32 => Some(BlockKind::CarvedPumpkin), + 211u32 => Some(BlockKind::JackOLantern), + 212u32 => Some(BlockKind::Cake), + 213u32 => Some(BlockKind::Repeater), + 214u32 => Some(BlockKind::WhiteStainedGlass), + 215u32 => Some(BlockKind::OrangeStainedGlass), + 216u32 => Some(BlockKind::MagentaStainedGlass), + 217u32 => Some(BlockKind::LightBlueStainedGlass), + 218u32 => Some(BlockKind::YellowStainedGlass), + 219u32 => Some(BlockKind::LimeStainedGlass), + 220u32 => Some(BlockKind::PinkStainedGlass), + 221u32 => Some(BlockKind::GrayStainedGlass), + 222u32 => Some(BlockKind::LightGrayStainedGlass), + 223u32 => Some(BlockKind::CyanStainedGlass), + 224u32 => Some(BlockKind::PurpleStainedGlass), + 225u32 => Some(BlockKind::BlueStainedGlass), + 226u32 => Some(BlockKind::BrownStainedGlass), + 227u32 => Some(BlockKind::GreenStainedGlass), + 228u32 => Some(BlockKind::RedStainedGlass), + 229u32 => Some(BlockKind::BlackStainedGlass), + 230u32 => Some(BlockKind::OakTrapdoor), + 231u32 => Some(BlockKind::SpruceTrapdoor), + 232u32 => Some(BlockKind::BirchTrapdoor), + 233u32 => Some(BlockKind::JungleTrapdoor), + 234u32 => Some(BlockKind::AcaciaTrapdoor), + 235u32 => Some(BlockKind::DarkOakTrapdoor), + 236u32 => Some(BlockKind::StoneBricks), + 237u32 => Some(BlockKind::MossyStoneBricks), + 238u32 => Some(BlockKind::CrackedStoneBricks), + 239u32 => Some(BlockKind::ChiseledStoneBricks), + 240u32 => Some(BlockKind::InfestedStone), + 241u32 => Some(BlockKind::InfestedCobblestone), + 242u32 => Some(BlockKind::InfestedStoneBricks), + 243u32 => Some(BlockKind::InfestedMossyStoneBricks), + 244u32 => Some(BlockKind::InfestedCrackedStoneBricks), + 245u32 => Some(BlockKind::InfestedChiseledStoneBricks), + 246u32 => Some(BlockKind::BrownMushroomBlock), + 247u32 => Some(BlockKind::RedMushroomBlock), + 248u32 => Some(BlockKind::MushroomStem), + 249u32 => Some(BlockKind::IronBars), + 250u32 => Some(BlockKind::Chain), + 251u32 => Some(BlockKind::GlassPane), + 252u32 => Some(BlockKind::Melon), + 253u32 => Some(BlockKind::AttachedPumpkinStem), + 254u32 => Some(BlockKind::AttachedMelonStem), + 255u32 => Some(BlockKind::PumpkinStem), + 256u32 => Some(BlockKind::MelonStem), + 257u32 => Some(BlockKind::Vine), + 258u32 => Some(BlockKind::GlowLichen), + 259u32 => Some(BlockKind::OakFenceGate), + 260u32 => Some(BlockKind::BrickStairs), + 261u32 => Some(BlockKind::StoneBrickStairs), + 262u32 => Some(BlockKind::Mycelium), + 263u32 => Some(BlockKind::LilyPad), + 264u32 => Some(BlockKind::NetherBricks), + 265u32 => Some(BlockKind::NetherBrickFence), + 266u32 => Some(BlockKind::NetherBrickStairs), + 267u32 => Some(BlockKind::NetherWart), + 268u32 => Some(BlockKind::EnchantingTable), + 269u32 => Some(BlockKind::BrewingStand), + 270u32 => Some(BlockKind::Cauldron), + 271u32 => Some(BlockKind::WaterCauldron), + 272u32 => Some(BlockKind::LavaCauldron), + 273u32 => Some(BlockKind::PowderSnowCauldron), + 274u32 => Some(BlockKind::EndPortal), + 275u32 => Some(BlockKind::EndPortalFrame), + 276u32 => Some(BlockKind::EndStone), + 277u32 => Some(BlockKind::DragonEgg), + 278u32 => Some(BlockKind::RedstoneLamp), + 279u32 => Some(BlockKind::Cocoa), + 280u32 => Some(BlockKind::SandstoneStairs), + 281u32 => Some(BlockKind::EmeraldOre), + 282u32 => Some(BlockKind::DeepslateEmeraldOre), + 283u32 => Some(BlockKind::EnderChest), + 284u32 => Some(BlockKind::TripwireHook), + 285u32 => Some(BlockKind::Tripwire), + 286u32 => Some(BlockKind::EmeraldBlock), + 287u32 => Some(BlockKind::SpruceStairs), + 288u32 => Some(BlockKind::BirchStairs), + 289u32 => Some(BlockKind::JungleStairs), + 290u32 => Some(BlockKind::CommandBlock), + 291u32 => Some(BlockKind::Beacon), + 292u32 => Some(BlockKind::CobblestoneWall), + 293u32 => Some(BlockKind::MossyCobblestoneWall), + 294u32 => Some(BlockKind::FlowerPot), + 295u32 => Some(BlockKind::PottedOakSapling), + 296u32 => Some(BlockKind::PottedSpruceSapling), + 297u32 => Some(BlockKind::PottedBirchSapling), + 298u32 => Some(BlockKind::PottedJungleSapling), + 299u32 => Some(BlockKind::PottedAcaciaSapling), + 300u32 => Some(BlockKind::PottedDarkOakSapling), + 301u32 => Some(BlockKind::PottedFern), + 302u32 => Some(BlockKind::PottedDandelion), + 303u32 => Some(BlockKind::PottedPoppy), + 304u32 => Some(BlockKind::PottedBlueOrchid), + 305u32 => Some(BlockKind::PottedAllium), + 306u32 => Some(BlockKind::PottedAzureBluet), + 307u32 => Some(BlockKind::PottedRedTulip), + 308u32 => Some(BlockKind::PottedOrangeTulip), + 309u32 => Some(BlockKind::PottedWhiteTulip), + 310u32 => Some(BlockKind::PottedPinkTulip), + 311u32 => Some(BlockKind::PottedOxeyeDaisy), + 312u32 => Some(BlockKind::PottedCornflower), + 313u32 => Some(BlockKind::PottedLilyOfTheValley), + 314u32 => Some(BlockKind::PottedWitherRose), + 315u32 => Some(BlockKind::PottedRedMushroom), + 316u32 => Some(BlockKind::PottedBrownMushroom), + 317u32 => Some(BlockKind::PottedDeadBush), + 318u32 => Some(BlockKind::PottedCactus), + 319u32 => Some(BlockKind::Carrots), + 320u32 => Some(BlockKind::Potatoes), + 321u32 => Some(BlockKind::OakButton), + 322u32 => Some(BlockKind::SpruceButton), + 323u32 => Some(BlockKind::BirchButton), + 324u32 => Some(BlockKind::JungleButton), + 325u32 => Some(BlockKind::AcaciaButton), + 326u32 => Some(BlockKind::DarkOakButton), + 327u32 => Some(BlockKind::SkeletonSkull), + 328u32 => Some(BlockKind::SkeletonWallSkull), + 329u32 => Some(BlockKind::WitherSkeletonSkull), + 330u32 => Some(BlockKind::WitherSkeletonWallSkull), + 331u32 => Some(BlockKind::ZombieHead), + 332u32 => Some(BlockKind::ZombieWallHead), + 333u32 => Some(BlockKind::PlayerHead), + 334u32 => Some(BlockKind::PlayerWallHead), + 335u32 => Some(BlockKind::CreeperHead), + 336u32 => Some(BlockKind::CreeperWallHead), + 337u32 => Some(BlockKind::DragonHead), + 338u32 => Some(BlockKind::DragonWallHead), + 339u32 => Some(BlockKind::Anvil), + 340u32 => Some(BlockKind::ChippedAnvil), + 341u32 => Some(BlockKind::DamagedAnvil), + 342u32 => Some(BlockKind::TrappedChest), + 343u32 => Some(BlockKind::LightWeightedPressurePlate), + 344u32 => Some(BlockKind::HeavyWeightedPressurePlate), + 345u32 => Some(BlockKind::Comparator), + 346u32 => Some(BlockKind::DaylightDetector), + 347u32 => Some(BlockKind::RedstoneBlock), + 348u32 => Some(BlockKind::NetherQuartzOre), + 349u32 => Some(BlockKind::Hopper), + 350u32 => Some(BlockKind::QuartzBlock), + 351u32 => Some(BlockKind::ChiseledQuartzBlock), + 352u32 => Some(BlockKind::QuartzPillar), + 353u32 => Some(BlockKind::QuartzStairs), + 354u32 => Some(BlockKind::ActivatorRail), + 355u32 => Some(BlockKind::Dropper), + 356u32 => Some(BlockKind::WhiteTerracotta), + 357u32 => Some(BlockKind::OrangeTerracotta), + 358u32 => Some(BlockKind::MagentaTerracotta), + 359u32 => Some(BlockKind::LightBlueTerracotta), + 360u32 => Some(BlockKind::YellowTerracotta), + 361u32 => Some(BlockKind::LimeTerracotta), + 362u32 => Some(BlockKind::PinkTerracotta), + 363u32 => Some(BlockKind::GrayTerracotta), + 364u32 => Some(BlockKind::LightGrayTerracotta), + 365u32 => Some(BlockKind::CyanTerracotta), + 366u32 => Some(BlockKind::PurpleTerracotta), + 367u32 => Some(BlockKind::BlueTerracotta), + 368u32 => Some(BlockKind::BrownTerracotta), + 369u32 => Some(BlockKind::GreenTerracotta), + 370u32 => Some(BlockKind::RedTerracotta), + 371u32 => Some(BlockKind::BlackTerracotta), + 372u32 => Some(BlockKind::WhiteStainedGlassPane), + 373u32 => Some(BlockKind::OrangeStainedGlassPane), + 374u32 => Some(BlockKind::MagentaStainedGlassPane), + 375u32 => Some(BlockKind::LightBlueStainedGlassPane), + 376u32 => Some(BlockKind::YellowStainedGlassPane), + 377u32 => Some(BlockKind::LimeStainedGlassPane), + 378u32 => Some(BlockKind::PinkStainedGlassPane), + 379u32 => Some(BlockKind::GrayStainedGlassPane), + 380u32 => Some(BlockKind::LightGrayStainedGlassPane), + 381u32 => Some(BlockKind::CyanStainedGlassPane), + 382u32 => Some(BlockKind::PurpleStainedGlassPane), + 383u32 => Some(BlockKind::BlueStainedGlassPane), + 384u32 => Some(BlockKind::BrownStainedGlassPane), + 385u32 => Some(BlockKind::GreenStainedGlassPane), + 386u32 => Some(BlockKind::RedStainedGlassPane), + 387u32 => Some(BlockKind::BlackStainedGlassPane), + 388u32 => Some(BlockKind::AcaciaStairs), + 389u32 => Some(BlockKind::DarkOakStairs), + 390u32 => Some(BlockKind::SlimeBlock), + 391u32 => Some(BlockKind::Barrier), + 392u32 => Some(BlockKind::Light), + 393u32 => Some(BlockKind::IronTrapdoor), + 394u32 => Some(BlockKind::Prismarine), + 395u32 => Some(BlockKind::PrismarineBricks), + 396u32 => Some(BlockKind::DarkPrismarine), + 397u32 => Some(BlockKind::PrismarineStairs), + 398u32 => Some(BlockKind::PrismarineBrickStairs), + 399u32 => Some(BlockKind::DarkPrismarineStairs), + 400u32 => Some(BlockKind::PrismarineSlab), + 401u32 => Some(BlockKind::PrismarineBrickSlab), + 402u32 => Some(BlockKind::DarkPrismarineSlab), + 403u32 => Some(BlockKind::SeaLantern), + 404u32 => Some(BlockKind::HayBlock), + 405u32 => Some(BlockKind::WhiteCarpet), + 406u32 => Some(BlockKind::OrangeCarpet), + 407u32 => Some(BlockKind::MagentaCarpet), + 408u32 => Some(BlockKind::LightBlueCarpet), + 409u32 => Some(BlockKind::YellowCarpet), + 410u32 => Some(BlockKind::LimeCarpet), + 411u32 => Some(BlockKind::PinkCarpet), + 412u32 => Some(BlockKind::GrayCarpet), + 413u32 => Some(BlockKind::LightGrayCarpet), + 414u32 => Some(BlockKind::CyanCarpet), + 415u32 => Some(BlockKind::PurpleCarpet), + 416u32 => Some(BlockKind::BlueCarpet), + 417u32 => Some(BlockKind::BrownCarpet), + 418u32 => Some(BlockKind::GreenCarpet), + 419u32 => Some(BlockKind::RedCarpet), + 420u32 => Some(BlockKind::BlackCarpet), + 421u32 => Some(BlockKind::Terracotta), + 422u32 => Some(BlockKind::CoalBlock), + 423u32 => Some(BlockKind::PackedIce), + 424u32 => Some(BlockKind::Sunflower), + 425u32 => Some(BlockKind::Lilac), + 426u32 => Some(BlockKind::RoseBush), + 427u32 => Some(BlockKind::Peony), + 428u32 => Some(BlockKind::TallGrass), + 429u32 => Some(BlockKind::LargeFern), + 430u32 => Some(BlockKind::WhiteBanner), + 431u32 => Some(BlockKind::OrangeBanner), + 432u32 => Some(BlockKind::MagentaBanner), + 433u32 => Some(BlockKind::LightBlueBanner), + 434u32 => Some(BlockKind::YellowBanner), + 435u32 => Some(BlockKind::LimeBanner), + 436u32 => Some(BlockKind::PinkBanner), + 437u32 => Some(BlockKind::GrayBanner), + 438u32 => Some(BlockKind::LightGrayBanner), + 439u32 => Some(BlockKind::CyanBanner), + 440u32 => Some(BlockKind::PurpleBanner), + 441u32 => Some(BlockKind::BlueBanner), + 442u32 => Some(BlockKind::BrownBanner), + 443u32 => Some(BlockKind::GreenBanner), + 444u32 => Some(BlockKind::RedBanner), + 445u32 => Some(BlockKind::BlackBanner), + 446u32 => Some(BlockKind::WhiteWallBanner), + 447u32 => Some(BlockKind::OrangeWallBanner), + 448u32 => Some(BlockKind::MagentaWallBanner), + 449u32 => Some(BlockKind::LightBlueWallBanner), + 450u32 => Some(BlockKind::YellowWallBanner), + 451u32 => Some(BlockKind::LimeWallBanner), + 452u32 => Some(BlockKind::PinkWallBanner), + 453u32 => Some(BlockKind::GrayWallBanner), + 454u32 => Some(BlockKind::LightGrayWallBanner), + 455u32 => Some(BlockKind::CyanWallBanner), + 456u32 => Some(BlockKind::PurpleWallBanner), + 457u32 => Some(BlockKind::BlueWallBanner), + 458u32 => Some(BlockKind::BrownWallBanner), + 459u32 => Some(BlockKind::GreenWallBanner), + 460u32 => Some(BlockKind::RedWallBanner), + 461u32 => Some(BlockKind::BlackWallBanner), + 462u32 => Some(BlockKind::RedSandstone), + 463u32 => Some(BlockKind::ChiseledRedSandstone), + 464u32 => Some(BlockKind::CutRedSandstone), + 465u32 => Some(BlockKind::RedSandstoneStairs), + 466u32 => Some(BlockKind::OakSlab), + 467u32 => Some(BlockKind::SpruceSlab), + 468u32 => Some(BlockKind::BirchSlab), + 469u32 => Some(BlockKind::JungleSlab), + 470u32 => Some(BlockKind::AcaciaSlab), + 471u32 => Some(BlockKind::DarkOakSlab), + 472u32 => Some(BlockKind::StoneSlab), + 473u32 => Some(BlockKind::SmoothStoneSlab), + 474u32 => Some(BlockKind::SandstoneSlab), + 475u32 => Some(BlockKind::CutSandstoneSlab), + 476u32 => Some(BlockKind::PetrifiedOakSlab), + 477u32 => Some(BlockKind::CobblestoneSlab), + 478u32 => Some(BlockKind::BrickSlab), + 479u32 => Some(BlockKind::StoneBrickSlab), + 480u32 => Some(BlockKind::NetherBrickSlab), + 481u32 => Some(BlockKind::QuartzSlab), + 482u32 => Some(BlockKind::RedSandstoneSlab), + 483u32 => Some(BlockKind::CutRedSandstoneSlab), + 484u32 => Some(BlockKind::PurpurSlab), + 485u32 => Some(BlockKind::SmoothStone), + 486u32 => Some(BlockKind::SmoothSandstone), + 487u32 => Some(BlockKind::SmoothQuartz), + 488u32 => Some(BlockKind::SmoothRedSandstone), + 489u32 => Some(BlockKind::SpruceFenceGate), + 490u32 => Some(BlockKind::BirchFenceGate), + 491u32 => Some(BlockKind::JungleFenceGate), + 492u32 => Some(BlockKind::AcaciaFenceGate), + 493u32 => Some(BlockKind::DarkOakFenceGate), + 494u32 => Some(BlockKind::SpruceFence), + 495u32 => Some(BlockKind::BirchFence), + 496u32 => Some(BlockKind::JungleFence), + 497u32 => Some(BlockKind::AcaciaFence), + 498u32 => Some(BlockKind::DarkOakFence), + 499u32 => Some(BlockKind::SpruceDoor), + 500u32 => Some(BlockKind::BirchDoor), + 501u32 => Some(BlockKind::JungleDoor), + 502u32 => Some(BlockKind::AcaciaDoor), + 503u32 => Some(BlockKind::DarkOakDoor), + 504u32 => Some(BlockKind::EndRod), + 505u32 => Some(BlockKind::ChorusPlant), + 506u32 => Some(BlockKind::ChorusFlower), + 507u32 => Some(BlockKind::PurpurBlock), + 508u32 => Some(BlockKind::PurpurPillar), + 509u32 => Some(BlockKind::PurpurStairs), + 510u32 => Some(BlockKind::EndStoneBricks), + 511u32 => Some(BlockKind::Beetroots), + 512u32 => Some(BlockKind::DirtPath), + 513u32 => Some(BlockKind::EndGateway), + 514u32 => Some(BlockKind::RepeatingCommandBlock), + 515u32 => Some(BlockKind::ChainCommandBlock), + 516u32 => Some(BlockKind::FrostedIce), + 517u32 => Some(BlockKind::MagmaBlock), + 518u32 => Some(BlockKind::NetherWartBlock), + 519u32 => Some(BlockKind::RedNetherBricks), + 520u32 => Some(BlockKind::BoneBlock), + 521u32 => Some(BlockKind::StructureVoid), + 522u32 => Some(BlockKind::Observer), + 523u32 => Some(BlockKind::ShulkerBox), + 524u32 => Some(BlockKind::WhiteShulkerBox), + 525u32 => Some(BlockKind::OrangeShulkerBox), + 526u32 => Some(BlockKind::MagentaShulkerBox), + 527u32 => Some(BlockKind::LightBlueShulkerBox), + 528u32 => Some(BlockKind::YellowShulkerBox), + 529u32 => Some(BlockKind::LimeShulkerBox), + 530u32 => Some(BlockKind::PinkShulkerBox), + 531u32 => Some(BlockKind::GrayShulkerBox), + 532u32 => Some(BlockKind::LightGrayShulkerBox), + 533u32 => Some(BlockKind::CyanShulkerBox), + 534u32 => Some(BlockKind::PurpleShulkerBox), + 535u32 => Some(BlockKind::BlueShulkerBox), + 536u32 => Some(BlockKind::BrownShulkerBox), + 537u32 => Some(BlockKind::GreenShulkerBox), + 538u32 => Some(BlockKind::RedShulkerBox), + 539u32 => Some(BlockKind::BlackShulkerBox), + 540u32 => Some(BlockKind::WhiteGlazedTerracotta), + 541u32 => Some(BlockKind::OrangeGlazedTerracotta), + 542u32 => Some(BlockKind::MagentaGlazedTerracotta), + 543u32 => Some(BlockKind::LightBlueGlazedTerracotta), + 544u32 => Some(BlockKind::YellowGlazedTerracotta), + 545u32 => Some(BlockKind::LimeGlazedTerracotta), + 546u32 => Some(BlockKind::PinkGlazedTerracotta), + 547u32 => Some(BlockKind::GrayGlazedTerracotta), + 548u32 => Some(BlockKind::LightGrayGlazedTerracotta), + 549u32 => Some(BlockKind::CyanGlazedTerracotta), + 550u32 => Some(BlockKind::PurpleGlazedTerracotta), + 551u32 => Some(BlockKind::BlueGlazedTerracotta), + 552u32 => Some(BlockKind::BrownGlazedTerracotta), + 553u32 => Some(BlockKind::GreenGlazedTerracotta), + 554u32 => Some(BlockKind::RedGlazedTerracotta), + 555u32 => Some(BlockKind::BlackGlazedTerracotta), + 556u32 => Some(BlockKind::WhiteConcrete), + 557u32 => Some(BlockKind::OrangeConcrete), + 558u32 => Some(BlockKind::MagentaConcrete), + 559u32 => Some(BlockKind::LightBlueConcrete), + 560u32 => Some(BlockKind::YellowConcrete), + 561u32 => Some(BlockKind::LimeConcrete), + 562u32 => Some(BlockKind::PinkConcrete), + 563u32 => Some(BlockKind::GrayConcrete), + 564u32 => Some(BlockKind::LightGrayConcrete), + 565u32 => Some(BlockKind::CyanConcrete), + 566u32 => Some(BlockKind::PurpleConcrete), + 567u32 => Some(BlockKind::BlueConcrete), + 568u32 => Some(BlockKind::BrownConcrete), + 569u32 => Some(BlockKind::GreenConcrete), + 570u32 => Some(BlockKind::RedConcrete), + 571u32 => Some(BlockKind::BlackConcrete), + 572u32 => Some(BlockKind::WhiteConcretePowder), + 573u32 => Some(BlockKind::OrangeConcretePowder), + 574u32 => Some(BlockKind::MagentaConcretePowder), + 575u32 => Some(BlockKind::LightBlueConcretePowder), + 576u32 => Some(BlockKind::YellowConcretePowder), + 577u32 => Some(BlockKind::LimeConcretePowder), + 578u32 => Some(BlockKind::PinkConcretePowder), + 579u32 => Some(BlockKind::GrayConcretePowder), + 580u32 => Some(BlockKind::LightGrayConcretePowder), + 581u32 => Some(BlockKind::CyanConcretePowder), + 582u32 => Some(BlockKind::PurpleConcretePowder), + 583u32 => Some(BlockKind::BlueConcretePowder), + 584u32 => Some(BlockKind::BrownConcretePowder), + 585u32 => Some(BlockKind::GreenConcretePowder), + 586u32 => Some(BlockKind::RedConcretePowder), + 587u32 => Some(BlockKind::BlackConcretePowder), + 588u32 => Some(BlockKind::Kelp), + 589u32 => Some(BlockKind::KelpPlant), + 590u32 => Some(BlockKind::DriedKelpBlock), + 591u32 => Some(BlockKind::TurtleEgg), + 592u32 => Some(BlockKind::DeadTubeCoralBlock), + 593u32 => Some(BlockKind::DeadBrainCoralBlock), + 594u32 => Some(BlockKind::DeadBubbleCoralBlock), + 595u32 => Some(BlockKind::DeadFireCoralBlock), + 596u32 => Some(BlockKind::DeadHornCoralBlock), + 597u32 => Some(BlockKind::TubeCoralBlock), + 598u32 => Some(BlockKind::BrainCoralBlock), + 599u32 => Some(BlockKind::BubbleCoralBlock), + 600u32 => Some(BlockKind::FireCoralBlock), + 601u32 => Some(BlockKind::HornCoralBlock), + 602u32 => Some(BlockKind::DeadTubeCoral), + 603u32 => Some(BlockKind::DeadBrainCoral), + 604u32 => Some(BlockKind::DeadBubbleCoral), + 605u32 => Some(BlockKind::DeadFireCoral), + 606u32 => Some(BlockKind::DeadHornCoral), + 607u32 => Some(BlockKind::TubeCoral), + 608u32 => Some(BlockKind::BrainCoral), + 609u32 => Some(BlockKind::BubbleCoral), + 610u32 => Some(BlockKind::FireCoral), + 611u32 => Some(BlockKind::HornCoral), + 612u32 => Some(BlockKind::DeadTubeCoralFan), + 613u32 => Some(BlockKind::DeadBrainCoralFan), + 614u32 => Some(BlockKind::DeadBubbleCoralFan), + 615u32 => Some(BlockKind::DeadFireCoralFan), + 616u32 => Some(BlockKind::DeadHornCoralFan), + 617u32 => Some(BlockKind::TubeCoralFan), + 618u32 => Some(BlockKind::BrainCoralFan), + 619u32 => Some(BlockKind::BubbleCoralFan), + 620u32 => Some(BlockKind::FireCoralFan), + 621u32 => Some(BlockKind::HornCoralFan), + 622u32 => Some(BlockKind::DeadTubeCoralWallFan), + 623u32 => Some(BlockKind::DeadBrainCoralWallFan), + 624u32 => Some(BlockKind::DeadBubbleCoralWallFan), + 625u32 => Some(BlockKind::DeadFireCoralWallFan), + 626u32 => Some(BlockKind::DeadHornCoralWallFan), + 627u32 => Some(BlockKind::TubeCoralWallFan), + 628u32 => Some(BlockKind::BrainCoralWallFan), + 629u32 => Some(BlockKind::BubbleCoralWallFan), + 630u32 => Some(BlockKind::FireCoralWallFan), + 631u32 => Some(BlockKind::HornCoralWallFan), + 632u32 => Some(BlockKind::SeaPickle), + 633u32 => Some(BlockKind::BlueIce), + 634u32 => Some(BlockKind::Conduit), + 635u32 => Some(BlockKind::BambooSapling), + 636u32 => Some(BlockKind::Bamboo), + 637u32 => Some(BlockKind::PottedBamboo), + 638u32 => Some(BlockKind::VoidAir), + 639u32 => Some(BlockKind::CaveAir), + 640u32 => Some(BlockKind::BubbleColumn), + 641u32 => Some(BlockKind::PolishedGraniteStairs), + 642u32 => Some(BlockKind::SmoothRedSandstoneStairs), + 643u32 => Some(BlockKind::MossyStoneBrickStairs), + 644u32 => Some(BlockKind::PolishedDioriteStairs), + 645u32 => Some(BlockKind::MossyCobblestoneStairs), + 646u32 => Some(BlockKind::EndStoneBrickStairs), + 647u32 => Some(BlockKind::StoneStairs), + 648u32 => Some(BlockKind::SmoothSandstoneStairs), + 649u32 => Some(BlockKind::SmoothQuartzStairs), + 650u32 => Some(BlockKind::GraniteStairs), + 651u32 => Some(BlockKind::AndesiteStairs), + 652u32 => Some(BlockKind::RedNetherBrickStairs), + 653u32 => Some(BlockKind::PolishedAndesiteStairs), + 654u32 => Some(BlockKind::DioriteStairs), + 655u32 => Some(BlockKind::PolishedGraniteSlab), + 656u32 => Some(BlockKind::SmoothRedSandstoneSlab), + 657u32 => Some(BlockKind::MossyStoneBrickSlab), + 658u32 => Some(BlockKind::PolishedDioriteSlab), + 659u32 => Some(BlockKind::MossyCobblestoneSlab), + 660u32 => Some(BlockKind::EndStoneBrickSlab), + 661u32 => Some(BlockKind::SmoothSandstoneSlab), + 662u32 => Some(BlockKind::SmoothQuartzSlab), + 663u32 => Some(BlockKind::GraniteSlab), + 664u32 => Some(BlockKind::AndesiteSlab), + 665u32 => Some(BlockKind::RedNetherBrickSlab), + 666u32 => Some(BlockKind::PolishedAndesiteSlab), + 667u32 => Some(BlockKind::DioriteSlab), + 668u32 => Some(BlockKind::BrickWall), + 669u32 => Some(BlockKind::PrismarineWall), + 670u32 => Some(BlockKind::RedSandstoneWall), + 671u32 => Some(BlockKind::MossyStoneBrickWall), + 672u32 => Some(BlockKind::GraniteWall), + 673u32 => Some(BlockKind::StoneBrickWall), + 674u32 => Some(BlockKind::NetherBrickWall), + 675u32 => Some(BlockKind::AndesiteWall), + 676u32 => Some(BlockKind::RedNetherBrickWall), + 677u32 => Some(BlockKind::SandstoneWall), + 678u32 => Some(BlockKind::EndStoneBrickWall), + 679u32 => Some(BlockKind::DioriteWall), + 680u32 => Some(BlockKind::Scaffolding), + 681u32 => Some(BlockKind::Loom), + 682u32 => Some(BlockKind::Barrel), + 683u32 => Some(BlockKind::Smoker), + 684u32 => Some(BlockKind::BlastFurnace), + 685u32 => Some(BlockKind::CartographyTable), + 686u32 => Some(BlockKind::FletchingTable), + 687u32 => Some(BlockKind::Grindstone), + 688u32 => Some(BlockKind::Lectern), + 689u32 => Some(BlockKind::SmithingTable), + 690u32 => Some(BlockKind::Stonecutter), + 691u32 => Some(BlockKind::Bell), + 692u32 => Some(BlockKind::Lantern), + 693u32 => Some(BlockKind::SoulLantern), + 694u32 => Some(BlockKind::Campfire), + 695u32 => Some(BlockKind::SoulCampfire), + 696u32 => Some(BlockKind::SweetBerryBush), + 697u32 => Some(BlockKind::WarpedStem), + 698u32 => Some(BlockKind::StrippedWarpedStem), + 699u32 => Some(BlockKind::WarpedHyphae), + 700u32 => Some(BlockKind::StrippedWarpedHyphae), + 701u32 => Some(BlockKind::WarpedNylium), + 702u32 => Some(BlockKind::WarpedFungus), + 703u32 => Some(BlockKind::WarpedWartBlock), + 704u32 => Some(BlockKind::WarpedRoots), + 705u32 => Some(BlockKind::NetherSprouts), + 706u32 => Some(BlockKind::CrimsonStem), + 707u32 => Some(BlockKind::StrippedCrimsonStem), + 708u32 => Some(BlockKind::CrimsonHyphae), + 709u32 => Some(BlockKind::StrippedCrimsonHyphae), + 710u32 => Some(BlockKind::CrimsonNylium), + 711u32 => Some(BlockKind::CrimsonFungus), + 712u32 => Some(BlockKind::Shroomlight), + 713u32 => Some(BlockKind::WeepingVines), + 714u32 => Some(BlockKind::WeepingVinesPlant), + 715u32 => Some(BlockKind::TwistingVines), + 716u32 => Some(BlockKind::TwistingVinesPlant), + 717u32 => Some(BlockKind::CrimsonRoots), + 718u32 => Some(BlockKind::CrimsonPlanks), + 719u32 => Some(BlockKind::WarpedPlanks), + 720u32 => Some(BlockKind::CrimsonSlab), + 721u32 => Some(BlockKind::WarpedSlab), + 722u32 => Some(BlockKind::CrimsonPressurePlate), + 723u32 => Some(BlockKind::WarpedPressurePlate), + 724u32 => Some(BlockKind::CrimsonFence), + 725u32 => Some(BlockKind::WarpedFence), + 726u32 => Some(BlockKind::CrimsonTrapdoor), + 727u32 => Some(BlockKind::WarpedTrapdoor), + 728u32 => Some(BlockKind::CrimsonFenceGate), + 729u32 => Some(BlockKind::WarpedFenceGate), + 730u32 => Some(BlockKind::CrimsonStairs), + 731u32 => Some(BlockKind::WarpedStairs), + 732u32 => Some(BlockKind::CrimsonButton), + 733u32 => Some(BlockKind::WarpedButton), + 734u32 => Some(BlockKind::CrimsonDoor), + 735u32 => Some(BlockKind::WarpedDoor), + 736u32 => Some(BlockKind::CrimsonSign), + 737u32 => Some(BlockKind::WarpedSign), + 738u32 => Some(BlockKind::CrimsonWallSign), + 739u32 => Some(BlockKind::WarpedWallSign), + 740u32 => Some(BlockKind::StructureBlock), + 741u32 => Some(BlockKind::Jigsaw), + 742u32 => Some(BlockKind::Composter), + 743u32 => Some(BlockKind::Target), + 744u32 => Some(BlockKind::BeeNest), + 745u32 => Some(BlockKind::Beehive), + 746u32 => Some(BlockKind::HoneyBlock), + 747u32 => Some(BlockKind::HoneycombBlock), + 748u32 => Some(BlockKind::NetheriteBlock), + 749u32 => Some(BlockKind::AncientDebris), + 750u32 => Some(BlockKind::CryingObsidian), + 751u32 => Some(BlockKind::RespawnAnchor), + 752u32 => Some(BlockKind::PottedCrimsonFungus), + 753u32 => Some(BlockKind::PottedWarpedFungus), + 754u32 => Some(BlockKind::PottedCrimsonRoots), + 755u32 => Some(BlockKind::PottedWarpedRoots), + 756u32 => Some(BlockKind::Lodestone), + 757u32 => Some(BlockKind::Blackstone), + 758u32 => Some(BlockKind::BlackstoneStairs), + 759u32 => Some(BlockKind::BlackstoneWall), + 760u32 => Some(BlockKind::BlackstoneSlab), + 761u32 => Some(BlockKind::PolishedBlackstone), + 762u32 => Some(BlockKind::PolishedBlackstoneBricks), + 763u32 => Some(BlockKind::CrackedPolishedBlackstoneBricks), + 764u32 => Some(BlockKind::ChiseledPolishedBlackstone), + 765u32 => Some(BlockKind::PolishedBlackstoneBrickSlab), + 766u32 => Some(BlockKind::PolishedBlackstoneBrickStairs), + 767u32 => Some(BlockKind::PolishedBlackstoneBrickWall), + 768u32 => Some(BlockKind::GildedBlackstone), + 769u32 => Some(BlockKind::PolishedBlackstoneStairs), + 770u32 => Some(BlockKind::PolishedBlackstoneSlab), + 771u32 => Some(BlockKind::PolishedBlackstonePressurePlate), + 772u32 => Some(BlockKind::PolishedBlackstoneButton), + 773u32 => Some(BlockKind::PolishedBlackstoneWall), + 774u32 => Some(BlockKind::ChiseledNetherBricks), + 775u32 => Some(BlockKind::CrackedNetherBricks), + 776u32 => Some(BlockKind::QuartzBricks), + 777u32 => Some(BlockKind::Candle), + 778u32 => Some(BlockKind::WhiteCandle), + 779u32 => Some(BlockKind::OrangeCandle), + 780u32 => Some(BlockKind::MagentaCandle), + 781u32 => Some(BlockKind::LightBlueCandle), + 782u32 => Some(BlockKind::YellowCandle), + 783u32 => Some(BlockKind::LimeCandle), + 784u32 => Some(BlockKind::PinkCandle), + 785u32 => Some(BlockKind::GrayCandle), + 786u32 => Some(BlockKind::LightGrayCandle), + 787u32 => Some(BlockKind::CyanCandle), + 788u32 => Some(BlockKind::PurpleCandle), + 789u32 => Some(BlockKind::BlueCandle), + 790u32 => Some(BlockKind::BrownCandle), + 791u32 => Some(BlockKind::GreenCandle), + 792u32 => Some(BlockKind::RedCandle), + 793u32 => Some(BlockKind::BlackCandle), + 794u32 => Some(BlockKind::CandleCake), + 795u32 => Some(BlockKind::WhiteCandleCake), + 796u32 => Some(BlockKind::OrangeCandleCake), + 797u32 => Some(BlockKind::MagentaCandleCake), + 798u32 => Some(BlockKind::LightBlueCandleCake), + 799u32 => Some(BlockKind::YellowCandleCake), + 800u32 => Some(BlockKind::LimeCandleCake), + 801u32 => Some(BlockKind::PinkCandleCake), + 802u32 => Some(BlockKind::GrayCandleCake), + 803u32 => Some(BlockKind::LightGrayCandleCake), + 804u32 => Some(BlockKind::CyanCandleCake), + 805u32 => Some(BlockKind::PurpleCandleCake), + 806u32 => Some(BlockKind::BlueCandleCake), + 807u32 => Some(BlockKind::BrownCandleCake), + 808u32 => Some(BlockKind::GreenCandleCake), + 809u32 => Some(BlockKind::RedCandleCake), + 810u32 => Some(BlockKind::BlackCandleCake), + 811u32 => Some(BlockKind::AmethystBlock), + 812u32 => Some(BlockKind::BuddingAmethyst), + 813u32 => Some(BlockKind::AmethystCluster), + 814u32 => Some(BlockKind::LargeAmethystBud), + 815u32 => Some(BlockKind::MediumAmethystBud), + 816u32 => Some(BlockKind::SmallAmethystBud), + 817u32 => Some(BlockKind::Tuff), + 818u32 => Some(BlockKind::Calcite), + 819u32 => Some(BlockKind::TintedGlass), + 820u32 => Some(BlockKind::PowderSnow), + 821u32 => Some(BlockKind::SculkSensor), + 822u32 => Some(BlockKind::OxidizedCopper), + 823u32 => Some(BlockKind::WeatheredCopper), + 824u32 => Some(BlockKind::ExposedCopper), + 825u32 => Some(BlockKind::CopperBlock), + 826u32 => Some(BlockKind::CopperOre), + 827u32 => Some(BlockKind::DeepslateCopperOre), + 828u32 => Some(BlockKind::OxidizedCutCopper), + 829u32 => Some(BlockKind::WeatheredCutCopper), + 830u32 => Some(BlockKind::ExposedCutCopper), + 831u32 => Some(BlockKind::CutCopper), + 832u32 => Some(BlockKind::OxidizedCutCopperStairs), + 833u32 => Some(BlockKind::WeatheredCutCopperStairs), + 834u32 => Some(BlockKind::ExposedCutCopperStairs), + 835u32 => Some(BlockKind::CutCopperStairs), + 836u32 => Some(BlockKind::OxidizedCutCopperSlab), + 837u32 => Some(BlockKind::WeatheredCutCopperSlab), + 838u32 => Some(BlockKind::ExposedCutCopperSlab), + 839u32 => Some(BlockKind::CutCopperSlab), + 840u32 => Some(BlockKind::WaxedCopperBlock), + 841u32 => Some(BlockKind::WaxedWeatheredCopper), + 842u32 => Some(BlockKind::WaxedExposedCopper), + 843u32 => Some(BlockKind::WaxedOxidizedCopper), + 844u32 => Some(BlockKind::WaxedOxidizedCutCopper), + 845u32 => Some(BlockKind::WaxedWeatheredCutCopper), + 846u32 => Some(BlockKind::WaxedExposedCutCopper), + 847u32 => Some(BlockKind::WaxedCutCopper), + 848u32 => Some(BlockKind::WaxedOxidizedCutCopperStairs), + 849u32 => Some(BlockKind::WaxedWeatheredCutCopperStairs), + 850u32 => Some(BlockKind::WaxedExposedCutCopperStairs), + 851u32 => Some(BlockKind::WaxedCutCopperStairs), + 852u32 => Some(BlockKind::WaxedOxidizedCutCopperSlab), + 853u32 => Some(BlockKind::WaxedWeatheredCutCopperSlab), + 854u32 => Some(BlockKind::WaxedExposedCutCopperSlab), + 855u32 => Some(BlockKind::WaxedCutCopperSlab), + 856u32 => Some(BlockKind::LightningRod), + 857u32 => Some(BlockKind::PointedDripstone), + 858u32 => Some(BlockKind::DripstoneBlock), + 859u32 => Some(BlockKind::CaveVines), + 860u32 => Some(BlockKind::CaveVinesPlant), + 861u32 => Some(BlockKind::SporeBlossom), + 862u32 => Some(BlockKind::Azalea), + 863u32 => Some(BlockKind::FloweringAzalea), + 864u32 => Some(BlockKind::MossCarpet), + 865u32 => Some(BlockKind::MossBlock), + 866u32 => Some(BlockKind::BigDripleaf), + 867u32 => Some(BlockKind::BigDripleafStem), + 868u32 => Some(BlockKind::SmallDripleaf), + 869u32 => Some(BlockKind::HangingRoots), + 870u32 => Some(BlockKind::RootedDirt), + 871u32 => Some(BlockKind::Deepslate), + 872u32 => Some(BlockKind::CobbledDeepslate), + 873u32 => Some(BlockKind::CobbledDeepslateStairs), + 874u32 => Some(BlockKind::CobbledDeepslateSlab), + 875u32 => Some(BlockKind::CobbledDeepslateWall), + 876u32 => Some(BlockKind::PolishedDeepslate), + 877u32 => Some(BlockKind::PolishedDeepslateStairs), + 878u32 => Some(BlockKind::PolishedDeepslateSlab), + 879u32 => Some(BlockKind::PolishedDeepslateWall), + 880u32 => Some(BlockKind::DeepslateTiles), + 881u32 => Some(BlockKind::DeepslateTileStairs), + 882u32 => Some(BlockKind::DeepslateTileSlab), + 883u32 => Some(BlockKind::DeepslateTileWall), + 884u32 => Some(BlockKind::DeepslateBricks), + 885u32 => Some(BlockKind::DeepslateBrickStairs), + 886u32 => Some(BlockKind::DeepslateBrickSlab), + 887u32 => Some(BlockKind::DeepslateBrickWall), + 888u32 => Some(BlockKind::ChiseledDeepslate), + 889u32 => Some(BlockKind::CrackedDeepslateBricks), + 890u32 => Some(BlockKind::CrackedDeepslateTiles), + 891u32 => Some(BlockKind::InfestedDeepslate), + 892u32 => Some(BlockKind::SmoothBasalt), + 893u32 => Some(BlockKind::RawIronBlock), + 894u32 => Some(BlockKind::RawCopperBlock), + 895u32 => Some(BlockKind::RawGoldBlock), + 896u32 => Some(BlockKind::PottedAzaleaBush), + 897u32 => Some(BlockKind::PottedFloweringAzaleaBush), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `name` property of this `BlockKind`. + #[doc = "Returns the `name` property of this `BlockKind`."] + #[inline] pub fn name(&self) -> &'static str { match self { BlockKind::Air => "air", @@ -2359,8 +3826,11 @@ impl BlockKind { BlockKind::RedSand => "red_sand", BlockKind::Gravel => "gravel", BlockKind::GoldOre => "gold_ore", + BlockKind::DeepslateGoldOre => "deepslate_gold_ore", BlockKind::IronOre => "iron_ore", + BlockKind::DeepslateIronOre => "deepslate_iron_ore", BlockKind::CoalOre => "coal_ore", + BlockKind::DeepslateCoalOre => "deepslate_coal_ore", BlockKind::NetherGoldOre => "nether_gold_ore", BlockKind::OakLog => "oak_log", BlockKind::SpruceLog => "spruce_log", @@ -2392,10 +3862,13 @@ impl BlockKind { BlockKind::JungleLeaves => "jungle_leaves", BlockKind::AcaciaLeaves => "acacia_leaves", BlockKind::DarkOakLeaves => "dark_oak_leaves", + BlockKind::AzaleaLeaves => "azalea_leaves", + BlockKind::FloweringAzaleaLeaves => "flowering_azalea_leaves", BlockKind::Sponge => "sponge", BlockKind::WetSponge => "wet_sponge", BlockKind::Glass => "glass", BlockKind::LapisOre => "lapis_ore", + BlockKind::DeepslateLapisOre => "deepslate_lapis_ore", BlockKind::LapisBlock => "lapis_block", BlockKind::Dispenser => "dispenser", BlockKind::Sandstone => "sandstone", @@ -2477,6 +3950,7 @@ impl BlockKind { BlockKind::Chest => "chest", BlockKind::RedstoneWire => "redstone_wire", BlockKind::DiamondOre => "diamond_ore", + BlockKind::DeepslateDiamondOre => "deepslate_diamond_ore", BlockKind::DiamondBlock => "diamond_block", BlockKind::CraftingTable => "crafting_table", BlockKind::Wheat => "wheat", @@ -2508,6 +3982,7 @@ impl BlockKind { BlockKind::AcaciaPressurePlate => "acacia_pressure_plate", BlockKind::DarkOakPressurePlate => "dark_oak_pressure_plate", BlockKind::RedstoneOre => "redstone_ore", + BlockKind::DeepslateRedstoneOre => "deepslate_redstone_ore", BlockKind::RedstoneTorch => "redstone_torch", BlockKind::RedstoneWallTorch => "redstone_wall_torch", BlockKind::StoneButton => "stone_button", @@ -2577,6 +4052,7 @@ impl BlockKind { BlockKind::PumpkinStem => "pumpkin_stem", BlockKind::MelonStem => "melon_stem", BlockKind::Vine => "vine", + BlockKind::GlowLichen => "glow_lichen", BlockKind::OakFenceGate => "oak_fence_gate", BlockKind::BrickStairs => "brick_stairs", BlockKind::StoneBrickStairs => "stone_brick_stairs", @@ -2589,6 +4065,9 @@ impl BlockKind { BlockKind::EnchantingTable => "enchanting_table", BlockKind::BrewingStand => "brewing_stand", BlockKind::Cauldron => "cauldron", + BlockKind::WaterCauldron => "water_cauldron", + BlockKind::LavaCauldron => "lava_cauldron", + BlockKind::PowderSnowCauldron => "powder_snow_cauldron", BlockKind::EndPortal => "end_portal", BlockKind::EndPortalFrame => "end_portal_frame", BlockKind::EndStone => "end_stone", @@ -2597,6 +4076,7 @@ impl BlockKind { BlockKind::Cocoa => "cocoa", BlockKind::SandstoneStairs => "sandstone_stairs", BlockKind::EmeraldOre => "emerald_ore", + BlockKind::DeepslateEmeraldOre => "deepslate_emerald_ore", BlockKind::EnderChest => "ender_chest", BlockKind::TripwireHook => "tripwire_hook", BlockKind::Tripwire => "tripwire", @@ -2706,6 +4186,7 @@ impl BlockKind { BlockKind::DarkOakStairs => "dark_oak_stairs", BlockKind::SlimeBlock => "slime_block", BlockKind::Barrier => "barrier", + BlockKind::Light => "light", BlockKind::IronTrapdoor => "iron_trapdoor", BlockKind::Prismarine => "prismarine", BlockKind::PrismarineBricks => "prismarine_bricks", @@ -2825,7 +4306,7 @@ impl BlockKind { BlockKind::PurpurStairs => "purpur_stairs", BlockKind::EndStoneBricks => "end_stone_bricks", BlockKind::Beetroots => "beetroots", - BlockKind::GrassPath => "grass_path", + BlockKind::DirtPath => "dirt_path", BlockKind::EndGateway => "end_gateway", BlockKind::RepeatingCommandBlock => "repeating_command_block", BlockKind::ChainCommandBlock => "chain_command_block", @@ -3090,10 +4571,131 @@ impl BlockKind { BlockKind::ChiseledNetherBricks => "chiseled_nether_bricks", BlockKind::CrackedNetherBricks => "cracked_nether_bricks", BlockKind::QuartzBricks => "quartz_bricks", + BlockKind::Candle => "candle", + BlockKind::WhiteCandle => "white_candle", + BlockKind::OrangeCandle => "orange_candle", + BlockKind::MagentaCandle => "magenta_candle", + BlockKind::LightBlueCandle => "light_blue_candle", + BlockKind::YellowCandle => "yellow_candle", + BlockKind::LimeCandle => "lime_candle", + BlockKind::PinkCandle => "pink_candle", + BlockKind::GrayCandle => "gray_candle", + BlockKind::LightGrayCandle => "light_gray_candle", + BlockKind::CyanCandle => "cyan_candle", + BlockKind::PurpleCandle => "purple_candle", + BlockKind::BlueCandle => "blue_candle", + BlockKind::BrownCandle => "brown_candle", + BlockKind::GreenCandle => "green_candle", + BlockKind::RedCandle => "red_candle", + BlockKind::BlackCandle => "black_candle", + BlockKind::CandleCake => "candle_cake", + BlockKind::WhiteCandleCake => "white_candle_cake", + BlockKind::OrangeCandleCake => "orange_candle_cake", + BlockKind::MagentaCandleCake => "magenta_candle_cake", + BlockKind::LightBlueCandleCake => "light_blue_candle_cake", + BlockKind::YellowCandleCake => "yellow_candle_cake", + BlockKind::LimeCandleCake => "lime_candle_cake", + BlockKind::PinkCandleCake => "pink_candle_cake", + BlockKind::GrayCandleCake => "gray_candle_cake", + BlockKind::LightGrayCandleCake => "light_gray_candle_cake", + BlockKind::CyanCandleCake => "cyan_candle_cake", + BlockKind::PurpleCandleCake => "purple_candle_cake", + BlockKind::BlueCandleCake => "blue_candle_cake", + BlockKind::BrownCandleCake => "brown_candle_cake", + BlockKind::GreenCandleCake => "green_candle_cake", + BlockKind::RedCandleCake => "red_candle_cake", + BlockKind::BlackCandleCake => "black_candle_cake", + BlockKind::AmethystBlock => "amethyst_block", + BlockKind::BuddingAmethyst => "budding_amethyst", + BlockKind::AmethystCluster => "amethyst_cluster", + BlockKind::LargeAmethystBud => "large_amethyst_bud", + BlockKind::MediumAmethystBud => "medium_amethyst_bud", + BlockKind::SmallAmethystBud => "small_amethyst_bud", + BlockKind::Tuff => "tuff", + BlockKind::Calcite => "calcite", + BlockKind::TintedGlass => "tinted_glass", + BlockKind::PowderSnow => "powder_snow", + BlockKind::SculkSensor => "sculk_sensor", + BlockKind::OxidizedCopper => "oxidized_copper", + BlockKind::WeatheredCopper => "weathered_copper", + BlockKind::ExposedCopper => "exposed_copper", + BlockKind::CopperBlock => "copper_block", + BlockKind::CopperOre => "copper_ore", + BlockKind::DeepslateCopperOre => "deepslate_copper_ore", + BlockKind::OxidizedCutCopper => "oxidized_cut_copper", + BlockKind::WeatheredCutCopper => "weathered_cut_copper", + BlockKind::ExposedCutCopper => "exposed_cut_copper", + BlockKind::CutCopper => "cut_copper", + BlockKind::OxidizedCutCopperStairs => "oxidized_cut_copper_stairs", + BlockKind::WeatheredCutCopperStairs => "weathered_cut_copper_stairs", + BlockKind::ExposedCutCopperStairs => "exposed_cut_copper_stairs", + BlockKind::CutCopperStairs => "cut_copper_stairs", + BlockKind::OxidizedCutCopperSlab => "oxidized_cut_copper_slab", + BlockKind::WeatheredCutCopperSlab => "weathered_cut_copper_slab", + BlockKind::ExposedCutCopperSlab => "exposed_cut_copper_slab", + BlockKind::CutCopperSlab => "cut_copper_slab", + BlockKind::WaxedCopperBlock => "waxed_copper_block", + BlockKind::WaxedWeatheredCopper => "waxed_weathered_copper", + BlockKind::WaxedExposedCopper => "waxed_exposed_copper", + BlockKind::WaxedOxidizedCopper => "waxed_oxidized_copper", + BlockKind::WaxedOxidizedCutCopper => "waxed_oxidized_cut_copper", + BlockKind::WaxedWeatheredCutCopper => "waxed_weathered_cut_copper", + BlockKind::WaxedExposedCutCopper => "waxed_exposed_cut_copper", + BlockKind::WaxedCutCopper => "waxed_cut_copper", + BlockKind::WaxedOxidizedCutCopperStairs => "waxed_oxidized_cut_copper_stairs", + BlockKind::WaxedWeatheredCutCopperStairs => "waxed_weathered_cut_copper_stairs", + BlockKind::WaxedExposedCutCopperStairs => "waxed_exposed_cut_copper_stairs", + BlockKind::WaxedCutCopperStairs => "waxed_cut_copper_stairs", + BlockKind::WaxedOxidizedCutCopperSlab => "waxed_oxidized_cut_copper_slab", + BlockKind::WaxedWeatheredCutCopperSlab => "waxed_weathered_cut_copper_slab", + BlockKind::WaxedExposedCutCopperSlab => "waxed_exposed_cut_copper_slab", + BlockKind::WaxedCutCopperSlab => "waxed_cut_copper_slab", + BlockKind::LightningRod => "lightning_rod", + BlockKind::PointedDripstone => "pointed_dripstone", + BlockKind::DripstoneBlock => "dripstone_block", + BlockKind::CaveVines => "cave_vines", + BlockKind::CaveVinesPlant => "cave_vines_plant", + BlockKind::SporeBlossom => "spore_blossom", + BlockKind::Azalea => "azalea", + BlockKind::FloweringAzalea => "flowering_azalea", + BlockKind::MossCarpet => "moss_carpet", + BlockKind::MossBlock => "moss_block", + BlockKind::BigDripleaf => "big_dripleaf", + BlockKind::BigDripleafStem => "big_dripleaf_stem", + BlockKind::SmallDripleaf => "small_dripleaf", + BlockKind::HangingRoots => "hanging_roots", + BlockKind::RootedDirt => "rooted_dirt", + BlockKind::Deepslate => "deepslate", + BlockKind::CobbledDeepslate => "cobbled_deepslate", + BlockKind::CobbledDeepslateStairs => "cobbled_deepslate_stairs", + BlockKind::CobbledDeepslateSlab => "cobbled_deepslate_slab", + BlockKind::CobbledDeepslateWall => "cobbled_deepslate_wall", + BlockKind::PolishedDeepslate => "polished_deepslate", + BlockKind::PolishedDeepslateStairs => "polished_deepslate_stairs", + BlockKind::PolishedDeepslateSlab => "polished_deepslate_slab", + BlockKind::PolishedDeepslateWall => "polished_deepslate_wall", + BlockKind::DeepslateTiles => "deepslate_tiles", + BlockKind::DeepslateTileStairs => "deepslate_tile_stairs", + BlockKind::DeepslateTileSlab => "deepslate_tile_slab", + BlockKind::DeepslateTileWall => "deepslate_tile_wall", + BlockKind::DeepslateBricks => "deepslate_bricks", + BlockKind::DeepslateBrickStairs => "deepslate_brick_stairs", + BlockKind::DeepslateBrickSlab => "deepslate_brick_slab", + BlockKind::DeepslateBrickWall => "deepslate_brick_wall", + BlockKind::ChiseledDeepslate => "chiseled_deepslate", + BlockKind::CrackedDeepslateBricks => "cracked_deepslate_bricks", + BlockKind::CrackedDeepslateTiles => "cracked_deepslate_tiles", + BlockKind::InfestedDeepslate => "infested_deepslate", + BlockKind::SmoothBasalt => "smooth_basalt", + BlockKind::RawIronBlock => "raw_iron_block", + BlockKind::RawCopperBlock => "raw_copper_block", + BlockKind::RawGoldBlock => "raw_gold_block", + BlockKind::PottedAzaleaBush => "potted_azalea_bush", + BlockKind::PottedFloweringAzaleaBush => "potted_flowering_azalea_bush", } } - - /// Gets a `BlockKind` by its `name`. + #[doc = "Gets a `BlockKind` by its `name`."] + #[inline] pub fn from_name(name: &str) -> Option { match name { "air" => Some(BlockKind::Air), @@ -3128,8 +4730,11 @@ impl BlockKind { "red_sand" => Some(BlockKind::RedSand), "gravel" => Some(BlockKind::Gravel), "gold_ore" => Some(BlockKind::GoldOre), + "deepslate_gold_ore" => Some(BlockKind::DeepslateGoldOre), "iron_ore" => Some(BlockKind::IronOre), + "deepslate_iron_ore" => Some(BlockKind::DeepslateIronOre), "coal_ore" => Some(BlockKind::CoalOre), + "deepslate_coal_ore" => Some(BlockKind::DeepslateCoalOre), "nether_gold_ore" => Some(BlockKind::NetherGoldOre), "oak_log" => Some(BlockKind::OakLog), "spruce_log" => Some(BlockKind::SpruceLog), @@ -3161,10 +4766,13 @@ impl BlockKind { "jungle_leaves" => Some(BlockKind::JungleLeaves), "acacia_leaves" => Some(BlockKind::AcaciaLeaves), "dark_oak_leaves" => Some(BlockKind::DarkOakLeaves), + "azalea_leaves" => Some(BlockKind::AzaleaLeaves), + "flowering_azalea_leaves" => Some(BlockKind::FloweringAzaleaLeaves), "sponge" => Some(BlockKind::Sponge), "wet_sponge" => Some(BlockKind::WetSponge), "glass" => Some(BlockKind::Glass), "lapis_ore" => Some(BlockKind::LapisOre), + "deepslate_lapis_ore" => Some(BlockKind::DeepslateLapisOre), "lapis_block" => Some(BlockKind::LapisBlock), "dispenser" => Some(BlockKind::Dispenser), "sandstone" => Some(BlockKind::Sandstone), @@ -3246,6 +4854,7 @@ impl BlockKind { "chest" => Some(BlockKind::Chest), "redstone_wire" => Some(BlockKind::RedstoneWire), "diamond_ore" => Some(BlockKind::DiamondOre), + "deepslate_diamond_ore" => Some(BlockKind::DeepslateDiamondOre), "diamond_block" => Some(BlockKind::DiamondBlock), "crafting_table" => Some(BlockKind::CraftingTable), "wheat" => Some(BlockKind::Wheat), @@ -3277,6 +4886,7 @@ impl BlockKind { "acacia_pressure_plate" => Some(BlockKind::AcaciaPressurePlate), "dark_oak_pressure_plate" => Some(BlockKind::DarkOakPressurePlate), "redstone_ore" => Some(BlockKind::RedstoneOre), + "deepslate_redstone_ore" => Some(BlockKind::DeepslateRedstoneOre), "redstone_torch" => Some(BlockKind::RedstoneTorch), "redstone_wall_torch" => Some(BlockKind::RedstoneWallTorch), "stone_button" => Some(BlockKind::StoneButton), @@ -3346,6 +4956,7 @@ impl BlockKind { "pumpkin_stem" => Some(BlockKind::PumpkinStem), "melon_stem" => Some(BlockKind::MelonStem), "vine" => Some(BlockKind::Vine), + "glow_lichen" => Some(BlockKind::GlowLichen), "oak_fence_gate" => Some(BlockKind::OakFenceGate), "brick_stairs" => Some(BlockKind::BrickStairs), "stone_brick_stairs" => Some(BlockKind::StoneBrickStairs), @@ -3358,6 +4969,9 @@ impl BlockKind { "enchanting_table" => Some(BlockKind::EnchantingTable), "brewing_stand" => Some(BlockKind::BrewingStand), "cauldron" => Some(BlockKind::Cauldron), + "water_cauldron" => Some(BlockKind::WaterCauldron), + "lava_cauldron" => Some(BlockKind::LavaCauldron), + "powder_snow_cauldron" => Some(BlockKind::PowderSnowCauldron), "end_portal" => Some(BlockKind::EndPortal), "end_portal_frame" => Some(BlockKind::EndPortalFrame), "end_stone" => Some(BlockKind::EndStone), @@ -3366,6 +4980,7 @@ impl BlockKind { "cocoa" => Some(BlockKind::Cocoa), "sandstone_stairs" => Some(BlockKind::SandstoneStairs), "emerald_ore" => Some(BlockKind::EmeraldOre), + "deepslate_emerald_ore" => Some(BlockKind::DeepslateEmeraldOre), "ender_chest" => Some(BlockKind::EnderChest), "tripwire_hook" => Some(BlockKind::TripwireHook), "tripwire" => Some(BlockKind::Tripwire), @@ -3475,6 +5090,7 @@ impl BlockKind { "dark_oak_stairs" => Some(BlockKind::DarkOakStairs), "slime_block" => Some(BlockKind::SlimeBlock), "barrier" => Some(BlockKind::Barrier), + "light" => Some(BlockKind::Light), "iron_trapdoor" => Some(BlockKind::IronTrapdoor), "prismarine" => Some(BlockKind::Prismarine), "prismarine_bricks" => Some(BlockKind::PrismarineBricks), @@ -3594,7 +5210,7 @@ impl BlockKind { "purpur_stairs" => Some(BlockKind::PurpurStairs), "end_stone_bricks" => Some(BlockKind::EndStoneBricks), "beetroots" => Some(BlockKind::Beetroots), - "grass_path" => Some(BlockKind::GrassPath), + "dirt_path" => Some(BlockKind::DirtPath), "end_gateway" => Some(BlockKind::EndGateway), "repeating_command_block" => Some(BlockKind::RepeatingCommandBlock), "chain_command_block" => Some(BlockKind::ChainCommandBlock), @@ -3863,2332 +5479,4699 @@ impl BlockKind { "chiseled_nether_bricks" => Some(BlockKind::ChiseledNetherBricks), "cracked_nether_bricks" => Some(BlockKind::CrackedNetherBricks), "quartz_bricks" => Some(BlockKind::QuartzBricks), + "candle" => Some(BlockKind::Candle), + "white_candle" => Some(BlockKind::WhiteCandle), + "orange_candle" => Some(BlockKind::OrangeCandle), + "magenta_candle" => Some(BlockKind::MagentaCandle), + "light_blue_candle" => Some(BlockKind::LightBlueCandle), + "yellow_candle" => Some(BlockKind::YellowCandle), + "lime_candle" => Some(BlockKind::LimeCandle), + "pink_candle" => Some(BlockKind::PinkCandle), + "gray_candle" => Some(BlockKind::GrayCandle), + "light_gray_candle" => Some(BlockKind::LightGrayCandle), + "cyan_candle" => Some(BlockKind::CyanCandle), + "purple_candle" => Some(BlockKind::PurpleCandle), + "blue_candle" => Some(BlockKind::BlueCandle), + "brown_candle" => Some(BlockKind::BrownCandle), + "green_candle" => Some(BlockKind::GreenCandle), + "red_candle" => Some(BlockKind::RedCandle), + "black_candle" => Some(BlockKind::BlackCandle), + "candle_cake" => Some(BlockKind::CandleCake), + "white_candle_cake" => Some(BlockKind::WhiteCandleCake), + "orange_candle_cake" => Some(BlockKind::OrangeCandleCake), + "magenta_candle_cake" => Some(BlockKind::MagentaCandleCake), + "light_blue_candle_cake" => Some(BlockKind::LightBlueCandleCake), + "yellow_candle_cake" => Some(BlockKind::YellowCandleCake), + "lime_candle_cake" => Some(BlockKind::LimeCandleCake), + "pink_candle_cake" => Some(BlockKind::PinkCandleCake), + "gray_candle_cake" => Some(BlockKind::GrayCandleCake), + "light_gray_candle_cake" => Some(BlockKind::LightGrayCandleCake), + "cyan_candle_cake" => Some(BlockKind::CyanCandleCake), + "purple_candle_cake" => Some(BlockKind::PurpleCandleCake), + "blue_candle_cake" => Some(BlockKind::BlueCandleCake), + "brown_candle_cake" => Some(BlockKind::BrownCandleCake), + "green_candle_cake" => Some(BlockKind::GreenCandleCake), + "red_candle_cake" => Some(BlockKind::RedCandleCake), + "black_candle_cake" => Some(BlockKind::BlackCandleCake), + "amethyst_block" => Some(BlockKind::AmethystBlock), + "budding_amethyst" => Some(BlockKind::BuddingAmethyst), + "amethyst_cluster" => Some(BlockKind::AmethystCluster), + "large_amethyst_bud" => Some(BlockKind::LargeAmethystBud), + "medium_amethyst_bud" => Some(BlockKind::MediumAmethystBud), + "small_amethyst_bud" => Some(BlockKind::SmallAmethystBud), + "tuff" => Some(BlockKind::Tuff), + "calcite" => Some(BlockKind::Calcite), + "tinted_glass" => Some(BlockKind::TintedGlass), + "powder_snow" => Some(BlockKind::PowderSnow), + "sculk_sensor" => Some(BlockKind::SculkSensor), + "oxidized_copper" => Some(BlockKind::OxidizedCopper), + "weathered_copper" => Some(BlockKind::WeatheredCopper), + "exposed_copper" => Some(BlockKind::ExposedCopper), + "copper_block" => Some(BlockKind::CopperBlock), + "copper_ore" => Some(BlockKind::CopperOre), + "deepslate_copper_ore" => Some(BlockKind::DeepslateCopperOre), + "oxidized_cut_copper" => Some(BlockKind::OxidizedCutCopper), + "weathered_cut_copper" => Some(BlockKind::WeatheredCutCopper), + "exposed_cut_copper" => Some(BlockKind::ExposedCutCopper), + "cut_copper" => Some(BlockKind::CutCopper), + "oxidized_cut_copper_stairs" => Some(BlockKind::OxidizedCutCopperStairs), + "weathered_cut_copper_stairs" => Some(BlockKind::WeatheredCutCopperStairs), + "exposed_cut_copper_stairs" => Some(BlockKind::ExposedCutCopperStairs), + "cut_copper_stairs" => Some(BlockKind::CutCopperStairs), + "oxidized_cut_copper_slab" => Some(BlockKind::OxidizedCutCopperSlab), + "weathered_cut_copper_slab" => Some(BlockKind::WeatheredCutCopperSlab), + "exposed_cut_copper_slab" => Some(BlockKind::ExposedCutCopperSlab), + "cut_copper_slab" => Some(BlockKind::CutCopperSlab), + "waxed_copper_block" => Some(BlockKind::WaxedCopperBlock), + "waxed_weathered_copper" => Some(BlockKind::WaxedWeatheredCopper), + "waxed_exposed_copper" => Some(BlockKind::WaxedExposedCopper), + "waxed_oxidized_copper" => Some(BlockKind::WaxedOxidizedCopper), + "waxed_oxidized_cut_copper" => Some(BlockKind::WaxedOxidizedCutCopper), + "waxed_weathered_cut_copper" => Some(BlockKind::WaxedWeatheredCutCopper), + "waxed_exposed_cut_copper" => Some(BlockKind::WaxedExposedCutCopper), + "waxed_cut_copper" => Some(BlockKind::WaxedCutCopper), + "waxed_oxidized_cut_copper_stairs" => Some(BlockKind::WaxedOxidizedCutCopperStairs), + "waxed_weathered_cut_copper_stairs" => Some(BlockKind::WaxedWeatheredCutCopperStairs), + "waxed_exposed_cut_copper_stairs" => Some(BlockKind::WaxedExposedCutCopperStairs), + "waxed_cut_copper_stairs" => Some(BlockKind::WaxedCutCopperStairs), + "waxed_oxidized_cut_copper_slab" => Some(BlockKind::WaxedOxidizedCutCopperSlab), + "waxed_weathered_cut_copper_slab" => Some(BlockKind::WaxedWeatheredCutCopperSlab), + "waxed_exposed_cut_copper_slab" => Some(BlockKind::WaxedExposedCutCopperSlab), + "waxed_cut_copper_slab" => Some(BlockKind::WaxedCutCopperSlab), + "lightning_rod" => Some(BlockKind::LightningRod), + "pointed_dripstone" => Some(BlockKind::PointedDripstone), + "dripstone_block" => Some(BlockKind::DripstoneBlock), + "cave_vines" => Some(BlockKind::CaveVines), + "cave_vines_plant" => Some(BlockKind::CaveVinesPlant), + "spore_blossom" => Some(BlockKind::SporeBlossom), + "azalea" => Some(BlockKind::Azalea), + "flowering_azalea" => Some(BlockKind::FloweringAzalea), + "moss_carpet" => Some(BlockKind::MossCarpet), + "moss_block" => Some(BlockKind::MossBlock), + "big_dripleaf" => Some(BlockKind::BigDripleaf), + "big_dripleaf_stem" => Some(BlockKind::BigDripleafStem), + "small_dripleaf" => Some(BlockKind::SmallDripleaf), + "hanging_roots" => Some(BlockKind::HangingRoots), + "rooted_dirt" => Some(BlockKind::RootedDirt), + "deepslate" => Some(BlockKind::Deepslate), + "cobbled_deepslate" => Some(BlockKind::CobbledDeepslate), + "cobbled_deepslate_stairs" => Some(BlockKind::CobbledDeepslateStairs), + "cobbled_deepslate_slab" => Some(BlockKind::CobbledDeepslateSlab), + "cobbled_deepslate_wall" => Some(BlockKind::CobbledDeepslateWall), + "polished_deepslate" => Some(BlockKind::PolishedDeepslate), + "polished_deepslate_stairs" => Some(BlockKind::PolishedDeepslateStairs), + "polished_deepslate_slab" => Some(BlockKind::PolishedDeepslateSlab), + "polished_deepslate_wall" => Some(BlockKind::PolishedDeepslateWall), + "deepslate_tiles" => Some(BlockKind::DeepslateTiles), + "deepslate_tile_stairs" => Some(BlockKind::DeepslateTileStairs), + "deepslate_tile_slab" => Some(BlockKind::DeepslateTileSlab), + "deepslate_tile_wall" => Some(BlockKind::DeepslateTileWall), + "deepslate_bricks" => Some(BlockKind::DeepslateBricks), + "deepslate_brick_stairs" => Some(BlockKind::DeepslateBrickStairs), + "deepslate_brick_slab" => Some(BlockKind::DeepslateBrickSlab), + "deepslate_brick_wall" => Some(BlockKind::DeepslateBrickWall), + "chiseled_deepslate" => Some(BlockKind::ChiseledDeepslate), + "cracked_deepslate_bricks" => Some(BlockKind::CrackedDeepslateBricks), + "cracked_deepslate_tiles" => Some(BlockKind::CrackedDeepslateTiles), + "infested_deepslate" => Some(BlockKind::InfestedDeepslate), + "smooth_basalt" => Some(BlockKind::SmoothBasalt), + "raw_iron_block" => Some(BlockKind::RawIronBlock), + "raw_copper_block" => Some(BlockKind::RawCopperBlock), + "raw_gold_block" => Some(BlockKind::RawGoldBlock), + "potted_azalea_bush" => Some(BlockKind::PottedAzaleaBush), + "potted_flowering_azalea_bush" => Some(BlockKind::PottedFloweringAzaleaBush), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `display_name` property of this `BlockKind`. - pub fn display_name(&self) -> &'static str { + #[doc = "Returns the `namespaced_id` property of this `BlockKind`."] + #[inline] + pub fn namespaced_id(&self) -> &'static str { match self { - BlockKind::Air => "Air", - BlockKind::Stone => "Stone", - BlockKind::Granite => "Granite", - BlockKind::PolishedGranite => "Polished Granite", - BlockKind::Diorite => "Diorite", - BlockKind::PolishedDiorite => "Polished Diorite", - BlockKind::Andesite => "Andesite", - BlockKind::PolishedAndesite => "Polished Andesite", - BlockKind::GrassBlock => "Grass Block", - BlockKind::Dirt => "Dirt", - BlockKind::CoarseDirt => "Coarse Dirt", - BlockKind::Podzol => "Podzol", - BlockKind::Cobblestone => "Cobblestone", - BlockKind::OakPlanks => "Oak Planks", - BlockKind::SprucePlanks => "Spruce Planks", - BlockKind::BirchPlanks => "Birch Planks", - BlockKind::JunglePlanks => "Jungle Planks", - BlockKind::AcaciaPlanks => "Acacia Planks", - BlockKind::DarkOakPlanks => "Dark Oak Planks", - BlockKind::OakSapling => "Oak Sapling", - BlockKind::SpruceSapling => "Spruce Sapling", - BlockKind::BirchSapling => "Birch Sapling", - BlockKind::JungleSapling => "Jungle Sapling", - BlockKind::AcaciaSapling => "Acacia Sapling", - BlockKind::DarkOakSapling => "Dark Oak Sapling", - BlockKind::Bedrock => "Bedrock", - BlockKind::Water => "Water", - BlockKind::Lava => "Lava", - BlockKind::Sand => "Sand", - BlockKind::RedSand => "Red Sand", - BlockKind::Gravel => "Gravel", - BlockKind::GoldOre => "Gold Ore", - BlockKind::IronOre => "Iron Ore", - BlockKind::CoalOre => "Coal Ore", - BlockKind::NetherGoldOre => "Nether Gold Ore", - BlockKind::OakLog => "Oak Log", - BlockKind::SpruceLog => "Spruce Log", - BlockKind::BirchLog => "Birch Log", - BlockKind::JungleLog => "Jungle Log", - BlockKind::AcaciaLog => "Acacia Log", - BlockKind::DarkOakLog => "Dark Oak Log", - BlockKind::StrippedSpruceLog => "Stripped Spruce Log", - BlockKind::StrippedBirchLog => "Stripped Birch Log", - BlockKind::StrippedJungleLog => "Stripped Jungle Log", - BlockKind::StrippedAcaciaLog => "Stripped Acacia Log", - BlockKind::StrippedDarkOakLog => "Stripped Dark Oak Log", - BlockKind::StrippedOakLog => "Stripped Oak Log", - BlockKind::OakWood => "Oak Wood", - BlockKind::SpruceWood => "Spruce Wood", - BlockKind::BirchWood => "Birch Wood", - BlockKind::JungleWood => "Jungle Wood", - BlockKind::AcaciaWood => "Acacia Wood", - BlockKind::DarkOakWood => "Dark Oak Wood", - BlockKind::StrippedOakWood => "Stripped Oak Wood", - BlockKind::StrippedSpruceWood => "Stripped Spruce Wood", - BlockKind::StrippedBirchWood => "Stripped Birch Wood", - BlockKind::StrippedJungleWood => "Stripped Jungle Wood", - BlockKind::StrippedAcaciaWood => "Stripped Acacia Wood", - BlockKind::StrippedDarkOakWood => "Stripped Dark Oak Wood", - BlockKind::OakLeaves => "Oak Leaves", - BlockKind::SpruceLeaves => "Spruce Leaves", - BlockKind::BirchLeaves => "Birch Leaves", - BlockKind::JungleLeaves => "Jungle Leaves", - BlockKind::AcaciaLeaves => "Acacia Leaves", - BlockKind::DarkOakLeaves => "Dark Oak Leaves", - BlockKind::Sponge => "Sponge", - BlockKind::WetSponge => "Wet Sponge", - BlockKind::Glass => "Glass", - BlockKind::LapisOre => "Lapis Lazuli Ore", - BlockKind::LapisBlock => "Lapis Lazuli Block", - BlockKind::Dispenser => "Dispenser", - BlockKind::Sandstone => "Sandstone", - BlockKind::ChiseledSandstone => "Chiseled Sandstone", - BlockKind::CutSandstone => "Cut Sandstone", - BlockKind::NoteBlock => "Note Block", - BlockKind::WhiteBed => "White Bed", - BlockKind::OrangeBed => "Orange Bed", - BlockKind::MagentaBed => "Magenta Bed", - BlockKind::LightBlueBed => "Light Blue Bed", - BlockKind::YellowBed => "Yellow Bed", - BlockKind::LimeBed => "Lime Bed", - BlockKind::PinkBed => "Pink Bed", - BlockKind::GrayBed => "Gray Bed", - BlockKind::LightGrayBed => "Light Gray Bed", - BlockKind::CyanBed => "Cyan Bed", - BlockKind::PurpleBed => "Purple Bed", - BlockKind::BlueBed => "Blue Bed", - BlockKind::BrownBed => "Brown Bed", - BlockKind::GreenBed => "Green Bed", - BlockKind::RedBed => "Red Bed", - BlockKind::BlackBed => "Black Bed", - BlockKind::PoweredRail => "Powered Rail", - BlockKind::DetectorRail => "Detector Rail", - BlockKind::StickyPiston => "Sticky Piston", - BlockKind::Cobweb => "Cobweb", - BlockKind::Grass => "Grass", - BlockKind::Fern => "Fern", - BlockKind::DeadBush => "Dead Bush", - BlockKind::Seagrass => "Seagrass", - BlockKind::TallSeagrass => "Tall Seagrass", - BlockKind::Piston => "Piston", - BlockKind::PistonHead => "Piston Head", - BlockKind::WhiteWool => "White Wool", - BlockKind::OrangeWool => "Orange Wool", - BlockKind::MagentaWool => "Magenta Wool", - BlockKind::LightBlueWool => "Light Blue Wool", - BlockKind::YellowWool => "Yellow Wool", - BlockKind::LimeWool => "Lime Wool", - BlockKind::PinkWool => "Pink Wool", - BlockKind::GrayWool => "Gray Wool", - BlockKind::LightGrayWool => "Light Gray Wool", - BlockKind::CyanWool => "Cyan Wool", - BlockKind::PurpleWool => "Purple Wool", - BlockKind::BlueWool => "Blue Wool", - BlockKind::BrownWool => "Brown Wool", - BlockKind::GreenWool => "Green Wool", - BlockKind::RedWool => "Red Wool", - BlockKind::BlackWool => "Black Wool", - BlockKind::MovingPiston => "Moving Piston", - BlockKind::Dandelion => "Dandelion", - BlockKind::Poppy => "Poppy", - BlockKind::BlueOrchid => "Blue Orchid", - BlockKind::Allium => "Allium", - BlockKind::AzureBluet => "Azure Bluet", - BlockKind::RedTulip => "Red Tulip", - BlockKind::OrangeTulip => "Orange Tulip", - BlockKind::WhiteTulip => "White Tulip", - BlockKind::PinkTulip => "Pink Tulip", - BlockKind::OxeyeDaisy => "Oxeye Daisy", - BlockKind::Cornflower => "Cornflower", - BlockKind::WitherRose => "Wither Rose", - BlockKind::LilyOfTheValley => "Lily of the Valley", - BlockKind::BrownMushroom => "Brown Mushroom", - BlockKind::RedMushroom => "Red Mushroom", - BlockKind::GoldBlock => "Block of Gold", - BlockKind::IronBlock => "Block of Iron", - BlockKind::Bricks => "Bricks", - BlockKind::Tnt => "TNT", - BlockKind::Bookshelf => "Bookshelf", - BlockKind::MossyCobblestone => "Mossy Cobblestone", - BlockKind::Obsidian => "Obsidian", - BlockKind::Torch => "Torch", - BlockKind::WallTorch => "Wall Torch", - BlockKind::Fire => "Fire", - BlockKind::SoulFire => "Soul Fire", - BlockKind::Spawner => "Spawner", - BlockKind::OakStairs => "Oak Stairs", - BlockKind::Chest => "Chest", - BlockKind::RedstoneWire => "Redstone Wire", - BlockKind::DiamondOre => "Diamond Ore", - BlockKind::DiamondBlock => "Block of Diamond", - BlockKind::CraftingTable => "Crafting Table", - BlockKind::Wheat => "Wheat Crops", - BlockKind::Farmland => "Farmland", - BlockKind::Furnace => "Furnace", - BlockKind::OakSign => "Oak Sign", - BlockKind::SpruceSign => "Spruce Sign", - BlockKind::BirchSign => "Birch Sign", - BlockKind::AcaciaSign => "Acacia Sign", - BlockKind::JungleSign => "Jungle Sign", - BlockKind::DarkOakSign => "Dark Oak Sign", - BlockKind::OakDoor => "Oak Door", - BlockKind::Ladder => "Ladder", - BlockKind::Rail => "Rail", - BlockKind::CobblestoneStairs => "Cobblestone Stairs", - BlockKind::OakWallSign => "Oak Wall Sign", - BlockKind::SpruceWallSign => "Spruce Wall Sign", - BlockKind::BirchWallSign => "Birch Wall Sign", - BlockKind::AcaciaWallSign => "Acacia Wall Sign", - BlockKind::JungleWallSign => "Jungle Wall Sign", - BlockKind::DarkOakWallSign => "Dark Oak Wall Sign", - BlockKind::Lever => "Lever", - BlockKind::StonePressurePlate => "Stone Pressure Plate", - BlockKind::IronDoor => "Iron Door", - BlockKind::OakPressurePlate => "Oak Pressure Plate", - BlockKind::SprucePressurePlate => "Spruce Pressure Plate", - BlockKind::BirchPressurePlate => "Birch Pressure Plate", - BlockKind::JunglePressurePlate => "Jungle Pressure Plate", - BlockKind::AcaciaPressurePlate => "Acacia Pressure Plate", - BlockKind::DarkOakPressurePlate => "Dark Oak Pressure Plate", - BlockKind::RedstoneOre => "Redstone Ore", - BlockKind::RedstoneTorch => "Redstone Torch", - BlockKind::RedstoneWallTorch => "Redstone Wall Torch", - BlockKind::StoneButton => "Stone Button", - BlockKind::Snow => "Snow", - BlockKind::Ice => "Ice", - BlockKind::SnowBlock => "Snow Block", - BlockKind::Cactus => "Cactus", - BlockKind::Clay => "Clay", - BlockKind::SugarCane => "Sugar Cane", - BlockKind::Jukebox => "Jukebox", - BlockKind::OakFence => "Oak Fence", - BlockKind::Pumpkin => "Pumpkin", - BlockKind::Netherrack => "Netherrack", - BlockKind::SoulSand => "Soul Sand", - BlockKind::SoulSoil => "Soul Soil", - BlockKind::Basalt => "Basalt", - BlockKind::PolishedBasalt => "Polished Basalt", - BlockKind::SoulTorch => "Soul Torch", - BlockKind::SoulWallTorch => "Soul Wall Torch", - BlockKind::Glowstone => "Glowstone", - BlockKind::NetherPortal => "Nether Portal", - BlockKind::CarvedPumpkin => "Carved Pumpkin", - BlockKind::JackOLantern => "Jack o'Lantern", - BlockKind::Cake => "Cake", - BlockKind::Repeater => "Redstone Repeater", - BlockKind::WhiteStainedGlass => "White Stained Glass", - BlockKind::OrangeStainedGlass => "Orange Stained Glass", - BlockKind::MagentaStainedGlass => "Magenta Stained Glass", - BlockKind::LightBlueStainedGlass => "Light Blue Stained Glass", - BlockKind::YellowStainedGlass => "Yellow Stained Glass", - BlockKind::LimeStainedGlass => "Lime Stained Glass", - BlockKind::PinkStainedGlass => "Pink Stained Glass", - BlockKind::GrayStainedGlass => "Gray Stained Glass", - BlockKind::LightGrayStainedGlass => "Light Gray Stained Glass", - BlockKind::CyanStainedGlass => "Cyan Stained Glass", - BlockKind::PurpleStainedGlass => "Purple Stained Glass", - BlockKind::BlueStainedGlass => "Blue Stained Glass", - BlockKind::BrownStainedGlass => "Brown Stained Glass", - BlockKind::GreenStainedGlass => "Green Stained Glass", - BlockKind::RedStainedGlass => "Red Stained Glass", - BlockKind::BlackStainedGlass => "Black Stained Glass", - BlockKind::OakTrapdoor => "Oak Trapdoor", - BlockKind::SpruceTrapdoor => "Spruce Trapdoor", - BlockKind::BirchTrapdoor => "Birch Trapdoor", - BlockKind::JungleTrapdoor => "Jungle Trapdoor", - BlockKind::AcaciaTrapdoor => "Acacia Trapdoor", - BlockKind::DarkOakTrapdoor => "Dark Oak Trapdoor", - BlockKind::StoneBricks => "Stone Bricks", - BlockKind::MossyStoneBricks => "Mossy Stone Bricks", - BlockKind::CrackedStoneBricks => "Cracked Stone Bricks", - BlockKind::ChiseledStoneBricks => "Chiseled Stone Bricks", - BlockKind::InfestedStone => "Infested Stone", - BlockKind::InfestedCobblestone => "Infested Cobblestone", - BlockKind::InfestedStoneBricks => "Infested Stone Bricks", - BlockKind::InfestedMossyStoneBricks => "Infested Mossy Stone Bricks", - BlockKind::InfestedCrackedStoneBricks => "Infested Cracked Stone Bricks", - BlockKind::InfestedChiseledStoneBricks => "Infested Chiseled Stone Bricks", - BlockKind::BrownMushroomBlock => "Brown Mushroom Block", - BlockKind::RedMushroomBlock => "Red Mushroom Block", - BlockKind::MushroomStem => "Mushroom Stem", - BlockKind::IronBars => "Iron Bars", - BlockKind::Chain => "Chain", - BlockKind::GlassPane => "Glass Pane", - BlockKind::Melon => "Melon", - BlockKind::AttachedPumpkinStem => "Attached Pumpkin Stem", - BlockKind::AttachedMelonStem => "Attached Melon Stem", - BlockKind::PumpkinStem => "Pumpkin Stem", - BlockKind::MelonStem => "Melon Stem", - BlockKind::Vine => "Vines", - BlockKind::OakFenceGate => "Oak Fence Gate", - BlockKind::BrickStairs => "Brick Stairs", - BlockKind::StoneBrickStairs => "Stone Brick Stairs", - BlockKind::Mycelium => "Mycelium", - BlockKind::LilyPad => "Lily Pad", - BlockKind::NetherBricks => "Nether Bricks", - BlockKind::NetherBrickFence => "Nether Brick Fence", - BlockKind::NetherBrickStairs => "Nether Brick Stairs", - BlockKind::NetherWart => "Nether Wart", - BlockKind::EnchantingTable => "Enchanting Table", - BlockKind::BrewingStand => "Brewing Stand", - BlockKind::Cauldron => "Cauldron", - BlockKind::EndPortal => "End Portal", - BlockKind::EndPortalFrame => "End Portal Frame", - BlockKind::EndStone => "End Stone", - BlockKind::DragonEgg => "Dragon Egg", - BlockKind::RedstoneLamp => "Redstone Lamp", - BlockKind::Cocoa => "Cocoa", - BlockKind::SandstoneStairs => "Sandstone Stairs", - BlockKind::EmeraldOre => "Emerald Ore", - BlockKind::EnderChest => "Ender Chest", - BlockKind::TripwireHook => "Tripwire Hook", - BlockKind::Tripwire => "Tripwire", - BlockKind::EmeraldBlock => "Block of Emerald", - BlockKind::SpruceStairs => "Spruce Stairs", - BlockKind::BirchStairs => "Birch Stairs", - BlockKind::JungleStairs => "Jungle Stairs", - BlockKind::CommandBlock => "Command Block", - BlockKind::Beacon => "Beacon", - BlockKind::CobblestoneWall => "Cobblestone Wall", - BlockKind::MossyCobblestoneWall => "Mossy Cobblestone Wall", - BlockKind::FlowerPot => "Flower Pot", - BlockKind::PottedOakSapling => "Potted Oak Sapling", - BlockKind::PottedSpruceSapling => "Potted Spruce Sapling", - BlockKind::PottedBirchSapling => "Potted Birch Sapling", - BlockKind::PottedJungleSapling => "Potted Jungle Sapling", - BlockKind::PottedAcaciaSapling => "Potted Acacia Sapling", - BlockKind::PottedDarkOakSapling => "Potted Dark Oak Sapling", - BlockKind::PottedFern => "Potted Fern", - BlockKind::PottedDandelion => "Potted Dandelion", - BlockKind::PottedPoppy => "Potted Poppy", - BlockKind::PottedBlueOrchid => "Potted Blue Orchid", - BlockKind::PottedAllium => "Potted Allium", - BlockKind::PottedAzureBluet => "Potted Azure Bluet", - BlockKind::PottedRedTulip => "Potted Red Tulip", - BlockKind::PottedOrangeTulip => "Potted Orange Tulip", - BlockKind::PottedWhiteTulip => "Potted White Tulip", - BlockKind::PottedPinkTulip => "Potted Pink Tulip", - BlockKind::PottedOxeyeDaisy => "Potted Oxeye Daisy", - BlockKind::PottedCornflower => "Potted Cornflower", - BlockKind::PottedLilyOfTheValley => "Potted Lily of the Valley", - BlockKind::PottedWitherRose => "Potted Wither Rose", - BlockKind::PottedRedMushroom => "Potted Red Mushroom", - BlockKind::PottedBrownMushroom => "Potted Brown Mushroom", - BlockKind::PottedDeadBush => "Potted Dead Bush", - BlockKind::PottedCactus => "Potted Cactus", - BlockKind::Carrots => "Carrots", - BlockKind::Potatoes => "Potatoes", - BlockKind::OakButton => "Oak Button", - BlockKind::SpruceButton => "Spruce Button", - BlockKind::BirchButton => "Birch Button", - BlockKind::JungleButton => "Jungle Button", - BlockKind::AcaciaButton => "Acacia Button", - BlockKind::DarkOakButton => "Dark Oak Button", - BlockKind::SkeletonSkull => "Skeleton Skull", - BlockKind::SkeletonWallSkull => "Skeleton Wall Skull", - BlockKind::WitherSkeletonSkull => "Wither Skeleton Skull", - BlockKind::WitherSkeletonWallSkull => "Wither Skeleton Wall Skull", - BlockKind::ZombieHead => "Zombie Head", - BlockKind::ZombieWallHead => "Zombie Wall Head", - BlockKind::PlayerHead => "Player Head", - BlockKind::PlayerWallHead => "Player Wall Head", - BlockKind::CreeperHead => "Creeper Head", - BlockKind::CreeperWallHead => "Creeper Wall Head", - BlockKind::DragonHead => "Dragon Head", - BlockKind::DragonWallHead => "Dragon Wall Head", - BlockKind::Anvil => "Anvil", - BlockKind::ChippedAnvil => "Chipped Anvil", - BlockKind::DamagedAnvil => "Damaged Anvil", - BlockKind::TrappedChest => "Trapped Chest", - BlockKind::LightWeightedPressurePlate => "Light Weighted Pressure Plate", - BlockKind::HeavyWeightedPressurePlate => "Heavy Weighted Pressure Plate", - BlockKind::Comparator => "Redstone Comparator", - BlockKind::DaylightDetector => "Daylight Detector", - BlockKind::RedstoneBlock => "Block of Redstone", - BlockKind::NetherQuartzOre => "Nether Quartz Ore", - BlockKind::Hopper => "Hopper", - BlockKind::QuartzBlock => "Block of Quartz", - BlockKind::ChiseledQuartzBlock => "Chiseled Quartz Block", - BlockKind::QuartzPillar => "Quartz Pillar", - BlockKind::QuartzStairs => "Quartz Stairs", - BlockKind::ActivatorRail => "Activator Rail", - BlockKind::Dropper => "Dropper", - BlockKind::WhiteTerracotta => "White Terracotta", - BlockKind::OrangeTerracotta => "Orange Terracotta", - BlockKind::MagentaTerracotta => "Magenta Terracotta", - BlockKind::LightBlueTerracotta => "Light Blue Terracotta", - BlockKind::YellowTerracotta => "Yellow Terracotta", - BlockKind::LimeTerracotta => "Lime Terracotta", - BlockKind::PinkTerracotta => "Pink Terracotta", - BlockKind::GrayTerracotta => "Gray Terracotta", - BlockKind::LightGrayTerracotta => "Light Gray Terracotta", - BlockKind::CyanTerracotta => "Cyan Terracotta", - BlockKind::PurpleTerracotta => "Purple Terracotta", - BlockKind::BlueTerracotta => "Blue Terracotta", - BlockKind::BrownTerracotta => "Brown Terracotta", - BlockKind::GreenTerracotta => "Green Terracotta", - BlockKind::RedTerracotta => "Red Terracotta", - BlockKind::BlackTerracotta => "Black Terracotta", - BlockKind::WhiteStainedGlassPane => "White Stained Glass Pane", - BlockKind::OrangeStainedGlassPane => "Orange Stained Glass Pane", - BlockKind::MagentaStainedGlassPane => "Magenta Stained Glass Pane", - BlockKind::LightBlueStainedGlassPane => "Light Blue Stained Glass Pane", - BlockKind::YellowStainedGlassPane => "Yellow Stained Glass Pane", - BlockKind::LimeStainedGlassPane => "Lime Stained Glass Pane", - BlockKind::PinkStainedGlassPane => "Pink Stained Glass Pane", - BlockKind::GrayStainedGlassPane => "Gray Stained Glass Pane", - BlockKind::LightGrayStainedGlassPane => "Light Gray Stained Glass Pane", - BlockKind::CyanStainedGlassPane => "Cyan Stained Glass Pane", - BlockKind::PurpleStainedGlassPane => "Purple Stained Glass Pane", - BlockKind::BlueStainedGlassPane => "Blue Stained Glass Pane", - BlockKind::BrownStainedGlassPane => "Brown Stained Glass Pane", - BlockKind::GreenStainedGlassPane => "Green Stained Glass Pane", - BlockKind::RedStainedGlassPane => "Red Stained Glass Pane", - BlockKind::BlackStainedGlassPane => "Black Stained Glass Pane", - BlockKind::AcaciaStairs => "Acacia Stairs", - BlockKind::DarkOakStairs => "Dark Oak Stairs", - BlockKind::SlimeBlock => "Slime Block", - BlockKind::Barrier => "Barrier", - BlockKind::IronTrapdoor => "Iron Trapdoor", - BlockKind::Prismarine => "Prismarine", - BlockKind::PrismarineBricks => "Prismarine Bricks", - BlockKind::DarkPrismarine => "Dark Prismarine", - BlockKind::PrismarineStairs => "Prismarine Stairs", - BlockKind::PrismarineBrickStairs => "Prismarine Brick Stairs", - BlockKind::DarkPrismarineStairs => "Dark Prismarine Stairs", - BlockKind::PrismarineSlab => "Prismarine Slab", - BlockKind::PrismarineBrickSlab => "Prismarine Brick Slab", - BlockKind::DarkPrismarineSlab => "Dark Prismarine Slab", - BlockKind::SeaLantern => "Sea Lantern", - BlockKind::HayBlock => "Hay Bale", - BlockKind::WhiteCarpet => "White Carpet", - BlockKind::OrangeCarpet => "Orange Carpet", - BlockKind::MagentaCarpet => "Magenta Carpet", - BlockKind::LightBlueCarpet => "Light Blue Carpet", - BlockKind::YellowCarpet => "Yellow Carpet", - BlockKind::LimeCarpet => "Lime Carpet", - BlockKind::PinkCarpet => "Pink Carpet", - BlockKind::GrayCarpet => "Gray Carpet", - BlockKind::LightGrayCarpet => "Light Gray Carpet", - BlockKind::CyanCarpet => "Cyan Carpet", - BlockKind::PurpleCarpet => "Purple Carpet", - BlockKind::BlueCarpet => "Blue Carpet", - BlockKind::BrownCarpet => "Brown Carpet", - BlockKind::GreenCarpet => "Green Carpet", - BlockKind::RedCarpet => "Red Carpet", - BlockKind::BlackCarpet => "Black Carpet", - BlockKind::Terracotta => "Terracotta", - BlockKind::CoalBlock => "Block of Coal", - BlockKind::PackedIce => "Packed Ice", - BlockKind::Sunflower => "Sunflower", - BlockKind::Lilac => "Lilac", - BlockKind::RoseBush => "Rose Bush", - BlockKind::Peony => "Peony", - BlockKind::TallGrass => "Tall Grass", - BlockKind::LargeFern => "Large Fern", - BlockKind::WhiteBanner => "White Banner", - BlockKind::OrangeBanner => "Orange Banner", - BlockKind::MagentaBanner => "Magenta Banner", - BlockKind::LightBlueBanner => "Light Blue Banner", - BlockKind::YellowBanner => "Yellow Banner", - BlockKind::LimeBanner => "Lime Banner", - BlockKind::PinkBanner => "Pink Banner", - BlockKind::GrayBanner => "Gray Banner", - BlockKind::LightGrayBanner => "Light Gray Banner", - BlockKind::CyanBanner => "Cyan Banner", - BlockKind::PurpleBanner => "Purple Banner", - BlockKind::BlueBanner => "Blue Banner", - BlockKind::BrownBanner => "Brown Banner", - BlockKind::GreenBanner => "Green Banner", - BlockKind::RedBanner => "Red Banner", - BlockKind::BlackBanner => "Black Banner", - BlockKind::WhiteWallBanner => "White wall banner", - BlockKind::OrangeWallBanner => "Orange wall banner", - BlockKind::MagentaWallBanner => "Magenta wall banner", - BlockKind::LightBlueWallBanner => "Light blue wall banner", - BlockKind::YellowWallBanner => "Yellow wall banner", - BlockKind::LimeWallBanner => "Lime wall banner", - BlockKind::PinkWallBanner => "Pink wall banner", - BlockKind::GrayWallBanner => "Gray wall banner", - BlockKind::LightGrayWallBanner => "Light gray wall banner", - BlockKind::CyanWallBanner => "Cyan wall banner", - BlockKind::PurpleWallBanner => "Purple wall banner", - BlockKind::BlueWallBanner => "Blue wall banner", - BlockKind::BrownWallBanner => "Brown wall banner", - BlockKind::GreenWallBanner => "Green wall banner", - BlockKind::RedWallBanner => "Red wall banner", - BlockKind::BlackWallBanner => "Black wall banner", - BlockKind::RedSandstone => "Red Sandstone", - BlockKind::ChiseledRedSandstone => "Chiseled Red Sandstone", - BlockKind::CutRedSandstone => "Cut Red Sandstone", - BlockKind::RedSandstoneStairs => "Red Sandstone Stairs", - BlockKind::OakSlab => "Oak Slab", - BlockKind::SpruceSlab => "Spruce Slab", - BlockKind::BirchSlab => "Birch Slab", - BlockKind::JungleSlab => "Jungle Slab", - BlockKind::AcaciaSlab => "Acacia Slab", - BlockKind::DarkOakSlab => "Dark Oak Slab", - BlockKind::StoneSlab => "Stone Slab", - BlockKind::SmoothStoneSlab => "Smooth Stone Slab", - BlockKind::SandstoneSlab => "Sandstone Slab", - BlockKind::CutSandstoneSlab => "Cut Sandstone Slab", - BlockKind::PetrifiedOakSlab => "Petrified Oak Slab", - BlockKind::CobblestoneSlab => "Cobblestone Slab", - BlockKind::BrickSlab => "Brick Slab", - BlockKind::StoneBrickSlab => "Stone Brick Slab", - BlockKind::NetherBrickSlab => "Nether Brick Slab", - BlockKind::QuartzSlab => "Quartz Slab", - BlockKind::RedSandstoneSlab => "Red Sandstone Slab", - BlockKind::CutRedSandstoneSlab => "Cut Red Sandstone Slab", - BlockKind::PurpurSlab => "Purpur Slab", - BlockKind::SmoothStone => "Smooth Stone", - BlockKind::SmoothSandstone => "Smooth Sandstone", - BlockKind::SmoothQuartz => "Smooth Quartz Block", - BlockKind::SmoothRedSandstone => "Smooth Red Sandstone", - BlockKind::SpruceFenceGate => "Spruce Fence Gate", - BlockKind::BirchFenceGate => "Birch Fence Gate", - BlockKind::JungleFenceGate => "Jungle Fence Gate", - BlockKind::AcaciaFenceGate => "Acacia Fence Gate", - BlockKind::DarkOakFenceGate => "Dark Oak Fence Gate", - BlockKind::SpruceFence => "Spruce Fence", - BlockKind::BirchFence => "Birch Fence", - BlockKind::JungleFence => "Jungle Fence", - BlockKind::AcaciaFence => "Acacia Fence", - BlockKind::DarkOakFence => "Dark Oak Fence", - BlockKind::SpruceDoor => "Spruce Door", - BlockKind::BirchDoor => "Birch Door", - BlockKind::JungleDoor => "Jungle Door", - BlockKind::AcaciaDoor => "Acacia Door", - BlockKind::DarkOakDoor => "Dark Oak Door", - BlockKind::EndRod => "End Rod", - BlockKind::ChorusPlant => "Chorus Plant", - BlockKind::ChorusFlower => "Chorus Flower", - BlockKind::PurpurBlock => "Purpur Block", - BlockKind::PurpurPillar => "Purpur Pillar", - BlockKind::PurpurStairs => "Purpur Stairs", - BlockKind::EndStoneBricks => "End Stone Bricks", - BlockKind::Beetroots => "Beetroots", - BlockKind::GrassPath => "Grass Path", - BlockKind::EndGateway => "End Gateway", - BlockKind::RepeatingCommandBlock => "Repeating Command Block", - BlockKind::ChainCommandBlock => "Chain Command Block", - BlockKind::FrostedIce => "Frosted Ice", - BlockKind::MagmaBlock => "Magma Block", - BlockKind::NetherWartBlock => "Nether Wart Block", - BlockKind::RedNetherBricks => "Red Nether Bricks", - BlockKind::BoneBlock => "Bone Block", - BlockKind::StructureVoid => "Structure Void", - BlockKind::Observer => "Observer", - BlockKind::ShulkerBox => "Shulker Box", - BlockKind::WhiteShulkerBox => "White Shulker Box", - BlockKind::OrangeShulkerBox => "Orange Shulker Box", - BlockKind::MagentaShulkerBox => "Magenta Shulker Box", - BlockKind::LightBlueShulkerBox => "Light Blue Shulker Box", - BlockKind::YellowShulkerBox => "Yellow Shulker Box", - BlockKind::LimeShulkerBox => "Lime Shulker Box", - BlockKind::PinkShulkerBox => "Pink Shulker Box", - BlockKind::GrayShulkerBox => "Gray Shulker Box", - BlockKind::LightGrayShulkerBox => "Light Gray Shulker Box", - BlockKind::CyanShulkerBox => "Cyan Shulker Box", - BlockKind::PurpleShulkerBox => "Purple Shulker Box", - BlockKind::BlueShulkerBox => "Blue Shulker Box", - BlockKind::BrownShulkerBox => "Brown Shulker Box", - BlockKind::GreenShulkerBox => "Green Shulker Box", - BlockKind::RedShulkerBox => "Red Shulker Box", - BlockKind::BlackShulkerBox => "Black Shulker Box", - BlockKind::WhiteGlazedTerracotta => "White Glazed Terracotta", - BlockKind::OrangeGlazedTerracotta => "Orange Glazed Terracotta", - BlockKind::MagentaGlazedTerracotta => "Magenta Glazed Terracotta", - BlockKind::LightBlueGlazedTerracotta => "Light Blue Glazed Terracotta", - BlockKind::YellowGlazedTerracotta => "Yellow Glazed Terracotta", - BlockKind::LimeGlazedTerracotta => "Lime Glazed Terracotta", - BlockKind::PinkGlazedTerracotta => "Pink Glazed Terracotta", - BlockKind::GrayGlazedTerracotta => "Gray Glazed Terracotta", - BlockKind::LightGrayGlazedTerracotta => "Light Gray Glazed Terracotta", - BlockKind::CyanGlazedTerracotta => "Cyan Glazed Terracotta", - BlockKind::PurpleGlazedTerracotta => "Purple Glazed Terracotta", - BlockKind::BlueGlazedTerracotta => "Blue Glazed Terracotta", - BlockKind::BrownGlazedTerracotta => "Brown Glazed Terracotta", - BlockKind::GreenGlazedTerracotta => "Green Glazed Terracotta", - BlockKind::RedGlazedTerracotta => "Red Glazed Terracotta", - BlockKind::BlackGlazedTerracotta => "Black Glazed Terracotta", - BlockKind::WhiteConcrete => "White Concrete", - BlockKind::OrangeConcrete => "Orange Concrete", - BlockKind::MagentaConcrete => "Magenta Concrete", - BlockKind::LightBlueConcrete => "Light Blue Concrete", - BlockKind::YellowConcrete => "Yellow Concrete", - BlockKind::LimeConcrete => "Lime Concrete", - BlockKind::PinkConcrete => "Pink Concrete", - BlockKind::GrayConcrete => "Gray Concrete", - BlockKind::LightGrayConcrete => "Light Gray Concrete", - BlockKind::CyanConcrete => "Cyan Concrete", - BlockKind::PurpleConcrete => "Purple Concrete", - BlockKind::BlueConcrete => "Blue Concrete", - BlockKind::BrownConcrete => "Brown Concrete", - BlockKind::GreenConcrete => "Green Concrete", - BlockKind::RedConcrete => "Red Concrete", - BlockKind::BlackConcrete => "Black Concrete", - BlockKind::WhiteConcretePowder => "White Concrete Powder", - BlockKind::OrangeConcretePowder => "Orange Concrete Powder", - BlockKind::MagentaConcretePowder => "Magenta Concrete Powder", - BlockKind::LightBlueConcretePowder => "Light Blue Concrete Powder", - BlockKind::YellowConcretePowder => "Yellow Concrete Powder", - BlockKind::LimeConcretePowder => "Lime Concrete Powder", - BlockKind::PinkConcretePowder => "Pink Concrete Powder", - BlockKind::GrayConcretePowder => "Gray Concrete Powder", - BlockKind::LightGrayConcretePowder => "Light Gray Concrete Powder", - BlockKind::CyanConcretePowder => "Cyan Concrete Powder", - BlockKind::PurpleConcretePowder => "Purple Concrete Powder", - BlockKind::BlueConcretePowder => "Blue Concrete Powder", - BlockKind::BrownConcretePowder => "Brown Concrete Powder", - BlockKind::GreenConcretePowder => "Green Concrete Powder", - BlockKind::RedConcretePowder => "Red Concrete Powder", - BlockKind::BlackConcretePowder => "Black Concrete Powder", - BlockKind::Kelp => "Kelp", - BlockKind::KelpPlant => "Kelp Plant", - BlockKind::DriedKelpBlock => "Dried Kelp Block", - BlockKind::TurtleEgg => "Turtle Egg", - BlockKind::DeadTubeCoralBlock => "Dead Tube Coral Block", - BlockKind::DeadBrainCoralBlock => "Dead Brain Coral Block", - BlockKind::DeadBubbleCoralBlock => "Dead Bubble Coral Block", - BlockKind::DeadFireCoralBlock => "Dead Fire Coral Block", - BlockKind::DeadHornCoralBlock => "Dead Horn Coral Block", - BlockKind::TubeCoralBlock => "Tube Coral Block", - BlockKind::BrainCoralBlock => "Brain Coral Block", - BlockKind::BubbleCoralBlock => "Bubble Coral Block", - BlockKind::FireCoralBlock => "Fire Coral Block", - BlockKind::HornCoralBlock => "Horn Coral Block", - BlockKind::DeadTubeCoral => "Dead Tube Coral", - BlockKind::DeadBrainCoral => "Dead Brain Coral", - BlockKind::DeadBubbleCoral => "Dead Bubble Coral", - BlockKind::DeadFireCoral => "Dead Fire Coral", - BlockKind::DeadHornCoral => "Dead Horn Coral", - BlockKind::TubeCoral => "Tube Coral", - BlockKind::BrainCoral => "Brain Coral", - BlockKind::BubbleCoral => "Bubble Coral", - BlockKind::FireCoral => "Fire Coral", - BlockKind::HornCoral => "Horn Coral", - BlockKind::DeadTubeCoralFan => "Dead Tube Coral Fan", - BlockKind::DeadBrainCoralFan => "Dead Brain Coral Fan", - BlockKind::DeadBubbleCoralFan => "Dead Bubble Coral Fan", - BlockKind::DeadFireCoralFan => "Dead Fire Coral Fan", - BlockKind::DeadHornCoralFan => "Dead Horn Coral Fan", - BlockKind::TubeCoralFan => "Tube Coral Fan", - BlockKind::BrainCoralFan => "Brain Coral Fan", - BlockKind::BubbleCoralFan => "Bubble Coral Fan", - BlockKind::FireCoralFan => "Fire Coral Fan", - BlockKind::HornCoralFan => "Horn Coral Fan", - BlockKind::DeadTubeCoralWallFan => "Dead Tube Coral Wall Fan", - BlockKind::DeadBrainCoralWallFan => "Dead Brain Coral Wall Fan", - BlockKind::DeadBubbleCoralWallFan => "Dead Bubble Coral Wall Fan", - BlockKind::DeadFireCoralWallFan => "Dead Fire Coral Wall Fan", - BlockKind::DeadHornCoralWallFan => "Dead Horn Coral Wall Fan", - BlockKind::TubeCoralWallFan => "Tube Coral Wall Fan", - BlockKind::BrainCoralWallFan => "Brain Coral Wall Fan", - BlockKind::BubbleCoralWallFan => "Bubble Coral Wall Fan", - BlockKind::FireCoralWallFan => "Fire Coral Wall Fan", - BlockKind::HornCoralWallFan => "Horn Coral Wall Fan", - BlockKind::SeaPickle => "Sea Pickle", - BlockKind::BlueIce => "Blue Ice", - BlockKind::Conduit => "Conduit", - BlockKind::BambooSapling => "Bamboo Shoot", - BlockKind::Bamboo => "Bamboo", - BlockKind::PottedBamboo => "Potted Bamboo", - BlockKind::VoidAir => "Void Air", - BlockKind::CaveAir => "Cave Air", - BlockKind::BubbleColumn => "Bubble Column", - BlockKind::PolishedGraniteStairs => "Polished Granite Stairs", - BlockKind::SmoothRedSandstoneStairs => "Smooth Red Sandstone Stairs", - BlockKind::MossyStoneBrickStairs => "Mossy Stone Brick Stairs", - BlockKind::PolishedDioriteStairs => "Polished Diorite Stairs", - BlockKind::MossyCobblestoneStairs => "Mossy Cobblestone Stairs", - BlockKind::EndStoneBrickStairs => "End Stone Brick Stairs", - BlockKind::StoneStairs => "Stone Stairs", - BlockKind::SmoothSandstoneStairs => "Smooth Sandstone Stairs", - BlockKind::SmoothQuartzStairs => "Smooth Quartz Stairs", - BlockKind::GraniteStairs => "Granite Stairs", - BlockKind::AndesiteStairs => "Andesite Stairs", - BlockKind::RedNetherBrickStairs => "Red Nether Brick Stairs", - BlockKind::PolishedAndesiteStairs => "Polished Andesite Stairs", - BlockKind::DioriteStairs => "Diorite Stairs", - BlockKind::PolishedGraniteSlab => "Polished Granite Slab", - BlockKind::SmoothRedSandstoneSlab => "Smooth Red Sandstone Slab", - BlockKind::MossyStoneBrickSlab => "Mossy Stone Brick Slab", - BlockKind::PolishedDioriteSlab => "Polished Diorite Slab", - BlockKind::MossyCobblestoneSlab => "Mossy Cobblestone Slab", - BlockKind::EndStoneBrickSlab => "End Stone Brick Slab", - BlockKind::SmoothSandstoneSlab => "Smooth Sandstone Slab", - BlockKind::SmoothQuartzSlab => "Smooth Quartz Slab", - BlockKind::GraniteSlab => "Granite Slab", - BlockKind::AndesiteSlab => "Andesite Slab", - BlockKind::RedNetherBrickSlab => "Red Nether Brick Slab", - BlockKind::PolishedAndesiteSlab => "Polished Andesite Slab", - BlockKind::DioriteSlab => "Diorite Slab", - BlockKind::BrickWall => "Brick Wall", - BlockKind::PrismarineWall => "Prismarine Wall", - BlockKind::RedSandstoneWall => "Red Sandstone Wall", - BlockKind::MossyStoneBrickWall => "Mossy Stone Brick Wall", - BlockKind::GraniteWall => "Granite Wall", - BlockKind::StoneBrickWall => "Stone Brick Wall", - BlockKind::NetherBrickWall => "Nether Brick Wall", - BlockKind::AndesiteWall => "Andesite Wall", - BlockKind::RedNetherBrickWall => "Red Nether Brick Wall", - BlockKind::SandstoneWall => "Sandstone Wall", - BlockKind::EndStoneBrickWall => "End Stone Brick Wall", - BlockKind::DioriteWall => "Diorite Wall", - BlockKind::Scaffolding => "Scaffolding", - BlockKind::Loom => "Loom", - BlockKind::Barrel => "Barrel", - BlockKind::Smoker => "Smoker", - BlockKind::BlastFurnace => "Blast Furnace", - BlockKind::CartographyTable => "Cartography Table", - BlockKind::FletchingTable => "Fletching Table", - BlockKind::Grindstone => "Grindstone", - BlockKind::Lectern => "Lectern", - BlockKind::SmithingTable => "Smithing Table", - BlockKind::Stonecutter => "Stonecutter", - BlockKind::Bell => "Bell", - BlockKind::Lantern => "Lantern", - BlockKind::SoulLantern => "Soul Lantern", - BlockKind::Campfire => "Campfire", - BlockKind::SoulCampfire => "Soul Campfire", - BlockKind::SweetBerryBush => "Sweet Berry Bush", - BlockKind::WarpedStem => "Warped Stem", - BlockKind::StrippedWarpedStem => "Stripped Warped Stem", - BlockKind::WarpedHyphae => "Warped Hyphae", - BlockKind::StrippedWarpedHyphae => "Stripped Warped Hyphae", - BlockKind::WarpedNylium => "Warped Nylium", - BlockKind::WarpedFungus => "Warped Fungus", - BlockKind::WarpedWartBlock => "Warped Wart Block", - BlockKind::WarpedRoots => "Warped Roots", - BlockKind::NetherSprouts => "Nether Sprouts", - BlockKind::CrimsonStem => "Crimson Stem", - BlockKind::StrippedCrimsonStem => "Stripped Crimson Stem", - BlockKind::CrimsonHyphae => "Crimson Hyphae", - BlockKind::StrippedCrimsonHyphae => "Stripped Crimson Hyphae", - BlockKind::CrimsonNylium => "Crimson Nylium", - BlockKind::CrimsonFungus => "Crimson Fungus", - BlockKind::Shroomlight => "Shroomlight", - BlockKind::WeepingVines => "Weeping Vines", - BlockKind::WeepingVinesPlant => "Weeping Vines Plant", - BlockKind::TwistingVines => "Twisting Vines", - BlockKind::TwistingVinesPlant => "Twisting Vines Plant", - BlockKind::CrimsonRoots => "Crimson Roots", - BlockKind::CrimsonPlanks => "Crimson Planks", - BlockKind::WarpedPlanks => "Warped Planks", - BlockKind::CrimsonSlab => "Crimson Slab", - BlockKind::WarpedSlab => "Warped Slab", - BlockKind::CrimsonPressurePlate => "Crimson Pressure Plate", - BlockKind::WarpedPressurePlate => "Warped Pressure Plate", - BlockKind::CrimsonFence => "Crimson Fence", - BlockKind::WarpedFence => "Warped Fence", - BlockKind::CrimsonTrapdoor => "Crimson Trapdoor", - BlockKind::WarpedTrapdoor => "Warped Trapdoor", - BlockKind::CrimsonFenceGate => "Crimson Fence Gate", - BlockKind::WarpedFenceGate => "Warped Fence Gate", - BlockKind::CrimsonStairs => "Crimson Stairs", - BlockKind::WarpedStairs => "Warped Stairs", - BlockKind::CrimsonButton => "Crimson Button", - BlockKind::WarpedButton => "Warped Button", - BlockKind::CrimsonDoor => "Crimson Door", - BlockKind::WarpedDoor => "Warped Door", - BlockKind::CrimsonSign => "Crimson Sign", - BlockKind::WarpedSign => "Warped Sign", - BlockKind::CrimsonWallSign => "Crimson Wall Sign", - BlockKind::WarpedWallSign => "Warped Wall Sign", - BlockKind::StructureBlock => "Structure Block", - BlockKind::Jigsaw => "Jigsaw Block", - BlockKind::Composter => "Composter", - BlockKind::Target => "Target", - BlockKind::BeeNest => "Bee Nest", - BlockKind::Beehive => "Beehive", - BlockKind::HoneyBlock => "Honey Block", - BlockKind::HoneycombBlock => "Honeycomb Block", - BlockKind::NetheriteBlock => "Block of Netherite", - BlockKind::AncientDebris => "Ancient Debris", - BlockKind::CryingObsidian => "Crying Obsidian", - BlockKind::RespawnAnchor => "Respawn Anchor", - BlockKind::PottedCrimsonFungus => "Potted Crimson Fungus", - BlockKind::PottedWarpedFungus => "Potted Warped Fungus", - BlockKind::PottedCrimsonRoots => "Potted Crimson Roots", - BlockKind::PottedWarpedRoots => "Potted Warped Roots", - BlockKind::Lodestone => "Lodestone", - BlockKind::Blackstone => "Blackstone", - BlockKind::BlackstoneStairs => "Blackstone Stairs", - BlockKind::BlackstoneWall => "Blackstone Wall", - BlockKind::BlackstoneSlab => "Blackstone Slab", - BlockKind::PolishedBlackstone => "Polished Blackstone", - BlockKind::PolishedBlackstoneBricks => "Polished Blackstone Bricks", - BlockKind::CrackedPolishedBlackstoneBricks => "Cracked Polished Blackstone Bricks", - BlockKind::ChiseledPolishedBlackstone => "Chiseled Polished Blackstone", - BlockKind::PolishedBlackstoneBrickSlab => "Polished Blackstone Brick Slab", - BlockKind::PolishedBlackstoneBrickStairs => "Polished Blackstone Brick Stairs", - BlockKind::PolishedBlackstoneBrickWall => "Polished Blackstone Brick Wall", - BlockKind::GildedBlackstone => "Gilded Blackstone", - BlockKind::PolishedBlackstoneStairs => "Polished Blackstone Stairs", - BlockKind::PolishedBlackstoneSlab => "Polished Blackstone Slab", - BlockKind::PolishedBlackstonePressurePlate => "Polished Blackstone Pressure Plate", - BlockKind::PolishedBlackstoneButton => "Polished Blackstone Button", - BlockKind::PolishedBlackstoneWall => "Polished Blackstone Wall", - BlockKind::ChiseledNetherBricks => "Chiseled Nether Bricks", - BlockKind::CrackedNetherBricks => "Cracked Nether Bricks", - BlockKind::QuartzBricks => "Quartz Bricks", + BlockKind::Air => "minecraft:air", + BlockKind::Stone => "minecraft:stone", + BlockKind::Granite => "minecraft:granite", + BlockKind::PolishedGranite => "minecraft:polished_granite", + BlockKind::Diorite => "minecraft:diorite", + BlockKind::PolishedDiorite => "minecraft:polished_diorite", + BlockKind::Andesite => "minecraft:andesite", + BlockKind::PolishedAndesite => "minecraft:polished_andesite", + BlockKind::GrassBlock => "minecraft:grass_block", + BlockKind::Dirt => "minecraft:dirt", + BlockKind::CoarseDirt => "minecraft:coarse_dirt", + BlockKind::Podzol => "minecraft:podzol", + BlockKind::Cobblestone => "minecraft:cobblestone", + BlockKind::OakPlanks => "minecraft:oak_planks", + BlockKind::SprucePlanks => "minecraft:spruce_planks", + BlockKind::BirchPlanks => "minecraft:birch_planks", + BlockKind::JunglePlanks => "minecraft:jungle_planks", + BlockKind::AcaciaPlanks => "minecraft:acacia_planks", + BlockKind::DarkOakPlanks => "minecraft:dark_oak_planks", + BlockKind::OakSapling => "minecraft:oak_sapling", + BlockKind::SpruceSapling => "minecraft:spruce_sapling", + BlockKind::BirchSapling => "minecraft:birch_sapling", + BlockKind::JungleSapling => "minecraft:jungle_sapling", + BlockKind::AcaciaSapling => "minecraft:acacia_sapling", + BlockKind::DarkOakSapling => "minecraft:dark_oak_sapling", + BlockKind::Bedrock => "minecraft:bedrock", + BlockKind::Water => "minecraft:water", + BlockKind::Lava => "minecraft:lava", + BlockKind::Sand => "minecraft:sand", + BlockKind::RedSand => "minecraft:red_sand", + BlockKind::Gravel => "minecraft:gravel", + BlockKind::GoldOre => "minecraft:gold_ore", + BlockKind::DeepslateGoldOre => "minecraft:deepslate_gold_ore", + BlockKind::IronOre => "minecraft:iron_ore", + BlockKind::DeepslateIronOre => "minecraft:deepslate_iron_ore", + BlockKind::CoalOre => "minecraft:coal_ore", + BlockKind::DeepslateCoalOre => "minecraft:deepslate_coal_ore", + BlockKind::NetherGoldOre => "minecraft:nether_gold_ore", + BlockKind::OakLog => "minecraft:oak_log", + BlockKind::SpruceLog => "minecraft:spruce_log", + BlockKind::BirchLog => "minecraft:birch_log", + BlockKind::JungleLog => "minecraft:jungle_log", + BlockKind::AcaciaLog => "minecraft:acacia_log", + BlockKind::DarkOakLog => "minecraft:dark_oak_log", + BlockKind::StrippedSpruceLog => "minecraft:stripped_spruce_log", + BlockKind::StrippedBirchLog => "minecraft:stripped_birch_log", + BlockKind::StrippedJungleLog => "minecraft:stripped_jungle_log", + BlockKind::StrippedAcaciaLog => "minecraft:stripped_acacia_log", + BlockKind::StrippedDarkOakLog => "minecraft:stripped_dark_oak_log", + BlockKind::StrippedOakLog => "minecraft:stripped_oak_log", + BlockKind::OakWood => "minecraft:oak_wood", + BlockKind::SpruceWood => "minecraft:spruce_wood", + BlockKind::BirchWood => "minecraft:birch_wood", + BlockKind::JungleWood => "minecraft:jungle_wood", + BlockKind::AcaciaWood => "minecraft:acacia_wood", + BlockKind::DarkOakWood => "minecraft:dark_oak_wood", + BlockKind::StrippedOakWood => "minecraft:stripped_oak_wood", + BlockKind::StrippedSpruceWood => "minecraft:stripped_spruce_wood", + BlockKind::StrippedBirchWood => "minecraft:stripped_birch_wood", + BlockKind::StrippedJungleWood => "minecraft:stripped_jungle_wood", + BlockKind::StrippedAcaciaWood => "minecraft:stripped_acacia_wood", + BlockKind::StrippedDarkOakWood => "minecraft:stripped_dark_oak_wood", + BlockKind::OakLeaves => "minecraft:oak_leaves", + BlockKind::SpruceLeaves => "minecraft:spruce_leaves", + BlockKind::BirchLeaves => "minecraft:birch_leaves", + BlockKind::JungleLeaves => "minecraft:jungle_leaves", + BlockKind::AcaciaLeaves => "minecraft:acacia_leaves", + BlockKind::DarkOakLeaves => "minecraft:dark_oak_leaves", + BlockKind::AzaleaLeaves => "minecraft:azalea_leaves", + BlockKind::FloweringAzaleaLeaves => "minecraft:flowering_azalea_leaves", + BlockKind::Sponge => "minecraft:sponge", + BlockKind::WetSponge => "minecraft:wet_sponge", + BlockKind::Glass => "minecraft:glass", + BlockKind::LapisOre => "minecraft:lapis_ore", + BlockKind::DeepslateLapisOre => "minecraft:deepslate_lapis_ore", + BlockKind::LapisBlock => "minecraft:lapis_block", + BlockKind::Dispenser => "minecraft:dispenser", + BlockKind::Sandstone => "minecraft:sandstone", + BlockKind::ChiseledSandstone => "minecraft:chiseled_sandstone", + BlockKind::CutSandstone => "minecraft:cut_sandstone", + BlockKind::NoteBlock => "minecraft:note_block", + BlockKind::WhiteBed => "minecraft:white_bed", + BlockKind::OrangeBed => "minecraft:orange_bed", + BlockKind::MagentaBed => "minecraft:magenta_bed", + BlockKind::LightBlueBed => "minecraft:light_blue_bed", + BlockKind::YellowBed => "minecraft:yellow_bed", + BlockKind::LimeBed => "minecraft:lime_bed", + BlockKind::PinkBed => "minecraft:pink_bed", + BlockKind::GrayBed => "minecraft:gray_bed", + BlockKind::LightGrayBed => "minecraft:light_gray_bed", + BlockKind::CyanBed => "minecraft:cyan_bed", + BlockKind::PurpleBed => "minecraft:purple_bed", + BlockKind::BlueBed => "minecraft:blue_bed", + BlockKind::BrownBed => "minecraft:brown_bed", + BlockKind::GreenBed => "minecraft:green_bed", + BlockKind::RedBed => "minecraft:red_bed", + BlockKind::BlackBed => "minecraft:black_bed", + BlockKind::PoweredRail => "minecraft:powered_rail", + BlockKind::DetectorRail => "minecraft:detector_rail", + BlockKind::StickyPiston => "minecraft:sticky_piston", + BlockKind::Cobweb => "minecraft:cobweb", + BlockKind::Grass => "minecraft:grass", + BlockKind::Fern => "minecraft:fern", + BlockKind::DeadBush => "minecraft:dead_bush", + BlockKind::Seagrass => "minecraft:seagrass", + BlockKind::TallSeagrass => "minecraft:tall_seagrass", + BlockKind::Piston => "minecraft:piston", + BlockKind::PistonHead => "minecraft:piston_head", + BlockKind::WhiteWool => "minecraft:white_wool", + BlockKind::OrangeWool => "minecraft:orange_wool", + BlockKind::MagentaWool => "minecraft:magenta_wool", + BlockKind::LightBlueWool => "minecraft:light_blue_wool", + BlockKind::YellowWool => "minecraft:yellow_wool", + BlockKind::LimeWool => "minecraft:lime_wool", + BlockKind::PinkWool => "minecraft:pink_wool", + BlockKind::GrayWool => "minecraft:gray_wool", + BlockKind::LightGrayWool => "minecraft:light_gray_wool", + BlockKind::CyanWool => "minecraft:cyan_wool", + BlockKind::PurpleWool => "minecraft:purple_wool", + BlockKind::BlueWool => "minecraft:blue_wool", + BlockKind::BrownWool => "minecraft:brown_wool", + BlockKind::GreenWool => "minecraft:green_wool", + BlockKind::RedWool => "minecraft:red_wool", + BlockKind::BlackWool => "minecraft:black_wool", + BlockKind::MovingPiston => "minecraft:moving_piston", + BlockKind::Dandelion => "minecraft:dandelion", + BlockKind::Poppy => "minecraft:poppy", + BlockKind::BlueOrchid => "minecraft:blue_orchid", + BlockKind::Allium => "minecraft:allium", + BlockKind::AzureBluet => "minecraft:azure_bluet", + BlockKind::RedTulip => "minecraft:red_tulip", + BlockKind::OrangeTulip => "minecraft:orange_tulip", + BlockKind::WhiteTulip => "minecraft:white_tulip", + BlockKind::PinkTulip => "minecraft:pink_tulip", + BlockKind::OxeyeDaisy => "minecraft:oxeye_daisy", + BlockKind::Cornflower => "minecraft:cornflower", + BlockKind::WitherRose => "minecraft:wither_rose", + BlockKind::LilyOfTheValley => "minecraft:lily_of_the_valley", + BlockKind::BrownMushroom => "minecraft:brown_mushroom", + BlockKind::RedMushroom => "minecraft:red_mushroom", + BlockKind::GoldBlock => "minecraft:gold_block", + BlockKind::IronBlock => "minecraft:iron_block", + BlockKind::Bricks => "minecraft:bricks", + BlockKind::Tnt => "minecraft:tnt", + BlockKind::Bookshelf => "minecraft:bookshelf", + BlockKind::MossyCobblestone => "minecraft:mossy_cobblestone", + BlockKind::Obsidian => "minecraft:obsidian", + BlockKind::Torch => "minecraft:torch", + BlockKind::WallTorch => "minecraft:wall_torch", + BlockKind::Fire => "minecraft:fire", + BlockKind::SoulFire => "minecraft:soul_fire", + BlockKind::Spawner => "minecraft:spawner", + BlockKind::OakStairs => "minecraft:oak_stairs", + BlockKind::Chest => "minecraft:chest", + BlockKind::RedstoneWire => "minecraft:redstone_wire", + BlockKind::DiamondOre => "minecraft:diamond_ore", + BlockKind::DeepslateDiamondOre => "minecraft:deepslate_diamond_ore", + BlockKind::DiamondBlock => "minecraft:diamond_block", + BlockKind::CraftingTable => "minecraft:crafting_table", + BlockKind::Wheat => "minecraft:wheat", + BlockKind::Farmland => "minecraft:farmland", + BlockKind::Furnace => "minecraft:furnace", + BlockKind::OakSign => "minecraft:oak_sign", + BlockKind::SpruceSign => "minecraft:spruce_sign", + BlockKind::BirchSign => "minecraft:birch_sign", + BlockKind::AcaciaSign => "minecraft:acacia_sign", + BlockKind::JungleSign => "minecraft:jungle_sign", + BlockKind::DarkOakSign => "minecraft:dark_oak_sign", + BlockKind::OakDoor => "minecraft:oak_door", + BlockKind::Ladder => "minecraft:ladder", + BlockKind::Rail => "minecraft:rail", + BlockKind::CobblestoneStairs => "minecraft:cobblestone_stairs", + BlockKind::OakWallSign => "minecraft:oak_wall_sign", + BlockKind::SpruceWallSign => "minecraft:spruce_wall_sign", + BlockKind::BirchWallSign => "minecraft:birch_wall_sign", + BlockKind::AcaciaWallSign => "minecraft:acacia_wall_sign", + BlockKind::JungleWallSign => "minecraft:jungle_wall_sign", + BlockKind::DarkOakWallSign => "minecraft:dark_oak_wall_sign", + BlockKind::Lever => "minecraft:lever", + BlockKind::StonePressurePlate => "minecraft:stone_pressure_plate", + BlockKind::IronDoor => "minecraft:iron_door", + BlockKind::OakPressurePlate => "minecraft:oak_pressure_plate", + BlockKind::SprucePressurePlate => "minecraft:spruce_pressure_plate", + BlockKind::BirchPressurePlate => "minecraft:birch_pressure_plate", + BlockKind::JunglePressurePlate => "minecraft:jungle_pressure_plate", + BlockKind::AcaciaPressurePlate => "minecraft:acacia_pressure_plate", + BlockKind::DarkOakPressurePlate => "minecraft:dark_oak_pressure_plate", + BlockKind::RedstoneOre => "minecraft:redstone_ore", + BlockKind::DeepslateRedstoneOre => "minecraft:deepslate_redstone_ore", + BlockKind::RedstoneTorch => "minecraft:redstone_torch", + BlockKind::RedstoneWallTorch => "minecraft:redstone_wall_torch", + BlockKind::StoneButton => "minecraft:stone_button", + BlockKind::Snow => "minecraft:snow", + BlockKind::Ice => "minecraft:ice", + BlockKind::SnowBlock => "minecraft:snow_block", + BlockKind::Cactus => "minecraft:cactus", + BlockKind::Clay => "minecraft:clay", + BlockKind::SugarCane => "minecraft:sugar_cane", + BlockKind::Jukebox => "minecraft:jukebox", + BlockKind::OakFence => "minecraft:oak_fence", + BlockKind::Pumpkin => "minecraft:pumpkin", + BlockKind::Netherrack => "minecraft:netherrack", + BlockKind::SoulSand => "minecraft:soul_sand", + BlockKind::SoulSoil => "minecraft:soul_soil", + BlockKind::Basalt => "minecraft:basalt", + BlockKind::PolishedBasalt => "minecraft:polished_basalt", + BlockKind::SoulTorch => "minecraft:soul_torch", + BlockKind::SoulWallTorch => "minecraft:soul_wall_torch", + BlockKind::Glowstone => "minecraft:glowstone", + BlockKind::NetherPortal => "minecraft:nether_portal", + BlockKind::CarvedPumpkin => "minecraft:carved_pumpkin", + BlockKind::JackOLantern => "minecraft:jack_o_lantern", + BlockKind::Cake => "minecraft:cake", + BlockKind::Repeater => "minecraft:repeater", + BlockKind::WhiteStainedGlass => "minecraft:white_stained_glass", + BlockKind::OrangeStainedGlass => "minecraft:orange_stained_glass", + BlockKind::MagentaStainedGlass => "minecraft:magenta_stained_glass", + BlockKind::LightBlueStainedGlass => "minecraft:light_blue_stained_glass", + BlockKind::YellowStainedGlass => "minecraft:yellow_stained_glass", + BlockKind::LimeStainedGlass => "minecraft:lime_stained_glass", + BlockKind::PinkStainedGlass => "minecraft:pink_stained_glass", + BlockKind::GrayStainedGlass => "minecraft:gray_stained_glass", + BlockKind::LightGrayStainedGlass => "minecraft:light_gray_stained_glass", + BlockKind::CyanStainedGlass => "minecraft:cyan_stained_glass", + BlockKind::PurpleStainedGlass => "minecraft:purple_stained_glass", + BlockKind::BlueStainedGlass => "minecraft:blue_stained_glass", + BlockKind::BrownStainedGlass => "minecraft:brown_stained_glass", + BlockKind::GreenStainedGlass => "minecraft:green_stained_glass", + BlockKind::RedStainedGlass => "minecraft:red_stained_glass", + BlockKind::BlackStainedGlass => "minecraft:black_stained_glass", + BlockKind::OakTrapdoor => "minecraft:oak_trapdoor", + BlockKind::SpruceTrapdoor => "minecraft:spruce_trapdoor", + BlockKind::BirchTrapdoor => "minecraft:birch_trapdoor", + BlockKind::JungleTrapdoor => "minecraft:jungle_trapdoor", + BlockKind::AcaciaTrapdoor => "minecraft:acacia_trapdoor", + BlockKind::DarkOakTrapdoor => "minecraft:dark_oak_trapdoor", + BlockKind::StoneBricks => "minecraft:stone_bricks", + BlockKind::MossyStoneBricks => "minecraft:mossy_stone_bricks", + BlockKind::CrackedStoneBricks => "minecraft:cracked_stone_bricks", + BlockKind::ChiseledStoneBricks => "minecraft:chiseled_stone_bricks", + BlockKind::InfestedStone => "minecraft:infested_stone", + BlockKind::InfestedCobblestone => "minecraft:infested_cobblestone", + BlockKind::InfestedStoneBricks => "minecraft:infested_stone_bricks", + BlockKind::InfestedMossyStoneBricks => "minecraft:infested_mossy_stone_bricks", + BlockKind::InfestedCrackedStoneBricks => "minecraft:infested_cracked_stone_bricks", + BlockKind::InfestedChiseledStoneBricks => "minecraft:infested_chiseled_stone_bricks", + BlockKind::BrownMushroomBlock => "minecraft:brown_mushroom_block", + BlockKind::RedMushroomBlock => "minecraft:red_mushroom_block", + BlockKind::MushroomStem => "minecraft:mushroom_stem", + BlockKind::IronBars => "minecraft:iron_bars", + BlockKind::Chain => "minecraft:chain", + BlockKind::GlassPane => "minecraft:glass_pane", + BlockKind::Melon => "minecraft:melon", + BlockKind::AttachedPumpkinStem => "minecraft:attached_pumpkin_stem", + BlockKind::AttachedMelonStem => "minecraft:attached_melon_stem", + BlockKind::PumpkinStem => "minecraft:pumpkin_stem", + BlockKind::MelonStem => "minecraft:melon_stem", + BlockKind::Vine => "minecraft:vine", + BlockKind::GlowLichen => "minecraft:glow_lichen", + BlockKind::OakFenceGate => "minecraft:oak_fence_gate", + BlockKind::BrickStairs => "minecraft:brick_stairs", + BlockKind::StoneBrickStairs => "minecraft:stone_brick_stairs", + BlockKind::Mycelium => "minecraft:mycelium", + BlockKind::LilyPad => "minecraft:lily_pad", + BlockKind::NetherBricks => "minecraft:nether_bricks", + BlockKind::NetherBrickFence => "minecraft:nether_brick_fence", + BlockKind::NetherBrickStairs => "minecraft:nether_brick_stairs", + BlockKind::NetherWart => "minecraft:nether_wart", + BlockKind::EnchantingTable => "minecraft:enchanting_table", + BlockKind::BrewingStand => "minecraft:brewing_stand", + BlockKind::Cauldron => "minecraft:cauldron", + BlockKind::WaterCauldron => "minecraft:water_cauldron", + BlockKind::LavaCauldron => "minecraft:lava_cauldron", + BlockKind::PowderSnowCauldron => "minecraft:powder_snow_cauldron", + BlockKind::EndPortal => "minecraft:end_portal", + BlockKind::EndPortalFrame => "minecraft:end_portal_frame", + BlockKind::EndStone => "minecraft:end_stone", + BlockKind::DragonEgg => "minecraft:dragon_egg", + BlockKind::RedstoneLamp => "minecraft:redstone_lamp", + BlockKind::Cocoa => "minecraft:cocoa", + BlockKind::SandstoneStairs => "minecraft:sandstone_stairs", + BlockKind::EmeraldOre => "minecraft:emerald_ore", + BlockKind::DeepslateEmeraldOre => "minecraft:deepslate_emerald_ore", + BlockKind::EnderChest => "minecraft:ender_chest", + BlockKind::TripwireHook => "minecraft:tripwire_hook", + BlockKind::Tripwire => "minecraft:tripwire", + BlockKind::EmeraldBlock => "minecraft:emerald_block", + BlockKind::SpruceStairs => "minecraft:spruce_stairs", + BlockKind::BirchStairs => "minecraft:birch_stairs", + BlockKind::JungleStairs => "minecraft:jungle_stairs", + BlockKind::CommandBlock => "minecraft:command_block", + BlockKind::Beacon => "minecraft:beacon", + BlockKind::CobblestoneWall => "minecraft:cobblestone_wall", + BlockKind::MossyCobblestoneWall => "minecraft:mossy_cobblestone_wall", + BlockKind::FlowerPot => "minecraft:flower_pot", + BlockKind::PottedOakSapling => "minecraft:potted_oak_sapling", + BlockKind::PottedSpruceSapling => "minecraft:potted_spruce_sapling", + BlockKind::PottedBirchSapling => "minecraft:potted_birch_sapling", + BlockKind::PottedJungleSapling => "minecraft:potted_jungle_sapling", + BlockKind::PottedAcaciaSapling => "minecraft:potted_acacia_sapling", + BlockKind::PottedDarkOakSapling => "minecraft:potted_dark_oak_sapling", + BlockKind::PottedFern => "minecraft:potted_fern", + BlockKind::PottedDandelion => "minecraft:potted_dandelion", + BlockKind::PottedPoppy => "minecraft:potted_poppy", + BlockKind::PottedBlueOrchid => "minecraft:potted_blue_orchid", + BlockKind::PottedAllium => "minecraft:potted_allium", + BlockKind::PottedAzureBluet => "minecraft:potted_azure_bluet", + BlockKind::PottedRedTulip => "minecraft:potted_red_tulip", + BlockKind::PottedOrangeTulip => "minecraft:potted_orange_tulip", + BlockKind::PottedWhiteTulip => "minecraft:potted_white_tulip", + BlockKind::PottedPinkTulip => "minecraft:potted_pink_tulip", + BlockKind::PottedOxeyeDaisy => "minecraft:potted_oxeye_daisy", + BlockKind::PottedCornflower => "minecraft:potted_cornflower", + BlockKind::PottedLilyOfTheValley => "minecraft:potted_lily_of_the_valley", + BlockKind::PottedWitherRose => "minecraft:potted_wither_rose", + BlockKind::PottedRedMushroom => "minecraft:potted_red_mushroom", + BlockKind::PottedBrownMushroom => "minecraft:potted_brown_mushroom", + BlockKind::PottedDeadBush => "minecraft:potted_dead_bush", + BlockKind::PottedCactus => "minecraft:potted_cactus", + BlockKind::Carrots => "minecraft:carrots", + BlockKind::Potatoes => "minecraft:potatoes", + BlockKind::OakButton => "minecraft:oak_button", + BlockKind::SpruceButton => "minecraft:spruce_button", + BlockKind::BirchButton => "minecraft:birch_button", + BlockKind::JungleButton => "minecraft:jungle_button", + BlockKind::AcaciaButton => "minecraft:acacia_button", + BlockKind::DarkOakButton => "minecraft:dark_oak_button", + BlockKind::SkeletonSkull => "minecraft:skeleton_skull", + BlockKind::SkeletonWallSkull => "minecraft:skeleton_wall_skull", + BlockKind::WitherSkeletonSkull => "minecraft:wither_skeleton_skull", + BlockKind::WitherSkeletonWallSkull => "minecraft:wither_skeleton_wall_skull", + BlockKind::ZombieHead => "minecraft:zombie_head", + BlockKind::ZombieWallHead => "minecraft:zombie_wall_head", + BlockKind::PlayerHead => "minecraft:player_head", + BlockKind::PlayerWallHead => "minecraft:player_wall_head", + BlockKind::CreeperHead => "minecraft:creeper_head", + BlockKind::CreeperWallHead => "minecraft:creeper_wall_head", + BlockKind::DragonHead => "minecraft:dragon_head", + BlockKind::DragonWallHead => "minecraft:dragon_wall_head", + BlockKind::Anvil => "minecraft:anvil", + BlockKind::ChippedAnvil => "minecraft:chipped_anvil", + BlockKind::DamagedAnvil => "minecraft:damaged_anvil", + BlockKind::TrappedChest => "minecraft:trapped_chest", + BlockKind::LightWeightedPressurePlate => "minecraft:light_weighted_pressure_plate", + BlockKind::HeavyWeightedPressurePlate => "minecraft:heavy_weighted_pressure_plate", + BlockKind::Comparator => "minecraft:comparator", + BlockKind::DaylightDetector => "minecraft:daylight_detector", + BlockKind::RedstoneBlock => "minecraft:redstone_block", + BlockKind::NetherQuartzOre => "minecraft:nether_quartz_ore", + BlockKind::Hopper => "minecraft:hopper", + BlockKind::QuartzBlock => "minecraft:quartz_block", + BlockKind::ChiseledQuartzBlock => "minecraft:chiseled_quartz_block", + BlockKind::QuartzPillar => "minecraft:quartz_pillar", + BlockKind::QuartzStairs => "minecraft:quartz_stairs", + BlockKind::ActivatorRail => "minecraft:activator_rail", + BlockKind::Dropper => "minecraft:dropper", + BlockKind::WhiteTerracotta => "minecraft:white_terracotta", + BlockKind::OrangeTerracotta => "minecraft:orange_terracotta", + BlockKind::MagentaTerracotta => "minecraft:magenta_terracotta", + BlockKind::LightBlueTerracotta => "minecraft:light_blue_terracotta", + BlockKind::YellowTerracotta => "minecraft:yellow_terracotta", + BlockKind::LimeTerracotta => "minecraft:lime_terracotta", + BlockKind::PinkTerracotta => "minecraft:pink_terracotta", + BlockKind::GrayTerracotta => "minecraft:gray_terracotta", + BlockKind::LightGrayTerracotta => "minecraft:light_gray_terracotta", + BlockKind::CyanTerracotta => "minecraft:cyan_terracotta", + BlockKind::PurpleTerracotta => "minecraft:purple_terracotta", + BlockKind::BlueTerracotta => "minecraft:blue_terracotta", + BlockKind::BrownTerracotta => "minecraft:brown_terracotta", + BlockKind::GreenTerracotta => "minecraft:green_terracotta", + BlockKind::RedTerracotta => "minecraft:red_terracotta", + BlockKind::BlackTerracotta => "minecraft:black_terracotta", + BlockKind::WhiteStainedGlassPane => "minecraft:white_stained_glass_pane", + BlockKind::OrangeStainedGlassPane => "minecraft:orange_stained_glass_pane", + BlockKind::MagentaStainedGlassPane => "minecraft:magenta_stained_glass_pane", + BlockKind::LightBlueStainedGlassPane => "minecraft:light_blue_stained_glass_pane", + BlockKind::YellowStainedGlassPane => "minecraft:yellow_stained_glass_pane", + BlockKind::LimeStainedGlassPane => "minecraft:lime_stained_glass_pane", + BlockKind::PinkStainedGlassPane => "minecraft:pink_stained_glass_pane", + BlockKind::GrayStainedGlassPane => "minecraft:gray_stained_glass_pane", + BlockKind::LightGrayStainedGlassPane => "minecraft:light_gray_stained_glass_pane", + BlockKind::CyanStainedGlassPane => "minecraft:cyan_stained_glass_pane", + BlockKind::PurpleStainedGlassPane => "minecraft:purple_stained_glass_pane", + BlockKind::BlueStainedGlassPane => "minecraft:blue_stained_glass_pane", + BlockKind::BrownStainedGlassPane => "minecraft:brown_stained_glass_pane", + BlockKind::GreenStainedGlassPane => "minecraft:green_stained_glass_pane", + BlockKind::RedStainedGlassPane => "minecraft:red_stained_glass_pane", + BlockKind::BlackStainedGlassPane => "minecraft:black_stained_glass_pane", + BlockKind::AcaciaStairs => "minecraft:acacia_stairs", + BlockKind::DarkOakStairs => "minecraft:dark_oak_stairs", + BlockKind::SlimeBlock => "minecraft:slime_block", + BlockKind::Barrier => "minecraft:barrier", + BlockKind::Light => "minecraft:light", + BlockKind::IronTrapdoor => "minecraft:iron_trapdoor", + BlockKind::Prismarine => "minecraft:prismarine", + BlockKind::PrismarineBricks => "minecraft:prismarine_bricks", + BlockKind::DarkPrismarine => "minecraft:dark_prismarine", + BlockKind::PrismarineStairs => "minecraft:prismarine_stairs", + BlockKind::PrismarineBrickStairs => "minecraft:prismarine_brick_stairs", + BlockKind::DarkPrismarineStairs => "minecraft:dark_prismarine_stairs", + BlockKind::PrismarineSlab => "minecraft:prismarine_slab", + BlockKind::PrismarineBrickSlab => "minecraft:prismarine_brick_slab", + BlockKind::DarkPrismarineSlab => "minecraft:dark_prismarine_slab", + BlockKind::SeaLantern => "minecraft:sea_lantern", + BlockKind::HayBlock => "minecraft:hay_block", + BlockKind::WhiteCarpet => "minecraft:white_carpet", + BlockKind::OrangeCarpet => "minecraft:orange_carpet", + BlockKind::MagentaCarpet => "minecraft:magenta_carpet", + BlockKind::LightBlueCarpet => "minecraft:light_blue_carpet", + BlockKind::YellowCarpet => "minecraft:yellow_carpet", + BlockKind::LimeCarpet => "minecraft:lime_carpet", + BlockKind::PinkCarpet => "minecraft:pink_carpet", + BlockKind::GrayCarpet => "minecraft:gray_carpet", + BlockKind::LightGrayCarpet => "minecraft:light_gray_carpet", + BlockKind::CyanCarpet => "minecraft:cyan_carpet", + BlockKind::PurpleCarpet => "minecraft:purple_carpet", + BlockKind::BlueCarpet => "minecraft:blue_carpet", + BlockKind::BrownCarpet => "minecraft:brown_carpet", + BlockKind::GreenCarpet => "minecraft:green_carpet", + BlockKind::RedCarpet => "minecraft:red_carpet", + BlockKind::BlackCarpet => "minecraft:black_carpet", + BlockKind::Terracotta => "minecraft:terracotta", + BlockKind::CoalBlock => "minecraft:coal_block", + BlockKind::PackedIce => "minecraft:packed_ice", + BlockKind::Sunflower => "minecraft:sunflower", + BlockKind::Lilac => "minecraft:lilac", + BlockKind::RoseBush => "minecraft:rose_bush", + BlockKind::Peony => "minecraft:peony", + BlockKind::TallGrass => "minecraft:tall_grass", + BlockKind::LargeFern => "minecraft:large_fern", + BlockKind::WhiteBanner => "minecraft:white_banner", + BlockKind::OrangeBanner => "minecraft:orange_banner", + BlockKind::MagentaBanner => "minecraft:magenta_banner", + BlockKind::LightBlueBanner => "minecraft:light_blue_banner", + BlockKind::YellowBanner => "minecraft:yellow_banner", + BlockKind::LimeBanner => "minecraft:lime_banner", + BlockKind::PinkBanner => "minecraft:pink_banner", + BlockKind::GrayBanner => "minecraft:gray_banner", + BlockKind::LightGrayBanner => "minecraft:light_gray_banner", + BlockKind::CyanBanner => "minecraft:cyan_banner", + BlockKind::PurpleBanner => "minecraft:purple_banner", + BlockKind::BlueBanner => "minecraft:blue_banner", + BlockKind::BrownBanner => "minecraft:brown_banner", + BlockKind::GreenBanner => "minecraft:green_banner", + BlockKind::RedBanner => "minecraft:red_banner", + BlockKind::BlackBanner => "minecraft:black_banner", + BlockKind::WhiteWallBanner => "minecraft:white_wall_banner", + BlockKind::OrangeWallBanner => "minecraft:orange_wall_banner", + BlockKind::MagentaWallBanner => "minecraft:magenta_wall_banner", + BlockKind::LightBlueWallBanner => "minecraft:light_blue_wall_banner", + BlockKind::YellowWallBanner => "minecraft:yellow_wall_banner", + BlockKind::LimeWallBanner => "minecraft:lime_wall_banner", + BlockKind::PinkWallBanner => "minecraft:pink_wall_banner", + BlockKind::GrayWallBanner => "minecraft:gray_wall_banner", + BlockKind::LightGrayWallBanner => "minecraft:light_gray_wall_banner", + BlockKind::CyanWallBanner => "minecraft:cyan_wall_banner", + BlockKind::PurpleWallBanner => "minecraft:purple_wall_banner", + BlockKind::BlueWallBanner => "minecraft:blue_wall_banner", + BlockKind::BrownWallBanner => "minecraft:brown_wall_banner", + BlockKind::GreenWallBanner => "minecraft:green_wall_banner", + BlockKind::RedWallBanner => "minecraft:red_wall_banner", + BlockKind::BlackWallBanner => "minecraft:black_wall_banner", + BlockKind::RedSandstone => "minecraft:red_sandstone", + BlockKind::ChiseledRedSandstone => "minecraft:chiseled_red_sandstone", + BlockKind::CutRedSandstone => "minecraft:cut_red_sandstone", + BlockKind::RedSandstoneStairs => "minecraft:red_sandstone_stairs", + BlockKind::OakSlab => "minecraft:oak_slab", + BlockKind::SpruceSlab => "minecraft:spruce_slab", + BlockKind::BirchSlab => "minecraft:birch_slab", + BlockKind::JungleSlab => "minecraft:jungle_slab", + BlockKind::AcaciaSlab => "minecraft:acacia_slab", + BlockKind::DarkOakSlab => "minecraft:dark_oak_slab", + BlockKind::StoneSlab => "minecraft:stone_slab", + BlockKind::SmoothStoneSlab => "minecraft:smooth_stone_slab", + BlockKind::SandstoneSlab => "minecraft:sandstone_slab", + BlockKind::CutSandstoneSlab => "minecraft:cut_sandstone_slab", + BlockKind::PetrifiedOakSlab => "minecraft:petrified_oak_slab", + BlockKind::CobblestoneSlab => "minecraft:cobblestone_slab", + BlockKind::BrickSlab => "minecraft:brick_slab", + BlockKind::StoneBrickSlab => "minecraft:stone_brick_slab", + BlockKind::NetherBrickSlab => "minecraft:nether_brick_slab", + BlockKind::QuartzSlab => "minecraft:quartz_slab", + BlockKind::RedSandstoneSlab => "minecraft:red_sandstone_slab", + BlockKind::CutRedSandstoneSlab => "minecraft:cut_red_sandstone_slab", + BlockKind::PurpurSlab => "minecraft:purpur_slab", + BlockKind::SmoothStone => "minecraft:smooth_stone", + BlockKind::SmoothSandstone => "minecraft:smooth_sandstone", + BlockKind::SmoothQuartz => "minecraft:smooth_quartz", + BlockKind::SmoothRedSandstone => "minecraft:smooth_red_sandstone", + BlockKind::SpruceFenceGate => "minecraft:spruce_fence_gate", + BlockKind::BirchFenceGate => "minecraft:birch_fence_gate", + BlockKind::JungleFenceGate => "minecraft:jungle_fence_gate", + BlockKind::AcaciaFenceGate => "minecraft:acacia_fence_gate", + BlockKind::DarkOakFenceGate => "minecraft:dark_oak_fence_gate", + BlockKind::SpruceFence => "minecraft:spruce_fence", + BlockKind::BirchFence => "minecraft:birch_fence", + BlockKind::JungleFence => "minecraft:jungle_fence", + BlockKind::AcaciaFence => "minecraft:acacia_fence", + BlockKind::DarkOakFence => "minecraft:dark_oak_fence", + BlockKind::SpruceDoor => "minecraft:spruce_door", + BlockKind::BirchDoor => "minecraft:birch_door", + BlockKind::JungleDoor => "minecraft:jungle_door", + BlockKind::AcaciaDoor => "minecraft:acacia_door", + BlockKind::DarkOakDoor => "minecraft:dark_oak_door", + BlockKind::EndRod => "minecraft:end_rod", + BlockKind::ChorusPlant => "minecraft:chorus_plant", + BlockKind::ChorusFlower => "minecraft:chorus_flower", + BlockKind::PurpurBlock => "minecraft:purpur_block", + BlockKind::PurpurPillar => "minecraft:purpur_pillar", + BlockKind::PurpurStairs => "minecraft:purpur_stairs", + BlockKind::EndStoneBricks => "minecraft:end_stone_bricks", + BlockKind::Beetroots => "minecraft:beetroots", + BlockKind::DirtPath => "minecraft:dirt_path", + BlockKind::EndGateway => "minecraft:end_gateway", + BlockKind::RepeatingCommandBlock => "minecraft:repeating_command_block", + BlockKind::ChainCommandBlock => "minecraft:chain_command_block", + BlockKind::FrostedIce => "minecraft:frosted_ice", + BlockKind::MagmaBlock => "minecraft:magma_block", + BlockKind::NetherWartBlock => "minecraft:nether_wart_block", + BlockKind::RedNetherBricks => "minecraft:red_nether_bricks", + BlockKind::BoneBlock => "minecraft:bone_block", + BlockKind::StructureVoid => "minecraft:structure_void", + BlockKind::Observer => "minecraft:observer", + BlockKind::ShulkerBox => "minecraft:shulker_box", + BlockKind::WhiteShulkerBox => "minecraft:white_shulker_box", + BlockKind::OrangeShulkerBox => "minecraft:orange_shulker_box", + BlockKind::MagentaShulkerBox => "minecraft:magenta_shulker_box", + BlockKind::LightBlueShulkerBox => "minecraft:light_blue_shulker_box", + BlockKind::YellowShulkerBox => "minecraft:yellow_shulker_box", + BlockKind::LimeShulkerBox => "minecraft:lime_shulker_box", + BlockKind::PinkShulkerBox => "minecraft:pink_shulker_box", + BlockKind::GrayShulkerBox => "minecraft:gray_shulker_box", + BlockKind::LightGrayShulkerBox => "minecraft:light_gray_shulker_box", + BlockKind::CyanShulkerBox => "minecraft:cyan_shulker_box", + BlockKind::PurpleShulkerBox => "minecraft:purple_shulker_box", + BlockKind::BlueShulkerBox => "minecraft:blue_shulker_box", + BlockKind::BrownShulkerBox => "minecraft:brown_shulker_box", + BlockKind::GreenShulkerBox => "minecraft:green_shulker_box", + BlockKind::RedShulkerBox => "minecraft:red_shulker_box", + BlockKind::BlackShulkerBox => "minecraft:black_shulker_box", + BlockKind::WhiteGlazedTerracotta => "minecraft:white_glazed_terracotta", + BlockKind::OrangeGlazedTerracotta => "minecraft:orange_glazed_terracotta", + BlockKind::MagentaGlazedTerracotta => "minecraft:magenta_glazed_terracotta", + BlockKind::LightBlueGlazedTerracotta => "minecraft:light_blue_glazed_terracotta", + BlockKind::YellowGlazedTerracotta => "minecraft:yellow_glazed_terracotta", + BlockKind::LimeGlazedTerracotta => "minecraft:lime_glazed_terracotta", + BlockKind::PinkGlazedTerracotta => "minecraft:pink_glazed_terracotta", + BlockKind::GrayGlazedTerracotta => "minecraft:gray_glazed_terracotta", + BlockKind::LightGrayGlazedTerracotta => "minecraft:light_gray_glazed_terracotta", + BlockKind::CyanGlazedTerracotta => "minecraft:cyan_glazed_terracotta", + BlockKind::PurpleGlazedTerracotta => "minecraft:purple_glazed_terracotta", + BlockKind::BlueGlazedTerracotta => "minecraft:blue_glazed_terracotta", + BlockKind::BrownGlazedTerracotta => "minecraft:brown_glazed_terracotta", + BlockKind::GreenGlazedTerracotta => "minecraft:green_glazed_terracotta", + BlockKind::RedGlazedTerracotta => "minecraft:red_glazed_terracotta", + BlockKind::BlackGlazedTerracotta => "minecraft:black_glazed_terracotta", + BlockKind::WhiteConcrete => "minecraft:white_concrete", + BlockKind::OrangeConcrete => "minecraft:orange_concrete", + BlockKind::MagentaConcrete => "minecraft:magenta_concrete", + BlockKind::LightBlueConcrete => "minecraft:light_blue_concrete", + BlockKind::YellowConcrete => "minecraft:yellow_concrete", + BlockKind::LimeConcrete => "minecraft:lime_concrete", + BlockKind::PinkConcrete => "minecraft:pink_concrete", + BlockKind::GrayConcrete => "minecraft:gray_concrete", + BlockKind::LightGrayConcrete => "minecraft:light_gray_concrete", + BlockKind::CyanConcrete => "minecraft:cyan_concrete", + BlockKind::PurpleConcrete => "minecraft:purple_concrete", + BlockKind::BlueConcrete => "minecraft:blue_concrete", + BlockKind::BrownConcrete => "minecraft:brown_concrete", + BlockKind::GreenConcrete => "minecraft:green_concrete", + BlockKind::RedConcrete => "minecraft:red_concrete", + BlockKind::BlackConcrete => "minecraft:black_concrete", + BlockKind::WhiteConcretePowder => "minecraft:white_concrete_powder", + BlockKind::OrangeConcretePowder => "minecraft:orange_concrete_powder", + BlockKind::MagentaConcretePowder => "minecraft:magenta_concrete_powder", + BlockKind::LightBlueConcretePowder => "minecraft:light_blue_concrete_powder", + BlockKind::YellowConcretePowder => "minecraft:yellow_concrete_powder", + BlockKind::LimeConcretePowder => "minecraft:lime_concrete_powder", + BlockKind::PinkConcretePowder => "minecraft:pink_concrete_powder", + BlockKind::GrayConcretePowder => "minecraft:gray_concrete_powder", + BlockKind::LightGrayConcretePowder => "minecraft:light_gray_concrete_powder", + BlockKind::CyanConcretePowder => "minecraft:cyan_concrete_powder", + BlockKind::PurpleConcretePowder => "minecraft:purple_concrete_powder", + BlockKind::BlueConcretePowder => "minecraft:blue_concrete_powder", + BlockKind::BrownConcretePowder => "minecraft:brown_concrete_powder", + BlockKind::GreenConcretePowder => "minecraft:green_concrete_powder", + BlockKind::RedConcretePowder => "minecraft:red_concrete_powder", + BlockKind::BlackConcretePowder => "minecraft:black_concrete_powder", + BlockKind::Kelp => "minecraft:kelp", + BlockKind::KelpPlant => "minecraft:kelp_plant", + BlockKind::DriedKelpBlock => "minecraft:dried_kelp_block", + BlockKind::TurtleEgg => "minecraft:turtle_egg", + BlockKind::DeadTubeCoralBlock => "minecraft:dead_tube_coral_block", + BlockKind::DeadBrainCoralBlock => "minecraft:dead_brain_coral_block", + BlockKind::DeadBubbleCoralBlock => "minecraft:dead_bubble_coral_block", + BlockKind::DeadFireCoralBlock => "minecraft:dead_fire_coral_block", + BlockKind::DeadHornCoralBlock => "minecraft:dead_horn_coral_block", + BlockKind::TubeCoralBlock => "minecraft:tube_coral_block", + BlockKind::BrainCoralBlock => "minecraft:brain_coral_block", + BlockKind::BubbleCoralBlock => "minecraft:bubble_coral_block", + BlockKind::FireCoralBlock => "minecraft:fire_coral_block", + BlockKind::HornCoralBlock => "minecraft:horn_coral_block", + BlockKind::DeadTubeCoral => "minecraft:dead_tube_coral", + BlockKind::DeadBrainCoral => "minecraft:dead_brain_coral", + BlockKind::DeadBubbleCoral => "minecraft:dead_bubble_coral", + BlockKind::DeadFireCoral => "minecraft:dead_fire_coral", + BlockKind::DeadHornCoral => "minecraft:dead_horn_coral", + BlockKind::TubeCoral => "minecraft:tube_coral", + BlockKind::BrainCoral => "minecraft:brain_coral", + BlockKind::BubbleCoral => "minecraft:bubble_coral", + BlockKind::FireCoral => "minecraft:fire_coral", + BlockKind::HornCoral => "minecraft:horn_coral", + BlockKind::DeadTubeCoralFan => "minecraft:dead_tube_coral_fan", + BlockKind::DeadBrainCoralFan => "minecraft:dead_brain_coral_fan", + BlockKind::DeadBubbleCoralFan => "minecraft:dead_bubble_coral_fan", + BlockKind::DeadFireCoralFan => "minecraft:dead_fire_coral_fan", + BlockKind::DeadHornCoralFan => "minecraft:dead_horn_coral_fan", + BlockKind::TubeCoralFan => "minecraft:tube_coral_fan", + BlockKind::BrainCoralFan => "minecraft:brain_coral_fan", + BlockKind::BubbleCoralFan => "minecraft:bubble_coral_fan", + BlockKind::FireCoralFan => "minecraft:fire_coral_fan", + BlockKind::HornCoralFan => "minecraft:horn_coral_fan", + BlockKind::DeadTubeCoralWallFan => "minecraft:dead_tube_coral_wall_fan", + BlockKind::DeadBrainCoralWallFan => "minecraft:dead_brain_coral_wall_fan", + BlockKind::DeadBubbleCoralWallFan => "minecraft:dead_bubble_coral_wall_fan", + BlockKind::DeadFireCoralWallFan => "minecraft:dead_fire_coral_wall_fan", + BlockKind::DeadHornCoralWallFan => "minecraft:dead_horn_coral_wall_fan", + BlockKind::TubeCoralWallFan => "minecraft:tube_coral_wall_fan", + BlockKind::BrainCoralWallFan => "minecraft:brain_coral_wall_fan", + BlockKind::BubbleCoralWallFan => "minecraft:bubble_coral_wall_fan", + BlockKind::FireCoralWallFan => "minecraft:fire_coral_wall_fan", + BlockKind::HornCoralWallFan => "minecraft:horn_coral_wall_fan", + BlockKind::SeaPickle => "minecraft:sea_pickle", + BlockKind::BlueIce => "minecraft:blue_ice", + BlockKind::Conduit => "minecraft:conduit", + BlockKind::BambooSapling => "minecraft:bamboo_sapling", + BlockKind::Bamboo => "minecraft:bamboo", + BlockKind::PottedBamboo => "minecraft:potted_bamboo", + BlockKind::VoidAir => "minecraft:void_air", + BlockKind::CaveAir => "minecraft:cave_air", + BlockKind::BubbleColumn => "minecraft:bubble_column", + BlockKind::PolishedGraniteStairs => "minecraft:polished_granite_stairs", + BlockKind::SmoothRedSandstoneStairs => "minecraft:smooth_red_sandstone_stairs", + BlockKind::MossyStoneBrickStairs => "minecraft:mossy_stone_brick_stairs", + BlockKind::PolishedDioriteStairs => "minecraft:polished_diorite_stairs", + BlockKind::MossyCobblestoneStairs => "minecraft:mossy_cobblestone_stairs", + BlockKind::EndStoneBrickStairs => "minecraft:end_stone_brick_stairs", + BlockKind::StoneStairs => "minecraft:stone_stairs", + BlockKind::SmoothSandstoneStairs => "minecraft:smooth_sandstone_stairs", + BlockKind::SmoothQuartzStairs => "minecraft:smooth_quartz_stairs", + BlockKind::GraniteStairs => "minecraft:granite_stairs", + BlockKind::AndesiteStairs => "minecraft:andesite_stairs", + BlockKind::RedNetherBrickStairs => "minecraft:red_nether_brick_stairs", + BlockKind::PolishedAndesiteStairs => "minecraft:polished_andesite_stairs", + BlockKind::DioriteStairs => "minecraft:diorite_stairs", + BlockKind::PolishedGraniteSlab => "minecraft:polished_granite_slab", + BlockKind::SmoothRedSandstoneSlab => "minecraft:smooth_red_sandstone_slab", + BlockKind::MossyStoneBrickSlab => "minecraft:mossy_stone_brick_slab", + BlockKind::PolishedDioriteSlab => "minecraft:polished_diorite_slab", + BlockKind::MossyCobblestoneSlab => "minecraft:mossy_cobblestone_slab", + BlockKind::EndStoneBrickSlab => "minecraft:end_stone_brick_slab", + BlockKind::SmoothSandstoneSlab => "minecraft:smooth_sandstone_slab", + BlockKind::SmoothQuartzSlab => "minecraft:smooth_quartz_slab", + BlockKind::GraniteSlab => "minecraft:granite_slab", + BlockKind::AndesiteSlab => "minecraft:andesite_slab", + BlockKind::RedNetherBrickSlab => "minecraft:red_nether_brick_slab", + BlockKind::PolishedAndesiteSlab => "minecraft:polished_andesite_slab", + BlockKind::DioriteSlab => "minecraft:diorite_slab", + BlockKind::BrickWall => "minecraft:brick_wall", + BlockKind::PrismarineWall => "minecraft:prismarine_wall", + BlockKind::RedSandstoneWall => "minecraft:red_sandstone_wall", + BlockKind::MossyStoneBrickWall => "minecraft:mossy_stone_brick_wall", + BlockKind::GraniteWall => "minecraft:granite_wall", + BlockKind::StoneBrickWall => "minecraft:stone_brick_wall", + BlockKind::NetherBrickWall => "minecraft:nether_brick_wall", + BlockKind::AndesiteWall => "minecraft:andesite_wall", + BlockKind::RedNetherBrickWall => "minecraft:red_nether_brick_wall", + BlockKind::SandstoneWall => "minecraft:sandstone_wall", + BlockKind::EndStoneBrickWall => "minecraft:end_stone_brick_wall", + BlockKind::DioriteWall => "minecraft:diorite_wall", + BlockKind::Scaffolding => "minecraft:scaffolding", + BlockKind::Loom => "minecraft:loom", + BlockKind::Barrel => "minecraft:barrel", + BlockKind::Smoker => "minecraft:smoker", + BlockKind::BlastFurnace => "minecraft:blast_furnace", + BlockKind::CartographyTable => "minecraft:cartography_table", + BlockKind::FletchingTable => "minecraft:fletching_table", + BlockKind::Grindstone => "minecraft:grindstone", + BlockKind::Lectern => "minecraft:lectern", + BlockKind::SmithingTable => "minecraft:smithing_table", + BlockKind::Stonecutter => "minecraft:stonecutter", + BlockKind::Bell => "minecraft:bell", + BlockKind::Lantern => "minecraft:lantern", + BlockKind::SoulLantern => "minecraft:soul_lantern", + BlockKind::Campfire => "minecraft:campfire", + BlockKind::SoulCampfire => "minecraft:soul_campfire", + BlockKind::SweetBerryBush => "minecraft:sweet_berry_bush", + BlockKind::WarpedStem => "minecraft:warped_stem", + BlockKind::StrippedWarpedStem => "minecraft:stripped_warped_stem", + BlockKind::WarpedHyphae => "minecraft:warped_hyphae", + BlockKind::StrippedWarpedHyphae => "minecraft:stripped_warped_hyphae", + BlockKind::WarpedNylium => "minecraft:warped_nylium", + BlockKind::WarpedFungus => "minecraft:warped_fungus", + BlockKind::WarpedWartBlock => "minecraft:warped_wart_block", + BlockKind::WarpedRoots => "minecraft:warped_roots", + BlockKind::NetherSprouts => "minecraft:nether_sprouts", + BlockKind::CrimsonStem => "minecraft:crimson_stem", + BlockKind::StrippedCrimsonStem => "minecraft:stripped_crimson_stem", + BlockKind::CrimsonHyphae => "minecraft:crimson_hyphae", + BlockKind::StrippedCrimsonHyphae => "minecraft:stripped_crimson_hyphae", + BlockKind::CrimsonNylium => "minecraft:crimson_nylium", + BlockKind::CrimsonFungus => "minecraft:crimson_fungus", + BlockKind::Shroomlight => "minecraft:shroomlight", + BlockKind::WeepingVines => "minecraft:weeping_vines", + BlockKind::WeepingVinesPlant => "minecraft:weeping_vines_plant", + BlockKind::TwistingVines => "minecraft:twisting_vines", + BlockKind::TwistingVinesPlant => "minecraft:twisting_vines_plant", + BlockKind::CrimsonRoots => "minecraft:crimson_roots", + BlockKind::CrimsonPlanks => "minecraft:crimson_planks", + BlockKind::WarpedPlanks => "minecraft:warped_planks", + BlockKind::CrimsonSlab => "minecraft:crimson_slab", + BlockKind::WarpedSlab => "minecraft:warped_slab", + BlockKind::CrimsonPressurePlate => "minecraft:crimson_pressure_plate", + BlockKind::WarpedPressurePlate => "minecraft:warped_pressure_plate", + BlockKind::CrimsonFence => "minecraft:crimson_fence", + BlockKind::WarpedFence => "minecraft:warped_fence", + BlockKind::CrimsonTrapdoor => "minecraft:crimson_trapdoor", + BlockKind::WarpedTrapdoor => "minecraft:warped_trapdoor", + BlockKind::CrimsonFenceGate => "minecraft:crimson_fence_gate", + BlockKind::WarpedFenceGate => "minecraft:warped_fence_gate", + BlockKind::CrimsonStairs => "minecraft:crimson_stairs", + BlockKind::WarpedStairs => "minecraft:warped_stairs", + BlockKind::CrimsonButton => "minecraft:crimson_button", + BlockKind::WarpedButton => "minecraft:warped_button", + BlockKind::CrimsonDoor => "minecraft:crimson_door", + BlockKind::WarpedDoor => "minecraft:warped_door", + BlockKind::CrimsonSign => "minecraft:crimson_sign", + BlockKind::WarpedSign => "minecraft:warped_sign", + BlockKind::CrimsonWallSign => "minecraft:crimson_wall_sign", + BlockKind::WarpedWallSign => "minecraft:warped_wall_sign", + BlockKind::StructureBlock => "minecraft:structure_block", + BlockKind::Jigsaw => "minecraft:jigsaw", + BlockKind::Composter => "minecraft:composter", + BlockKind::Target => "minecraft:target", + BlockKind::BeeNest => "minecraft:bee_nest", + BlockKind::Beehive => "minecraft:beehive", + BlockKind::HoneyBlock => "minecraft:honey_block", + BlockKind::HoneycombBlock => "minecraft:honeycomb_block", + BlockKind::NetheriteBlock => "minecraft:netherite_block", + BlockKind::AncientDebris => "minecraft:ancient_debris", + BlockKind::CryingObsidian => "minecraft:crying_obsidian", + BlockKind::RespawnAnchor => "minecraft:respawn_anchor", + BlockKind::PottedCrimsonFungus => "minecraft:potted_crimson_fungus", + BlockKind::PottedWarpedFungus => "minecraft:potted_warped_fungus", + BlockKind::PottedCrimsonRoots => "minecraft:potted_crimson_roots", + BlockKind::PottedWarpedRoots => "minecraft:potted_warped_roots", + BlockKind::Lodestone => "minecraft:lodestone", + BlockKind::Blackstone => "minecraft:blackstone", + BlockKind::BlackstoneStairs => "minecraft:blackstone_stairs", + BlockKind::BlackstoneWall => "minecraft:blackstone_wall", + BlockKind::BlackstoneSlab => "minecraft:blackstone_slab", + BlockKind::PolishedBlackstone => "minecraft:polished_blackstone", + BlockKind::PolishedBlackstoneBricks => "minecraft:polished_blackstone_bricks", + BlockKind::CrackedPolishedBlackstoneBricks => { + "minecraft:cracked_polished_blackstone_bricks" + } + BlockKind::ChiseledPolishedBlackstone => "minecraft:chiseled_polished_blackstone", + BlockKind::PolishedBlackstoneBrickSlab => "minecraft:polished_blackstone_brick_slab", + BlockKind::PolishedBlackstoneBrickStairs => { + "minecraft:polished_blackstone_brick_stairs" + } + BlockKind::PolishedBlackstoneBrickWall => "minecraft:polished_blackstone_brick_wall", + BlockKind::GildedBlackstone => "minecraft:gilded_blackstone", + BlockKind::PolishedBlackstoneStairs => "minecraft:polished_blackstone_stairs", + BlockKind::PolishedBlackstoneSlab => "minecraft:polished_blackstone_slab", + BlockKind::PolishedBlackstonePressurePlate => { + "minecraft:polished_blackstone_pressure_plate" + } + BlockKind::PolishedBlackstoneButton => "minecraft:polished_blackstone_button", + BlockKind::PolishedBlackstoneWall => "minecraft:polished_blackstone_wall", + BlockKind::ChiseledNetherBricks => "minecraft:chiseled_nether_bricks", + BlockKind::CrackedNetherBricks => "minecraft:cracked_nether_bricks", + BlockKind::QuartzBricks => "minecraft:quartz_bricks", + BlockKind::Candle => "minecraft:candle", + BlockKind::WhiteCandle => "minecraft:white_candle", + BlockKind::OrangeCandle => "minecraft:orange_candle", + BlockKind::MagentaCandle => "minecraft:magenta_candle", + BlockKind::LightBlueCandle => "minecraft:light_blue_candle", + BlockKind::YellowCandle => "minecraft:yellow_candle", + BlockKind::LimeCandle => "minecraft:lime_candle", + BlockKind::PinkCandle => "minecraft:pink_candle", + BlockKind::GrayCandle => "minecraft:gray_candle", + BlockKind::LightGrayCandle => "minecraft:light_gray_candle", + BlockKind::CyanCandle => "minecraft:cyan_candle", + BlockKind::PurpleCandle => "minecraft:purple_candle", + BlockKind::BlueCandle => "minecraft:blue_candle", + BlockKind::BrownCandle => "minecraft:brown_candle", + BlockKind::GreenCandle => "minecraft:green_candle", + BlockKind::RedCandle => "minecraft:red_candle", + BlockKind::BlackCandle => "minecraft:black_candle", + BlockKind::CandleCake => "minecraft:candle_cake", + BlockKind::WhiteCandleCake => "minecraft:white_candle_cake", + BlockKind::OrangeCandleCake => "minecraft:orange_candle_cake", + BlockKind::MagentaCandleCake => "minecraft:magenta_candle_cake", + BlockKind::LightBlueCandleCake => "minecraft:light_blue_candle_cake", + BlockKind::YellowCandleCake => "minecraft:yellow_candle_cake", + BlockKind::LimeCandleCake => "minecraft:lime_candle_cake", + BlockKind::PinkCandleCake => "minecraft:pink_candle_cake", + BlockKind::GrayCandleCake => "minecraft:gray_candle_cake", + BlockKind::LightGrayCandleCake => "minecraft:light_gray_candle_cake", + BlockKind::CyanCandleCake => "minecraft:cyan_candle_cake", + BlockKind::PurpleCandleCake => "minecraft:purple_candle_cake", + BlockKind::BlueCandleCake => "minecraft:blue_candle_cake", + BlockKind::BrownCandleCake => "minecraft:brown_candle_cake", + BlockKind::GreenCandleCake => "minecraft:green_candle_cake", + BlockKind::RedCandleCake => "minecraft:red_candle_cake", + BlockKind::BlackCandleCake => "minecraft:black_candle_cake", + BlockKind::AmethystBlock => "minecraft:amethyst_block", + BlockKind::BuddingAmethyst => "minecraft:budding_amethyst", + BlockKind::AmethystCluster => "minecraft:amethyst_cluster", + BlockKind::LargeAmethystBud => "minecraft:large_amethyst_bud", + BlockKind::MediumAmethystBud => "minecraft:medium_amethyst_bud", + BlockKind::SmallAmethystBud => "minecraft:small_amethyst_bud", + BlockKind::Tuff => "minecraft:tuff", + BlockKind::Calcite => "minecraft:calcite", + BlockKind::TintedGlass => "minecraft:tinted_glass", + BlockKind::PowderSnow => "minecraft:powder_snow", + BlockKind::SculkSensor => "minecraft:sculk_sensor", + BlockKind::OxidizedCopper => "minecraft:oxidized_copper", + BlockKind::WeatheredCopper => "minecraft:weathered_copper", + BlockKind::ExposedCopper => "minecraft:exposed_copper", + BlockKind::CopperBlock => "minecraft:copper_block", + BlockKind::CopperOre => "minecraft:copper_ore", + BlockKind::DeepslateCopperOre => "minecraft:deepslate_copper_ore", + BlockKind::OxidizedCutCopper => "minecraft:oxidized_cut_copper", + BlockKind::WeatheredCutCopper => "minecraft:weathered_cut_copper", + BlockKind::ExposedCutCopper => "minecraft:exposed_cut_copper", + BlockKind::CutCopper => "minecraft:cut_copper", + BlockKind::OxidizedCutCopperStairs => "minecraft:oxidized_cut_copper_stairs", + BlockKind::WeatheredCutCopperStairs => "minecraft:weathered_cut_copper_stairs", + BlockKind::ExposedCutCopperStairs => "minecraft:exposed_cut_copper_stairs", + BlockKind::CutCopperStairs => "minecraft:cut_copper_stairs", + BlockKind::OxidizedCutCopperSlab => "minecraft:oxidized_cut_copper_slab", + BlockKind::WeatheredCutCopperSlab => "minecraft:weathered_cut_copper_slab", + BlockKind::ExposedCutCopperSlab => "minecraft:exposed_cut_copper_slab", + BlockKind::CutCopperSlab => "minecraft:cut_copper_slab", + BlockKind::WaxedCopperBlock => "minecraft:waxed_copper_block", + BlockKind::WaxedWeatheredCopper => "minecraft:waxed_weathered_copper", + BlockKind::WaxedExposedCopper => "minecraft:waxed_exposed_copper", + BlockKind::WaxedOxidizedCopper => "minecraft:waxed_oxidized_copper", + BlockKind::WaxedOxidizedCutCopper => "minecraft:waxed_oxidized_cut_copper", + BlockKind::WaxedWeatheredCutCopper => "minecraft:waxed_weathered_cut_copper", + BlockKind::WaxedExposedCutCopper => "minecraft:waxed_exposed_cut_copper", + BlockKind::WaxedCutCopper => "minecraft:waxed_cut_copper", + BlockKind::WaxedOxidizedCutCopperStairs => "minecraft:waxed_oxidized_cut_copper_stairs", + BlockKind::WaxedWeatheredCutCopperStairs => { + "minecraft:waxed_weathered_cut_copper_stairs" + } + BlockKind::WaxedExposedCutCopperStairs => "minecraft:waxed_exposed_cut_copper_stairs", + BlockKind::WaxedCutCopperStairs => "minecraft:waxed_cut_copper_stairs", + BlockKind::WaxedOxidizedCutCopperSlab => "minecraft:waxed_oxidized_cut_copper_slab", + BlockKind::WaxedWeatheredCutCopperSlab => "minecraft:waxed_weathered_cut_copper_slab", + BlockKind::WaxedExposedCutCopperSlab => "minecraft:waxed_exposed_cut_copper_slab", + BlockKind::WaxedCutCopperSlab => "minecraft:waxed_cut_copper_slab", + BlockKind::LightningRod => "minecraft:lightning_rod", + BlockKind::PointedDripstone => "minecraft:pointed_dripstone", + BlockKind::DripstoneBlock => "minecraft:dripstone_block", + BlockKind::CaveVines => "minecraft:cave_vines", + BlockKind::CaveVinesPlant => "minecraft:cave_vines_plant", + BlockKind::SporeBlossom => "minecraft:spore_blossom", + BlockKind::Azalea => "minecraft:azalea", + BlockKind::FloweringAzalea => "minecraft:flowering_azalea", + BlockKind::MossCarpet => "minecraft:moss_carpet", + BlockKind::MossBlock => "minecraft:moss_block", + BlockKind::BigDripleaf => "minecraft:big_dripleaf", + BlockKind::BigDripleafStem => "minecraft:big_dripleaf_stem", + BlockKind::SmallDripleaf => "minecraft:small_dripleaf", + BlockKind::HangingRoots => "minecraft:hanging_roots", + BlockKind::RootedDirt => "minecraft:rooted_dirt", + BlockKind::Deepslate => "minecraft:deepslate", + BlockKind::CobbledDeepslate => "minecraft:cobbled_deepslate", + BlockKind::CobbledDeepslateStairs => "minecraft:cobbled_deepslate_stairs", + BlockKind::CobbledDeepslateSlab => "minecraft:cobbled_deepslate_slab", + BlockKind::CobbledDeepslateWall => "minecraft:cobbled_deepslate_wall", + BlockKind::PolishedDeepslate => "minecraft:polished_deepslate", + BlockKind::PolishedDeepslateStairs => "minecraft:polished_deepslate_stairs", + BlockKind::PolishedDeepslateSlab => "minecraft:polished_deepslate_slab", + BlockKind::PolishedDeepslateWall => "minecraft:polished_deepslate_wall", + BlockKind::DeepslateTiles => "minecraft:deepslate_tiles", + BlockKind::DeepslateTileStairs => "minecraft:deepslate_tile_stairs", + BlockKind::DeepslateTileSlab => "minecraft:deepslate_tile_slab", + BlockKind::DeepslateTileWall => "minecraft:deepslate_tile_wall", + BlockKind::DeepslateBricks => "minecraft:deepslate_bricks", + BlockKind::DeepslateBrickStairs => "minecraft:deepslate_brick_stairs", + BlockKind::DeepslateBrickSlab => "minecraft:deepslate_brick_slab", + BlockKind::DeepslateBrickWall => "minecraft:deepslate_brick_wall", + BlockKind::ChiseledDeepslate => "minecraft:chiseled_deepslate", + BlockKind::CrackedDeepslateBricks => "minecraft:cracked_deepslate_bricks", + BlockKind::CrackedDeepslateTiles => "minecraft:cracked_deepslate_tiles", + BlockKind::InfestedDeepslate => "minecraft:infested_deepslate", + BlockKind::SmoothBasalt => "minecraft:smooth_basalt", + BlockKind::RawIronBlock => "minecraft:raw_iron_block", + BlockKind::RawCopperBlock => "minecraft:raw_copper_block", + BlockKind::RawGoldBlock => "minecraft:raw_gold_block", + BlockKind::PottedAzaleaBush => "minecraft:potted_azalea_bush", + BlockKind::PottedFloweringAzaleaBush => "minecraft:potted_flowering_azalea_bush", } } - - /// Gets a `BlockKind` by its `display_name`. - pub fn from_display_name(display_name: &str) -> Option { - match display_name { - "Air" => Some(BlockKind::Air), - "Stone" => Some(BlockKind::Stone), - "Granite" => Some(BlockKind::Granite), - "Polished Granite" => Some(BlockKind::PolishedGranite), - "Diorite" => Some(BlockKind::Diorite), - "Polished Diorite" => Some(BlockKind::PolishedDiorite), - "Andesite" => Some(BlockKind::Andesite), - "Polished Andesite" => Some(BlockKind::PolishedAndesite), - "Grass Block" => Some(BlockKind::GrassBlock), - "Dirt" => Some(BlockKind::Dirt), - "Coarse Dirt" => Some(BlockKind::CoarseDirt), - "Podzol" => Some(BlockKind::Podzol), - "Cobblestone" => Some(BlockKind::Cobblestone), - "Oak Planks" => Some(BlockKind::OakPlanks), - "Spruce Planks" => Some(BlockKind::SprucePlanks), - "Birch Planks" => Some(BlockKind::BirchPlanks), - "Jungle Planks" => Some(BlockKind::JunglePlanks), - "Acacia Planks" => Some(BlockKind::AcaciaPlanks), - "Dark Oak Planks" => Some(BlockKind::DarkOakPlanks), - "Oak Sapling" => Some(BlockKind::OakSapling), - "Spruce Sapling" => Some(BlockKind::SpruceSapling), - "Birch Sapling" => Some(BlockKind::BirchSapling), - "Jungle Sapling" => Some(BlockKind::JungleSapling), - "Acacia Sapling" => Some(BlockKind::AcaciaSapling), - "Dark Oak Sapling" => Some(BlockKind::DarkOakSapling), - "Bedrock" => Some(BlockKind::Bedrock), - "Water" => Some(BlockKind::Water), - "Lava" => Some(BlockKind::Lava), - "Sand" => Some(BlockKind::Sand), - "Red Sand" => Some(BlockKind::RedSand), - "Gravel" => Some(BlockKind::Gravel), - "Gold Ore" => Some(BlockKind::GoldOre), - "Iron Ore" => Some(BlockKind::IronOre), - "Coal Ore" => Some(BlockKind::CoalOre), - "Nether Gold Ore" => Some(BlockKind::NetherGoldOre), - "Oak Log" => Some(BlockKind::OakLog), - "Spruce Log" => Some(BlockKind::SpruceLog), - "Birch Log" => Some(BlockKind::BirchLog), - "Jungle Log" => Some(BlockKind::JungleLog), - "Acacia Log" => Some(BlockKind::AcaciaLog), - "Dark Oak Log" => Some(BlockKind::DarkOakLog), - "Stripped Spruce Log" => Some(BlockKind::StrippedSpruceLog), - "Stripped Birch Log" => Some(BlockKind::StrippedBirchLog), - "Stripped Jungle Log" => Some(BlockKind::StrippedJungleLog), - "Stripped Acacia Log" => Some(BlockKind::StrippedAcaciaLog), - "Stripped Dark Oak Log" => Some(BlockKind::StrippedDarkOakLog), - "Stripped Oak Log" => Some(BlockKind::StrippedOakLog), - "Oak Wood" => Some(BlockKind::OakWood), - "Spruce Wood" => Some(BlockKind::SpruceWood), - "Birch Wood" => Some(BlockKind::BirchWood), - "Jungle Wood" => Some(BlockKind::JungleWood), - "Acacia Wood" => Some(BlockKind::AcaciaWood), - "Dark Oak Wood" => Some(BlockKind::DarkOakWood), - "Stripped Oak Wood" => Some(BlockKind::StrippedOakWood), - "Stripped Spruce Wood" => Some(BlockKind::StrippedSpruceWood), - "Stripped Birch Wood" => Some(BlockKind::StrippedBirchWood), - "Stripped Jungle Wood" => Some(BlockKind::StrippedJungleWood), - "Stripped Acacia Wood" => Some(BlockKind::StrippedAcaciaWood), - "Stripped Dark Oak Wood" => Some(BlockKind::StrippedDarkOakWood), - "Oak Leaves" => Some(BlockKind::OakLeaves), - "Spruce Leaves" => Some(BlockKind::SpruceLeaves), - "Birch Leaves" => Some(BlockKind::BirchLeaves), - "Jungle Leaves" => Some(BlockKind::JungleLeaves), - "Acacia Leaves" => Some(BlockKind::AcaciaLeaves), - "Dark Oak Leaves" => Some(BlockKind::DarkOakLeaves), - "Sponge" => Some(BlockKind::Sponge), - "Wet Sponge" => Some(BlockKind::WetSponge), - "Glass" => Some(BlockKind::Glass), - "Lapis Lazuli Ore" => Some(BlockKind::LapisOre), - "Lapis Lazuli Block" => Some(BlockKind::LapisBlock), - "Dispenser" => Some(BlockKind::Dispenser), - "Sandstone" => Some(BlockKind::Sandstone), - "Chiseled Sandstone" => Some(BlockKind::ChiseledSandstone), - "Cut Sandstone" => Some(BlockKind::CutSandstone), - "Note Block" => Some(BlockKind::NoteBlock), - "White Bed" => Some(BlockKind::WhiteBed), - "Orange Bed" => Some(BlockKind::OrangeBed), - "Magenta Bed" => Some(BlockKind::MagentaBed), - "Light Blue Bed" => Some(BlockKind::LightBlueBed), - "Yellow Bed" => Some(BlockKind::YellowBed), - "Lime Bed" => Some(BlockKind::LimeBed), - "Pink Bed" => Some(BlockKind::PinkBed), - "Gray Bed" => Some(BlockKind::GrayBed), - "Light Gray Bed" => Some(BlockKind::LightGrayBed), - "Cyan Bed" => Some(BlockKind::CyanBed), - "Purple Bed" => Some(BlockKind::PurpleBed), - "Blue Bed" => Some(BlockKind::BlueBed), - "Brown Bed" => Some(BlockKind::BrownBed), - "Green Bed" => Some(BlockKind::GreenBed), - "Red Bed" => Some(BlockKind::RedBed), - "Black Bed" => Some(BlockKind::BlackBed), - "Powered Rail" => Some(BlockKind::PoweredRail), - "Detector Rail" => Some(BlockKind::DetectorRail), - "Sticky Piston" => Some(BlockKind::StickyPiston), - "Cobweb" => Some(BlockKind::Cobweb), - "Grass" => Some(BlockKind::Grass), - "Fern" => Some(BlockKind::Fern), - "Dead Bush" => Some(BlockKind::DeadBush), - "Seagrass" => Some(BlockKind::Seagrass), - "Tall Seagrass" => Some(BlockKind::TallSeagrass), - "Piston" => Some(BlockKind::Piston), - "Piston Head" => Some(BlockKind::PistonHead), - "White Wool" => Some(BlockKind::WhiteWool), - "Orange Wool" => Some(BlockKind::OrangeWool), - "Magenta Wool" => Some(BlockKind::MagentaWool), - "Light Blue Wool" => Some(BlockKind::LightBlueWool), - "Yellow Wool" => Some(BlockKind::YellowWool), - "Lime Wool" => Some(BlockKind::LimeWool), - "Pink Wool" => Some(BlockKind::PinkWool), - "Gray Wool" => Some(BlockKind::GrayWool), - "Light Gray Wool" => Some(BlockKind::LightGrayWool), - "Cyan Wool" => Some(BlockKind::CyanWool), - "Purple Wool" => Some(BlockKind::PurpleWool), - "Blue Wool" => Some(BlockKind::BlueWool), - "Brown Wool" => Some(BlockKind::BrownWool), - "Green Wool" => Some(BlockKind::GreenWool), - "Red Wool" => Some(BlockKind::RedWool), - "Black Wool" => Some(BlockKind::BlackWool), - "Moving Piston" => Some(BlockKind::MovingPiston), - "Dandelion" => Some(BlockKind::Dandelion), - "Poppy" => Some(BlockKind::Poppy), - "Blue Orchid" => Some(BlockKind::BlueOrchid), - "Allium" => Some(BlockKind::Allium), - "Azure Bluet" => Some(BlockKind::AzureBluet), - "Red Tulip" => Some(BlockKind::RedTulip), - "Orange Tulip" => Some(BlockKind::OrangeTulip), - "White Tulip" => Some(BlockKind::WhiteTulip), - "Pink Tulip" => Some(BlockKind::PinkTulip), - "Oxeye Daisy" => Some(BlockKind::OxeyeDaisy), - "Cornflower" => Some(BlockKind::Cornflower), - "Wither Rose" => Some(BlockKind::WitherRose), - "Lily of the Valley" => Some(BlockKind::LilyOfTheValley), - "Brown Mushroom" => Some(BlockKind::BrownMushroom), - "Red Mushroom" => Some(BlockKind::RedMushroom), - "Block of Gold" => Some(BlockKind::GoldBlock), - "Block of Iron" => Some(BlockKind::IronBlock), - "Bricks" => Some(BlockKind::Bricks), - "TNT" => Some(BlockKind::Tnt), - "Bookshelf" => Some(BlockKind::Bookshelf), - "Mossy Cobblestone" => Some(BlockKind::MossyCobblestone), - "Obsidian" => Some(BlockKind::Obsidian), - "Torch" => Some(BlockKind::Torch), - "Wall Torch" => Some(BlockKind::WallTorch), - "Fire" => Some(BlockKind::Fire), - "Soul Fire" => Some(BlockKind::SoulFire), - "Spawner" => Some(BlockKind::Spawner), - "Oak Stairs" => Some(BlockKind::OakStairs), - "Chest" => Some(BlockKind::Chest), - "Redstone Wire" => Some(BlockKind::RedstoneWire), - "Diamond Ore" => Some(BlockKind::DiamondOre), - "Block of Diamond" => Some(BlockKind::DiamondBlock), - "Crafting Table" => Some(BlockKind::CraftingTable), - "Wheat Crops" => Some(BlockKind::Wheat), - "Farmland" => Some(BlockKind::Farmland), - "Furnace" => Some(BlockKind::Furnace), - "Oak Sign" => Some(BlockKind::OakSign), - "Spruce Sign" => Some(BlockKind::SpruceSign), - "Birch Sign" => Some(BlockKind::BirchSign), - "Acacia Sign" => Some(BlockKind::AcaciaSign), - "Jungle Sign" => Some(BlockKind::JungleSign), - "Dark Oak Sign" => Some(BlockKind::DarkOakSign), - "Oak Door" => Some(BlockKind::OakDoor), - "Ladder" => Some(BlockKind::Ladder), - "Rail" => Some(BlockKind::Rail), - "Cobblestone Stairs" => Some(BlockKind::CobblestoneStairs), - "Oak Wall Sign" => Some(BlockKind::OakWallSign), - "Spruce Wall Sign" => Some(BlockKind::SpruceWallSign), - "Birch Wall Sign" => Some(BlockKind::BirchWallSign), - "Acacia Wall Sign" => Some(BlockKind::AcaciaWallSign), - "Jungle Wall Sign" => Some(BlockKind::JungleWallSign), - "Dark Oak Wall Sign" => Some(BlockKind::DarkOakWallSign), - "Lever" => Some(BlockKind::Lever), - "Stone Pressure Plate" => Some(BlockKind::StonePressurePlate), - "Iron Door" => Some(BlockKind::IronDoor), - "Oak Pressure Plate" => Some(BlockKind::OakPressurePlate), - "Spruce Pressure Plate" => Some(BlockKind::SprucePressurePlate), - "Birch Pressure Plate" => Some(BlockKind::BirchPressurePlate), - "Jungle Pressure Plate" => Some(BlockKind::JunglePressurePlate), - "Acacia Pressure Plate" => Some(BlockKind::AcaciaPressurePlate), - "Dark Oak Pressure Plate" => Some(BlockKind::DarkOakPressurePlate), - "Redstone Ore" => Some(BlockKind::RedstoneOre), - "Redstone Torch" => Some(BlockKind::RedstoneTorch), - "Redstone Wall Torch" => Some(BlockKind::RedstoneWallTorch), - "Stone Button" => Some(BlockKind::StoneButton), - "Snow" => Some(BlockKind::Snow), - "Ice" => Some(BlockKind::Ice), - "Snow Block" => Some(BlockKind::SnowBlock), - "Cactus" => Some(BlockKind::Cactus), - "Clay" => Some(BlockKind::Clay), - "Sugar Cane" => Some(BlockKind::SugarCane), - "Jukebox" => Some(BlockKind::Jukebox), - "Oak Fence" => Some(BlockKind::OakFence), - "Pumpkin" => Some(BlockKind::Pumpkin), - "Netherrack" => Some(BlockKind::Netherrack), - "Soul Sand" => Some(BlockKind::SoulSand), - "Soul Soil" => Some(BlockKind::SoulSoil), - "Basalt" => Some(BlockKind::Basalt), - "Polished Basalt" => Some(BlockKind::PolishedBasalt), - "Soul Torch" => Some(BlockKind::SoulTorch), - "Soul Wall Torch" => Some(BlockKind::SoulWallTorch), - "Glowstone" => Some(BlockKind::Glowstone), - "Nether Portal" => Some(BlockKind::NetherPortal), - "Carved Pumpkin" => Some(BlockKind::CarvedPumpkin), - "Jack o'Lantern" => Some(BlockKind::JackOLantern), - "Cake" => Some(BlockKind::Cake), - "Redstone Repeater" => Some(BlockKind::Repeater), - "White Stained Glass" => Some(BlockKind::WhiteStainedGlass), - "Orange Stained Glass" => Some(BlockKind::OrangeStainedGlass), - "Magenta Stained Glass" => Some(BlockKind::MagentaStainedGlass), - "Light Blue Stained Glass" => Some(BlockKind::LightBlueStainedGlass), - "Yellow Stained Glass" => Some(BlockKind::YellowStainedGlass), - "Lime Stained Glass" => Some(BlockKind::LimeStainedGlass), - "Pink Stained Glass" => Some(BlockKind::PinkStainedGlass), - "Gray Stained Glass" => Some(BlockKind::GrayStainedGlass), - "Light Gray Stained Glass" => Some(BlockKind::LightGrayStainedGlass), - "Cyan Stained Glass" => Some(BlockKind::CyanStainedGlass), - "Purple Stained Glass" => Some(BlockKind::PurpleStainedGlass), - "Blue Stained Glass" => Some(BlockKind::BlueStainedGlass), - "Brown Stained Glass" => Some(BlockKind::BrownStainedGlass), - "Green Stained Glass" => Some(BlockKind::GreenStainedGlass), - "Red Stained Glass" => Some(BlockKind::RedStainedGlass), - "Black Stained Glass" => Some(BlockKind::BlackStainedGlass), - "Oak Trapdoor" => Some(BlockKind::OakTrapdoor), - "Spruce Trapdoor" => Some(BlockKind::SpruceTrapdoor), - "Birch Trapdoor" => Some(BlockKind::BirchTrapdoor), - "Jungle Trapdoor" => Some(BlockKind::JungleTrapdoor), - "Acacia Trapdoor" => Some(BlockKind::AcaciaTrapdoor), - "Dark Oak Trapdoor" => Some(BlockKind::DarkOakTrapdoor), - "Stone Bricks" => Some(BlockKind::StoneBricks), - "Mossy Stone Bricks" => Some(BlockKind::MossyStoneBricks), - "Cracked Stone Bricks" => Some(BlockKind::CrackedStoneBricks), - "Chiseled Stone Bricks" => Some(BlockKind::ChiseledStoneBricks), - "Infested Stone" => Some(BlockKind::InfestedStone), - "Infested Cobblestone" => Some(BlockKind::InfestedCobblestone), - "Infested Stone Bricks" => Some(BlockKind::InfestedStoneBricks), - "Infested Mossy Stone Bricks" => Some(BlockKind::InfestedMossyStoneBricks), - "Infested Cracked Stone Bricks" => Some(BlockKind::InfestedCrackedStoneBricks), - "Infested Chiseled Stone Bricks" => Some(BlockKind::InfestedChiseledStoneBricks), - "Brown Mushroom Block" => Some(BlockKind::BrownMushroomBlock), - "Red Mushroom Block" => Some(BlockKind::RedMushroomBlock), - "Mushroom Stem" => Some(BlockKind::MushroomStem), - "Iron Bars" => Some(BlockKind::IronBars), - "Chain" => Some(BlockKind::Chain), - "Glass Pane" => Some(BlockKind::GlassPane), - "Melon" => Some(BlockKind::Melon), - "Attached Pumpkin Stem" => Some(BlockKind::AttachedPumpkinStem), - "Attached Melon Stem" => Some(BlockKind::AttachedMelonStem), - "Pumpkin Stem" => Some(BlockKind::PumpkinStem), - "Melon Stem" => Some(BlockKind::MelonStem), - "Vines" => Some(BlockKind::Vine), - "Oak Fence Gate" => Some(BlockKind::OakFenceGate), - "Brick Stairs" => Some(BlockKind::BrickStairs), - "Stone Brick Stairs" => Some(BlockKind::StoneBrickStairs), - "Mycelium" => Some(BlockKind::Mycelium), - "Lily Pad" => Some(BlockKind::LilyPad), - "Nether Bricks" => Some(BlockKind::NetherBricks), - "Nether Brick Fence" => Some(BlockKind::NetherBrickFence), - "Nether Brick Stairs" => Some(BlockKind::NetherBrickStairs), - "Nether Wart" => Some(BlockKind::NetherWart), - "Enchanting Table" => Some(BlockKind::EnchantingTable), - "Brewing Stand" => Some(BlockKind::BrewingStand), - "Cauldron" => Some(BlockKind::Cauldron), - "End Portal" => Some(BlockKind::EndPortal), - "End Portal Frame" => Some(BlockKind::EndPortalFrame), - "End Stone" => Some(BlockKind::EndStone), - "Dragon Egg" => Some(BlockKind::DragonEgg), - "Redstone Lamp" => Some(BlockKind::RedstoneLamp), - "Cocoa" => Some(BlockKind::Cocoa), - "Sandstone Stairs" => Some(BlockKind::SandstoneStairs), - "Emerald Ore" => Some(BlockKind::EmeraldOre), - "Ender Chest" => Some(BlockKind::EnderChest), - "Tripwire Hook" => Some(BlockKind::TripwireHook), - "Tripwire" => Some(BlockKind::Tripwire), - "Block of Emerald" => Some(BlockKind::EmeraldBlock), - "Spruce Stairs" => Some(BlockKind::SpruceStairs), - "Birch Stairs" => Some(BlockKind::BirchStairs), - "Jungle Stairs" => Some(BlockKind::JungleStairs), - "Command Block" => Some(BlockKind::CommandBlock), - "Beacon" => Some(BlockKind::Beacon), - "Cobblestone Wall" => Some(BlockKind::CobblestoneWall), - "Mossy Cobblestone Wall" => Some(BlockKind::MossyCobblestoneWall), - "Flower Pot" => Some(BlockKind::FlowerPot), - "Potted Oak Sapling" => Some(BlockKind::PottedOakSapling), - "Potted Spruce Sapling" => Some(BlockKind::PottedSpruceSapling), - "Potted Birch Sapling" => Some(BlockKind::PottedBirchSapling), - "Potted Jungle Sapling" => Some(BlockKind::PottedJungleSapling), - "Potted Acacia Sapling" => Some(BlockKind::PottedAcaciaSapling), - "Potted Dark Oak Sapling" => Some(BlockKind::PottedDarkOakSapling), - "Potted Fern" => Some(BlockKind::PottedFern), - "Potted Dandelion" => Some(BlockKind::PottedDandelion), - "Potted Poppy" => Some(BlockKind::PottedPoppy), - "Potted Blue Orchid" => Some(BlockKind::PottedBlueOrchid), - "Potted Allium" => Some(BlockKind::PottedAllium), - "Potted Azure Bluet" => Some(BlockKind::PottedAzureBluet), - "Potted Red Tulip" => Some(BlockKind::PottedRedTulip), - "Potted Orange Tulip" => Some(BlockKind::PottedOrangeTulip), - "Potted White Tulip" => Some(BlockKind::PottedWhiteTulip), - "Potted Pink Tulip" => Some(BlockKind::PottedPinkTulip), - "Potted Oxeye Daisy" => Some(BlockKind::PottedOxeyeDaisy), - "Potted Cornflower" => Some(BlockKind::PottedCornflower), - "Potted Lily of the Valley" => Some(BlockKind::PottedLilyOfTheValley), - "Potted Wither Rose" => Some(BlockKind::PottedWitherRose), - "Potted Red Mushroom" => Some(BlockKind::PottedRedMushroom), - "Potted Brown Mushroom" => Some(BlockKind::PottedBrownMushroom), - "Potted Dead Bush" => Some(BlockKind::PottedDeadBush), - "Potted Cactus" => Some(BlockKind::PottedCactus), - "Carrots" => Some(BlockKind::Carrots), - "Potatoes" => Some(BlockKind::Potatoes), - "Oak Button" => Some(BlockKind::OakButton), - "Spruce Button" => Some(BlockKind::SpruceButton), - "Birch Button" => Some(BlockKind::BirchButton), - "Jungle Button" => Some(BlockKind::JungleButton), - "Acacia Button" => Some(BlockKind::AcaciaButton), - "Dark Oak Button" => Some(BlockKind::DarkOakButton), - "Skeleton Skull" => Some(BlockKind::SkeletonSkull), - "Skeleton Wall Skull" => Some(BlockKind::SkeletonWallSkull), - "Wither Skeleton Skull" => Some(BlockKind::WitherSkeletonSkull), - "Wither Skeleton Wall Skull" => Some(BlockKind::WitherSkeletonWallSkull), - "Zombie Head" => Some(BlockKind::ZombieHead), - "Zombie Wall Head" => Some(BlockKind::ZombieWallHead), - "Player Head" => Some(BlockKind::PlayerHead), - "Player Wall Head" => Some(BlockKind::PlayerWallHead), - "Creeper Head" => Some(BlockKind::CreeperHead), - "Creeper Wall Head" => Some(BlockKind::CreeperWallHead), - "Dragon Head" => Some(BlockKind::DragonHead), - "Dragon Wall Head" => Some(BlockKind::DragonWallHead), - "Anvil" => Some(BlockKind::Anvil), - "Chipped Anvil" => Some(BlockKind::ChippedAnvil), - "Damaged Anvil" => Some(BlockKind::DamagedAnvil), - "Trapped Chest" => Some(BlockKind::TrappedChest), - "Light Weighted Pressure Plate" => Some(BlockKind::LightWeightedPressurePlate), - "Heavy Weighted Pressure Plate" => Some(BlockKind::HeavyWeightedPressurePlate), - "Redstone Comparator" => Some(BlockKind::Comparator), - "Daylight Detector" => Some(BlockKind::DaylightDetector), - "Block of Redstone" => Some(BlockKind::RedstoneBlock), - "Nether Quartz Ore" => Some(BlockKind::NetherQuartzOre), - "Hopper" => Some(BlockKind::Hopper), - "Block of Quartz" => Some(BlockKind::QuartzBlock), - "Chiseled Quartz Block" => Some(BlockKind::ChiseledQuartzBlock), - "Quartz Pillar" => Some(BlockKind::QuartzPillar), - "Quartz Stairs" => Some(BlockKind::QuartzStairs), - "Activator Rail" => Some(BlockKind::ActivatorRail), - "Dropper" => Some(BlockKind::Dropper), - "White Terracotta" => Some(BlockKind::WhiteTerracotta), - "Orange Terracotta" => Some(BlockKind::OrangeTerracotta), - "Magenta Terracotta" => Some(BlockKind::MagentaTerracotta), - "Light Blue Terracotta" => Some(BlockKind::LightBlueTerracotta), - "Yellow Terracotta" => Some(BlockKind::YellowTerracotta), - "Lime Terracotta" => Some(BlockKind::LimeTerracotta), - "Pink Terracotta" => Some(BlockKind::PinkTerracotta), - "Gray Terracotta" => Some(BlockKind::GrayTerracotta), - "Light Gray Terracotta" => Some(BlockKind::LightGrayTerracotta), - "Cyan Terracotta" => Some(BlockKind::CyanTerracotta), - "Purple Terracotta" => Some(BlockKind::PurpleTerracotta), - "Blue Terracotta" => Some(BlockKind::BlueTerracotta), - "Brown Terracotta" => Some(BlockKind::BrownTerracotta), - "Green Terracotta" => Some(BlockKind::GreenTerracotta), - "Red Terracotta" => Some(BlockKind::RedTerracotta), - "Black Terracotta" => Some(BlockKind::BlackTerracotta), - "White Stained Glass Pane" => Some(BlockKind::WhiteStainedGlassPane), - "Orange Stained Glass Pane" => Some(BlockKind::OrangeStainedGlassPane), - "Magenta Stained Glass Pane" => Some(BlockKind::MagentaStainedGlassPane), - "Light Blue Stained Glass Pane" => Some(BlockKind::LightBlueStainedGlassPane), - "Yellow Stained Glass Pane" => Some(BlockKind::YellowStainedGlassPane), - "Lime Stained Glass Pane" => Some(BlockKind::LimeStainedGlassPane), - "Pink Stained Glass Pane" => Some(BlockKind::PinkStainedGlassPane), - "Gray Stained Glass Pane" => Some(BlockKind::GrayStainedGlassPane), - "Light Gray Stained Glass Pane" => Some(BlockKind::LightGrayStainedGlassPane), - "Cyan Stained Glass Pane" => Some(BlockKind::CyanStainedGlassPane), - "Purple Stained Glass Pane" => Some(BlockKind::PurpleStainedGlassPane), - "Blue Stained Glass Pane" => Some(BlockKind::BlueStainedGlassPane), - "Brown Stained Glass Pane" => Some(BlockKind::BrownStainedGlassPane), - "Green Stained Glass Pane" => Some(BlockKind::GreenStainedGlassPane), - "Red Stained Glass Pane" => Some(BlockKind::RedStainedGlassPane), - "Black Stained Glass Pane" => Some(BlockKind::BlackStainedGlassPane), - "Acacia Stairs" => Some(BlockKind::AcaciaStairs), - "Dark Oak Stairs" => Some(BlockKind::DarkOakStairs), - "Slime Block" => Some(BlockKind::SlimeBlock), - "Barrier" => Some(BlockKind::Barrier), - "Iron Trapdoor" => Some(BlockKind::IronTrapdoor), - "Prismarine" => Some(BlockKind::Prismarine), - "Prismarine Bricks" => Some(BlockKind::PrismarineBricks), - "Dark Prismarine" => Some(BlockKind::DarkPrismarine), - "Prismarine Stairs" => Some(BlockKind::PrismarineStairs), - "Prismarine Brick Stairs" => Some(BlockKind::PrismarineBrickStairs), - "Dark Prismarine Stairs" => Some(BlockKind::DarkPrismarineStairs), - "Prismarine Slab" => Some(BlockKind::PrismarineSlab), - "Prismarine Brick Slab" => Some(BlockKind::PrismarineBrickSlab), - "Dark Prismarine Slab" => Some(BlockKind::DarkPrismarineSlab), - "Sea Lantern" => Some(BlockKind::SeaLantern), - "Hay Bale" => Some(BlockKind::HayBlock), - "White Carpet" => Some(BlockKind::WhiteCarpet), - "Orange Carpet" => Some(BlockKind::OrangeCarpet), - "Magenta Carpet" => Some(BlockKind::MagentaCarpet), - "Light Blue Carpet" => Some(BlockKind::LightBlueCarpet), - "Yellow Carpet" => Some(BlockKind::YellowCarpet), - "Lime Carpet" => Some(BlockKind::LimeCarpet), - "Pink Carpet" => Some(BlockKind::PinkCarpet), - "Gray Carpet" => Some(BlockKind::GrayCarpet), - "Light Gray Carpet" => Some(BlockKind::LightGrayCarpet), - "Cyan Carpet" => Some(BlockKind::CyanCarpet), - "Purple Carpet" => Some(BlockKind::PurpleCarpet), - "Blue Carpet" => Some(BlockKind::BlueCarpet), - "Brown Carpet" => Some(BlockKind::BrownCarpet), - "Green Carpet" => Some(BlockKind::GreenCarpet), - "Red Carpet" => Some(BlockKind::RedCarpet), - "Black Carpet" => Some(BlockKind::BlackCarpet), - "Terracotta" => Some(BlockKind::Terracotta), - "Block of Coal" => Some(BlockKind::CoalBlock), - "Packed Ice" => Some(BlockKind::PackedIce), - "Sunflower" => Some(BlockKind::Sunflower), - "Lilac" => Some(BlockKind::Lilac), - "Rose Bush" => Some(BlockKind::RoseBush), - "Peony" => Some(BlockKind::Peony), - "Tall Grass" => Some(BlockKind::TallGrass), - "Large Fern" => Some(BlockKind::LargeFern), - "White Banner" => Some(BlockKind::WhiteBanner), - "Orange Banner" => Some(BlockKind::OrangeBanner), - "Magenta Banner" => Some(BlockKind::MagentaBanner), - "Light Blue Banner" => Some(BlockKind::LightBlueBanner), - "Yellow Banner" => Some(BlockKind::YellowBanner), - "Lime Banner" => Some(BlockKind::LimeBanner), - "Pink Banner" => Some(BlockKind::PinkBanner), - "Gray Banner" => Some(BlockKind::GrayBanner), - "Light Gray Banner" => Some(BlockKind::LightGrayBanner), - "Cyan Banner" => Some(BlockKind::CyanBanner), - "Purple Banner" => Some(BlockKind::PurpleBanner), - "Blue Banner" => Some(BlockKind::BlueBanner), - "Brown Banner" => Some(BlockKind::BrownBanner), - "Green Banner" => Some(BlockKind::GreenBanner), - "Red Banner" => Some(BlockKind::RedBanner), - "Black Banner" => Some(BlockKind::BlackBanner), - "White wall banner" => Some(BlockKind::WhiteWallBanner), - "Orange wall banner" => Some(BlockKind::OrangeWallBanner), - "Magenta wall banner" => Some(BlockKind::MagentaWallBanner), - "Light blue wall banner" => Some(BlockKind::LightBlueWallBanner), - "Yellow wall banner" => Some(BlockKind::YellowWallBanner), - "Lime wall banner" => Some(BlockKind::LimeWallBanner), - "Pink wall banner" => Some(BlockKind::PinkWallBanner), - "Gray wall banner" => Some(BlockKind::GrayWallBanner), - "Light gray wall banner" => Some(BlockKind::LightGrayWallBanner), - "Cyan wall banner" => Some(BlockKind::CyanWallBanner), - "Purple wall banner" => Some(BlockKind::PurpleWallBanner), - "Blue wall banner" => Some(BlockKind::BlueWallBanner), - "Brown wall banner" => Some(BlockKind::BrownWallBanner), - "Green wall banner" => Some(BlockKind::GreenWallBanner), - "Red wall banner" => Some(BlockKind::RedWallBanner), - "Black wall banner" => Some(BlockKind::BlackWallBanner), - "Red Sandstone" => Some(BlockKind::RedSandstone), - "Chiseled Red Sandstone" => Some(BlockKind::ChiseledRedSandstone), - "Cut Red Sandstone" => Some(BlockKind::CutRedSandstone), - "Red Sandstone Stairs" => Some(BlockKind::RedSandstoneStairs), - "Oak Slab" => Some(BlockKind::OakSlab), - "Spruce Slab" => Some(BlockKind::SpruceSlab), - "Birch Slab" => Some(BlockKind::BirchSlab), - "Jungle Slab" => Some(BlockKind::JungleSlab), - "Acacia Slab" => Some(BlockKind::AcaciaSlab), - "Dark Oak Slab" => Some(BlockKind::DarkOakSlab), - "Stone Slab" => Some(BlockKind::StoneSlab), - "Smooth Stone Slab" => Some(BlockKind::SmoothStoneSlab), - "Sandstone Slab" => Some(BlockKind::SandstoneSlab), - "Cut Sandstone Slab" => Some(BlockKind::CutSandstoneSlab), - "Petrified Oak Slab" => Some(BlockKind::PetrifiedOakSlab), - "Cobblestone Slab" => Some(BlockKind::CobblestoneSlab), - "Brick Slab" => Some(BlockKind::BrickSlab), - "Stone Brick Slab" => Some(BlockKind::StoneBrickSlab), - "Nether Brick Slab" => Some(BlockKind::NetherBrickSlab), - "Quartz Slab" => Some(BlockKind::QuartzSlab), - "Red Sandstone Slab" => Some(BlockKind::RedSandstoneSlab), - "Cut Red Sandstone Slab" => Some(BlockKind::CutRedSandstoneSlab), - "Purpur Slab" => Some(BlockKind::PurpurSlab), - "Smooth Stone" => Some(BlockKind::SmoothStone), - "Smooth Sandstone" => Some(BlockKind::SmoothSandstone), - "Smooth Quartz Block" => Some(BlockKind::SmoothQuartz), - "Smooth Red Sandstone" => Some(BlockKind::SmoothRedSandstone), - "Spruce Fence Gate" => Some(BlockKind::SpruceFenceGate), - "Birch Fence Gate" => Some(BlockKind::BirchFenceGate), - "Jungle Fence Gate" => Some(BlockKind::JungleFenceGate), - "Acacia Fence Gate" => Some(BlockKind::AcaciaFenceGate), - "Dark Oak Fence Gate" => Some(BlockKind::DarkOakFenceGate), - "Spruce Fence" => Some(BlockKind::SpruceFence), - "Birch Fence" => Some(BlockKind::BirchFence), - "Jungle Fence" => Some(BlockKind::JungleFence), - "Acacia Fence" => Some(BlockKind::AcaciaFence), - "Dark Oak Fence" => Some(BlockKind::DarkOakFence), - "Spruce Door" => Some(BlockKind::SpruceDoor), - "Birch Door" => Some(BlockKind::BirchDoor), - "Jungle Door" => Some(BlockKind::JungleDoor), - "Acacia Door" => Some(BlockKind::AcaciaDoor), - "Dark Oak Door" => Some(BlockKind::DarkOakDoor), - "End Rod" => Some(BlockKind::EndRod), - "Chorus Plant" => Some(BlockKind::ChorusPlant), - "Chorus Flower" => Some(BlockKind::ChorusFlower), - "Purpur Block" => Some(BlockKind::PurpurBlock), - "Purpur Pillar" => Some(BlockKind::PurpurPillar), - "Purpur Stairs" => Some(BlockKind::PurpurStairs), - "End Stone Bricks" => Some(BlockKind::EndStoneBricks), - "Beetroots" => Some(BlockKind::Beetroots), - "Grass Path" => Some(BlockKind::GrassPath), - "End Gateway" => Some(BlockKind::EndGateway), - "Repeating Command Block" => Some(BlockKind::RepeatingCommandBlock), - "Chain Command Block" => Some(BlockKind::ChainCommandBlock), - "Frosted Ice" => Some(BlockKind::FrostedIce), - "Magma Block" => Some(BlockKind::MagmaBlock), - "Nether Wart Block" => Some(BlockKind::NetherWartBlock), - "Red Nether Bricks" => Some(BlockKind::RedNetherBricks), - "Bone Block" => Some(BlockKind::BoneBlock), - "Structure Void" => Some(BlockKind::StructureVoid), - "Observer" => Some(BlockKind::Observer), - "Shulker Box" => Some(BlockKind::ShulkerBox), - "White Shulker Box" => Some(BlockKind::WhiteShulkerBox), - "Orange Shulker Box" => Some(BlockKind::OrangeShulkerBox), - "Magenta Shulker Box" => Some(BlockKind::MagentaShulkerBox), - "Light Blue Shulker Box" => Some(BlockKind::LightBlueShulkerBox), - "Yellow Shulker Box" => Some(BlockKind::YellowShulkerBox), - "Lime Shulker Box" => Some(BlockKind::LimeShulkerBox), - "Pink Shulker Box" => Some(BlockKind::PinkShulkerBox), - "Gray Shulker Box" => Some(BlockKind::GrayShulkerBox), - "Light Gray Shulker Box" => Some(BlockKind::LightGrayShulkerBox), - "Cyan Shulker Box" => Some(BlockKind::CyanShulkerBox), - "Purple Shulker Box" => Some(BlockKind::PurpleShulkerBox), - "Blue Shulker Box" => Some(BlockKind::BlueShulkerBox), - "Brown Shulker Box" => Some(BlockKind::BrownShulkerBox), - "Green Shulker Box" => Some(BlockKind::GreenShulkerBox), - "Red Shulker Box" => Some(BlockKind::RedShulkerBox), - "Black Shulker Box" => Some(BlockKind::BlackShulkerBox), - "White Glazed Terracotta" => Some(BlockKind::WhiteGlazedTerracotta), - "Orange Glazed Terracotta" => Some(BlockKind::OrangeGlazedTerracotta), - "Magenta Glazed Terracotta" => Some(BlockKind::MagentaGlazedTerracotta), - "Light Blue Glazed Terracotta" => Some(BlockKind::LightBlueGlazedTerracotta), - "Yellow Glazed Terracotta" => Some(BlockKind::YellowGlazedTerracotta), - "Lime Glazed Terracotta" => Some(BlockKind::LimeGlazedTerracotta), - "Pink Glazed Terracotta" => Some(BlockKind::PinkGlazedTerracotta), - "Gray Glazed Terracotta" => Some(BlockKind::GrayGlazedTerracotta), - "Light Gray Glazed Terracotta" => Some(BlockKind::LightGrayGlazedTerracotta), - "Cyan Glazed Terracotta" => Some(BlockKind::CyanGlazedTerracotta), - "Purple Glazed Terracotta" => Some(BlockKind::PurpleGlazedTerracotta), - "Blue Glazed Terracotta" => Some(BlockKind::BlueGlazedTerracotta), - "Brown Glazed Terracotta" => Some(BlockKind::BrownGlazedTerracotta), - "Green Glazed Terracotta" => Some(BlockKind::GreenGlazedTerracotta), - "Red Glazed Terracotta" => Some(BlockKind::RedGlazedTerracotta), - "Black Glazed Terracotta" => Some(BlockKind::BlackGlazedTerracotta), - "White Concrete" => Some(BlockKind::WhiteConcrete), - "Orange Concrete" => Some(BlockKind::OrangeConcrete), - "Magenta Concrete" => Some(BlockKind::MagentaConcrete), - "Light Blue Concrete" => Some(BlockKind::LightBlueConcrete), - "Yellow Concrete" => Some(BlockKind::YellowConcrete), - "Lime Concrete" => Some(BlockKind::LimeConcrete), - "Pink Concrete" => Some(BlockKind::PinkConcrete), - "Gray Concrete" => Some(BlockKind::GrayConcrete), - "Light Gray Concrete" => Some(BlockKind::LightGrayConcrete), - "Cyan Concrete" => Some(BlockKind::CyanConcrete), - "Purple Concrete" => Some(BlockKind::PurpleConcrete), - "Blue Concrete" => Some(BlockKind::BlueConcrete), - "Brown Concrete" => Some(BlockKind::BrownConcrete), - "Green Concrete" => Some(BlockKind::GreenConcrete), - "Red Concrete" => Some(BlockKind::RedConcrete), - "Black Concrete" => Some(BlockKind::BlackConcrete), - "White Concrete Powder" => Some(BlockKind::WhiteConcretePowder), - "Orange Concrete Powder" => Some(BlockKind::OrangeConcretePowder), - "Magenta Concrete Powder" => Some(BlockKind::MagentaConcretePowder), - "Light Blue Concrete Powder" => Some(BlockKind::LightBlueConcretePowder), - "Yellow Concrete Powder" => Some(BlockKind::YellowConcretePowder), - "Lime Concrete Powder" => Some(BlockKind::LimeConcretePowder), - "Pink Concrete Powder" => Some(BlockKind::PinkConcretePowder), - "Gray Concrete Powder" => Some(BlockKind::GrayConcretePowder), - "Light Gray Concrete Powder" => Some(BlockKind::LightGrayConcretePowder), - "Cyan Concrete Powder" => Some(BlockKind::CyanConcretePowder), - "Purple Concrete Powder" => Some(BlockKind::PurpleConcretePowder), - "Blue Concrete Powder" => Some(BlockKind::BlueConcretePowder), - "Brown Concrete Powder" => Some(BlockKind::BrownConcretePowder), - "Green Concrete Powder" => Some(BlockKind::GreenConcretePowder), - "Red Concrete Powder" => Some(BlockKind::RedConcretePowder), - "Black Concrete Powder" => Some(BlockKind::BlackConcretePowder), - "Kelp" => Some(BlockKind::Kelp), - "Kelp Plant" => Some(BlockKind::KelpPlant), - "Dried Kelp Block" => Some(BlockKind::DriedKelpBlock), - "Turtle Egg" => Some(BlockKind::TurtleEgg), - "Dead Tube Coral Block" => Some(BlockKind::DeadTubeCoralBlock), - "Dead Brain Coral Block" => Some(BlockKind::DeadBrainCoralBlock), - "Dead Bubble Coral Block" => Some(BlockKind::DeadBubbleCoralBlock), - "Dead Fire Coral Block" => Some(BlockKind::DeadFireCoralBlock), - "Dead Horn Coral Block" => Some(BlockKind::DeadHornCoralBlock), - "Tube Coral Block" => Some(BlockKind::TubeCoralBlock), - "Brain Coral Block" => Some(BlockKind::BrainCoralBlock), - "Bubble Coral Block" => Some(BlockKind::BubbleCoralBlock), - "Fire Coral Block" => Some(BlockKind::FireCoralBlock), - "Horn Coral Block" => Some(BlockKind::HornCoralBlock), - "Dead Tube Coral" => Some(BlockKind::DeadTubeCoral), - "Dead Brain Coral" => Some(BlockKind::DeadBrainCoral), - "Dead Bubble Coral" => Some(BlockKind::DeadBubbleCoral), - "Dead Fire Coral" => Some(BlockKind::DeadFireCoral), - "Dead Horn Coral" => Some(BlockKind::DeadHornCoral), - "Tube Coral" => Some(BlockKind::TubeCoral), - "Brain Coral" => Some(BlockKind::BrainCoral), - "Bubble Coral" => Some(BlockKind::BubbleCoral), - "Fire Coral" => Some(BlockKind::FireCoral), - "Horn Coral" => Some(BlockKind::HornCoral), - "Dead Tube Coral Fan" => Some(BlockKind::DeadTubeCoralFan), - "Dead Brain Coral Fan" => Some(BlockKind::DeadBrainCoralFan), - "Dead Bubble Coral Fan" => Some(BlockKind::DeadBubbleCoralFan), - "Dead Fire Coral Fan" => Some(BlockKind::DeadFireCoralFan), - "Dead Horn Coral Fan" => Some(BlockKind::DeadHornCoralFan), - "Tube Coral Fan" => Some(BlockKind::TubeCoralFan), - "Brain Coral Fan" => Some(BlockKind::BrainCoralFan), - "Bubble Coral Fan" => Some(BlockKind::BubbleCoralFan), - "Fire Coral Fan" => Some(BlockKind::FireCoralFan), - "Horn Coral Fan" => Some(BlockKind::HornCoralFan), - "Dead Tube Coral Wall Fan" => Some(BlockKind::DeadTubeCoralWallFan), - "Dead Brain Coral Wall Fan" => Some(BlockKind::DeadBrainCoralWallFan), - "Dead Bubble Coral Wall Fan" => Some(BlockKind::DeadBubbleCoralWallFan), - "Dead Fire Coral Wall Fan" => Some(BlockKind::DeadFireCoralWallFan), - "Dead Horn Coral Wall Fan" => Some(BlockKind::DeadHornCoralWallFan), - "Tube Coral Wall Fan" => Some(BlockKind::TubeCoralWallFan), - "Brain Coral Wall Fan" => Some(BlockKind::BrainCoralWallFan), - "Bubble Coral Wall Fan" => Some(BlockKind::BubbleCoralWallFan), - "Fire Coral Wall Fan" => Some(BlockKind::FireCoralWallFan), - "Horn Coral Wall Fan" => Some(BlockKind::HornCoralWallFan), - "Sea Pickle" => Some(BlockKind::SeaPickle), - "Blue Ice" => Some(BlockKind::BlueIce), - "Conduit" => Some(BlockKind::Conduit), - "Bamboo Shoot" => Some(BlockKind::BambooSapling), - "Bamboo" => Some(BlockKind::Bamboo), - "Potted Bamboo" => Some(BlockKind::PottedBamboo), - "Void Air" => Some(BlockKind::VoidAir), - "Cave Air" => Some(BlockKind::CaveAir), - "Bubble Column" => Some(BlockKind::BubbleColumn), - "Polished Granite Stairs" => Some(BlockKind::PolishedGraniteStairs), - "Smooth Red Sandstone Stairs" => Some(BlockKind::SmoothRedSandstoneStairs), - "Mossy Stone Brick Stairs" => Some(BlockKind::MossyStoneBrickStairs), - "Polished Diorite Stairs" => Some(BlockKind::PolishedDioriteStairs), - "Mossy Cobblestone Stairs" => Some(BlockKind::MossyCobblestoneStairs), - "End Stone Brick Stairs" => Some(BlockKind::EndStoneBrickStairs), - "Stone Stairs" => Some(BlockKind::StoneStairs), - "Smooth Sandstone Stairs" => Some(BlockKind::SmoothSandstoneStairs), - "Smooth Quartz Stairs" => Some(BlockKind::SmoothQuartzStairs), - "Granite Stairs" => Some(BlockKind::GraniteStairs), - "Andesite Stairs" => Some(BlockKind::AndesiteStairs), - "Red Nether Brick Stairs" => Some(BlockKind::RedNetherBrickStairs), - "Polished Andesite Stairs" => Some(BlockKind::PolishedAndesiteStairs), - "Diorite Stairs" => Some(BlockKind::DioriteStairs), - "Polished Granite Slab" => Some(BlockKind::PolishedGraniteSlab), - "Smooth Red Sandstone Slab" => Some(BlockKind::SmoothRedSandstoneSlab), - "Mossy Stone Brick Slab" => Some(BlockKind::MossyStoneBrickSlab), - "Polished Diorite Slab" => Some(BlockKind::PolishedDioriteSlab), - "Mossy Cobblestone Slab" => Some(BlockKind::MossyCobblestoneSlab), - "End Stone Brick Slab" => Some(BlockKind::EndStoneBrickSlab), - "Smooth Sandstone Slab" => Some(BlockKind::SmoothSandstoneSlab), - "Smooth Quartz Slab" => Some(BlockKind::SmoothQuartzSlab), - "Granite Slab" => Some(BlockKind::GraniteSlab), - "Andesite Slab" => Some(BlockKind::AndesiteSlab), - "Red Nether Brick Slab" => Some(BlockKind::RedNetherBrickSlab), - "Polished Andesite Slab" => Some(BlockKind::PolishedAndesiteSlab), - "Diorite Slab" => Some(BlockKind::DioriteSlab), - "Brick Wall" => Some(BlockKind::BrickWall), - "Prismarine Wall" => Some(BlockKind::PrismarineWall), - "Red Sandstone Wall" => Some(BlockKind::RedSandstoneWall), - "Mossy Stone Brick Wall" => Some(BlockKind::MossyStoneBrickWall), - "Granite Wall" => Some(BlockKind::GraniteWall), - "Stone Brick Wall" => Some(BlockKind::StoneBrickWall), - "Nether Brick Wall" => Some(BlockKind::NetherBrickWall), - "Andesite Wall" => Some(BlockKind::AndesiteWall), - "Red Nether Brick Wall" => Some(BlockKind::RedNetherBrickWall), - "Sandstone Wall" => Some(BlockKind::SandstoneWall), - "End Stone Brick Wall" => Some(BlockKind::EndStoneBrickWall), - "Diorite Wall" => Some(BlockKind::DioriteWall), - "Scaffolding" => Some(BlockKind::Scaffolding), - "Loom" => Some(BlockKind::Loom), - "Barrel" => Some(BlockKind::Barrel), - "Smoker" => Some(BlockKind::Smoker), - "Blast Furnace" => Some(BlockKind::BlastFurnace), - "Cartography Table" => Some(BlockKind::CartographyTable), - "Fletching Table" => Some(BlockKind::FletchingTable), - "Grindstone" => Some(BlockKind::Grindstone), - "Lectern" => Some(BlockKind::Lectern), - "Smithing Table" => Some(BlockKind::SmithingTable), - "Stonecutter" => Some(BlockKind::Stonecutter), - "Bell" => Some(BlockKind::Bell), - "Lantern" => Some(BlockKind::Lantern), - "Soul Lantern" => Some(BlockKind::SoulLantern), - "Campfire" => Some(BlockKind::Campfire), - "Soul Campfire" => Some(BlockKind::SoulCampfire), - "Sweet Berry Bush" => Some(BlockKind::SweetBerryBush), - "Warped Stem" => Some(BlockKind::WarpedStem), - "Stripped Warped Stem" => Some(BlockKind::StrippedWarpedStem), - "Warped Hyphae" => Some(BlockKind::WarpedHyphae), - "Stripped Warped Hyphae" => Some(BlockKind::StrippedWarpedHyphae), - "Warped Nylium" => Some(BlockKind::WarpedNylium), - "Warped Fungus" => Some(BlockKind::WarpedFungus), - "Warped Wart Block" => Some(BlockKind::WarpedWartBlock), - "Warped Roots" => Some(BlockKind::WarpedRoots), - "Nether Sprouts" => Some(BlockKind::NetherSprouts), - "Crimson Stem" => Some(BlockKind::CrimsonStem), - "Stripped Crimson Stem" => Some(BlockKind::StrippedCrimsonStem), - "Crimson Hyphae" => Some(BlockKind::CrimsonHyphae), - "Stripped Crimson Hyphae" => Some(BlockKind::StrippedCrimsonHyphae), - "Crimson Nylium" => Some(BlockKind::CrimsonNylium), - "Crimson Fungus" => Some(BlockKind::CrimsonFungus), - "Shroomlight" => Some(BlockKind::Shroomlight), - "Weeping Vines" => Some(BlockKind::WeepingVines), - "Weeping Vines Plant" => Some(BlockKind::WeepingVinesPlant), - "Twisting Vines" => Some(BlockKind::TwistingVines), - "Twisting Vines Plant" => Some(BlockKind::TwistingVinesPlant), - "Crimson Roots" => Some(BlockKind::CrimsonRoots), - "Crimson Planks" => Some(BlockKind::CrimsonPlanks), - "Warped Planks" => Some(BlockKind::WarpedPlanks), - "Crimson Slab" => Some(BlockKind::CrimsonSlab), - "Warped Slab" => Some(BlockKind::WarpedSlab), - "Crimson Pressure Plate" => Some(BlockKind::CrimsonPressurePlate), - "Warped Pressure Plate" => Some(BlockKind::WarpedPressurePlate), - "Crimson Fence" => Some(BlockKind::CrimsonFence), - "Warped Fence" => Some(BlockKind::WarpedFence), - "Crimson Trapdoor" => Some(BlockKind::CrimsonTrapdoor), - "Warped Trapdoor" => Some(BlockKind::WarpedTrapdoor), - "Crimson Fence Gate" => Some(BlockKind::CrimsonFenceGate), - "Warped Fence Gate" => Some(BlockKind::WarpedFenceGate), - "Crimson Stairs" => Some(BlockKind::CrimsonStairs), - "Warped Stairs" => Some(BlockKind::WarpedStairs), - "Crimson Button" => Some(BlockKind::CrimsonButton), - "Warped Button" => Some(BlockKind::WarpedButton), - "Crimson Door" => Some(BlockKind::CrimsonDoor), - "Warped Door" => Some(BlockKind::WarpedDoor), - "Crimson Sign" => Some(BlockKind::CrimsonSign), - "Warped Sign" => Some(BlockKind::WarpedSign), - "Crimson Wall Sign" => Some(BlockKind::CrimsonWallSign), - "Warped Wall Sign" => Some(BlockKind::WarpedWallSign), - "Structure Block" => Some(BlockKind::StructureBlock), - "Jigsaw Block" => Some(BlockKind::Jigsaw), - "Composter" => Some(BlockKind::Composter), - "Target" => Some(BlockKind::Target), - "Bee Nest" => Some(BlockKind::BeeNest), - "Beehive" => Some(BlockKind::Beehive), - "Honey Block" => Some(BlockKind::HoneyBlock), - "Honeycomb Block" => Some(BlockKind::HoneycombBlock), - "Block of Netherite" => Some(BlockKind::NetheriteBlock), - "Ancient Debris" => Some(BlockKind::AncientDebris), - "Crying Obsidian" => Some(BlockKind::CryingObsidian), - "Respawn Anchor" => Some(BlockKind::RespawnAnchor), - "Potted Crimson Fungus" => Some(BlockKind::PottedCrimsonFungus), - "Potted Warped Fungus" => Some(BlockKind::PottedWarpedFungus), - "Potted Crimson Roots" => Some(BlockKind::PottedCrimsonRoots), - "Potted Warped Roots" => Some(BlockKind::PottedWarpedRoots), - "Lodestone" => Some(BlockKind::Lodestone), - "Blackstone" => Some(BlockKind::Blackstone), - "Blackstone Stairs" => Some(BlockKind::BlackstoneStairs), - "Blackstone Wall" => Some(BlockKind::BlackstoneWall), - "Blackstone Slab" => Some(BlockKind::BlackstoneSlab), - "Polished Blackstone" => Some(BlockKind::PolishedBlackstone), - "Polished Blackstone Bricks" => Some(BlockKind::PolishedBlackstoneBricks), - "Cracked Polished Blackstone Bricks" => { + #[doc = "Gets a `BlockKind` by its `namespaced_id`."] + #[inline] + pub fn from_namespaced_id(namespaced_id: &str) -> Option { + match namespaced_id { + "minecraft:air" => Some(BlockKind::Air), + "minecraft:stone" => Some(BlockKind::Stone), + "minecraft:granite" => Some(BlockKind::Granite), + "minecraft:polished_granite" => Some(BlockKind::PolishedGranite), + "minecraft:diorite" => Some(BlockKind::Diorite), + "minecraft:polished_diorite" => Some(BlockKind::PolishedDiorite), + "minecraft:andesite" => Some(BlockKind::Andesite), + "minecraft:polished_andesite" => Some(BlockKind::PolishedAndesite), + "minecraft:grass_block" => Some(BlockKind::GrassBlock), + "minecraft:dirt" => Some(BlockKind::Dirt), + "minecraft:coarse_dirt" => Some(BlockKind::CoarseDirt), + "minecraft:podzol" => Some(BlockKind::Podzol), + "minecraft:cobblestone" => Some(BlockKind::Cobblestone), + "minecraft:oak_planks" => Some(BlockKind::OakPlanks), + "minecraft:spruce_planks" => Some(BlockKind::SprucePlanks), + "minecraft:birch_planks" => Some(BlockKind::BirchPlanks), + "minecraft:jungle_planks" => Some(BlockKind::JunglePlanks), + "minecraft:acacia_planks" => Some(BlockKind::AcaciaPlanks), + "minecraft:dark_oak_planks" => Some(BlockKind::DarkOakPlanks), + "minecraft:oak_sapling" => Some(BlockKind::OakSapling), + "minecraft:spruce_sapling" => Some(BlockKind::SpruceSapling), + "minecraft:birch_sapling" => Some(BlockKind::BirchSapling), + "minecraft:jungle_sapling" => Some(BlockKind::JungleSapling), + "minecraft:acacia_sapling" => Some(BlockKind::AcaciaSapling), + "minecraft:dark_oak_sapling" => Some(BlockKind::DarkOakSapling), + "minecraft:bedrock" => Some(BlockKind::Bedrock), + "minecraft:water" => Some(BlockKind::Water), + "minecraft:lava" => Some(BlockKind::Lava), + "minecraft:sand" => Some(BlockKind::Sand), + "minecraft:red_sand" => Some(BlockKind::RedSand), + "minecraft:gravel" => Some(BlockKind::Gravel), + "minecraft:gold_ore" => Some(BlockKind::GoldOre), + "minecraft:deepslate_gold_ore" => Some(BlockKind::DeepslateGoldOre), + "minecraft:iron_ore" => Some(BlockKind::IronOre), + "minecraft:deepslate_iron_ore" => Some(BlockKind::DeepslateIronOre), + "minecraft:coal_ore" => Some(BlockKind::CoalOre), + "minecraft:deepslate_coal_ore" => Some(BlockKind::DeepslateCoalOre), + "minecraft:nether_gold_ore" => Some(BlockKind::NetherGoldOre), + "minecraft:oak_log" => Some(BlockKind::OakLog), + "minecraft:spruce_log" => Some(BlockKind::SpruceLog), + "minecraft:birch_log" => Some(BlockKind::BirchLog), + "minecraft:jungle_log" => Some(BlockKind::JungleLog), + "minecraft:acacia_log" => Some(BlockKind::AcaciaLog), + "minecraft:dark_oak_log" => Some(BlockKind::DarkOakLog), + "minecraft:stripped_spruce_log" => Some(BlockKind::StrippedSpruceLog), + "minecraft:stripped_birch_log" => Some(BlockKind::StrippedBirchLog), + "minecraft:stripped_jungle_log" => Some(BlockKind::StrippedJungleLog), + "minecraft:stripped_acacia_log" => Some(BlockKind::StrippedAcaciaLog), + "minecraft:stripped_dark_oak_log" => Some(BlockKind::StrippedDarkOakLog), + "minecraft:stripped_oak_log" => Some(BlockKind::StrippedOakLog), + "minecraft:oak_wood" => Some(BlockKind::OakWood), + "minecraft:spruce_wood" => Some(BlockKind::SpruceWood), + "minecraft:birch_wood" => Some(BlockKind::BirchWood), + "minecraft:jungle_wood" => Some(BlockKind::JungleWood), + "minecraft:acacia_wood" => Some(BlockKind::AcaciaWood), + "minecraft:dark_oak_wood" => Some(BlockKind::DarkOakWood), + "minecraft:stripped_oak_wood" => Some(BlockKind::StrippedOakWood), + "minecraft:stripped_spruce_wood" => Some(BlockKind::StrippedSpruceWood), + "minecraft:stripped_birch_wood" => Some(BlockKind::StrippedBirchWood), + "minecraft:stripped_jungle_wood" => Some(BlockKind::StrippedJungleWood), + "minecraft:stripped_acacia_wood" => Some(BlockKind::StrippedAcaciaWood), + "minecraft:stripped_dark_oak_wood" => Some(BlockKind::StrippedDarkOakWood), + "minecraft:oak_leaves" => Some(BlockKind::OakLeaves), + "minecraft:spruce_leaves" => Some(BlockKind::SpruceLeaves), + "minecraft:birch_leaves" => Some(BlockKind::BirchLeaves), + "minecraft:jungle_leaves" => Some(BlockKind::JungleLeaves), + "minecraft:acacia_leaves" => Some(BlockKind::AcaciaLeaves), + "minecraft:dark_oak_leaves" => Some(BlockKind::DarkOakLeaves), + "minecraft:azalea_leaves" => Some(BlockKind::AzaleaLeaves), + "minecraft:flowering_azalea_leaves" => Some(BlockKind::FloweringAzaleaLeaves), + "minecraft:sponge" => Some(BlockKind::Sponge), + "minecraft:wet_sponge" => Some(BlockKind::WetSponge), + "minecraft:glass" => Some(BlockKind::Glass), + "minecraft:lapis_ore" => Some(BlockKind::LapisOre), + "minecraft:deepslate_lapis_ore" => Some(BlockKind::DeepslateLapisOre), + "minecraft:lapis_block" => Some(BlockKind::LapisBlock), + "minecraft:dispenser" => Some(BlockKind::Dispenser), + "minecraft:sandstone" => Some(BlockKind::Sandstone), + "minecraft:chiseled_sandstone" => Some(BlockKind::ChiseledSandstone), + "minecraft:cut_sandstone" => Some(BlockKind::CutSandstone), + "minecraft:note_block" => Some(BlockKind::NoteBlock), + "minecraft:white_bed" => Some(BlockKind::WhiteBed), + "minecraft:orange_bed" => Some(BlockKind::OrangeBed), + "minecraft:magenta_bed" => Some(BlockKind::MagentaBed), + "minecraft:light_blue_bed" => Some(BlockKind::LightBlueBed), + "minecraft:yellow_bed" => Some(BlockKind::YellowBed), + "minecraft:lime_bed" => Some(BlockKind::LimeBed), + "minecraft:pink_bed" => Some(BlockKind::PinkBed), + "minecraft:gray_bed" => Some(BlockKind::GrayBed), + "minecraft:light_gray_bed" => Some(BlockKind::LightGrayBed), + "minecraft:cyan_bed" => Some(BlockKind::CyanBed), + "minecraft:purple_bed" => Some(BlockKind::PurpleBed), + "minecraft:blue_bed" => Some(BlockKind::BlueBed), + "minecraft:brown_bed" => Some(BlockKind::BrownBed), + "minecraft:green_bed" => Some(BlockKind::GreenBed), + "minecraft:red_bed" => Some(BlockKind::RedBed), + "minecraft:black_bed" => Some(BlockKind::BlackBed), + "minecraft:powered_rail" => Some(BlockKind::PoweredRail), + "minecraft:detector_rail" => Some(BlockKind::DetectorRail), + "minecraft:sticky_piston" => Some(BlockKind::StickyPiston), + "minecraft:cobweb" => Some(BlockKind::Cobweb), + "minecraft:grass" => Some(BlockKind::Grass), + "minecraft:fern" => Some(BlockKind::Fern), + "minecraft:dead_bush" => Some(BlockKind::DeadBush), + "minecraft:seagrass" => Some(BlockKind::Seagrass), + "minecraft:tall_seagrass" => Some(BlockKind::TallSeagrass), + "minecraft:piston" => Some(BlockKind::Piston), + "minecraft:piston_head" => Some(BlockKind::PistonHead), + "minecraft:white_wool" => Some(BlockKind::WhiteWool), + "minecraft:orange_wool" => Some(BlockKind::OrangeWool), + "minecraft:magenta_wool" => Some(BlockKind::MagentaWool), + "minecraft:light_blue_wool" => Some(BlockKind::LightBlueWool), + "minecraft:yellow_wool" => Some(BlockKind::YellowWool), + "minecraft:lime_wool" => Some(BlockKind::LimeWool), + "minecraft:pink_wool" => Some(BlockKind::PinkWool), + "minecraft:gray_wool" => Some(BlockKind::GrayWool), + "minecraft:light_gray_wool" => Some(BlockKind::LightGrayWool), + "minecraft:cyan_wool" => Some(BlockKind::CyanWool), + "minecraft:purple_wool" => Some(BlockKind::PurpleWool), + "minecraft:blue_wool" => Some(BlockKind::BlueWool), + "minecraft:brown_wool" => Some(BlockKind::BrownWool), + "minecraft:green_wool" => Some(BlockKind::GreenWool), + "minecraft:red_wool" => Some(BlockKind::RedWool), + "minecraft:black_wool" => Some(BlockKind::BlackWool), + "minecraft:moving_piston" => Some(BlockKind::MovingPiston), + "minecraft:dandelion" => Some(BlockKind::Dandelion), + "minecraft:poppy" => Some(BlockKind::Poppy), + "minecraft:blue_orchid" => Some(BlockKind::BlueOrchid), + "minecraft:allium" => Some(BlockKind::Allium), + "minecraft:azure_bluet" => Some(BlockKind::AzureBluet), + "minecraft:red_tulip" => Some(BlockKind::RedTulip), + "minecraft:orange_tulip" => Some(BlockKind::OrangeTulip), + "minecraft:white_tulip" => Some(BlockKind::WhiteTulip), + "minecraft:pink_tulip" => Some(BlockKind::PinkTulip), + "minecraft:oxeye_daisy" => Some(BlockKind::OxeyeDaisy), + "minecraft:cornflower" => Some(BlockKind::Cornflower), + "minecraft:wither_rose" => Some(BlockKind::WitherRose), + "minecraft:lily_of_the_valley" => Some(BlockKind::LilyOfTheValley), + "minecraft:brown_mushroom" => Some(BlockKind::BrownMushroom), + "minecraft:red_mushroom" => Some(BlockKind::RedMushroom), + "minecraft:gold_block" => Some(BlockKind::GoldBlock), + "minecraft:iron_block" => Some(BlockKind::IronBlock), + "minecraft:bricks" => Some(BlockKind::Bricks), + "minecraft:tnt" => Some(BlockKind::Tnt), + "minecraft:bookshelf" => Some(BlockKind::Bookshelf), + "minecraft:mossy_cobblestone" => Some(BlockKind::MossyCobblestone), + "minecraft:obsidian" => Some(BlockKind::Obsidian), + "minecraft:torch" => Some(BlockKind::Torch), + "minecraft:wall_torch" => Some(BlockKind::WallTorch), + "minecraft:fire" => Some(BlockKind::Fire), + "minecraft:soul_fire" => Some(BlockKind::SoulFire), + "minecraft:spawner" => Some(BlockKind::Spawner), + "minecraft:oak_stairs" => Some(BlockKind::OakStairs), + "minecraft:chest" => Some(BlockKind::Chest), + "minecraft:redstone_wire" => Some(BlockKind::RedstoneWire), + "minecraft:diamond_ore" => Some(BlockKind::DiamondOre), + "minecraft:deepslate_diamond_ore" => Some(BlockKind::DeepslateDiamondOre), + "minecraft:diamond_block" => Some(BlockKind::DiamondBlock), + "minecraft:crafting_table" => Some(BlockKind::CraftingTable), + "minecraft:wheat" => Some(BlockKind::Wheat), + "minecraft:farmland" => Some(BlockKind::Farmland), + "minecraft:furnace" => Some(BlockKind::Furnace), + "minecraft:oak_sign" => Some(BlockKind::OakSign), + "minecraft:spruce_sign" => Some(BlockKind::SpruceSign), + "minecraft:birch_sign" => Some(BlockKind::BirchSign), + "minecraft:acacia_sign" => Some(BlockKind::AcaciaSign), + "minecraft:jungle_sign" => Some(BlockKind::JungleSign), + "minecraft:dark_oak_sign" => Some(BlockKind::DarkOakSign), + "minecraft:oak_door" => Some(BlockKind::OakDoor), + "minecraft:ladder" => Some(BlockKind::Ladder), + "minecraft:rail" => Some(BlockKind::Rail), + "minecraft:cobblestone_stairs" => Some(BlockKind::CobblestoneStairs), + "minecraft:oak_wall_sign" => Some(BlockKind::OakWallSign), + "minecraft:spruce_wall_sign" => Some(BlockKind::SpruceWallSign), + "minecraft:birch_wall_sign" => Some(BlockKind::BirchWallSign), + "minecraft:acacia_wall_sign" => Some(BlockKind::AcaciaWallSign), + "minecraft:jungle_wall_sign" => Some(BlockKind::JungleWallSign), + "minecraft:dark_oak_wall_sign" => Some(BlockKind::DarkOakWallSign), + "minecraft:lever" => Some(BlockKind::Lever), + "minecraft:stone_pressure_plate" => Some(BlockKind::StonePressurePlate), + "minecraft:iron_door" => Some(BlockKind::IronDoor), + "minecraft:oak_pressure_plate" => Some(BlockKind::OakPressurePlate), + "minecraft:spruce_pressure_plate" => Some(BlockKind::SprucePressurePlate), + "minecraft:birch_pressure_plate" => Some(BlockKind::BirchPressurePlate), + "minecraft:jungle_pressure_plate" => Some(BlockKind::JunglePressurePlate), + "minecraft:acacia_pressure_plate" => Some(BlockKind::AcaciaPressurePlate), + "minecraft:dark_oak_pressure_plate" => Some(BlockKind::DarkOakPressurePlate), + "minecraft:redstone_ore" => Some(BlockKind::RedstoneOre), + "minecraft:deepslate_redstone_ore" => Some(BlockKind::DeepslateRedstoneOre), + "minecraft:redstone_torch" => Some(BlockKind::RedstoneTorch), + "minecraft:redstone_wall_torch" => Some(BlockKind::RedstoneWallTorch), + "minecraft:stone_button" => Some(BlockKind::StoneButton), + "minecraft:snow" => Some(BlockKind::Snow), + "minecraft:ice" => Some(BlockKind::Ice), + "minecraft:snow_block" => Some(BlockKind::SnowBlock), + "minecraft:cactus" => Some(BlockKind::Cactus), + "minecraft:clay" => Some(BlockKind::Clay), + "minecraft:sugar_cane" => Some(BlockKind::SugarCane), + "minecraft:jukebox" => Some(BlockKind::Jukebox), + "minecraft:oak_fence" => Some(BlockKind::OakFence), + "minecraft:pumpkin" => Some(BlockKind::Pumpkin), + "minecraft:netherrack" => Some(BlockKind::Netherrack), + "minecraft:soul_sand" => Some(BlockKind::SoulSand), + "minecraft:soul_soil" => Some(BlockKind::SoulSoil), + "minecraft:basalt" => Some(BlockKind::Basalt), + "minecraft:polished_basalt" => Some(BlockKind::PolishedBasalt), + "minecraft:soul_torch" => Some(BlockKind::SoulTorch), + "minecraft:soul_wall_torch" => Some(BlockKind::SoulWallTorch), + "minecraft:glowstone" => Some(BlockKind::Glowstone), + "minecraft:nether_portal" => Some(BlockKind::NetherPortal), + "minecraft:carved_pumpkin" => Some(BlockKind::CarvedPumpkin), + "minecraft:jack_o_lantern" => Some(BlockKind::JackOLantern), + "minecraft:cake" => Some(BlockKind::Cake), + "minecraft:repeater" => Some(BlockKind::Repeater), + "minecraft:white_stained_glass" => Some(BlockKind::WhiteStainedGlass), + "minecraft:orange_stained_glass" => Some(BlockKind::OrangeStainedGlass), + "minecraft:magenta_stained_glass" => Some(BlockKind::MagentaStainedGlass), + "minecraft:light_blue_stained_glass" => Some(BlockKind::LightBlueStainedGlass), + "minecraft:yellow_stained_glass" => Some(BlockKind::YellowStainedGlass), + "minecraft:lime_stained_glass" => Some(BlockKind::LimeStainedGlass), + "minecraft:pink_stained_glass" => Some(BlockKind::PinkStainedGlass), + "minecraft:gray_stained_glass" => Some(BlockKind::GrayStainedGlass), + "minecraft:light_gray_stained_glass" => Some(BlockKind::LightGrayStainedGlass), + "minecraft:cyan_stained_glass" => Some(BlockKind::CyanStainedGlass), + "minecraft:purple_stained_glass" => Some(BlockKind::PurpleStainedGlass), + "minecraft:blue_stained_glass" => Some(BlockKind::BlueStainedGlass), + "minecraft:brown_stained_glass" => Some(BlockKind::BrownStainedGlass), + "minecraft:green_stained_glass" => Some(BlockKind::GreenStainedGlass), + "minecraft:red_stained_glass" => Some(BlockKind::RedStainedGlass), + "minecraft:black_stained_glass" => Some(BlockKind::BlackStainedGlass), + "minecraft:oak_trapdoor" => Some(BlockKind::OakTrapdoor), + "minecraft:spruce_trapdoor" => Some(BlockKind::SpruceTrapdoor), + "minecraft:birch_trapdoor" => Some(BlockKind::BirchTrapdoor), + "minecraft:jungle_trapdoor" => Some(BlockKind::JungleTrapdoor), + "minecraft:acacia_trapdoor" => Some(BlockKind::AcaciaTrapdoor), + "minecraft:dark_oak_trapdoor" => Some(BlockKind::DarkOakTrapdoor), + "minecraft:stone_bricks" => Some(BlockKind::StoneBricks), + "minecraft:mossy_stone_bricks" => Some(BlockKind::MossyStoneBricks), + "minecraft:cracked_stone_bricks" => Some(BlockKind::CrackedStoneBricks), + "minecraft:chiseled_stone_bricks" => Some(BlockKind::ChiseledStoneBricks), + "minecraft:infested_stone" => Some(BlockKind::InfestedStone), + "minecraft:infested_cobblestone" => Some(BlockKind::InfestedCobblestone), + "minecraft:infested_stone_bricks" => Some(BlockKind::InfestedStoneBricks), + "minecraft:infested_mossy_stone_bricks" => Some(BlockKind::InfestedMossyStoneBricks), + "minecraft:infested_cracked_stone_bricks" => { + Some(BlockKind::InfestedCrackedStoneBricks) + } + "minecraft:infested_chiseled_stone_bricks" => { + Some(BlockKind::InfestedChiseledStoneBricks) + } + "minecraft:brown_mushroom_block" => Some(BlockKind::BrownMushroomBlock), + "minecraft:red_mushroom_block" => Some(BlockKind::RedMushroomBlock), + "minecraft:mushroom_stem" => Some(BlockKind::MushroomStem), + "minecraft:iron_bars" => Some(BlockKind::IronBars), + "minecraft:chain" => Some(BlockKind::Chain), + "minecraft:glass_pane" => Some(BlockKind::GlassPane), + "minecraft:melon" => Some(BlockKind::Melon), + "minecraft:attached_pumpkin_stem" => Some(BlockKind::AttachedPumpkinStem), + "minecraft:attached_melon_stem" => Some(BlockKind::AttachedMelonStem), + "minecraft:pumpkin_stem" => Some(BlockKind::PumpkinStem), + "minecraft:melon_stem" => Some(BlockKind::MelonStem), + "minecraft:vine" => Some(BlockKind::Vine), + "minecraft:glow_lichen" => Some(BlockKind::GlowLichen), + "minecraft:oak_fence_gate" => Some(BlockKind::OakFenceGate), + "minecraft:brick_stairs" => Some(BlockKind::BrickStairs), + "minecraft:stone_brick_stairs" => Some(BlockKind::StoneBrickStairs), + "minecraft:mycelium" => Some(BlockKind::Mycelium), + "minecraft:lily_pad" => Some(BlockKind::LilyPad), + "minecraft:nether_bricks" => Some(BlockKind::NetherBricks), + "minecraft:nether_brick_fence" => Some(BlockKind::NetherBrickFence), + "minecraft:nether_brick_stairs" => Some(BlockKind::NetherBrickStairs), + "minecraft:nether_wart" => Some(BlockKind::NetherWart), + "minecraft:enchanting_table" => Some(BlockKind::EnchantingTable), + "minecraft:brewing_stand" => Some(BlockKind::BrewingStand), + "minecraft:cauldron" => Some(BlockKind::Cauldron), + "minecraft:water_cauldron" => Some(BlockKind::WaterCauldron), + "minecraft:lava_cauldron" => Some(BlockKind::LavaCauldron), + "minecraft:powder_snow_cauldron" => Some(BlockKind::PowderSnowCauldron), + "minecraft:end_portal" => Some(BlockKind::EndPortal), + "minecraft:end_portal_frame" => Some(BlockKind::EndPortalFrame), + "minecraft:end_stone" => Some(BlockKind::EndStone), + "minecraft:dragon_egg" => Some(BlockKind::DragonEgg), + "minecraft:redstone_lamp" => Some(BlockKind::RedstoneLamp), + "minecraft:cocoa" => Some(BlockKind::Cocoa), + "minecraft:sandstone_stairs" => Some(BlockKind::SandstoneStairs), + "minecraft:emerald_ore" => Some(BlockKind::EmeraldOre), + "minecraft:deepslate_emerald_ore" => Some(BlockKind::DeepslateEmeraldOre), + "minecraft:ender_chest" => Some(BlockKind::EnderChest), + "minecraft:tripwire_hook" => Some(BlockKind::TripwireHook), + "minecraft:tripwire" => Some(BlockKind::Tripwire), + "minecraft:emerald_block" => Some(BlockKind::EmeraldBlock), + "minecraft:spruce_stairs" => Some(BlockKind::SpruceStairs), + "minecraft:birch_stairs" => Some(BlockKind::BirchStairs), + "minecraft:jungle_stairs" => Some(BlockKind::JungleStairs), + "minecraft:command_block" => Some(BlockKind::CommandBlock), + "minecraft:beacon" => Some(BlockKind::Beacon), + "minecraft:cobblestone_wall" => Some(BlockKind::CobblestoneWall), + "minecraft:mossy_cobblestone_wall" => Some(BlockKind::MossyCobblestoneWall), + "minecraft:flower_pot" => Some(BlockKind::FlowerPot), + "minecraft:potted_oak_sapling" => Some(BlockKind::PottedOakSapling), + "minecraft:potted_spruce_sapling" => Some(BlockKind::PottedSpruceSapling), + "minecraft:potted_birch_sapling" => Some(BlockKind::PottedBirchSapling), + "minecraft:potted_jungle_sapling" => Some(BlockKind::PottedJungleSapling), + "minecraft:potted_acacia_sapling" => Some(BlockKind::PottedAcaciaSapling), + "minecraft:potted_dark_oak_sapling" => Some(BlockKind::PottedDarkOakSapling), + "minecraft:potted_fern" => Some(BlockKind::PottedFern), + "minecraft:potted_dandelion" => Some(BlockKind::PottedDandelion), + "minecraft:potted_poppy" => Some(BlockKind::PottedPoppy), + "minecraft:potted_blue_orchid" => Some(BlockKind::PottedBlueOrchid), + "minecraft:potted_allium" => Some(BlockKind::PottedAllium), + "minecraft:potted_azure_bluet" => Some(BlockKind::PottedAzureBluet), + "minecraft:potted_red_tulip" => Some(BlockKind::PottedRedTulip), + "minecraft:potted_orange_tulip" => Some(BlockKind::PottedOrangeTulip), + "minecraft:potted_white_tulip" => Some(BlockKind::PottedWhiteTulip), + "minecraft:potted_pink_tulip" => Some(BlockKind::PottedPinkTulip), + "minecraft:potted_oxeye_daisy" => Some(BlockKind::PottedOxeyeDaisy), + "minecraft:potted_cornflower" => Some(BlockKind::PottedCornflower), + "minecraft:potted_lily_of_the_valley" => Some(BlockKind::PottedLilyOfTheValley), + "minecraft:potted_wither_rose" => Some(BlockKind::PottedWitherRose), + "minecraft:potted_red_mushroom" => Some(BlockKind::PottedRedMushroom), + "minecraft:potted_brown_mushroom" => Some(BlockKind::PottedBrownMushroom), + "minecraft:potted_dead_bush" => Some(BlockKind::PottedDeadBush), + "minecraft:potted_cactus" => Some(BlockKind::PottedCactus), + "minecraft:carrots" => Some(BlockKind::Carrots), + "minecraft:potatoes" => Some(BlockKind::Potatoes), + "minecraft:oak_button" => Some(BlockKind::OakButton), + "minecraft:spruce_button" => Some(BlockKind::SpruceButton), + "minecraft:birch_button" => Some(BlockKind::BirchButton), + "minecraft:jungle_button" => Some(BlockKind::JungleButton), + "minecraft:acacia_button" => Some(BlockKind::AcaciaButton), + "minecraft:dark_oak_button" => Some(BlockKind::DarkOakButton), + "minecraft:skeleton_skull" => Some(BlockKind::SkeletonSkull), + "minecraft:skeleton_wall_skull" => Some(BlockKind::SkeletonWallSkull), + "minecraft:wither_skeleton_skull" => Some(BlockKind::WitherSkeletonSkull), + "minecraft:wither_skeleton_wall_skull" => Some(BlockKind::WitherSkeletonWallSkull), + "minecraft:zombie_head" => Some(BlockKind::ZombieHead), + "minecraft:zombie_wall_head" => Some(BlockKind::ZombieWallHead), + "minecraft:player_head" => Some(BlockKind::PlayerHead), + "minecraft:player_wall_head" => Some(BlockKind::PlayerWallHead), + "minecraft:creeper_head" => Some(BlockKind::CreeperHead), + "minecraft:creeper_wall_head" => Some(BlockKind::CreeperWallHead), + "minecraft:dragon_head" => Some(BlockKind::DragonHead), + "minecraft:dragon_wall_head" => Some(BlockKind::DragonWallHead), + "minecraft:anvil" => Some(BlockKind::Anvil), + "minecraft:chipped_anvil" => Some(BlockKind::ChippedAnvil), + "minecraft:damaged_anvil" => Some(BlockKind::DamagedAnvil), + "minecraft:trapped_chest" => Some(BlockKind::TrappedChest), + "minecraft:light_weighted_pressure_plate" => { + Some(BlockKind::LightWeightedPressurePlate) + } + "minecraft:heavy_weighted_pressure_plate" => { + Some(BlockKind::HeavyWeightedPressurePlate) + } + "minecraft:comparator" => Some(BlockKind::Comparator), + "minecraft:daylight_detector" => Some(BlockKind::DaylightDetector), + "minecraft:redstone_block" => Some(BlockKind::RedstoneBlock), + "minecraft:nether_quartz_ore" => Some(BlockKind::NetherQuartzOre), + "minecraft:hopper" => Some(BlockKind::Hopper), + "minecraft:quartz_block" => Some(BlockKind::QuartzBlock), + "minecraft:chiseled_quartz_block" => Some(BlockKind::ChiseledQuartzBlock), + "minecraft:quartz_pillar" => Some(BlockKind::QuartzPillar), + "minecraft:quartz_stairs" => Some(BlockKind::QuartzStairs), + "minecraft:activator_rail" => Some(BlockKind::ActivatorRail), + "minecraft:dropper" => Some(BlockKind::Dropper), + "minecraft:white_terracotta" => Some(BlockKind::WhiteTerracotta), + "minecraft:orange_terracotta" => Some(BlockKind::OrangeTerracotta), + "minecraft:magenta_terracotta" => Some(BlockKind::MagentaTerracotta), + "minecraft:light_blue_terracotta" => Some(BlockKind::LightBlueTerracotta), + "minecraft:yellow_terracotta" => Some(BlockKind::YellowTerracotta), + "minecraft:lime_terracotta" => Some(BlockKind::LimeTerracotta), + "minecraft:pink_terracotta" => Some(BlockKind::PinkTerracotta), + "minecraft:gray_terracotta" => Some(BlockKind::GrayTerracotta), + "minecraft:light_gray_terracotta" => Some(BlockKind::LightGrayTerracotta), + "minecraft:cyan_terracotta" => Some(BlockKind::CyanTerracotta), + "minecraft:purple_terracotta" => Some(BlockKind::PurpleTerracotta), + "minecraft:blue_terracotta" => Some(BlockKind::BlueTerracotta), + "minecraft:brown_terracotta" => Some(BlockKind::BrownTerracotta), + "minecraft:green_terracotta" => Some(BlockKind::GreenTerracotta), + "minecraft:red_terracotta" => Some(BlockKind::RedTerracotta), + "minecraft:black_terracotta" => Some(BlockKind::BlackTerracotta), + "minecraft:white_stained_glass_pane" => Some(BlockKind::WhiteStainedGlassPane), + "minecraft:orange_stained_glass_pane" => Some(BlockKind::OrangeStainedGlassPane), + "minecraft:magenta_stained_glass_pane" => Some(BlockKind::MagentaStainedGlassPane), + "minecraft:light_blue_stained_glass_pane" => Some(BlockKind::LightBlueStainedGlassPane), + "minecraft:yellow_stained_glass_pane" => Some(BlockKind::YellowStainedGlassPane), + "minecraft:lime_stained_glass_pane" => Some(BlockKind::LimeStainedGlassPane), + "minecraft:pink_stained_glass_pane" => Some(BlockKind::PinkStainedGlassPane), + "minecraft:gray_stained_glass_pane" => Some(BlockKind::GrayStainedGlassPane), + "minecraft:light_gray_stained_glass_pane" => Some(BlockKind::LightGrayStainedGlassPane), + "minecraft:cyan_stained_glass_pane" => Some(BlockKind::CyanStainedGlassPane), + "minecraft:purple_stained_glass_pane" => Some(BlockKind::PurpleStainedGlassPane), + "minecraft:blue_stained_glass_pane" => Some(BlockKind::BlueStainedGlassPane), + "minecraft:brown_stained_glass_pane" => Some(BlockKind::BrownStainedGlassPane), + "minecraft:green_stained_glass_pane" => Some(BlockKind::GreenStainedGlassPane), + "minecraft:red_stained_glass_pane" => Some(BlockKind::RedStainedGlassPane), + "minecraft:black_stained_glass_pane" => Some(BlockKind::BlackStainedGlassPane), + "minecraft:acacia_stairs" => Some(BlockKind::AcaciaStairs), + "minecraft:dark_oak_stairs" => Some(BlockKind::DarkOakStairs), + "minecraft:slime_block" => Some(BlockKind::SlimeBlock), + "minecraft:barrier" => Some(BlockKind::Barrier), + "minecraft:light" => Some(BlockKind::Light), + "minecraft:iron_trapdoor" => Some(BlockKind::IronTrapdoor), + "minecraft:prismarine" => Some(BlockKind::Prismarine), + "minecraft:prismarine_bricks" => Some(BlockKind::PrismarineBricks), + "minecraft:dark_prismarine" => Some(BlockKind::DarkPrismarine), + "minecraft:prismarine_stairs" => Some(BlockKind::PrismarineStairs), + "minecraft:prismarine_brick_stairs" => Some(BlockKind::PrismarineBrickStairs), + "minecraft:dark_prismarine_stairs" => Some(BlockKind::DarkPrismarineStairs), + "minecraft:prismarine_slab" => Some(BlockKind::PrismarineSlab), + "minecraft:prismarine_brick_slab" => Some(BlockKind::PrismarineBrickSlab), + "minecraft:dark_prismarine_slab" => Some(BlockKind::DarkPrismarineSlab), + "minecraft:sea_lantern" => Some(BlockKind::SeaLantern), + "minecraft:hay_block" => Some(BlockKind::HayBlock), + "minecraft:white_carpet" => Some(BlockKind::WhiteCarpet), + "minecraft:orange_carpet" => Some(BlockKind::OrangeCarpet), + "minecraft:magenta_carpet" => Some(BlockKind::MagentaCarpet), + "minecraft:light_blue_carpet" => Some(BlockKind::LightBlueCarpet), + "minecraft:yellow_carpet" => Some(BlockKind::YellowCarpet), + "minecraft:lime_carpet" => Some(BlockKind::LimeCarpet), + "minecraft:pink_carpet" => Some(BlockKind::PinkCarpet), + "minecraft:gray_carpet" => Some(BlockKind::GrayCarpet), + "minecraft:light_gray_carpet" => Some(BlockKind::LightGrayCarpet), + "minecraft:cyan_carpet" => Some(BlockKind::CyanCarpet), + "minecraft:purple_carpet" => Some(BlockKind::PurpleCarpet), + "minecraft:blue_carpet" => Some(BlockKind::BlueCarpet), + "minecraft:brown_carpet" => Some(BlockKind::BrownCarpet), + "minecraft:green_carpet" => Some(BlockKind::GreenCarpet), + "minecraft:red_carpet" => Some(BlockKind::RedCarpet), + "minecraft:black_carpet" => Some(BlockKind::BlackCarpet), + "minecraft:terracotta" => Some(BlockKind::Terracotta), + "minecraft:coal_block" => Some(BlockKind::CoalBlock), + "minecraft:packed_ice" => Some(BlockKind::PackedIce), + "minecraft:sunflower" => Some(BlockKind::Sunflower), + "minecraft:lilac" => Some(BlockKind::Lilac), + "minecraft:rose_bush" => Some(BlockKind::RoseBush), + "minecraft:peony" => Some(BlockKind::Peony), + "minecraft:tall_grass" => Some(BlockKind::TallGrass), + "minecraft:large_fern" => Some(BlockKind::LargeFern), + "minecraft:white_banner" => Some(BlockKind::WhiteBanner), + "minecraft:orange_banner" => Some(BlockKind::OrangeBanner), + "minecraft:magenta_banner" => Some(BlockKind::MagentaBanner), + "minecraft:light_blue_banner" => Some(BlockKind::LightBlueBanner), + "minecraft:yellow_banner" => Some(BlockKind::YellowBanner), + "minecraft:lime_banner" => Some(BlockKind::LimeBanner), + "minecraft:pink_banner" => Some(BlockKind::PinkBanner), + "minecraft:gray_banner" => Some(BlockKind::GrayBanner), + "minecraft:light_gray_banner" => Some(BlockKind::LightGrayBanner), + "minecraft:cyan_banner" => Some(BlockKind::CyanBanner), + "minecraft:purple_banner" => Some(BlockKind::PurpleBanner), + "minecraft:blue_banner" => Some(BlockKind::BlueBanner), + "minecraft:brown_banner" => Some(BlockKind::BrownBanner), + "minecraft:green_banner" => Some(BlockKind::GreenBanner), + "minecraft:red_banner" => Some(BlockKind::RedBanner), + "minecraft:black_banner" => Some(BlockKind::BlackBanner), + "minecraft:white_wall_banner" => Some(BlockKind::WhiteWallBanner), + "minecraft:orange_wall_banner" => Some(BlockKind::OrangeWallBanner), + "minecraft:magenta_wall_banner" => Some(BlockKind::MagentaWallBanner), + "minecraft:light_blue_wall_banner" => Some(BlockKind::LightBlueWallBanner), + "minecraft:yellow_wall_banner" => Some(BlockKind::YellowWallBanner), + "minecraft:lime_wall_banner" => Some(BlockKind::LimeWallBanner), + "minecraft:pink_wall_banner" => Some(BlockKind::PinkWallBanner), + "minecraft:gray_wall_banner" => Some(BlockKind::GrayWallBanner), + "minecraft:light_gray_wall_banner" => Some(BlockKind::LightGrayWallBanner), + "minecraft:cyan_wall_banner" => Some(BlockKind::CyanWallBanner), + "minecraft:purple_wall_banner" => Some(BlockKind::PurpleWallBanner), + "minecraft:blue_wall_banner" => Some(BlockKind::BlueWallBanner), + "minecraft:brown_wall_banner" => Some(BlockKind::BrownWallBanner), + "minecraft:green_wall_banner" => Some(BlockKind::GreenWallBanner), + "minecraft:red_wall_banner" => Some(BlockKind::RedWallBanner), + "minecraft:black_wall_banner" => Some(BlockKind::BlackWallBanner), + "minecraft:red_sandstone" => Some(BlockKind::RedSandstone), + "minecraft:chiseled_red_sandstone" => Some(BlockKind::ChiseledRedSandstone), + "minecraft:cut_red_sandstone" => Some(BlockKind::CutRedSandstone), + "minecraft:red_sandstone_stairs" => Some(BlockKind::RedSandstoneStairs), + "minecraft:oak_slab" => Some(BlockKind::OakSlab), + "minecraft:spruce_slab" => Some(BlockKind::SpruceSlab), + "minecraft:birch_slab" => Some(BlockKind::BirchSlab), + "minecraft:jungle_slab" => Some(BlockKind::JungleSlab), + "minecraft:acacia_slab" => Some(BlockKind::AcaciaSlab), + "minecraft:dark_oak_slab" => Some(BlockKind::DarkOakSlab), + "minecraft:stone_slab" => Some(BlockKind::StoneSlab), + "minecraft:smooth_stone_slab" => Some(BlockKind::SmoothStoneSlab), + "minecraft:sandstone_slab" => Some(BlockKind::SandstoneSlab), + "minecraft:cut_sandstone_slab" => Some(BlockKind::CutSandstoneSlab), + "minecraft:petrified_oak_slab" => Some(BlockKind::PetrifiedOakSlab), + "minecraft:cobblestone_slab" => Some(BlockKind::CobblestoneSlab), + "minecraft:brick_slab" => Some(BlockKind::BrickSlab), + "minecraft:stone_brick_slab" => Some(BlockKind::StoneBrickSlab), + "minecraft:nether_brick_slab" => Some(BlockKind::NetherBrickSlab), + "minecraft:quartz_slab" => Some(BlockKind::QuartzSlab), + "minecraft:red_sandstone_slab" => Some(BlockKind::RedSandstoneSlab), + "minecraft:cut_red_sandstone_slab" => Some(BlockKind::CutRedSandstoneSlab), + "minecraft:purpur_slab" => Some(BlockKind::PurpurSlab), + "minecraft:smooth_stone" => Some(BlockKind::SmoothStone), + "minecraft:smooth_sandstone" => Some(BlockKind::SmoothSandstone), + "minecraft:smooth_quartz" => Some(BlockKind::SmoothQuartz), + "minecraft:smooth_red_sandstone" => Some(BlockKind::SmoothRedSandstone), + "minecraft:spruce_fence_gate" => Some(BlockKind::SpruceFenceGate), + "minecraft:birch_fence_gate" => Some(BlockKind::BirchFenceGate), + "minecraft:jungle_fence_gate" => Some(BlockKind::JungleFenceGate), + "minecraft:acacia_fence_gate" => Some(BlockKind::AcaciaFenceGate), + "minecraft:dark_oak_fence_gate" => Some(BlockKind::DarkOakFenceGate), + "minecraft:spruce_fence" => Some(BlockKind::SpruceFence), + "minecraft:birch_fence" => Some(BlockKind::BirchFence), + "minecraft:jungle_fence" => Some(BlockKind::JungleFence), + "minecraft:acacia_fence" => Some(BlockKind::AcaciaFence), + "minecraft:dark_oak_fence" => Some(BlockKind::DarkOakFence), + "minecraft:spruce_door" => Some(BlockKind::SpruceDoor), + "minecraft:birch_door" => Some(BlockKind::BirchDoor), + "minecraft:jungle_door" => Some(BlockKind::JungleDoor), + "minecraft:acacia_door" => Some(BlockKind::AcaciaDoor), + "minecraft:dark_oak_door" => Some(BlockKind::DarkOakDoor), + "minecraft:end_rod" => Some(BlockKind::EndRod), + "minecraft:chorus_plant" => Some(BlockKind::ChorusPlant), + "minecraft:chorus_flower" => Some(BlockKind::ChorusFlower), + "minecraft:purpur_block" => Some(BlockKind::PurpurBlock), + "minecraft:purpur_pillar" => Some(BlockKind::PurpurPillar), + "minecraft:purpur_stairs" => Some(BlockKind::PurpurStairs), + "minecraft:end_stone_bricks" => Some(BlockKind::EndStoneBricks), + "minecraft:beetroots" => Some(BlockKind::Beetroots), + "minecraft:dirt_path" => Some(BlockKind::DirtPath), + "minecraft:end_gateway" => Some(BlockKind::EndGateway), + "minecraft:repeating_command_block" => Some(BlockKind::RepeatingCommandBlock), + "minecraft:chain_command_block" => Some(BlockKind::ChainCommandBlock), + "minecraft:frosted_ice" => Some(BlockKind::FrostedIce), + "minecraft:magma_block" => Some(BlockKind::MagmaBlock), + "minecraft:nether_wart_block" => Some(BlockKind::NetherWartBlock), + "minecraft:red_nether_bricks" => Some(BlockKind::RedNetherBricks), + "minecraft:bone_block" => Some(BlockKind::BoneBlock), + "minecraft:structure_void" => Some(BlockKind::StructureVoid), + "minecraft:observer" => Some(BlockKind::Observer), + "minecraft:shulker_box" => Some(BlockKind::ShulkerBox), + "minecraft:white_shulker_box" => Some(BlockKind::WhiteShulkerBox), + "minecraft:orange_shulker_box" => Some(BlockKind::OrangeShulkerBox), + "minecraft:magenta_shulker_box" => Some(BlockKind::MagentaShulkerBox), + "minecraft:light_blue_shulker_box" => Some(BlockKind::LightBlueShulkerBox), + "minecraft:yellow_shulker_box" => Some(BlockKind::YellowShulkerBox), + "minecraft:lime_shulker_box" => Some(BlockKind::LimeShulkerBox), + "minecraft:pink_shulker_box" => Some(BlockKind::PinkShulkerBox), + "minecraft:gray_shulker_box" => Some(BlockKind::GrayShulkerBox), + "minecraft:light_gray_shulker_box" => Some(BlockKind::LightGrayShulkerBox), + "minecraft:cyan_shulker_box" => Some(BlockKind::CyanShulkerBox), + "minecraft:purple_shulker_box" => Some(BlockKind::PurpleShulkerBox), + "minecraft:blue_shulker_box" => Some(BlockKind::BlueShulkerBox), + "minecraft:brown_shulker_box" => Some(BlockKind::BrownShulkerBox), + "minecraft:green_shulker_box" => Some(BlockKind::GreenShulkerBox), + "minecraft:red_shulker_box" => Some(BlockKind::RedShulkerBox), + "minecraft:black_shulker_box" => Some(BlockKind::BlackShulkerBox), + "minecraft:white_glazed_terracotta" => Some(BlockKind::WhiteGlazedTerracotta), + "minecraft:orange_glazed_terracotta" => Some(BlockKind::OrangeGlazedTerracotta), + "minecraft:magenta_glazed_terracotta" => Some(BlockKind::MagentaGlazedTerracotta), + "minecraft:light_blue_glazed_terracotta" => Some(BlockKind::LightBlueGlazedTerracotta), + "minecraft:yellow_glazed_terracotta" => Some(BlockKind::YellowGlazedTerracotta), + "minecraft:lime_glazed_terracotta" => Some(BlockKind::LimeGlazedTerracotta), + "minecraft:pink_glazed_terracotta" => Some(BlockKind::PinkGlazedTerracotta), + "minecraft:gray_glazed_terracotta" => Some(BlockKind::GrayGlazedTerracotta), + "minecraft:light_gray_glazed_terracotta" => Some(BlockKind::LightGrayGlazedTerracotta), + "minecraft:cyan_glazed_terracotta" => Some(BlockKind::CyanGlazedTerracotta), + "minecraft:purple_glazed_terracotta" => Some(BlockKind::PurpleGlazedTerracotta), + "minecraft:blue_glazed_terracotta" => Some(BlockKind::BlueGlazedTerracotta), + "minecraft:brown_glazed_terracotta" => Some(BlockKind::BrownGlazedTerracotta), + "minecraft:green_glazed_terracotta" => Some(BlockKind::GreenGlazedTerracotta), + "minecraft:red_glazed_terracotta" => Some(BlockKind::RedGlazedTerracotta), + "minecraft:black_glazed_terracotta" => Some(BlockKind::BlackGlazedTerracotta), + "minecraft:white_concrete" => Some(BlockKind::WhiteConcrete), + "minecraft:orange_concrete" => Some(BlockKind::OrangeConcrete), + "minecraft:magenta_concrete" => Some(BlockKind::MagentaConcrete), + "minecraft:light_blue_concrete" => Some(BlockKind::LightBlueConcrete), + "minecraft:yellow_concrete" => Some(BlockKind::YellowConcrete), + "minecraft:lime_concrete" => Some(BlockKind::LimeConcrete), + "minecraft:pink_concrete" => Some(BlockKind::PinkConcrete), + "minecraft:gray_concrete" => Some(BlockKind::GrayConcrete), + "minecraft:light_gray_concrete" => Some(BlockKind::LightGrayConcrete), + "minecraft:cyan_concrete" => Some(BlockKind::CyanConcrete), + "minecraft:purple_concrete" => Some(BlockKind::PurpleConcrete), + "minecraft:blue_concrete" => Some(BlockKind::BlueConcrete), + "minecraft:brown_concrete" => Some(BlockKind::BrownConcrete), + "minecraft:green_concrete" => Some(BlockKind::GreenConcrete), + "minecraft:red_concrete" => Some(BlockKind::RedConcrete), + "minecraft:black_concrete" => Some(BlockKind::BlackConcrete), + "minecraft:white_concrete_powder" => Some(BlockKind::WhiteConcretePowder), + "minecraft:orange_concrete_powder" => Some(BlockKind::OrangeConcretePowder), + "minecraft:magenta_concrete_powder" => Some(BlockKind::MagentaConcretePowder), + "minecraft:light_blue_concrete_powder" => Some(BlockKind::LightBlueConcretePowder), + "minecraft:yellow_concrete_powder" => Some(BlockKind::YellowConcretePowder), + "minecraft:lime_concrete_powder" => Some(BlockKind::LimeConcretePowder), + "minecraft:pink_concrete_powder" => Some(BlockKind::PinkConcretePowder), + "minecraft:gray_concrete_powder" => Some(BlockKind::GrayConcretePowder), + "minecraft:light_gray_concrete_powder" => Some(BlockKind::LightGrayConcretePowder), + "minecraft:cyan_concrete_powder" => Some(BlockKind::CyanConcretePowder), + "minecraft:purple_concrete_powder" => Some(BlockKind::PurpleConcretePowder), + "minecraft:blue_concrete_powder" => Some(BlockKind::BlueConcretePowder), + "minecraft:brown_concrete_powder" => Some(BlockKind::BrownConcretePowder), + "minecraft:green_concrete_powder" => Some(BlockKind::GreenConcretePowder), + "minecraft:red_concrete_powder" => Some(BlockKind::RedConcretePowder), + "minecraft:black_concrete_powder" => Some(BlockKind::BlackConcretePowder), + "minecraft:kelp" => Some(BlockKind::Kelp), + "minecraft:kelp_plant" => Some(BlockKind::KelpPlant), + "minecraft:dried_kelp_block" => Some(BlockKind::DriedKelpBlock), + "minecraft:turtle_egg" => Some(BlockKind::TurtleEgg), + "minecraft:dead_tube_coral_block" => Some(BlockKind::DeadTubeCoralBlock), + "minecraft:dead_brain_coral_block" => Some(BlockKind::DeadBrainCoralBlock), + "minecraft:dead_bubble_coral_block" => Some(BlockKind::DeadBubbleCoralBlock), + "minecraft:dead_fire_coral_block" => Some(BlockKind::DeadFireCoralBlock), + "minecraft:dead_horn_coral_block" => Some(BlockKind::DeadHornCoralBlock), + "minecraft:tube_coral_block" => Some(BlockKind::TubeCoralBlock), + "minecraft:brain_coral_block" => Some(BlockKind::BrainCoralBlock), + "minecraft:bubble_coral_block" => Some(BlockKind::BubbleCoralBlock), + "minecraft:fire_coral_block" => Some(BlockKind::FireCoralBlock), + "minecraft:horn_coral_block" => Some(BlockKind::HornCoralBlock), + "minecraft:dead_tube_coral" => Some(BlockKind::DeadTubeCoral), + "minecraft:dead_brain_coral" => Some(BlockKind::DeadBrainCoral), + "minecraft:dead_bubble_coral" => Some(BlockKind::DeadBubbleCoral), + "minecraft:dead_fire_coral" => Some(BlockKind::DeadFireCoral), + "minecraft:dead_horn_coral" => Some(BlockKind::DeadHornCoral), + "minecraft:tube_coral" => Some(BlockKind::TubeCoral), + "minecraft:brain_coral" => Some(BlockKind::BrainCoral), + "minecraft:bubble_coral" => Some(BlockKind::BubbleCoral), + "minecraft:fire_coral" => Some(BlockKind::FireCoral), + "minecraft:horn_coral" => Some(BlockKind::HornCoral), + "minecraft:dead_tube_coral_fan" => Some(BlockKind::DeadTubeCoralFan), + "minecraft:dead_brain_coral_fan" => Some(BlockKind::DeadBrainCoralFan), + "minecraft:dead_bubble_coral_fan" => Some(BlockKind::DeadBubbleCoralFan), + "minecraft:dead_fire_coral_fan" => Some(BlockKind::DeadFireCoralFan), + "minecraft:dead_horn_coral_fan" => Some(BlockKind::DeadHornCoralFan), + "minecraft:tube_coral_fan" => Some(BlockKind::TubeCoralFan), + "minecraft:brain_coral_fan" => Some(BlockKind::BrainCoralFan), + "minecraft:bubble_coral_fan" => Some(BlockKind::BubbleCoralFan), + "minecraft:fire_coral_fan" => Some(BlockKind::FireCoralFan), + "minecraft:horn_coral_fan" => Some(BlockKind::HornCoralFan), + "minecraft:dead_tube_coral_wall_fan" => Some(BlockKind::DeadTubeCoralWallFan), + "minecraft:dead_brain_coral_wall_fan" => Some(BlockKind::DeadBrainCoralWallFan), + "minecraft:dead_bubble_coral_wall_fan" => Some(BlockKind::DeadBubbleCoralWallFan), + "minecraft:dead_fire_coral_wall_fan" => Some(BlockKind::DeadFireCoralWallFan), + "minecraft:dead_horn_coral_wall_fan" => Some(BlockKind::DeadHornCoralWallFan), + "minecraft:tube_coral_wall_fan" => Some(BlockKind::TubeCoralWallFan), + "minecraft:brain_coral_wall_fan" => Some(BlockKind::BrainCoralWallFan), + "minecraft:bubble_coral_wall_fan" => Some(BlockKind::BubbleCoralWallFan), + "minecraft:fire_coral_wall_fan" => Some(BlockKind::FireCoralWallFan), + "minecraft:horn_coral_wall_fan" => Some(BlockKind::HornCoralWallFan), + "minecraft:sea_pickle" => Some(BlockKind::SeaPickle), + "minecraft:blue_ice" => Some(BlockKind::BlueIce), + "minecraft:conduit" => Some(BlockKind::Conduit), + "minecraft:bamboo_sapling" => Some(BlockKind::BambooSapling), + "minecraft:bamboo" => Some(BlockKind::Bamboo), + "minecraft:potted_bamboo" => Some(BlockKind::PottedBamboo), + "minecraft:void_air" => Some(BlockKind::VoidAir), + "minecraft:cave_air" => Some(BlockKind::CaveAir), + "minecraft:bubble_column" => Some(BlockKind::BubbleColumn), + "minecraft:polished_granite_stairs" => Some(BlockKind::PolishedGraniteStairs), + "minecraft:smooth_red_sandstone_stairs" => Some(BlockKind::SmoothRedSandstoneStairs), + "minecraft:mossy_stone_brick_stairs" => Some(BlockKind::MossyStoneBrickStairs), + "minecraft:polished_diorite_stairs" => Some(BlockKind::PolishedDioriteStairs), + "minecraft:mossy_cobblestone_stairs" => Some(BlockKind::MossyCobblestoneStairs), + "minecraft:end_stone_brick_stairs" => Some(BlockKind::EndStoneBrickStairs), + "minecraft:stone_stairs" => Some(BlockKind::StoneStairs), + "minecraft:smooth_sandstone_stairs" => Some(BlockKind::SmoothSandstoneStairs), + "minecraft:smooth_quartz_stairs" => Some(BlockKind::SmoothQuartzStairs), + "minecraft:granite_stairs" => Some(BlockKind::GraniteStairs), + "minecraft:andesite_stairs" => Some(BlockKind::AndesiteStairs), + "minecraft:red_nether_brick_stairs" => Some(BlockKind::RedNetherBrickStairs), + "minecraft:polished_andesite_stairs" => Some(BlockKind::PolishedAndesiteStairs), + "minecraft:diorite_stairs" => Some(BlockKind::DioriteStairs), + "minecraft:polished_granite_slab" => Some(BlockKind::PolishedGraniteSlab), + "minecraft:smooth_red_sandstone_slab" => Some(BlockKind::SmoothRedSandstoneSlab), + "minecraft:mossy_stone_brick_slab" => Some(BlockKind::MossyStoneBrickSlab), + "minecraft:polished_diorite_slab" => Some(BlockKind::PolishedDioriteSlab), + "minecraft:mossy_cobblestone_slab" => Some(BlockKind::MossyCobblestoneSlab), + "minecraft:end_stone_brick_slab" => Some(BlockKind::EndStoneBrickSlab), + "minecraft:smooth_sandstone_slab" => Some(BlockKind::SmoothSandstoneSlab), + "minecraft:smooth_quartz_slab" => Some(BlockKind::SmoothQuartzSlab), + "minecraft:granite_slab" => Some(BlockKind::GraniteSlab), + "minecraft:andesite_slab" => Some(BlockKind::AndesiteSlab), + "minecraft:red_nether_brick_slab" => Some(BlockKind::RedNetherBrickSlab), + "minecraft:polished_andesite_slab" => Some(BlockKind::PolishedAndesiteSlab), + "minecraft:diorite_slab" => Some(BlockKind::DioriteSlab), + "minecraft:brick_wall" => Some(BlockKind::BrickWall), + "minecraft:prismarine_wall" => Some(BlockKind::PrismarineWall), + "minecraft:red_sandstone_wall" => Some(BlockKind::RedSandstoneWall), + "minecraft:mossy_stone_brick_wall" => Some(BlockKind::MossyStoneBrickWall), + "minecraft:granite_wall" => Some(BlockKind::GraniteWall), + "minecraft:stone_brick_wall" => Some(BlockKind::StoneBrickWall), + "minecraft:nether_brick_wall" => Some(BlockKind::NetherBrickWall), + "minecraft:andesite_wall" => Some(BlockKind::AndesiteWall), + "minecraft:red_nether_brick_wall" => Some(BlockKind::RedNetherBrickWall), + "minecraft:sandstone_wall" => Some(BlockKind::SandstoneWall), + "minecraft:end_stone_brick_wall" => Some(BlockKind::EndStoneBrickWall), + "minecraft:diorite_wall" => Some(BlockKind::DioriteWall), + "minecraft:scaffolding" => Some(BlockKind::Scaffolding), + "minecraft:loom" => Some(BlockKind::Loom), + "minecraft:barrel" => Some(BlockKind::Barrel), + "minecraft:smoker" => Some(BlockKind::Smoker), + "minecraft:blast_furnace" => Some(BlockKind::BlastFurnace), + "minecraft:cartography_table" => Some(BlockKind::CartographyTable), + "minecraft:fletching_table" => Some(BlockKind::FletchingTable), + "minecraft:grindstone" => Some(BlockKind::Grindstone), + "minecraft:lectern" => Some(BlockKind::Lectern), + "minecraft:smithing_table" => Some(BlockKind::SmithingTable), + "minecraft:stonecutter" => Some(BlockKind::Stonecutter), + "minecraft:bell" => Some(BlockKind::Bell), + "minecraft:lantern" => Some(BlockKind::Lantern), + "minecraft:soul_lantern" => Some(BlockKind::SoulLantern), + "minecraft:campfire" => Some(BlockKind::Campfire), + "minecraft:soul_campfire" => Some(BlockKind::SoulCampfire), + "minecraft:sweet_berry_bush" => Some(BlockKind::SweetBerryBush), + "minecraft:warped_stem" => Some(BlockKind::WarpedStem), + "minecraft:stripped_warped_stem" => Some(BlockKind::StrippedWarpedStem), + "minecraft:warped_hyphae" => Some(BlockKind::WarpedHyphae), + "minecraft:stripped_warped_hyphae" => Some(BlockKind::StrippedWarpedHyphae), + "minecraft:warped_nylium" => Some(BlockKind::WarpedNylium), + "minecraft:warped_fungus" => Some(BlockKind::WarpedFungus), + "minecraft:warped_wart_block" => Some(BlockKind::WarpedWartBlock), + "minecraft:warped_roots" => Some(BlockKind::WarpedRoots), + "minecraft:nether_sprouts" => Some(BlockKind::NetherSprouts), + "minecraft:crimson_stem" => Some(BlockKind::CrimsonStem), + "minecraft:stripped_crimson_stem" => Some(BlockKind::StrippedCrimsonStem), + "minecraft:crimson_hyphae" => Some(BlockKind::CrimsonHyphae), + "minecraft:stripped_crimson_hyphae" => Some(BlockKind::StrippedCrimsonHyphae), + "minecraft:crimson_nylium" => Some(BlockKind::CrimsonNylium), + "minecraft:crimson_fungus" => Some(BlockKind::CrimsonFungus), + "minecraft:shroomlight" => Some(BlockKind::Shroomlight), + "minecraft:weeping_vines" => Some(BlockKind::WeepingVines), + "minecraft:weeping_vines_plant" => Some(BlockKind::WeepingVinesPlant), + "minecraft:twisting_vines" => Some(BlockKind::TwistingVines), + "minecraft:twisting_vines_plant" => Some(BlockKind::TwistingVinesPlant), + "minecraft:crimson_roots" => Some(BlockKind::CrimsonRoots), + "minecraft:crimson_planks" => Some(BlockKind::CrimsonPlanks), + "minecraft:warped_planks" => Some(BlockKind::WarpedPlanks), + "minecraft:crimson_slab" => Some(BlockKind::CrimsonSlab), + "minecraft:warped_slab" => Some(BlockKind::WarpedSlab), + "minecraft:crimson_pressure_plate" => Some(BlockKind::CrimsonPressurePlate), + "minecraft:warped_pressure_plate" => Some(BlockKind::WarpedPressurePlate), + "minecraft:crimson_fence" => Some(BlockKind::CrimsonFence), + "minecraft:warped_fence" => Some(BlockKind::WarpedFence), + "minecraft:crimson_trapdoor" => Some(BlockKind::CrimsonTrapdoor), + "minecraft:warped_trapdoor" => Some(BlockKind::WarpedTrapdoor), + "minecraft:crimson_fence_gate" => Some(BlockKind::CrimsonFenceGate), + "minecraft:warped_fence_gate" => Some(BlockKind::WarpedFenceGate), + "minecraft:crimson_stairs" => Some(BlockKind::CrimsonStairs), + "minecraft:warped_stairs" => Some(BlockKind::WarpedStairs), + "minecraft:crimson_button" => Some(BlockKind::CrimsonButton), + "minecraft:warped_button" => Some(BlockKind::WarpedButton), + "minecraft:crimson_door" => Some(BlockKind::CrimsonDoor), + "minecraft:warped_door" => Some(BlockKind::WarpedDoor), + "minecraft:crimson_sign" => Some(BlockKind::CrimsonSign), + "minecraft:warped_sign" => Some(BlockKind::WarpedSign), + "minecraft:crimson_wall_sign" => Some(BlockKind::CrimsonWallSign), + "minecraft:warped_wall_sign" => Some(BlockKind::WarpedWallSign), + "minecraft:structure_block" => Some(BlockKind::StructureBlock), + "minecraft:jigsaw" => Some(BlockKind::Jigsaw), + "minecraft:composter" => Some(BlockKind::Composter), + "minecraft:target" => Some(BlockKind::Target), + "minecraft:bee_nest" => Some(BlockKind::BeeNest), + "minecraft:beehive" => Some(BlockKind::Beehive), + "minecraft:honey_block" => Some(BlockKind::HoneyBlock), + "minecraft:honeycomb_block" => Some(BlockKind::HoneycombBlock), + "minecraft:netherite_block" => Some(BlockKind::NetheriteBlock), + "minecraft:ancient_debris" => Some(BlockKind::AncientDebris), + "minecraft:crying_obsidian" => Some(BlockKind::CryingObsidian), + "minecraft:respawn_anchor" => Some(BlockKind::RespawnAnchor), + "minecraft:potted_crimson_fungus" => Some(BlockKind::PottedCrimsonFungus), + "minecraft:potted_warped_fungus" => Some(BlockKind::PottedWarpedFungus), + "minecraft:potted_crimson_roots" => Some(BlockKind::PottedCrimsonRoots), + "minecraft:potted_warped_roots" => Some(BlockKind::PottedWarpedRoots), + "minecraft:lodestone" => Some(BlockKind::Lodestone), + "minecraft:blackstone" => Some(BlockKind::Blackstone), + "minecraft:blackstone_stairs" => Some(BlockKind::BlackstoneStairs), + "minecraft:blackstone_wall" => Some(BlockKind::BlackstoneWall), + "minecraft:blackstone_slab" => Some(BlockKind::BlackstoneSlab), + "minecraft:polished_blackstone" => Some(BlockKind::PolishedBlackstone), + "minecraft:polished_blackstone_bricks" => Some(BlockKind::PolishedBlackstoneBricks), + "minecraft:cracked_polished_blackstone_bricks" => { Some(BlockKind::CrackedPolishedBlackstoneBricks) } - "Chiseled Polished Blackstone" => Some(BlockKind::ChiseledPolishedBlackstone), - "Polished Blackstone Brick Slab" => Some(BlockKind::PolishedBlackstoneBrickSlab), - "Polished Blackstone Brick Stairs" => Some(BlockKind::PolishedBlackstoneBrickStairs), - "Polished Blackstone Brick Wall" => Some(BlockKind::PolishedBlackstoneBrickWall), - "Gilded Blackstone" => Some(BlockKind::GildedBlackstone), - "Polished Blackstone Stairs" => Some(BlockKind::PolishedBlackstoneStairs), - "Polished Blackstone Slab" => Some(BlockKind::PolishedBlackstoneSlab), - "Polished Blackstone Pressure Plate" => { + "minecraft:chiseled_polished_blackstone" => Some(BlockKind::ChiseledPolishedBlackstone), + "minecraft:polished_blackstone_brick_slab" => { + Some(BlockKind::PolishedBlackstoneBrickSlab) + } + "minecraft:polished_blackstone_brick_stairs" => { + Some(BlockKind::PolishedBlackstoneBrickStairs) + } + "minecraft:polished_blackstone_brick_wall" => { + Some(BlockKind::PolishedBlackstoneBrickWall) + } + "minecraft:gilded_blackstone" => Some(BlockKind::GildedBlackstone), + "minecraft:polished_blackstone_stairs" => Some(BlockKind::PolishedBlackstoneStairs), + "minecraft:polished_blackstone_slab" => Some(BlockKind::PolishedBlackstoneSlab), + "minecraft:polished_blackstone_pressure_plate" => { Some(BlockKind::PolishedBlackstonePressurePlate) } - "Polished Blackstone Button" => Some(BlockKind::PolishedBlackstoneButton), - "Polished Blackstone Wall" => Some(BlockKind::PolishedBlackstoneWall), - "Chiseled Nether Bricks" => Some(BlockKind::ChiseledNetherBricks), - "Cracked Nether Bricks" => Some(BlockKind::CrackedNetherBricks), - "Quartz Bricks" => Some(BlockKind::QuartzBricks), + "minecraft:polished_blackstone_button" => Some(BlockKind::PolishedBlackstoneButton), + "minecraft:polished_blackstone_wall" => Some(BlockKind::PolishedBlackstoneWall), + "minecraft:chiseled_nether_bricks" => Some(BlockKind::ChiseledNetherBricks), + "minecraft:cracked_nether_bricks" => Some(BlockKind::CrackedNetherBricks), + "minecraft:quartz_bricks" => Some(BlockKind::QuartzBricks), + "minecraft:candle" => Some(BlockKind::Candle), + "minecraft:white_candle" => Some(BlockKind::WhiteCandle), + "minecraft:orange_candle" => Some(BlockKind::OrangeCandle), + "minecraft:magenta_candle" => Some(BlockKind::MagentaCandle), + "minecraft:light_blue_candle" => Some(BlockKind::LightBlueCandle), + "minecraft:yellow_candle" => Some(BlockKind::YellowCandle), + "minecraft:lime_candle" => Some(BlockKind::LimeCandle), + "minecraft:pink_candle" => Some(BlockKind::PinkCandle), + "minecraft:gray_candle" => Some(BlockKind::GrayCandle), + "minecraft:light_gray_candle" => Some(BlockKind::LightGrayCandle), + "minecraft:cyan_candle" => Some(BlockKind::CyanCandle), + "minecraft:purple_candle" => Some(BlockKind::PurpleCandle), + "minecraft:blue_candle" => Some(BlockKind::BlueCandle), + "minecraft:brown_candle" => Some(BlockKind::BrownCandle), + "minecraft:green_candle" => Some(BlockKind::GreenCandle), + "minecraft:red_candle" => Some(BlockKind::RedCandle), + "minecraft:black_candle" => Some(BlockKind::BlackCandle), + "minecraft:candle_cake" => Some(BlockKind::CandleCake), + "minecraft:white_candle_cake" => Some(BlockKind::WhiteCandleCake), + "minecraft:orange_candle_cake" => Some(BlockKind::OrangeCandleCake), + "minecraft:magenta_candle_cake" => Some(BlockKind::MagentaCandleCake), + "minecraft:light_blue_candle_cake" => Some(BlockKind::LightBlueCandleCake), + "minecraft:yellow_candle_cake" => Some(BlockKind::YellowCandleCake), + "minecraft:lime_candle_cake" => Some(BlockKind::LimeCandleCake), + "minecraft:pink_candle_cake" => Some(BlockKind::PinkCandleCake), + "minecraft:gray_candle_cake" => Some(BlockKind::GrayCandleCake), + "minecraft:light_gray_candle_cake" => Some(BlockKind::LightGrayCandleCake), + "minecraft:cyan_candle_cake" => Some(BlockKind::CyanCandleCake), + "minecraft:purple_candle_cake" => Some(BlockKind::PurpleCandleCake), + "minecraft:blue_candle_cake" => Some(BlockKind::BlueCandleCake), + "minecraft:brown_candle_cake" => Some(BlockKind::BrownCandleCake), + "minecraft:green_candle_cake" => Some(BlockKind::GreenCandleCake), + "minecraft:red_candle_cake" => Some(BlockKind::RedCandleCake), + "minecraft:black_candle_cake" => Some(BlockKind::BlackCandleCake), + "minecraft:amethyst_block" => Some(BlockKind::AmethystBlock), + "minecraft:budding_amethyst" => Some(BlockKind::BuddingAmethyst), + "minecraft:amethyst_cluster" => Some(BlockKind::AmethystCluster), + "minecraft:large_amethyst_bud" => Some(BlockKind::LargeAmethystBud), + "minecraft:medium_amethyst_bud" => Some(BlockKind::MediumAmethystBud), + "minecraft:small_amethyst_bud" => Some(BlockKind::SmallAmethystBud), + "minecraft:tuff" => Some(BlockKind::Tuff), + "minecraft:calcite" => Some(BlockKind::Calcite), + "minecraft:tinted_glass" => Some(BlockKind::TintedGlass), + "minecraft:powder_snow" => Some(BlockKind::PowderSnow), + "minecraft:sculk_sensor" => Some(BlockKind::SculkSensor), + "minecraft:oxidized_copper" => Some(BlockKind::OxidizedCopper), + "minecraft:weathered_copper" => Some(BlockKind::WeatheredCopper), + "minecraft:exposed_copper" => Some(BlockKind::ExposedCopper), + "minecraft:copper_block" => Some(BlockKind::CopperBlock), + "minecraft:copper_ore" => Some(BlockKind::CopperOre), + "minecraft:deepslate_copper_ore" => Some(BlockKind::DeepslateCopperOre), + "minecraft:oxidized_cut_copper" => Some(BlockKind::OxidizedCutCopper), + "minecraft:weathered_cut_copper" => Some(BlockKind::WeatheredCutCopper), + "minecraft:exposed_cut_copper" => Some(BlockKind::ExposedCutCopper), + "minecraft:cut_copper" => Some(BlockKind::CutCopper), + "minecraft:oxidized_cut_copper_stairs" => Some(BlockKind::OxidizedCutCopperStairs), + "minecraft:weathered_cut_copper_stairs" => Some(BlockKind::WeatheredCutCopperStairs), + "minecraft:exposed_cut_copper_stairs" => Some(BlockKind::ExposedCutCopperStairs), + "minecraft:cut_copper_stairs" => Some(BlockKind::CutCopperStairs), + "minecraft:oxidized_cut_copper_slab" => Some(BlockKind::OxidizedCutCopperSlab), + "minecraft:weathered_cut_copper_slab" => Some(BlockKind::WeatheredCutCopperSlab), + "minecraft:exposed_cut_copper_slab" => Some(BlockKind::ExposedCutCopperSlab), + "minecraft:cut_copper_slab" => Some(BlockKind::CutCopperSlab), + "minecraft:waxed_copper_block" => Some(BlockKind::WaxedCopperBlock), + "minecraft:waxed_weathered_copper" => Some(BlockKind::WaxedWeatheredCopper), + "minecraft:waxed_exposed_copper" => Some(BlockKind::WaxedExposedCopper), + "minecraft:waxed_oxidized_copper" => Some(BlockKind::WaxedOxidizedCopper), + "minecraft:waxed_oxidized_cut_copper" => Some(BlockKind::WaxedOxidizedCutCopper), + "minecraft:waxed_weathered_cut_copper" => Some(BlockKind::WaxedWeatheredCutCopper), + "minecraft:waxed_exposed_cut_copper" => Some(BlockKind::WaxedExposedCutCopper), + "minecraft:waxed_cut_copper" => Some(BlockKind::WaxedCutCopper), + "minecraft:waxed_oxidized_cut_copper_stairs" => { + Some(BlockKind::WaxedOxidizedCutCopperStairs) + } + "minecraft:waxed_weathered_cut_copper_stairs" => { + Some(BlockKind::WaxedWeatheredCutCopperStairs) + } + "minecraft:waxed_exposed_cut_copper_stairs" => { + Some(BlockKind::WaxedExposedCutCopperStairs) + } + "minecraft:waxed_cut_copper_stairs" => Some(BlockKind::WaxedCutCopperStairs), + "minecraft:waxed_oxidized_cut_copper_slab" => { + Some(BlockKind::WaxedOxidizedCutCopperSlab) + } + "minecraft:waxed_weathered_cut_copper_slab" => { + Some(BlockKind::WaxedWeatheredCutCopperSlab) + } + "minecraft:waxed_exposed_cut_copper_slab" => Some(BlockKind::WaxedExposedCutCopperSlab), + "minecraft:waxed_cut_copper_slab" => Some(BlockKind::WaxedCutCopperSlab), + "minecraft:lightning_rod" => Some(BlockKind::LightningRod), + "minecraft:pointed_dripstone" => Some(BlockKind::PointedDripstone), + "minecraft:dripstone_block" => Some(BlockKind::DripstoneBlock), + "minecraft:cave_vines" => Some(BlockKind::CaveVines), + "minecraft:cave_vines_plant" => Some(BlockKind::CaveVinesPlant), + "minecraft:spore_blossom" => Some(BlockKind::SporeBlossom), + "minecraft:azalea" => Some(BlockKind::Azalea), + "minecraft:flowering_azalea" => Some(BlockKind::FloweringAzalea), + "minecraft:moss_carpet" => Some(BlockKind::MossCarpet), + "minecraft:moss_block" => Some(BlockKind::MossBlock), + "minecraft:big_dripleaf" => Some(BlockKind::BigDripleaf), + "minecraft:big_dripleaf_stem" => Some(BlockKind::BigDripleafStem), + "minecraft:small_dripleaf" => Some(BlockKind::SmallDripleaf), + "minecraft:hanging_roots" => Some(BlockKind::HangingRoots), + "minecraft:rooted_dirt" => Some(BlockKind::RootedDirt), + "minecraft:deepslate" => Some(BlockKind::Deepslate), + "minecraft:cobbled_deepslate" => Some(BlockKind::CobbledDeepslate), + "minecraft:cobbled_deepslate_stairs" => Some(BlockKind::CobbledDeepslateStairs), + "minecraft:cobbled_deepslate_slab" => Some(BlockKind::CobbledDeepslateSlab), + "minecraft:cobbled_deepslate_wall" => Some(BlockKind::CobbledDeepslateWall), + "minecraft:polished_deepslate" => Some(BlockKind::PolishedDeepslate), + "minecraft:polished_deepslate_stairs" => Some(BlockKind::PolishedDeepslateStairs), + "minecraft:polished_deepslate_slab" => Some(BlockKind::PolishedDeepslateSlab), + "minecraft:polished_deepslate_wall" => Some(BlockKind::PolishedDeepslateWall), + "minecraft:deepslate_tiles" => Some(BlockKind::DeepslateTiles), + "minecraft:deepslate_tile_stairs" => Some(BlockKind::DeepslateTileStairs), + "minecraft:deepslate_tile_slab" => Some(BlockKind::DeepslateTileSlab), + "minecraft:deepslate_tile_wall" => Some(BlockKind::DeepslateTileWall), + "minecraft:deepslate_bricks" => Some(BlockKind::DeepslateBricks), + "minecraft:deepslate_brick_stairs" => Some(BlockKind::DeepslateBrickStairs), + "minecraft:deepslate_brick_slab" => Some(BlockKind::DeepslateBrickSlab), + "minecraft:deepslate_brick_wall" => Some(BlockKind::DeepslateBrickWall), + "minecraft:chiseled_deepslate" => Some(BlockKind::ChiseledDeepslate), + "minecraft:cracked_deepslate_bricks" => Some(BlockKind::CrackedDeepslateBricks), + "minecraft:cracked_deepslate_tiles" => Some(BlockKind::CrackedDeepslateTiles), + "minecraft:infested_deepslate" => Some(BlockKind::InfestedDeepslate), + "minecraft:smooth_basalt" => Some(BlockKind::SmoothBasalt), + "minecraft:raw_iron_block" => Some(BlockKind::RawIronBlock), + "minecraft:raw_copper_block" => Some(BlockKind::RawCopperBlock), + "minecraft:raw_gold_block" => Some(BlockKind::RawGoldBlock), + "minecraft:potted_azalea_bush" => Some(BlockKind::PottedAzaleaBush), + "minecraft:potted_flowering_azalea_bush" => Some(BlockKind::PottedFloweringAzaleaBush), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `hardness` property of this `BlockKind`. + #[doc = "Returns the `resistance` property of this `BlockKind`."] + #[inline] + pub fn resistance(&self) -> f32 { + match self { + BlockKind::Air => 0f32, + BlockKind::Stone => 6f32, + BlockKind::Granite => 6f32, + BlockKind::PolishedGranite => 6f32, + BlockKind::Diorite => 6f32, + BlockKind::PolishedDiorite => 6f32, + BlockKind::Andesite => 6f32, + BlockKind::PolishedAndesite => 6f32, + BlockKind::GrassBlock => 0.6f32, + BlockKind::Dirt => 0.5f32, + BlockKind::CoarseDirt => 0.5f32, + BlockKind::Podzol => 0.5f32, + BlockKind::Cobblestone => 6f32, + BlockKind::OakPlanks => 3f32, + BlockKind::SprucePlanks => 3f32, + BlockKind::BirchPlanks => 3f32, + BlockKind::JunglePlanks => 3f32, + BlockKind::AcaciaPlanks => 3f32, + BlockKind::DarkOakPlanks => 3f32, + BlockKind::OakSapling => 0f32, + BlockKind::SpruceSapling => 0f32, + BlockKind::BirchSapling => 0f32, + BlockKind::JungleSapling => 0f32, + BlockKind::AcaciaSapling => 0f32, + BlockKind::DarkOakSapling => 0f32, + BlockKind::Bedrock => 3600000f32, + BlockKind::Water => 100f32, + BlockKind::Lava => 100f32, + BlockKind::Sand => 0.5f32, + BlockKind::RedSand => 0.5f32, + BlockKind::Gravel => 0.6f32, + BlockKind::GoldOre => 3f32, + BlockKind::DeepslateGoldOre => 3f32, + BlockKind::IronOre => 3f32, + BlockKind::DeepslateIronOre => 3f32, + BlockKind::CoalOre => 3f32, + BlockKind::DeepslateCoalOre => 3f32, + BlockKind::NetherGoldOre => 3f32, + BlockKind::OakLog => 2f32, + BlockKind::SpruceLog => 2f32, + BlockKind::BirchLog => 2f32, + BlockKind::JungleLog => 2f32, + BlockKind::AcaciaLog => 2f32, + BlockKind::DarkOakLog => 2f32, + BlockKind::StrippedSpruceLog => 2f32, + BlockKind::StrippedBirchLog => 2f32, + BlockKind::StrippedJungleLog => 2f32, + BlockKind::StrippedAcaciaLog => 2f32, + BlockKind::StrippedDarkOakLog => 2f32, + BlockKind::StrippedOakLog => 2f32, + BlockKind::OakWood => 2f32, + BlockKind::SpruceWood => 2f32, + BlockKind::BirchWood => 2f32, + BlockKind::JungleWood => 2f32, + BlockKind::AcaciaWood => 2f32, + BlockKind::DarkOakWood => 2f32, + BlockKind::StrippedOakWood => 2f32, + BlockKind::StrippedSpruceWood => 2f32, + BlockKind::StrippedBirchWood => 2f32, + BlockKind::StrippedJungleWood => 2f32, + BlockKind::StrippedAcaciaWood => 2f32, + BlockKind::StrippedDarkOakWood => 2f32, + BlockKind::OakLeaves => 0.2f32, + BlockKind::SpruceLeaves => 0.2f32, + BlockKind::BirchLeaves => 0.2f32, + BlockKind::JungleLeaves => 0.2f32, + BlockKind::AcaciaLeaves => 0.2f32, + BlockKind::DarkOakLeaves => 0.2f32, + BlockKind::AzaleaLeaves => 0.2f32, + BlockKind::FloweringAzaleaLeaves => 0.2f32, + BlockKind::Sponge => 0.6f32, + BlockKind::WetSponge => 0.6f32, + BlockKind::Glass => 0.3f32, + BlockKind::LapisOre => 3f32, + BlockKind::DeepslateLapisOre => 3f32, + BlockKind::LapisBlock => 3f32, + BlockKind::Dispenser => 3.5f32, + BlockKind::Sandstone => 0.8f32, + BlockKind::ChiseledSandstone => 0.8f32, + BlockKind::CutSandstone => 0.8f32, + BlockKind::NoteBlock => 0.8f32, + BlockKind::WhiteBed => 0.2f32, + BlockKind::OrangeBed => 0.2f32, + BlockKind::MagentaBed => 0.2f32, + BlockKind::LightBlueBed => 0.2f32, + BlockKind::YellowBed => 0.2f32, + BlockKind::LimeBed => 0.2f32, + BlockKind::PinkBed => 0.2f32, + BlockKind::GrayBed => 0.2f32, + BlockKind::LightGrayBed => 0.2f32, + BlockKind::CyanBed => 0.2f32, + BlockKind::PurpleBed => 0.2f32, + BlockKind::BlueBed => 0.2f32, + BlockKind::BrownBed => 0.2f32, + BlockKind::GreenBed => 0.2f32, + BlockKind::RedBed => 0.2f32, + BlockKind::BlackBed => 0.2f32, + BlockKind::PoweredRail => 0.7f32, + BlockKind::DetectorRail => 0.7f32, + BlockKind::StickyPiston => 1.5f32, + BlockKind::Cobweb => 4f32, + BlockKind::Grass => 0f32, + BlockKind::Fern => 0f32, + BlockKind::DeadBush => 0f32, + BlockKind::Seagrass => 0f32, + BlockKind::TallSeagrass => 0f32, + BlockKind::Piston => 1.5f32, + BlockKind::PistonHead => 1.5f32, + BlockKind::WhiteWool => 0.8f32, + BlockKind::OrangeWool => 0.8f32, + BlockKind::MagentaWool => 0.8f32, + BlockKind::LightBlueWool => 0.8f32, + BlockKind::YellowWool => 0.8f32, + BlockKind::LimeWool => 0.8f32, + BlockKind::PinkWool => 0.8f32, + BlockKind::GrayWool => 0.8f32, + BlockKind::LightGrayWool => 0.8f32, + BlockKind::CyanWool => 0.8f32, + BlockKind::PurpleWool => 0.8f32, + BlockKind::BlueWool => 0.8f32, + BlockKind::BrownWool => 0.8f32, + BlockKind::GreenWool => 0.8f32, + BlockKind::RedWool => 0.8f32, + BlockKind::BlackWool => 0.8f32, + BlockKind::MovingPiston => -1f32, + BlockKind::Dandelion => 0f32, + BlockKind::Poppy => 0f32, + BlockKind::BlueOrchid => 0f32, + BlockKind::Allium => 0f32, + BlockKind::AzureBluet => 0f32, + BlockKind::RedTulip => 0f32, + BlockKind::OrangeTulip => 0f32, + BlockKind::WhiteTulip => 0f32, + BlockKind::PinkTulip => 0f32, + BlockKind::OxeyeDaisy => 0f32, + BlockKind::Cornflower => 0f32, + BlockKind::WitherRose => 0f32, + BlockKind::LilyOfTheValley => 0f32, + BlockKind::BrownMushroom => 0f32, + BlockKind::RedMushroom => 0f32, + BlockKind::GoldBlock => 6f32, + BlockKind::IronBlock => 6f32, + BlockKind::Bricks => 6f32, + BlockKind::Tnt => 0f32, + BlockKind::Bookshelf => 1.5f32, + BlockKind::MossyCobblestone => 6f32, + BlockKind::Obsidian => 1200f32, + BlockKind::Torch => 0f32, + BlockKind::WallTorch => 0f32, + BlockKind::Fire => 0f32, + BlockKind::SoulFire => 0f32, + BlockKind::Spawner => 5f32, + BlockKind::OakStairs => 3f32, + BlockKind::Chest => 2.5f32, + BlockKind::RedstoneWire => 0f32, + BlockKind::DiamondOre => 3f32, + BlockKind::DeepslateDiamondOre => 3f32, + BlockKind::DiamondBlock => 6f32, + BlockKind::CraftingTable => 2.5f32, + BlockKind::Wheat => 0f32, + BlockKind::Farmland => 0.6f32, + BlockKind::Furnace => 3.5f32, + BlockKind::OakSign => 1f32, + BlockKind::SpruceSign => 1f32, + BlockKind::BirchSign => 1f32, + BlockKind::AcaciaSign => 1f32, + BlockKind::JungleSign => 1f32, + BlockKind::DarkOakSign => 1f32, + BlockKind::OakDoor => 3f32, + BlockKind::Ladder => 0.4f32, + BlockKind::Rail => 0.7f32, + BlockKind::CobblestoneStairs => 6f32, + BlockKind::OakWallSign => 1f32, + BlockKind::SpruceWallSign => 1f32, + BlockKind::BirchWallSign => 1f32, + BlockKind::AcaciaWallSign => 1f32, + BlockKind::JungleWallSign => 1f32, + BlockKind::DarkOakWallSign => 1f32, + BlockKind::Lever => 0.5f32, + BlockKind::StonePressurePlate => 0.5f32, + BlockKind::IronDoor => 5f32, + BlockKind::OakPressurePlate => 0.5f32, + BlockKind::SprucePressurePlate => 0.5f32, + BlockKind::BirchPressurePlate => 0.5f32, + BlockKind::JunglePressurePlate => 0.5f32, + BlockKind::AcaciaPressurePlate => 0.5f32, + BlockKind::DarkOakPressurePlate => 0.5f32, + BlockKind::RedstoneOre => 3f32, + BlockKind::DeepslateRedstoneOre => 3f32, + BlockKind::RedstoneTorch => 0f32, + BlockKind::RedstoneWallTorch => 0f32, + BlockKind::StoneButton => 0.5f32, + BlockKind::Snow => 0.1f32, + BlockKind::Ice => 0.5f32, + BlockKind::SnowBlock => 0.2f32, + BlockKind::Cactus => 0.4f32, + BlockKind::Clay => 0.6f32, + BlockKind::SugarCane => 0f32, + BlockKind::Jukebox => 6f32, + BlockKind::OakFence => 3f32, + BlockKind::Pumpkin => 1f32, + BlockKind::Netherrack => 0.4f32, + BlockKind::SoulSand => 0.5f32, + BlockKind::SoulSoil => 0.5f32, + BlockKind::Basalt => 4.2f32, + BlockKind::PolishedBasalt => 4.2f32, + BlockKind::SoulTorch => 0f32, + BlockKind::SoulWallTorch => 0f32, + BlockKind::Glowstone => 0.3f32, + BlockKind::NetherPortal => -1f32, + BlockKind::CarvedPumpkin => 1f32, + BlockKind::JackOLantern => 1f32, + BlockKind::Cake => 0.5f32, + BlockKind::Repeater => 0f32, + BlockKind::WhiteStainedGlass => 0.3f32, + BlockKind::OrangeStainedGlass => 0.3f32, + BlockKind::MagentaStainedGlass => 0.3f32, + BlockKind::LightBlueStainedGlass => 0.3f32, + BlockKind::YellowStainedGlass => 0.3f32, + BlockKind::LimeStainedGlass => 0.3f32, + BlockKind::PinkStainedGlass => 0.3f32, + BlockKind::GrayStainedGlass => 0.3f32, + BlockKind::LightGrayStainedGlass => 0.3f32, + BlockKind::CyanStainedGlass => 0.3f32, + BlockKind::PurpleStainedGlass => 0.3f32, + BlockKind::BlueStainedGlass => 0.3f32, + BlockKind::BrownStainedGlass => 0.3f32, + BlockKind::GreenStainedGlass => 0.3f32, + BlockKind::RedStainedGlass => 0.3f32, + BlockKind::BlackStainedGlass => 0.3f32, + BlockKind::OakTrapdoor => 3f32, + BlockKind::SpruceTrapdoor => 3f32, + BlockKind::BirchTrapdoor => 3f32, + BlockKind::JungleTrapdoor => 3f32, + BlockKind::AcaciaTrapdoor => 3f32, + BlockKind::DarkOakTrapdoor => 3f32, + BlockKind::StoneBricks => 6f32, + BlockKind::MossyStoneBricks => 6f32, + BlockKind::CrackedStoneBricks => 6f32, + BlockKind::ChiseledStoneBricks => 6f32, + BlockKind::InfestedStone => 0f32, + BlockKind::InfestedCobblestone => 0f32, + BlockKind::InfestedStoneBricks => 0f32, + BlockKind::InfestedMossyStoneBricks => 0f32, + BlockKind::InfestedCrackedStoneBricks => 0f32, + BlockKind::InfestedChiseledStoneBricks => 0f32, + BlockKind::BrownMushroomBlock => 0.2f32, + BlockKind::RedMushroomBlock => 0.2f32, + BlockKind::MushroomStem => 0.2f32, + BlockKind::IronBars => 6f32, + BlockKind::Chain => 6f32, + BlockKind::GlassPane => 0.3f32, + BlockKind::Melon => 1f32, + BlockKind::AttachedPumpkinStem => 0f32, + BlockKind::AttachedMelonStem => 0f32, + BlockKind::PumpkinStem => 0f32, + BlockKind::MelonStem => 0f32, + BlockKind::Vine => 0.2f32, + BlockKind::GlowLichen => 0.2f32, + BlockKind::OakFenceGate => 3f32, + BlockKind::BrickStairs => 6f32, + BlockKind::StoneBrickStairs => 6f32, + BlockKind::Mycelium => 0.6f32, + BlockKind::LilyPad => 0f32, + BlockKind::NetherBricks => 6f32, + BlockKind::NetherBrickFence => 6f32, + BlockKind::NetherBrickStairs => 6f32, + BlockKind::NetherWart => 0f32, + BlockKind::EnchantingTable => 1200f32, + BlockKind::BrewingStand => 0.5f32, + BlockKind::Cauldron => 2f32, + BlockKind::WaterCauldron => 0f32, + BlockKind::LavaCauldron => 0f32, + BlockKind::PowderSnowCauldron => 0f32, + BlockKind::EndPortal => 3600000f32, + BlockKind::EndPortalFrame => 3600000f32, + BlockKind::EndStone => 9f32, + BlockKind::DragonEgg => 9f32, + BlockKind::RedstoneLamp => 0.3f32, + BlockKind::Cocoa => 3f32, + BlockKind::SandstoneStairs => 0.8f32, + BlockKind::EmeraldOre => 3f32, + BlockKind::DeepslateEmeraldOre => 3f32, + BlockKind::EnderChest => 600f32, + BlockKind::TripwireHook => 0f32, + BlockKind::Tripwire => 0f32, + BlockKind::EmeraldBlock => 6f32, + BlockKind::SpruceStairs => 3f32, + BlockKind::BirchStairs => 3f32, + BlockKind::JungleStairs => 3f32, + BlockKind::CommandBlock => 3600000f32, + BlockKind::Beacon => 3f32, + BlockKind::CobblestoneWall => 6f32, + BlockKind::MossyCobblestoneWall => 6f32, + BlockKind::FlowerPot => 0f32, + BlockKind::PottedOakSapling => 0f32, + BlockKind::PottedSpruceSapling => 0f32, + BlockKind::PottedBirchSapling => 0f32, + BlockKind::PottedJungleSapling => 0f32, + BlockKind::PottedAcaciaSapling => 0f32, + BlockKind::PottedDarkOakSapling => 0f32, + BlockKind::PottedFern => 0f32, + BlockKind::PottedDandelion => 0f32, + BlockKind::PottedPoppy => 0f32, + BlockKind::PottedBlueOrchid => 0f32, + BlockKind::PottedAllium => 0f32, + BlockKind::PottedAzureBluet => 0f32, + BlockKind::PottedRedTulip => 0f32, + BlockKind::PottedOrangeTulip => 0f32, + BlockKind::PottedWhiteTulip => 0f32, + BlockKind::PottedPinkTulip => 0f32, + BlockKind::PottedOxeyeDaisy => 0f32, + BlockKind::PottedCornflower => 0f32, + BlockKind::PottedLilyOfTheValley => 0f32, + BlockKind::PottedWitherRose => 0f32, + BlockKind::PottedRedMushroom => 0f32, + BlockKind::PottedBrownMushroom => 0f32, + BlockKind::PottedDeadBush => 0f32, + BlockKind::PottedCactus => 0f32, + BlockKind::Carrots => 0f32, + BlockKind::Potatoes => 0f32, + BlockKind::OakButton => 0.5f32, + BlockKind::SpruceButton => 0.5f32, + BlockKind::BirchButton => 0.5f32, + BlockKind::JungleButton => 0.5f32, + BlockKind::AcaciaButton => 0.5f32, + BlockKind::DarkOakButton => 0.5f32, + BlockKind::SkeletonSkull => 1f32, + BlockKind::SkeletonWallSkull => 1f32, + BlockKind::WitherSkeletonSkull => 1f32, + BlockKind::WitherSkeletonWallSkull => 1f32, + BlockKind::ZombieHead => 1f32, + BlockKind::ZombieWallHead => 1f32, + BlockKind::PlayerHead => 1f32, + BlockKind::PlayerWallHead => 1f32, + BlockKind::CreeperHead => 1f32, + BlockKind::CreeperWallHead => 1f32, + BlockKind::DragonHead => 1f32, + BlockKind::DragonWallHead => 1f32, + BlockKind::Anvil => 1200f32, + BlockKind::ChippedAnvil => 1200f32, + BlockKind::DamagedAnvil => 1200f32, + BlockKind::TrappedChest => 2.5f32, + BlockKind::LightWeightedPressurePlate => 0.5f32, + BlockKind::HeavyWeightedPressurePlate => 0.5f32, + BlockKind::Comparator => 0f32, + BlockKind::DaylightDetector => 0.2f32, + BlockKind::RedstoneBlock => 6f32, + BlockKind::NetherQuartzOre => 3f32, + BlockKind::Hopper => 4.8f32, + BlockKind::QuartzBlock => 0.8f32, + BlockKind::ChiseledQuartzBlock => 0.8f32, + BlockKind::QuartzPillar => 0.8f32, + BlockKind::QuartzStairs => 0.8f32, + BlockKind::ActivatorRail => 0.7f32, + BlockKind::Dropper => 3.5f32, + BlockKind::WhiteTerracotta => 4.2f32, + BlockKind::OrangeTerracotta => 4.2f32, + BlockKind::MagentaTerracotta => 4.2f32, + BlockKind::LightBlueTerracotta => 4.2f32, + BlockKind::YellowTerracotta => 4.2f32, + BlockKind::LimeTerracotta => 4.2f32, + BlockKind::PinkTerracotta => 4.2f32, + BlockKind::GrayTerracotta => 4.2f32, + BlockKind::LightGrayTerracotta => 4.2f32, + BlockKind::CyanTerracotta => 4.2f32, + BlockKind::PurpleTerracotta => 4.2f32, + BlockKind::BlueTerracotta => 4.2f32, + BlockKind::BrownTerracotta => 4.2f32, + BlockKind::GreenTerracotta => 4.2f32, + BlockKind::RedTerracotta => 4.2f32, + BlockKind::BlackTerracotta => 4.2f32, + BlockKind::WhiteStainedGlassPane => 0.3f32, + BlockKind::OrangeStainedGlassPane => 0.3f32, + BlockKind::MagentaStainedGlassPane => 0.3f32, + BlockKind::LightBlueStainedGlassPane => 0.3f32, + BlockKind::YellowStainedGlassPane => 0.3f32, + BlockKind::LimeStainedGlassPane => 0.3f32, + BlockKind::PinkStainedGlassPane => 0.3f32, + BlockKind::GrayStainedGlassPane => 0.3f32, + BlockKind::LightGrayStainedGlassPane => 0.3f32, + BlockKind::CyanStainedGlassPane => 0.3f32, + BlockKind::PurpleStainedGlassPane => 0.3f32, + BlockKind::BlueStainedGlassPane => 0.3f32, + BlockKind::BrownStainedGlassPane => 0.3f32, + BlockKind::GreenStainedGlassPane => 0.3f32, + BlockKind::RedStainedGlassPane => 0.3f32, + BlockKind::BlackStainedGlassPane => 0.3f32, + BlockKind::AcaciaStairs => 3f32, + BlockKind::DarkOakStairs => 3f32, + BlockKind::SlimeBlock => 0f32, + BlockKind::Barrier => 3600000.8f32, + BlockKind::Light => 3600000.8f32, + BlockKind::IronTrapdoor => 5f32, + BlockKind::Prismarine => 6f32, + BlockKind::PrismarineBricks => 6f32, + BlockKind::DarkPrismarine => 6f32, + BlockKind::PrismarineStairs => 6f32, + BlockKind::PrismarineBrickStairs => 6f32, + BlockKind::DarkPrismarineStairs => 6f32, + BlockKind::PrismarineSlab => 6f32, + BlockKind::PrismarineBrickSlab => 6f32, + BlockKind::DarkPrismarineSlab => 6f32, + BlockKind::SeaLantern => 0.3f32, + BlockKind::HayBlock => 0.5f32, + BlockKind::WhiteCarpet => 0.1f32, + BlockKind::OrangeCarpet => 0.1f32, + BlockKind::MagentaCarpet => 0.1f32, + BlockKind::LightBlueCarpet => 0.1f32, + BlockKind::YellowCarpet => 0.1f32, + BlockKind::LimeCarpet => 0.1f32, + BlockKind::PinkCarpet => 0.1f32, + BlockKind::GrayCarpet => 0.1f32, + BlockKind::LightGrayCarpet => 0.1f32, + BlockKind::CyanCarpet => 0.1f32, + BlockKind::PurpleCarpet => 0.1f32, + BlockKind::BlueCarpet => 0.1f32, + BlockKind::BrownCarpet => 0.1f32, + BlockKind::GreenCarpet => 0.1f32, + BlockKind::RedCarpet => 0.1f32, + BlockKind::BlackCarpet => 0.1f32, + BlockKind::Terracotta => 4.2f32, + BlockKind::CoalBlock => 6f32, + BlockKind::PackedIce => 0.5f32, + BlockKind::Sunflower => 0f32, + BlockKind::Lilac => 0f32, + BlockKind::RoseBush => 0f32, + BlockKind::Peony => 0f32, + BlockKind::TallGrass => 0f32, + BlockKind::LargeFern => 0f32, + BlockKind::WhiteBanner => 1f32, + BlockKind::OrangeBanner => 1f32, + BlockKind::MagentaBanner => 1f32, + BlockKind::LightBlueBanner => 1f32, + BlockKind::YellowBanner => 1f32, + BlockKind::LimeBanner => 1f32, + BlockKind::PinkBanner => 1f32, + BlockKind::GrayBanner => 1f32, + BlockKind::LightGrayBanner => 1f32, + BlockKind::CyanBanner => 1f32, + BlockKind::PurpleBanner => 1f32, + BlockKind::BlueBanner => 1f32, + BlockKind::BrownBanner => 1f32, + BlockKind::GreenBanner => 1f32, + BlockKind::RedBanner => 1f32, + BlockKind::BlackBanner => 1f32, + BlockKind::WhiteWallBanner => 1f32, + BlockKind::OrangeWallBanner => 1f32, + BlockKind::MagentaWallBanner => 1f32, + BlockKind::LightBlueWallBanner => 1f32, + BlockKind::YellowWallBanner => 1f32, + BlockKind::LimeWallBanner => 1f32, + BlockKind::PinkWallBanner => 1f32, + BlockKind::GrayWallBanner => 1f32, + BlockKind::LightGrayWallBanner => 1f32, + BlockKind::CyanWallBanner => 1f32, + BlockKind::PurpleWallBanner => 1f32, + BlockKind::BlueWallBanner => 1f32, + BlockKind::BrownWallBanner => 1f32, + BlockKind::GreenWallBanner => 1f32, + BlockKind::RedWallBanner => 1f32, + BlockKind::BlackWallBanner => 1f32, + BlockKind::RedSandstone => 0.8f32, + BlockKind::ChiseledRedSandstone => 0.8f32, + BlockKind::CutRedSandstone => 0.8f32, + BlockKind::RedSandstoneStairs => 0.8f32, + BlockKind::OakSlab => 3f32, + BlockKind::SpruceSlab => 3f32, + BlockKind::BirchSlab => 3f32, + BlockKind::JungleSlab => 3f32, + BlockKind::AcaciaSlab => 3f32, + BlockKind::DarkOakSlab => 3f32, + BlockKind::StoneSlab => 6f32, + BlockKind::SmoothStoneSlab => 6f32, + BlockKind::SandstoneSlab => 6f32, + BlockKind::CutSandstoneSlab => 6f32, + BlockKind::PetrifiedOakSlab => 6f32, + BlockKind::CobblestoneSlab => 6f32, + BlockKind::BrickSlab => 6f32, + BlockKind::StoneBrickSlab => 6f32, + BlockKind::NetherBrickSlab => 6f32, + BlockKind::QuartzSlab => 6f32, + BlockKind::RedSandstoneSlab => 6f32, + BlockKind::CutRedSandstoneSlab => 6f32, + BlockKind::PurpurSlab => 6f32, + BlockKind::SmoothStone => 6f32, + BlockKind::SmoothSandstone => 6f32, + BlockKind::SmoothQuartz => 6f32, + BlockKind::SmoothRedSandstone => 6f32, + BlockKind::SpruceFenceGate => 3f32, + BlockKind::BirchFenceGate => 3f32, + BlockKind::JungleFenceGate => 3f32, + BlockKind::AcaciaFenceGate => 3f32, + BlockKind::DarkOakFenceGate => 3f32, + BlockKind::SpruceFence => 3f32, + BlockKind::BirchFence => 3f32, + BlockKind::JungleFence => 3f32, + BlockKind::AcaciaFence => 3f32, + BlockKind::DarkOakFence => 3f32, + BlockKind::SpruceDoor => 3f32, + BlockKind::BirchDoor => 3f32, + BlockKind::JungleDoor => 3f32, + BlockKind::AcaciaDoor => 3f32, + BlockKind::DarkOakDoor => 3f32, + BlockKind::EndRod => 0f32, + BlockKind::ChorusPlant => 0.4f32, + BlockKind::ChorusFlower => 0.4f32, + BlockKind::PurpurBlock => 6f32, + BlockKind::PurpurPillar => 6f32, + BlockKind::PurpurStairs => 6f32, + BlockKind::EndStoneBricks => 9f32, + BlockKind::Beetroots => 0f32, + BlockKind::DirtPath => 0.65f32, + BlockKind::EndGateway => 3600000f32, + BlockKind::RepeatingCommandBlock => 3600000f32, + BlockKind::ChainCommandBlock => 3600000f32, + BlockKind::FrostedIce => 0.5f32, + BlockKind::MagmaBlock => 0.5f32, + BlockKind::NetherWartBlock => 1f32, + BlockKind::RedNetherBricks => 6f32, + BlockKind::BoneBlock => 2f32, + BlockKind::StructureVoid => 0f32, + BlockKind::Observer => 3f32, + BlockKind::ShulkerBox => 2f32, + BlockKind::WhiteShulkerBox => 2f32, + BlockKind::OrangeShulkerBox => 2f32, + BlockKind::MagentaShulkerBox => 2f32, + BlockKind::LightBlueShulkerBox => 2f32, + BlockKind::YellowShulkerBox => 2f32, + BlockKind::LimeShulkerBox => 2f32, + BlockKind::PinkShulkerBox => 2f32, + BlockKind::GrayShulkerBox => 2f32, + BlockKind::LightGrayShulkerBox => 2f32, + BlockKind::CyanShulkerBox => 2f32, + BlockKind::PurpleShulkerBox => 2f32, + BlockKind::BlueShulkerBox => 2f32, + BlockKind::BrownShulkerBox => 2f32, + BlockKind::GreenShulkerBox => 2f32, + BlockKind::RedShulkerBox => 2f32, + BlockKind::BlackShulkerBox => 2f32, + BlockKind::WhiteGlazedTerracotta => 1.4f32, + BlockKind::OrangeGlazedTerracotta => 1.4f32, + BlockKind::MagentaGlazedTerracotta => 1.4f32, + BlockKind::LightBlueGlazedTerracotta => 1.4f32, + BlockKind::YellowGlazedTerracotta => 1.4f32, + BlockKind::LimeGlazedTerracotta => 1.4f32, + BlockKind::PinkGlazedTerracotta => 1.4f32, + BlockKind::GrayGlazedTerracotta => 1.4f32, + BlockKind::LightGrayGlazedTerracotta => 1.4f32, + BlockKind::CyanGlazedTerracotta => 1.4f32, + BlockKind::PurpleGlazedTerracotta => 1.4f32, + BlockKind::BlueGlazedTerracotta => 1.4f32, + BlockKind::BrownGlazedTerracotta => 1.4f32, + BlockKind::GreenGlazedTerracotta => 1.4f32, + BlockKind::RedGlazedTerracotta => 1.4f32, + BlockKind::BlackGlazedTerracotta => 1.4f32, + BlockKind::WhiteConcrete => 1.8f32, + BlockKind::OrangeConcrete => 1.8f32, + BlockKind::MagentaConcrete => 1.8f32, + BlockKind::LightBlueConcrete => 1.8f32, + BlockKind::YellowConcrete => 1.8f32, + BlockKind::LimeConcrete => 1.8f32, + BlockKind::PinkConcrete => 1.8f32, + BlockKind::GrayConcrete => 1.8f32, + BlockKind::LightGrayConcrete => 1.8f32, + BlockKind::CyanConcrete => 1.8f32, + BlockKind::PurpleConcrete => 1.8f32, + BlockKind::BlueConcrete => 1.8f32, + BlockKind::BrownConcrete => 1.8f32, + BlockKind::GreenConcrete => 1.8f32, + BlockKind::RedConcrete => 1.8f32, + BlockKind::BlackConcrete => 1.8f32, + BlockKind::WhiteConcretePowder => 0.5f32, + BlockKind::OrangeConcretePowder => 0.5f32, + BlockKind::MagentaConcretePowder => 0.5f32, + BlockKind::LightBlueConcretePowder => 0.5f32, + BlockKind::YellowConcretePowder => 0.5f32, + BlockKind::LimeConcretePowder => 0.5f32, + BlockKind::PinkConcretePowder => 0.5f32, + BlockKind::GrayConcretePowder => 0.5f32, + BlockKind::LightGrayConcretePowder => 0.5f32, + BlockKind::CyanConcretePowder => 0.5f32, + BlockKind::PurpleConcretePowder => 0.5f32, + BlockKind::BlueConcretePowder => 0.5f32, + BlockKind::BrownConcretePowder => 0.5f32, + BlockKind::GreenConcretePowder => 0.5f32, + BlockKind::RedConcretePowder => 0.5f32, + BlockKind::BlackConcretePowder => 0.5f32, + BlockKind::Kelp => 0f32, + BlockKind::KelpPlant => 0f32, + BlockKind::DriedKelpBlock => 2.5f32, + BlockKind::TurtleEgg => 0.5f32, + BlockKind::DeadTubeCoralBlock => 6f32, + BlockKind::DeadBrainCoralBlock => 6f32, + BlockKind::DeadBubbleCoralBlock => 6f32, + BlockKind::DeadFireCoralBlock => 6f32, + BlockKind::DeadHornCoralBlock => 6f32, + BlockKind::TubeCoralBlock => 6f32, + BlockKind::BrainCoralBlock => 6f32, + BlockKind::BubbleCoralBlock => 6f32, + BlockKind::FireCoralBlock => 6f32, + BlockKind::HornCoralBlock => 6f32, + BlockKind::DeadTubeCoral => 0f32, + BlockKind::DeadBrainCoral => 0f32, + BlockKind::DeadBubbleCoral => 0f32, + BlockKind::DeadFireCoral => 0f32, + BlockKind::DeadHornCoral => 0f32, + BlockKind::TubeCoral => 0f32, + BlockKind::BrainCoral => 0f32, + BlockKind::BubbleCoral => 0f32, + BlockKind::FireCoral => 0f32, + BlockKind::HornCoral => 0f32, + BlockKind::DeadTubeCoralFan => 0f32, + BlockKind::DeadBrainCoralFan => 0f32, + BlockKind::DeadBubbleCoralFan => 0f32, + BlockKind::DeadFireCoralFan => 0f32, + BlockKind::DeadHornCoralFan => 0f32, + BlockKind::TubeCoralFan => 0f32, + BlockKind::BrainCoralFan => 0f32, + BlockKind::BubbleCoralFan => 0f32, + BlockKind::FireCoralFan => 0f32, + BlockKind::HornCoralFan => 0f32, + BlockKind::DeadTubeCoralWallFan => 0f32, + BlockKind::DeadBrainCoralWallFan => 0f32, + BlockKind::DeadBubbleCoralWallFan => 0f32, + BlockKind::DeadFireCoralWallFan => 0f32, + BlockKind::DeadHornCoralWallFan => 0f32, + BlockKind::TubeCoralWallFan => 0f32, + BlockKind::BrainCoralWallFan => 0f32, + BlockKind::BubbleCoralWallFan => 0f32, + BlockKind::FireCoralWallFan => 0f32, + BlockKind::HornCoralWallFan => 0f32, + BlockKind::SeaPickle => 0f32, + BlockKind::BlueIce => 2.8f32, + BlockKind::Conduit => 3f32, + BlockKind::BambooSapling => 1f32, + BlockKind::Bamboo => 1f32, + BlockKind::PottedBamboo => 0f32, + BlockKind::VoidAir => 0f32, + BlockKind::CaveAir => 0f32, + BlockKind::BubbleColumn => 0f32, + BlockKind::PolishedGraniteStairs => 6f32, + BlockKind::SmoothRedSandstoneStairs => 6f32, + BlockKind::MossyStoneBrickStairs => 6f32, + BlockKind::PolishedDioriteStairs => 6f32, + BlockKind::MossyCobblestoneStairs => 6f32, + BlockKind::EndStoneBrickStairs => 9f32, + BlockKind::StoneStairs => 6f32, + BlockKind::SmoothSandstoneStairs => 6f32, + BlockKind::SmoothQuartzStairs => 6f32, + BlockKind::GraniteStairs => 6f32, + BlockKind::AndesiteStairs => 6f32, + BlockKind::RedNetherBrickStairs => 6f32, + BlockKind::PolishedAndesiteStairs => 6f32, + BlockKind::DioriteStairs => 6f32, + BlockKind::PolishedGraniteSlab => 6f32, + BlockKind::SmoothRedSandstoneSlab => 6f32, + BlockKind::MossyStoneBrickSlab => 6f32, + BlockKind::PolishedDioriteSlab => 6f32, + BlockKind::MossyCobblestoneSlab => 6f32, + BlockKind::EndStoneBrickSlab => 9f32, + BlockKind::SmoothSandstoneSlab => 6f32, + BlockKind::SmoothQuartzSlab => 6f32, + BlockKind::GraniteSlab => 6f32, + BlockKind::AndesiteSlab => 6f32, + BlockKind::RedNetherBrickSlab => 6f32, + BlockKind::PolishedAndesiteSlab => 6f32, + BlockKind::DioriteSlab => 6f32, + BlockKind::BrickWall => 6f32, + BlockKind::PrismarineWall => 6f32, + BlockKind::RedSandstoneWall => 0.8f32, + BlockKind::MossyStoneBrickWall => 6f32, + BlockKind::GraniteWall => 6f32, + BlockKind::StoneBrickWall => 6f32, + BlockKind::NetherBrickWall => 6f32, + BlockKind::AndesiteWall => 6f32, + BlockKind::RedNetherBrickWall => 6f32, + BlockKind::SandstoneWall => 0.8f32, + BlockKind::EndStoneBrickWall => 9f32, + BlockKind::DioriteWall => 6f32, + BlockKind::Scaffolding => 0f32, + BlockKind::Loom => 2.5f32, + BlockKind::Barrel => 2.5f32, + BlockKind::Smoker => 3.5f32, + BlockKind::BlastFurnace => 3.5f32, + BlockKind::CartographyTable => 2.5f32, + BlockKind::FletchingTable => 2.5f32, + BlockKind::Grindstone => 6f32, + BlockKind::Lectern => 2.5f32, + BlockKind::SmithingTable => 2.5f32, + BlockKind::Stonecutter => 3.5f32, + BlockKind::Bell => 5f32, + BlockKind::Lantern => 3.5f32, + BlockKind::SoulLantern => 3.5f32, + BlockKind::Campfire => 2f32, + BlockKind::SoulCampfire => 2f32, + BlockKind::SweetBerryBush => 0f32, + BlockKind::WarpedStem => 2f32, + BlockKind::StrippedWarpedStem => 2f32, + BlockKind::WarpedHyphae => 2f32, + BlockKind::StrippedWarpedHyphae => 2f32, + BlockKind::WarpedNylium => 0.4f32, + BlockKind::WarpedFungus => 0f32, + BlockKind::WarpedWartBlock => 1f32, + BlockKind::WarpedRoots => 0f32, + BlockKind::NetherSprouts => 0f32, + BlockKind::CrimsonStem => 2f32, + BlockKind::StrippedCrimsonStem => 2f32, + BlockKind::CrimsonHyphae => 2f32, + BlockKind::StrippedCrimsonHyphae => 2f32, + BlockKind::CrimsonNylium => 0.4f32, + BlockKind::CrimsonFungus => 0f32, + BlockKind::Shroomlight => 1f32, + BlockKind::WeepingVines => 0f32, + BlockKind::WeepingVinesPlant => 0f32, + BlockKind::TwistingVines => 0f32, + BlockKind::TwistingVinesPlant => 0f32, + BlockKind::CrimsonRoots => 0f32, + BlockKind::CrimsonPlanks => 3f32, + BlockKind::WarpedPlanks => 3f32, + BlockKind::CrimsonSlab => 3f32, + BlockKind::WarpedSlab => 3f32, + BlockKind::CrimsonPressurePlate => 0.5f32, + BlockKind::WarpedPressurePlate => 0.5f32, + BlockKind::CrimsonFence => 3f32, + BlockKind::WarpedFence => 3f32, + BlockKind::CrimsonTrapdoor => 3f32, + BlockKind::WarpedTrapdoor => 3f32, + BlockKind::CrimsonFenceGate => 3f32, + BlockKind::WarpedFenceGate => 3f32, + BlockKind::CrimsonStairs => 3f32, + BlockKind::WarpedStairs => 3f32, + BlockKind::CrimsonButton => 0.5f32, + BlockKind::WarpedButton => 0.5f32, + BlockKind::CrimsonDoor => 3f32, + BlockKind::WarpedDoor => 3f32, + BlockKind::CrimsonSign => 1f32, + BlockKind::WarpedSign => 1f32, + BlockKind::CrimsonWallSign => 1f32, + BlockKind::WarpedWallSign => 1f32, + BlockKind::StructureBlock => 3600000f32, + BlockKind::Jigsaw => 3600000f32, + BlockKind::Composter => 0.6f32, + BlockKind::Target => 0.5f32, + BlockKind::BeeNest => 0.3f32, + BlockKind::Beehive => 0.6f32, + BlockKind::HoneyBlock => 0f32, + BlockKind::HoneycombBlock => 0.6f32, + BlockKind::NetheriteBlock => 1200f32, + BlockKind::AncientDebris => 1200f32, + BlockKind::CryingObsidian => 1200f32, + BlockKind::RespawnAnchor => 1200f32, + BlockKind::PottedCrimsonFungus => 0f32, + BlockKind::PottedWarpedFungus => 0f32, + BlockKind::PottedCrimsonRoots => 0f32, + BlockKind::PottedWarpedRoots => 0f32, + BlockKind::Lodestone => 3.5f32, + BlockKind::Blackstone => 6f32, + BlockKind::BlackstoneStairs => 6f32, + BlockKind::BlackstoneWall => 6f32, + BlockKind::BlackstoneSlab => 6f32, + BlockKind::PolishedBlackstone => 6f32, + BlockKind::PolishedBlackstoneBricks => 6f32, + BlockKind::CrackedPolishedBlackstoneBricks => 6f32, + BlockKind::ChiseledPolishedBlackstone => 6f32, + BlockKind::PolishedBlackstoneBrickSlab => 6f32, + BlockKind::PolishedBlackstoneBrickStairs => 6f32, + BlockKind::PolishedBlackstoneBrickWall => 6f32, + BlockKind::GildedBlackstone => 6f32, + BlockKind::PolishedBlackstoneStairs => 6f32, + BlockKind::PolishedBlackstoneSlab => 6f32, + BlockKind::PolishedBlackstonePressurePlate => 0.5f32, + BlockKind::PolishedBlackstoneButton => 0.5f32, + BlockKind::PolishedBlackstoneWall => 6f32, + BlockKind::ChiseledNetherBricks => 6f32, + BlockKind::CrackedNetherBricks => 6f32, + BlockKind::QuartzBricks => 0.8f32, + BlockKind::Candle => 0.1f32, + BlockKind::WhiteCandle => 0.1f32, + BlockKind::OrangeCandle => 0.1f32, + BlockKind::MagentaCandle => 0.1f32, + BlockKind::LightBlueCandle => 0.1f32, + BlockKind::YellowCandle => 0.1f32, + BlockKind::LimeCandle => 0.1f32, + BlockKind::PinkCandle => 0.1f32, + BlockKind::GrayCandle => 0.1f32, + BlockKind::LightGrayCandle => 0.1f32, + BlockKind::CyanCandle => 0.1f32, + BlockKind::PurpleCandle => 0.1f32, + BlockKind::BlueCandle => 0.1f32, + BlockKind::BrownCandle => 0.1f32, + BlockKind::GreenCandle => 0.1f32, + BlockKind::RedCandle => 0.1f32, + BlockKind::BlackCandle => 0.1f32, + BlockKind::CandleCake => 0f32, + BlockKind::WhiteCandleCake => 0f32, + BlockKind::OrangeCandleCake => 0f32, + BlockKind::MagentaCandleCake => 0f32, + BlockKind::LightBlueCandleCake => 0f32, + BlockKind::YellowCandleCake => 0f32, + BlockKind::LimeCandleCake => 0f32, + BlockKind::PinkCandleCake => 0f32, + BlockKind::GrayCandleCake => 0f32, + BlockKind::LightGrayCandleCake => 0f32, + BlockKind::CyanCandleCake => 0f32, + BlockKind::PurpleCandleCake => 0f32, + BlockKind::BlueCandleCake => 0f32, + BlockKind::BrownCandleCake => 0f32, + BlockKind::GreenCandleCake => 0f32, + BlockKind::RedCandleCake => 0f32, + BlockKind::BlackCandleCake => 0f32, + BlockKind::AmethystBlock => 1.5f32, + BlockKind::BuddingAmethyst => 1.5f32, + BlockKind::AmethystCluster => 1.5f32, + BlockKind::LargeAmethystBud => 0f32, + BlockKind::MediumAmethystBud => 0f32, + BlockKind::SmallAmethystBud => 0f32, + BlockKind::Tuff => 6f32, + BlockKind::Calcite => 0.75f32, + BlockKind::TintedGlass => 0f32, + BlockKind::PowderSnow => 0.25f32, + BlockKind::SculkSensor => 1.5f32, + BlockKind::OxidizedCopper => 6f32, + BlockKind::WeatheredCopper => 6f32, + BlockKind::ExposedCopper => 6f32, + BlockKind::CopperBlock => 6f32, + BlockKind::CopperOre => 0f32, + BlockKind::DeepslateCopperOre => 3f32, + BlockKind::OxidizedCutCopper => 0f32, + BlockKind::WeatheredCutCopper => 0f32, + BlockKind::ExposedCutCopper => 0f32, + BlockKind::CutCopper => 0f32, + BlockKind::OxidizedCutCopperStairs => 0f32, + BlockKind::WeatheredCutCopperStairs => 0f32, + BlockKind::ExposedCutCopperStairs => 0f32, + BlockKind::CutCopperStairs => 0f32, + BlockKind::OxidizedCutCopperSlab => 0f32, + BlockKind::WeatheredCutCopperSlab => 0f32, + BlockKind::ExposedCutCopperSlab => 0f32, + BlockKind::CutCopperSlab => 0f32, + BlockKind::WaxedCopperBlock => 0f32, + BlockKind::WaxedWeatheredCopper => 0f32, + BlockKind::WaxedExposedCopper => 0f32, + BlockKind::WaxedOxidizedCopper => 0f32, + BlockKind::WaxedOxidizedCutCopper => 0f32, + BlockKind::WaxedWeatheredCutCopper => 0f32, + BlockKind::WaxedExposedCutCopper => 0f32, + BlockKind::WaxedCutCopper => 0f32, + BlockKind::WaxedOxidizedCutCopperStairs => 0f32, + BlockKind::WaxedWeatheredCutCopperStairs => 0f32, + BlockKind::WaxedExposedCutCopperStairs => 0f32, + BlockKind::WaxedCutCopperStairs => 0f32, + BlockKind::WaxedOxidizedCutCopperSlab => 0f32, + BlockKind::WaxedWeatheredCutCopperSlab => 0f32, + BlockKind::WaxedExposedCutCopperSlab => 0f32, + BlockKind::WaxedCutCopperSlab => 0f32, + BlockKind::LightningRod => 6f32, + BlockKind::PointedDripstone => 3f32, + BlockKind::DripstoneBlock => 1f32, + BlockKind::CaveVines => 0f32, + BlockKind::CaveVinesPlant => 0f32, + BlockKind::SporeBlossom => 0f32, + BlockKind::Azalea => 0f32, + BlockKind::FloweringAzalea => 0f32, + BlockKind::MossCarpet => 0.1f32, + BlockKind::MossBlock => 0.1f32, + BlockKind::BigDripleaf => 0.1f32, + BlockKind::BigDripleafStem => 0.1f32, + BlockKind::SmallDripleaf => 0f32, + BlockKind::HangingRoots => 0f32, + BlockKind::RootedDirt => 0.5f32, + BlockKind::Deepslate => 6f32, + BlockKind::CobbledDeepslate => 6f32, + BlockKind::CobbledDeepslateStairs => 0f32, + BlockKind::CobbledDeepslateSlab => 0f32, + BlockKind::CobbledDeepslateWall => 0f32, + BlockKind::PolishedDeepslate => 0f32, + BlockKind::PolishedDeepslateStairs => 0f32, + BlockKind::PolishedDeepslateSlab => 0f32, + BlockKind::PolishedDeepslateWall => 0f32, + BlockKind::DeepslateTiles => 0f32, + BlockKind::DeepslateTileStairs => 0f32, + BlockKind::DeepslateTileSlab => 0f32, + BlockKind::DeepslateTileWall => 0f32, + BlockKind::DeepslateBricks => 0f32, + BlockKind::DeepslateBrickStairs => 0f32, + BlockKind::DeepslateBrickSlab => 0f32, + BlockKind::DeepslateBrickWall => 0f32, + BlockKind::ChiseledDeepslate => 0f32, + BlockKind::CrackedDeepslateBricks => 0f32, + BlockKind::CrackedDeepslateTiles => 0f32, + BlockKind::InfestedDeepslate => 0f32, + BlockKind::SmoothBasalt => 0f32, + BlockKind::RawIronBlock => 6f32, + BlockKind::RawCopperBlock => 6f32, + BlockKind::RawGoldBlock => 6f32, + BlockKind::PottedAzaleaBush => 0f32, + BlockKind::PottedFloweringAzaleaBush => 0f32, + } + } +} +impl BlockKind { + #[doc = "Returns the `hardness` property of this `BlockKind`."] + #[inline] pub fn hardness(&self) -> f32 { match self { - BlockKind::Air => 0 as f32, - BlockKind::Stone => 1.5 as f32, - BlockKind::Granite => 1.5 as f32, - BlockKind::PolishedGranite => 1.5 as f32, - BlockKind::Diorite => 1.5 as f32, - BlockKind::PolishedDiorite => 1.5 as f32, - BlockKind::Andesite => 1.5 as f32, - BlockKind::PolishedAndesite => 1.5 as f32, - BlockKind::GrassBlock => 0.6 as f32, - BlockKind::Dirt => 0.5 as f32, - BlockKind::CoarseDirt => 0.5 as f32, - BlockKind::Podzol => 0.5 as f32, - BlockKind::Cobblestone => 2 as f32, - BlockKind::OakPlanks => 2 as f32, - BlockKind::SprucePlanks => 2 as f32, - BlockKind::BirchPlanks => 2 as f32, - BlockKind::JunglePlanks => 2 as f32, - BlockKind::AcaciaPlanks => 2 as f32, - BlockKind::DarkOakPlanks => 2 as f32, - BlockKind::OakSapling => 0 as f32, - BlockKind::SpruceSapling => 0 as f32, - BlockKind::BirchSapling => 0 as f32, - BlockKind::JungleSapling => 0 as f32, - BlockKind::AcaciaSapling => 0 as f32, - BlockKind::DarkOakSapling => 0 as f32, - BlockKind::Bedrock => 0 as f32, - BlockKind::Water => 100 as f32, - BlockKind::Lava => 100 as f32, - BlockKind::Sand => 0.5 as f32, - BlockKind::RedSand => 0.5 as f32, - BlockKind::Gravel => 0.6 as f32, - BlockKind::GoldOre => 3 as f32, - BlockKind::IronOre => 3 as f32, - BlockKind::CoalOre => 3 as f32, - BlockKind::NetherGoldOre => 3 as f32, - BlockKind::OakLog => 2 as f32, - BlockKind::SpruceLog => 2 as f32, - BlockKind::BirchLog => 2 as f32, - BlockKind::JungleLog => 2 as f32, - BlockKind::AcaciaLog => 2 as f32, - BlockKind::DarkOakLog => 2 as f32, - BlockKind::StrippedSpruceLog => 2 as f32, - BlockKind::StrippedBirchLog => 2 as f32, - BlockKind::StrippedJungleLog => 2 as f32, - BlockKind::StrippedAcaciaLog => 2 as f32, - BlockKind::StrippedDarkOakLog => 2 as f32, - BlockKind::StrippedOakLog => 2 as f32, - BlockKind::OakWood => 2 as f32, - BlockKind::SpruceWood => 2 as f32, - BlockKind::BirchWood => 2 as f32, - BlockKind::JungleWood => 2 as f32, - BlockKind::AcaciaWood => 2 as f32, - BlockKind::DarkOakWood => 2 as f32, - BlockKind::StrippedOakWood => 2 as f32, - BlockKind::StrippedSpruceWood => 2 as f32, - BlockKind::StrippedBirchWood => 2 as f32, - BlockKind::StrippedJungleWood => 2 as f32, - BlockKind::StrippedAcaciaWood => 2 as f32, - BlockKind::StrippedDarkOakWood => 2 as f32, - BlockKind::OakLeaves => 0.2 as f32, - BlockKind::SpruceLeaves => 0.2 as f32, - BlockKind::BirchLeaves => 0.2 as f32, - BlockKind::JungleLeaves => 0.2 as f32, - BlockKind::AcaciaLeaves => 0.2 as f32, - BlockKind::DarkOakLeaves => 0.2 as f32, - BlockKind::Sponge => 0.6 as f32, - BlockKind::WetSponge => 0.6 as f32, - BlockKind::Glass => 0.3 as f32, - BlockKind::LapisOre => 3 as f32, - BlockKind::LapisBlock => 3 as f32, - BlockKind::Dispenser => 3.5 as f32, - BlockKind::Sandstone => 0.8 as f32, - BlockKind::ChiseledSandstone => 0.8 as f32, - BlockKind::CutSandstone => 0.8 as f32, - BlockKind::NoteBlock => 0.8 as f32, - BlockKind::WhiteBed => 0.2 as f32, - BlockKind::OrangeBed => 0.2 as f32, - BlockKind::MagentaBed => 0.2 as f32, - BlockKind::LightBlueBed => 0.2 as f32, - BlockKind::YellowBed => 0.2 as f32, - BlockKind::LimeBed => 0.2 as f32, - BlockKind::PinkBed => 0.2 as f32, - BlockKind::GrayBed => 0.2 as f32, - BlockKind::LightGrayBed => 0.2 as f32, - BlockKind::CyanBed => 0.2 as f32, - BlockKind::PurpleBed => 0.2 as f32, - BlockKind::BlueBed => 0.2 as f32, - BlockKind::BrownBed => 0.2 as f32, - BlockKind::GreenBed => 0.2 as f32, - BlockKind::RedBed => 0.2 as f32, - BlockKind::BlackBed => 0.2 as f32, - BlockKind::PoweredRail => 0.7 as f32, - BlockKind::DetectorRail => 0.7 as f32, - BlockKind::StickyPiston => 1.5 as f32, - BlockKind::Cobweb => 4 as f32, - BlockKind::Grass => 0 as f32, - BlockKind::Fern => 0 as f32, - BlockKind::DeadBush => 0 as f32, - BlockKind::Seagrass => 0 as f32, - BlockKind::TallSeagrass => 0 as f32, - BlockKind::Piston => 1.5 as f32, - BlockKind::PistonHead => 1.5 as f32, - BlockKind::WhiteWool => 0.8 as f32, - BlockKind::OrangeWool => 0.8 as f32, - BlockKind::MagentaWool => 0.8 as f32, - BlockKind::LightBlueWool => 0.8 as f32, - BlockKind::YellowWool => 0.8 as f32, - BlockKind::LimeWool => 0.8 as f32, - BlockKind::PinkWool => 0.8 as f32, - BlockKind::GrayWool => 0.8 as f32, - BlockKind::LightGrayWool => 0.8 as f32, - BlockKind::CyanWool => 0.8 as f32, - BlockKind::PurpleWool => 0.8 as f32, - BlockKind::BlueWool => 0.8 as f32, - BlockKind::BrownWool => 0.8 as f32, - BlockKind::GreenWool => 0.8 as f32, - BlockKind::RedWool => 0.8 as f32, - BlockKind::BlackWool => 0.8 as f32, - BlockKind::MovingPiston => 0 as f32, - BlockKind::Dandelion => 0 as f32, - BlockKind::Poppy => 0 as f32, - BlockKind::BlueOrchid => 0 as f32, - BlockKind::Allium => 0 as f32, - BlockKind::AzureBluet => 0 as f32, - BlockKind::RedTulip => 0 as f32, - BlockKind::OrangeTulip => 0 as f32, - BlockKind::WhiteTulip => 0 as f32, - BlockKind::PinkTulip => 0 as f32, - BlockKind::OxeyeDaisy => 0 as f32, - BlockKind::Cornflower => 0 as f32, - BlockKind::WitherRose => 0 as f32, - BlockKind::LilyOfTheValley => 0 as f32, - BlockKind::BrownMushroom => 0 as f32, - BlockKind::RedMushroom => 0 as f32, - BlockKind::GoldBlock => 3 as f32, - BlockKind::IronBlock => 5 as f32, - BlockKind::Bricks => 2 as f32, - BlockKind::Tnt => 0 as f32, - BlockKind::Bookshelf => 1.5 as f32, - BlockKind::MossyCobblestone => 2 as f32, - BlockKind::Obsidian => 50 as f32, - BlockKind::Torch => 0 as f32, - BlockKind::WallTorch => 0 as f32, - BlockKind::Fire => 0 as f32, - BlockKind::SoulFire => 0 as f32, - BlockKind::Spawner => 5 as f32, - BlockKind::OakStairs => 0 as f32, - BlockKind::Chest => 2.5 as f32, - BlockKind::RedstoneWire => 0 as f32, - BlockKind::DiamondOre => 3 as f32, - BlockKind::DiamondBlock => 5 as f32, - BlockKind::CraftingTable => 2.5 as f32, - BlockKind::Wheat => 0 as f32, - BlockKind::Farmland => 0.6 as f32, - BlockKind::Furnace => 3.5 as f32, - BlockKind::OakSign => 1 as f32, - BlockKind::SpruceSign => 1 as f32, - BlockKind::BirchSign => 1 as f32, - BlockKind::AcaciaSign => 1 as f32, - BlockKind::JungleSign => 1 as f32, - BlockKind::DarkOakSign => 1 as f32, - BlockKind::OakDoor => 3 as f32, - BlockKind::Ladder => 0.4 as f32, - BlockKind::Rail => 0.7 as f32, - BlockKind::CobblestoneStairs => 0 as f32, - BlockKind::OakWallSign => 1 as f32, - BlockKind::SpruceWallSign => 1 as f32, - BlockKind::BirchWallSign => 1 as f32, - BlockKind::AcaciaWallSign => 1 as f32, - BlockKind::JungleWallSign => 1 as f32, - BlockKind::DarkOakWallSign => 1 as f32, - BlockKind::Lever => 0.5 as f32, - BlockKind::StonePressurePlate => 0.5 as f32, - BlockKind::IronDoor => 5 as f32, - BlockKind::OakPressurePlate => 0.5 as f32, - BlockKind::SprucePressurePlate => 0.5 as f32, - BlockKind::BirchPressurePlate => 0.5 as f32, - BlockKind::JunglePressurePlate => 0.5 as f32, - BlockKind::AcaciaPressurePlate => 0.5 as f32, - BlockKind::DarkOakPressurePlate => 0.5 as f32, - BlockKind::RedstoneOre => 3 as f32, - BlockKind::RedstoneTorch => 0 as f32, - BlockKind::RedstoneWallTorch => 0 as f32, - BlockKind::StoneButton => 0.5 as f32, - BlockKind::Snow => 0.1 as f32, - BlockKind::Ice => 0.5 as f32, - BlockKind::SnowBlock => 0.2 as f32, - BlockKind::Cactus => 0.4 as f32, - BlockKind::Clay => 0.6 as f32, - BlockKind::SugarCane => 0 as f32, - BlockKind::Jukebox => 2 as f32, - BlockKind::OakFence => 2 as f32, - BlockKind::Pumpkin => 1 as f32, - BlockKind::Netherrack => 0.4 as f32, - BlockKind::SoulSand => 0.5 as f32, - BlockKind::SoulSoil => 0.5 as f32, - BlockKind::Basalt => 1.25 as f32, - BlockKind::PolishedBasalt => 1.25 as f32, - BlockKind::SoulTorch => 0 as f32, - BlockKind::SoulWallTorch => 0 as f32, - BlockKind::Glowstone => 0.3 as f32, - BlockKind::NetherPortal => 0 as f32, - BlockKind::CarvedPumpkin => 1 as f32, - BlockKind::JackOLantern => 1 as f32, - BlockKind::Cake => 0.5 as f32, - BlockKind::Repeater => 0 as f32, - BlockKind::WhiteStainedGlass => 0.3 as f32, - BlockKind::OrangeStainedGlass => 0.3 as f32, - BlockKind::MagentaStainedGlass => 0.3 as f32, - BlockKind::LightBlueStainedGlass => 0.3 as f32, - BlockKind::YellowStainedGlass => 0.3 as f32, - BlockKind::LimeStainedGlass => 0.3 as f32, - BlockKind::PinkStainedGlass => 0.3 as f32, - BlockKind::GrayStainedGlass => 0.3 as f32, - BlockKind::LightGrayStainedGlass => 0.3 as f32, - BlockKind::CyanStainedGlass => 0.3 as f32, - BlockKind::PurpleStainedGlass => 0.3 as f32, - BlockKind::BlueStainedGlass => 0.3 as f32, - BlockKind::BrownStainedGlass => 0.3 as f32, - BlockKind::GreenStainedGlass => 0.3 as f32, - BlockKind::RedStainedGlass => 0.3 as f32, - BlockKind::BlackStainedGlass => 0.3 as f32, - BlockKind::OakTrapdoor => 3 as f32, - BlockKind::SpruceTrapdoor => 3 as f32, - BlockKind::BirchTrapdoor => 3 as f32, - BlockKind::JungleTrapdoor => 3 as f32, - BlockKind::AcaciaTrapdoor => 3 as f32, - BlockKind::DarkOakTrapdoor => 3 as f32, - BlockKind::StoneBricks => 1.5 as f32, - BlockKind::MossyStoneBricks => 1.5 as f32, - BlockKind::CrackedStoneBricks => 1.5 as f32, - BlockKind::ChiseledStoneBricks => 1.5 as f32, - BlockKind::InfestedStone => 0 as f32, - BlockKind::InfestedCobblestone => 0 as f32, - BlockKind::InfestedStoneBricks => 0 as f32, - BlockKind::InfestedMossyStoneBricks => 0 as f32, - BlockKind::InfestedCrackedStoneBricks => 0 as f32, - BlockKind::InfestedChiseledStoneBricks => 0 as f32, - BlockKind::BrownMushroomBlock => 0.2 as f32, - BlockKind::RedMushroomBlock => 0.2 as f32, - BlockKind::MushroomStem => 0.2 as f32, - BlockKind::IronBars => 5 as f32, - BlockKind::Chain => 5 as f32, - BlockKind::GlassPane => 0.3 as f32, - BlockKind::Melon => 1 as f32, - BlockKind::AttachedPumpkinStem => 0 as f32, - BlockKind::AttachedMelonStem => 0 as f32, - BlockKind::PumpkinStem => 0 as f32, - BlockKind::MelonStem => 0 as f32, - BlockKind::Vine => 0.2 as f32, - BlockKind::OakFenceGate => 2 as f32, - BlockKind::BrickStairs => 0 as f32, - BlockKind::StoneBrickStairs => 0 as f32, - BlockKind::Mycelium => 0.6 as f32, - BlockKind::LilyPad => 0 as f32, - BlockKind::NetherBricks => 2 as f32, - BlockKind::NetherBrickFence => 2 as f32, - BlockKind::NetherBrickStairs => 0 as f32, - BlockKind::NetherWart => 0 as f32, - BlockKind::EnchantingTable => 5 as f32, - BlockKind::BrewingStand => 0.5 as f32, - BlockKind::Cauldron => 2 as f32, - BlockKind::EndPortal => 0 as f32, - BlockKind::EndPortalFrame => 0 as f32, - BlockKind::EndStone => 3 as f32, - BlockKind::DragonEgg => 3 as f32, - BlockKind::RedstoneLamp => 0.3 as f32, - BlockKind::Cocoa => 0.2 as f32, - BlockKind::SandstoneStairs => 0 as f32, - BlockKind::EmeraldOre => 3 as f32, - BlockKind::EnderChest => 22.5 as f32, - BlockKind::TripwireHook => 0 as f32, - BlockKind::Tripwire => 0 as f32, - BlockKind::EmeraldBlock => 5 as f32, - BlockKind::SpruceStairs => 0 as f32, - BlockKind::BirchStairs => 0 as f32, - BlockKind::JungleStairs => 0 as f32, - BlockKind::CommandBlock => 0 as f32, - BlockKind::Beacon => 3 as f32, - BlockKind::CobblestoneWall => 0 as f32, - BlockKind::MossyCobblestoneWall => 0 as f32, - BlockKind::FlowerPot => 0 as f32, - BlockKind::PottedOakSapling => 0 as f32, - BlockKind::PottedSpruceSapling => 0 as f32, - BlockKind::PottedBirchSapling => 0 as f32, - BlockKind::PottedJungleSapling => 0 as f32, - BlockKind::PottedAcaciaSapling => 0 as f32, - BlockKind::PottedDarkOakSapling => 0 as f32, - BlockKind::PottedFern => 0 as f32, - BlockKind::PottedDandelion => 0 as f32, - BlockKind::PottedPoppy => 0 as f32, - BlockKind::PottedBlueOrchid => 0 as f32, - BlockKind::PottedAllium => 0 as f32, - BlockKind::PottedAzureBluet => 0 as f32, - BlockKind::PottedRedTulip => 0 as f32, - BlockKind::PottedOrangeTulip => 0 as f32, - BlockKind::PottedWhiteTulip => 0 as f32, - BlockKind::PottedPinkTulip => 0 as f32, - BlockKind::PottedOxeyeDaisy => 0 as f32, - BlockKind::PottedCornflower => 0 as f32, - BlockKind::PottedLilyOfTheValley => 0 as f32, - BlockKind::PottedWitherRose => 0 as f32, - BlockKind::PottedRedMushroom => 0 as f32, - BlockKind::PottedBrownMushroom => 0 as f32, - BlockKind::PottedDeadBush => 0 as f32, - BlockKind::PottedCactus => 0 as f32, - BlockKind::Carrots => 0 as f32, - BlockKind::Potatoes => 0 as f32, - BlockKind::OakButton => 0.5 as f32, - BlockKind::SpruceButton => 0.5 as f32, - BlockKind::BirchButton => 0.5 as f32, - BlockKind::JungleButton => 0.5 as f32, - BlockKind::AcaciaButton => 0.5 as f32, - BlockKind::DarkOakButton => 0.5 as f32, - BlockKind::SkeletonSkull => 1 as f32, - BlockKind::SkeletonWallSkull => 1 as f32, - BlockKind::WitherSkeletonSkull => 1 as f32, - BlockKind::WitherSkeletonWallSkull => 1 as f32, - BlockKind::ZombieHead => 1 as f32, - BlockKind::ZombieWallHead => 1 as f32, - BlockKind::PlayerHead => 1 as f32, - BlockKind::PlayerWallHead => 1 as f32, - BlockKind::CreeperHead => 1 as f32, - BlockKind::CreeperWallHead => 1 as f32, - BlockKind::DragonHead => 1 as f32, - BlockKind::DragonWallHead => 1 as f32, - BlockKind::Anvil => 5 as f32, - BlockKind::ChippedAnvil => 5 as f32, - BlockKind::DamagedAnvil => 5 as f32, - BlockKind::TrappedChest => 2.5 as f32, - BlockKind::LightWeightedPressurePlate => 0.5 as f32, - BlockKind::HeavyWeightedPressurePlate => 0.5 as f32, - BlockKind::Comparator => 0 as f32, - BlockKind::DaylightDetector => 0.2 as f32, - BlockKind::RedstoneBlock => 5 as f32, - BlockKind::NetherQuartzOre => 3 as f32, - BlockKind::Hopper => 3 as f32, - BlockKind::QuartzBlock => 0.8 as f32, - BlockKind::ChiseledQuartzBlock => 0.8 as f32, - BlockKind::QuartzPillar => 0.8 as f32, - BlockKind::QuartzStairs => 0 as f32, - BlockKind::ActivatorRail => 0.7 as f32, - BlockKind::Dropper => 3.5 as f32, - BlockKind::WhiteTerracotta => 1.25 as f32, - BlockKind::OrangeTerracotta => 1.25 as f32, - BlockKind::MagentaTerracotta => 1.25 as f32, - BlockKind::LightBlueTerracotta => 1.25 as f32, - BlockKind::YellowTerracotta => 1.25 as f32, - BlockKind::LimeTerracotta => 1.25 as f32, - BlockKind::PinkTerracotta => 1.25 as f32, - BlockKind::GrayTerracotta => 1.25 as f32, - BlockKind::LightGrayTerracotta => 1.25 as f32, - BlockKind::CyanTerracotta => 1.25 as f32, - BlockKind::PurpleTerracotta => 1.25 as f32, - BlockKind::BlueTerracotta => 1.25 as f32, - BlockKind::BrownTerracotta => 1.25 as f32, - BlockKind::GreenTerracotta => 1.25 as f32, - BlockKind::RedTerracotta => 1.25 as f32, - BlockKind::BlackTerracotta => 1.25 as f32, - BlockKind::WhiteStainedGlassPane => 0.3 as f32, - BlockKind::OrangeStainedGlassPane => 0.3 as f32, - BlockKind::MagentaStainedGlassPane => 0.3 as f32, - BlockKind::LightBlueStainedGlassPane => 0.3 as f32, - BlockKind::YellowStainedGlassPane => 0.3 as f32, - BlockKind::LimeStainedGlassPane => 0.3 as f32, - BlockKind::PinkStainedGlassPane => 0.3 as f32, - BlockKind::GrayStainedGlassPane => 0.3 as f32, - BlockKind::LightGrayStainedGlassPane => 0.3 as f32, - BlockKind::CyanStainedGlassPane => 0.3 as f32, - BlockKind::PurpleStainedGlassPane => 0.3 as f32, - BlockKind::BlueStainedGlassPane => 0.3 as f32, - BlockKind::BrownStainedGlassPane => 0.3 as f32, - BlockKind::GreenStainedGlassPane => 0.3 as f32, - BlockKind::RedStainedGlassPane => 0.3 as f32, - BlockKind::BlackStainedGlassPane => 0.3 as f32, - BlockKind::AcaciaStairs => 0 as f32, - BlockKind::DarkOakStairs => 0 as f32, - BlockKind::SlimeBlock => 0 as f32, - BlockKind::Barrier => 0 as f32, - BlockKind::IronTrapdoor => 5 as f32, - BlockKind::Prismarine => 1.5 as f32, - BlockKind::PrismarineBricks => 1.5 as f32, - BlockKind::DarkPrismarine => 1.5 as f32, - BlockKind::PrismarineStairs => 0 as f32, - BlockKind::PrismarineBrickStairs => 0 as f32, - BlockKind::DarkPrismarineStairs => 0 as f32, - BlockKind::PrismarineSlab => 1.5 as f32, - BlockKind::PrismarineBrickSlab => 1.5 as f32, - BlockKind::DarkPrismarineSlab => 1.5 as f32, - BlockKind::SeaLantern => 0.3 as f32, - BlockKind::HayBlock => 0.5 as f32, - BlockKind::WhiteCarpet => 0.1 as f32, - BlockKind::OrangeCarpet => 0.1 as f32, - BlockKind::MagentaCarpet => 0.1 as f32, - BlockKind::LightBlueCarpet => 0.1 as f32, - BlockKind::YellowCarpet => 0.1 as f32, - BlockKind::LimeCarpet => 0.1 as f32, - BlockKind::PinkCarpet => 0.1 as f32, - BlockKind::GrayCarpet => 0.1 as f32, - BlockKind::LightGrayCarpet => 0.1 as f32, - BlockKind::CyanCarpet => 0.1 as f32, - BlockKind::PurpleCarpet => 0.1 as f32, - BlockKind::BlueCarpet => 0.1 as f32, - BlockKind::BrownCarpet => 0.1 as f32, - BlockKind::GreenCarpet => 0.1 as f32, - BlockKind::RedCarpet => 0.1 as f32, - BlockKind::BlackCarpet => 0.1 as f32, - BlockKind::Terracotta => 1.25 as f32, - BlockKind::CoalBlock => 5 as f32, - BlockKind::PackedIce => 0.5 as f32, - BlockKind::Sunflower => 0 as f32, - BlockKind::Lilac => 0 as f32, - BlockKind::RoseBush => 0 as f32, - BlockKind::Peony => 0 as f32, - BlockKind::TallGrass => 0 as f32, - BlockKind::LargeFern => 0 as f32, - BlockKind::WhiteBanner => 1 as f32, - BlockKind::OrangeBanner => 1 as f32, - BlockKind::MagentaBanner => 1 as f32, - BlockKind::LightBlueBanner => 1 as f32, - BlockKind::YellowBanner => 1 as f32, - BlockKind::LimeBanner => 1 as f32, - BlockKind::PinkBanner => 1 as f32, - BlockKind::GrayBanner => 1 as f32, - BlockKind::LightGrayBanner => 1 as f32, - BlockKind::CyanBanner => 1 as f32, - BlockKind::PurpleBanner => 1 as f32, - BlockKind::BlueBanner => 1 as f32, - BlockKind::BrownBanner => 1 as f32, - BlockKind::GreenBanner => 1 as f32, - BlockKind::RedBanner => 1 as f32, - BlockKind::BlackBanner => 1 as f32, - BlockKind::WhiteWallBanner => 1 as f32, - BlockKind::OrangeWallBanner => 1 as f32, - BlockKind::MagentaWallBanner => 1 as f32, - BlockKind::LightBlueWallBanner => 1 as f32, - BlockKind::YellowWallBanner => 1 as f32, - BlockKind::LimeWallBanner => 1 as f32, - BlockKind::PinkWallBanner => 1 as f32, - BlockKind::GrayWallBanner => 1 as f32, - BlockKind::LightGrayWallBanner => 1 as f32, - BlockKind::CyanWallBanner => 1 as f32, - BlockKind::PurpleWallBanner => 1 as f32, - BlockKind::BlueWallBanner => 1 as f32, - BlockKind::BrownWallBanner => 1 as f32, - BlockKind::GreenWallBanner => 1 as f32, - BlockKind::RedWallBanner => 1 as f32, - BlockKind::BlackWallBanner => 1 as f32, - BlockKind::RedSandstone => 0.8 as f32, - BlockKind::ChiseledRedSandstone => 0.8 as f32, - BlockKind::CutRedSandstone => 0.8 as f32, - BlockKind::RedSandstoneStairs => 0 as f32, - BlockKind::OakSlab => 2 as f32, - BlockKind::SpruceSlab => 2 as f32, - BlockKind::BirchSlab => 2 as f32, - BlockKind::JungleSlab => 2 as f32, - BlockKind::AcaciaSlab => 2 as f32, - BlockKind::DarkOakSlab => 2 as f32, - BlockKind::StoneSlab => 2 as f32, - BlockKind::SmoothStoneSlab => 2 as f32, - BlockKind::SandstoneSlab => 2 as f32, - BlockKind::CutSandstoneSlab => 2 as f32, - BlockKind::PetrifiedOakSlab => 2 as f32, - BlockKind::CobblestoneSlab => 2 as f32, - BlockKind::BrickSlab => 2 as f32, - BlockKind::StoneBrickSlab => 2 as f32, - BlockKind::NetherBrickSlab => 2 as f32, - BlockKind::QuartzSlab => 2 as f32, - BlockKind::RedSandstoneSlab => 2 as f32, - BlockKind::CutRedSandstoneSlab => 2 as f32, - BlockKind::PurpurSlab => 2 as f32, - BlockKind::SmoothStone => 2 as f32, - BlockKind::SmoothSandstone => 2 as f32, - BlockKind::SmoothQuartz => 2 as f32, - BlockKind::SmoothRedSandstone => 2 as f32, - BlockKind::SpruceFenceGate => 2 as f32, - BlockKind::BirchFenceGate => 2 as f32, - BlockKind::JungleFenceGate => 2 as f32, - BlockKind::AcaciaFenceGate => 2 as f32, - BlockKind::DarkOakFenceGate => 2 as f32, - BlockKind::SpruceFence => 2 as f32, - BlockKind::BirchFence => 2 as f32, - BlockKind::JungleFence => 2 as f32, - BlockKind::AcaciaFence => 2 as f32, - BlockKind::DarkOakFence => 2 as f32, - BlockKind::SpruceDoor => 3 as f32, - BlockKind::BirchDoor => 3 as f32, - BlockKind::JungleDoor => 3 as f32, - BlockKind::AcaciaDoor => 3 as f32, - BlockKind::DarkOakDoor => 3 as f32, - BlockKind::EndRod => 0 as f32, - BlockKind::ChorusPlant => 0.4 as f32, - BlockKind::ChorusFlower => 0.4 as f32, - BlockKind::PurpurBlock => 1.5 as f32, - BlockKind::PurpurPillar => 1.5 as f32, - BlockKind::PurpurStairs => 0 as f32, - BlockKind::EndStoneBricks => 3 as f32, - BlockKind::Beetroots => 0 as f32, - BlockKind::GrassPath => 0.65 as f32, - BlockKind::EndGateway => 0 as f32, - BlockKind::RepeatingCommandBlock => 0 as f32, - BlockKind::ChainCommandBlock => 0 as f32, - BlockKind::FrostedIce => 0.5 as f32, - BlockKind::MagmaBlock => 0.5 as f32, - BlockKind::NetherWartBlock => 1 as f32, - BlockKind::RedNetherBricks => 2 as f32, - BlockKind::BoneBlock => 2 as f32, - BlockKind::StructureVoid => 0 as f32, - BlockKind::Observer => 3 as f32, - BlockKind::ShulkerBox => 2 as f32, - BlockKind::WhiteShulkerBox => 2 as f32, - BlockKind::OrangeShulkerBox => 2 as f32, - BlockKind::MagentaShulkerBox => 2 as f32, - BlockKind::LightBlueShulkerBox => 2 as f32, - BlockKind::YellowShulkerBox => 2 as f32, - BlockKind::LimeShulkerBox => 2 as f32, - BlockKind::PinkShulkerBox => 2 as f32, - BlockKind::GrayShulkerBox => 2 as f32, - BlockKind::LightGrayShulkerBox => 2 as f32, - BlockKind::CyanShulkerBox => 2 as f32, - BlockKind::PurpleShulkerBox => 2 as f32, - BlockKind::BlueShulkerBox => 2 as f32, - BlockKind::BrownShulkerBox => 2 as f32, - BlockKind::GreenShulkerBox => 2 as f32, - BlockKind::RedShulkerBox => 2 as f32, - BlockKind::BlackShulkerBox => 2 as f32, - BlockKind::WhiteGlazedTerracotta => 1.4 as f32, - BlockKind::OrangeGlazedTerracotta => 1.4 as f32, - BlockKind::MagentaGlazedTerracotta => 1.4 as f32, - BlockKind::LightBlueGlazedTerracotta => 1.4 as f32, - BlockKind::YellowGlazedTerracotta => 1.4 as f32, - BlockKind::LimeGlazedTerracotta => 1.4 as f32, - BlockKind::PinkGlazedTerracotta => 1.4 as f32, - BlockKind::GrayGlazedTerracotta => 1.4 as f32, - BlockKind::LightGrayGlazedTerracotta => 1.4 as f32, - BlockKind::CyanGlazedTerracotta => 1.4 as f32, - BlockKind::PurpleGlazedTerracotta => 1.4 as f32, - BlockKind::BlueGlazedTerracotta => 1.4 as f32, - BlockKind::BrownGlazedTerracotta => 1.4 as f32, - BlockKind::GreenGlazedTerracotta => 1.4 as f32, - BlockKind::RedGlazedTerracotta => 1.4 as f32, - BlockKind::BlackGlazedTerracotta => 1.4 as f32, - BlockKind::WhiteConcrete => 1.8 as f32, - BlockKind::OrangeConcrete => 1.8 as f32, - BlockKind::MagentaConcrete => 1.8 as f32, - BlockKind::LightBlueConcrete => 1.8 as f32, - BlockKind::YellowConcrete => 1.8 as f32, - BlockKind::LimeConcrete => 1.8 as f32, - BlockKind::PinkConcrete => 1.8 as f32, - BlockKind::GrayConcrete => 1.8 as f32, - BlockKind::LightGrayConcrete => 1.8 as f32, - BlockKind::CyanConcrete => 1.8 as f32, - BlockKind::PurpleConcrete => 1.8 as f32, - BlockKind::BlueConcrete => 1.8 as f32, - BlockKind::BrownConcrete => 1.8 as f32, - BlockKind::GreenConcrete => 1.8 as f32, - BlockKind::RedConcrete => 1.8 as f32, - BlockKind::BlackConcrete => 1.8 as f32, - BlockKind::WhiteConcretePowder => 0.5 as f32, - BlockKind::OrangeConcretePowder => 0.5 as f32, - BlockKind::MagentaConcretePowder => 0.5 as f32, - BlockKind::LightBlueConcretePowder => 0.5 as f32, - BlockKind::YellowConcretePowder => 0.5 as f32, - BlockKind::LimeConcretePowder => 0.5 as f32, - BlockKind::PinkConcretePowder => 0.5 as f32, - BlockKind::GrayConcretePowder => 0.5 as f32, - BlockKind::LightGrayConcretePowder => 0.5 as f32, - BlockKind::CyanConcretePowder => 0.5 as f32, - BlockKind::PurpleConcretePowder => 0.5 as f32, - BlockKind::BlueConcretePowder => 0.5 as f32, - BlockKind::BrownConcretePowder => 0.5 as f32, - BlockKind::GreenConcretePowder => 0.5 as f32, - BlockKind::RedConcretePowder => 0.5 as f32, - BlockKind::BlackConcretePowder => 0.5 as f32, - BlockKind::Kelp => 0 as f32, - BlockKind::KelpPlant => 0 as f32, - BlockKind::DriedKelpBlock => 0.5 as f32, - BlockKind::TurtleEgg => 0.5 as f32, - BlockKind::DeadTubeCoralBlock => 1.5 as f32, - BlockKind::DeadBrainCoralBlock => 1.5 as f32, - BlockKind::DeadBubbleCoralBlock => 1.5 as f32, - BlockKind::DeadFireCoralBlock => 1.5 as f32, - BlockKind::DeadHornCoralBlock => 1.5 as f32, - BlockKind::TubeCoralBlock => 1.5 as f32, - BlockKind::BrainCoralBlock => 1.5 as f32, - BlockKind::BubbleCoralBlock => 1.5 as f32, - BlockKind::FireCoralBlock => 1.5 as f32, - BlockKind::HornCoralBlock => 1.5 as f32, - BlockKind::DeadTubeCoral => 0 as f32, - BlockKind::DeadBrainCoral => 0 as f32, - BlockKind::DeadBubbleCoral => 0 as f32, - BlockKind::DeadFireCoral => 0 as f32, - BlockKind::DeadHornCoral => 0 as f32, - BlockKind::TubeCoral => 0 as f32, - BlockKind::BrainCoral => 0 as f32, - BlockKind::BubbleCoral => 0 as f32, - BlockKind::FireCoral => 0 as f32, - BlockKind::HornCoral => 0 as f32, - BlockKind::DeadTubeCoralFan => 0 as f32, - BlockKind::DeadBrainCoralFan => 0 as f32, - BlockKind::DeadBubbleCoralFan => 0 as f32, - BlockKind::DeadFireCoralFan => 0 as f32, - BlockKind::DeadHornCoralFan => 0 as f32, - BlockKind::TubeCoralFan => 0 as f32, - BlockKind::BrainCoralFan => 0 as f32, - BlockKind::BubbleCoralFan => 0 as f32, - BlockKind::FireCoralFan => 0 as f32, - BlockKind::HornCoralFan => 0 as f32, - BlockKind::DeadTubeCoralWallFan => 0 as f32, - BlockKind::DeadBrainCoralWallFan => 0 as f32, - BlockKind::DeadBubbleCoralWallFan => 0 as f32, - BlockKind::DeadFireCoralWallFan => 0 as f32, - BlockKind::DeadHornCoralWallFan => 0 as f32, - BlockKind::TubeCoralWallFan => 0 as f32, - BlockKind::BrainCoralWallFan => 0 as f32, - BlockKind::BubbleCoralWallFan => 0 as f32, - BlockKind::FireCoralWallFan => 0 as f32, - BlockKind::HornCoralWallFan => 0 as f32, - BlockKind::SeaPickle => 0 as f32, - BlockKind::BlueIce => 2.8 as f32, - BlockKind::Conduit => 3 as f32, - BlockKind::BambooSapling => 1 as f32, - BlockKind::Bamboo => 1 as f32, - BlockKind::PottedBamboo => 0 as f32, - BlockKind::VoidAir => 0 as f32, - BlockKind::CaveAir => 0 as f32, - BlockKind::BubbleColumn => 0 as f32, - BlockKind::PolishedGraniteStairs => 0 as f32, - BlockKind::SmoothRedSandstoneStairs => 0 as f32, - BlockKind::MossyStoneBrickStairs => 0 as f32, - BlockKind::PolishedDioriteStairs => 0 as f32, - BlockKind::MossyCobblestoneStairs => 0 as f32, - BlockKind::EndStoneBrickStairs => 0 as f32, - BlockKind::StoneStairs => 0 as f32, - BlockKind::SmoothSandstoneStairs => 0 as f32, - BlockKind::SmoothQuartzStairs => 0 as f32, - BlockKind::GraniteStairs => 0 as f32, - BlockKind::AndesiteStairs => 0 as f32, - BlockKind::RedNetherBrickStairs => 0 as f32, - BlockKind::PolishedAndesiteStairs => 0 as f32, - BlockKind::DioriteStairs => 0 as f32, - BlockKind::PolishedGraniteSlab => 0 as f32, - BlockKind::SmoothRedSandstoneSlab => 0 as f32, - BlockKind::MossyStoneBrickSlab => 0 as f32, - BlockKind::PolishedDioriteSlab => 0 as f32, - BlockKind::MossyCobblestoneSlab => 0 as f32, - BlockKind::EndStoneBrickSlab => 0 as f32, - BlockKind::SmoothSandstoneSlab => 0 as f32, - BlockKind::SmoothQuartzSlab => 0 as f32, - BlockKind::GraniteSlab => 0 as f32, - BlockKind::AndesiteSlab => 0 as f32, - BlockKind::RedNetherBrickSlab => 0 as f32, - BlockKind::PolishedAndesiteSlab => 0 as f32, - BlockKind::DioriteSlab => 0 as f32, - BlockKind::BrickWall => 0 as f32, - BlockKind::PrismarineWall => 0 as f32, - BlockKind::RedSandstoneWall => 0 as f32, - BlockKind::MossyStoneBrickWall => 0 as f32, - BlockKind::GraniteWall => 0 as f32, - BlockKind::StoneBrickWall => 0 as f32, - BlockKind::NetherBrickWall => 0 as f32, - BlockKind::AndesiteWall => 0 as f32, - BlockKind::RedNetherBrickWall => 0 as f32, - BlockKind::SandstoneWall => 0 as f32, - BlockKind::EndStoneBrickWall => 0 as f32, - BlockKind::DioriteWall => 0 as f32, - BlockKind::Scaffolding => 0 as f32, - BlockKind::Loom => 2.5 as f32, - BlockKind::Barrel => 2.5 as f32, - BlockKind::Smoker => 3.5 as f32, - BlockKind::BlastFurnace => 3.5 as f32, - BlockKind::CartographyTable => 2.5 as f32, - BlockKind::FletchingTable => 2.5 as f32, - BlockKind::Grindstone => 2 as f32, - BlockKind::Lectern => 2.5 as f32, - BlockKind::SmithingTable => 2.5 as f32, - BlockKind::Stonecutter => 3.5 as f32, - BlockKind::Bell => 5 as f32, - BlockKind::Lantern => 3.5 as f32, - BlockKind::SoulLantern => 3.5 as f32, - BlockKind::Campfire => 2 as f32, - BlockKind::SoulCampfire => 2 as f32, - BlockKind::SweetBerryBush => 0 as f32, - BlockKind::WarpedStem => 2 as f32, - BlockKind::StrippedWarpedStem => 2 as f32, - BlockKind::WarpedHyphae => 2 as f32, - BlockKind::StrippedWarpedHyphae => 2 as f32, - BlockKind::WarpedNylium => 0.4 as f32, - BlockKind::WarpedFungus => 0 as f32, - BlockKind::WarpedWartBlock => 1 as f32, - BlockKind::WarpedRoots => 0 as f32, - BlockKind::NetherSprouts => 0 as f32, - BlockKind::CrimsonStem => 2 as f32, - BlockKind::StrippedCrimsonStem => 2 as f32, - BlockKind::CrimsonHyphae => 2 as f32, - BlockKind::StrippedCrimsonHyphae => 2 as f32, - BlockKind::CrimsonNylium => 0.4 as f32, - BlockKind::CrimsonFungus => 0 as f32, - BlockKind::Shroomlight => 1 as f32, - BlockKind::WeepingVines => 0 as f32, - BlockKind::WeepingVinesPlant => 0 as f32, - BlockKind::TwistingVines => 0 as f32, - BlockKind::TwistingVinesPlant => 0 as f32, - BlockKind::CrimsonRoots => 0 as f32, - BlockKind::CrimsonPlanks => 2 as f32, - BlockKind::WarpedPlanks => 2 as f32, - BlockKind::CrimsonSlab => 2 as f32, - BlockKind::WarpedSlab => 2 as f32, - BlockKind::CrimsonPressurePlate => 0.5 as f32, - BlockKind::WarpedPressurePlate => 0.5 as f32, - BlockKind::CrimsonFence => 2 as f32, - BlockKind::WarpedFence => 2 as f32, - BlockKind::CrimsonTrapdoor => 3 as f32, - BlockKind::WarpedTrapdoor => 3 as f32, - BlockKind::CrimsonFenceGate => 2 as f32, - BlockKind::WarpedFenceGate => 2 as f32, - BlockKind::CrimsonStairs => 0 as f32, - BlockKind::WarpedStairs => 0 as f32, - BlockKind::CrimsonButton => 0.5 as f32, - BlockKind::WarpedButton => 0.5 as f32, - BlockKind::CrimsonDoor => 3 as f32, - BlockKind::WarpedDoor => 3 as f32, - BlockKind::CrimsonSign => 1 as f32, - BlockKind::WarpedSign => 1 as f32, - BlockKind::CrimsonWallSign => 1 as f32, - BlockKind::WarpedWallSign => 1 as f32, - BlockKind::StructureBlock => 0 as f32, - BlockKind::Jigsaw => 0 as f32, - BlockKind::Composter => 0.6 as f32, - BlockKind::Target => 0.5 as f32, - BlockKind::BeeNest => 0.3 as f32, - BlockKind::Beehive => 0.6 as f32, - BlockKind::HoneyBlock => 0 as f32, - BlockKind::HoneycombBlock => 0.6 as f32, - BlockKind::NetheriteBlock => 50 as f32, - BlockKind::AncientDebris => 30 as f32, - BlockKind::CryingObsidian => 50 as f32, - BlockKind::RespawnAnchor => 50 as f32, - BlockKind::PottedCrimsonFungus => 0 as f32, - BlockKind::PottedWarpedFungus => 0 as f32, - BlockKind::PottedCrimsonRoots => 0 as f32, - BlockKind::PottedWarpedRoots => 0 as f32, - BlockKind::Lodestone => 3.5 as f32, - BlockKind::Blackstone => 1.5 as f32, - BlockKind::BlackstoneStairs => 0 as f32, - BlockKind::BlackstoneWall => 0 as f32, - BlockKind::BlackstoneSlab => 2 as f32, - BlockKind::PolishedBlackstone => 2 as f32, - BlockKind::PolishedBlackstoneBricks => 1.5 as f32, - BlockKind::CrackedPolishedBlackstoneBricks => 0 as f32, - BlockKind::ChiseledPolishedBlackstone => 1.5 as f32, - BlockKind::PolishedBlackstoneBrickSlab => 2 as f32, - BlockKind::PolishedBlackstoneBrickStairs => 0 as f32, - BlockKind::PolishedBlackstoneBrickWall => 0 as f32, - BlockKind::GildedBlackstone => 0 as f32, - BlockKind::PolishedBlackstoneStairs => 0 as f32, - BlockKind::PolishedBlackstoneSlab => 0 as f32, - BlockKind::PolishedBlackstonePressurePlate => 0.5 as f32, - BlockKind::PolishedBlackstoneButton => 0.5 as f32, - BlockKind::PolishedBlackstoneWall => 0 as f32, - BlockKind::ChiseledNetherBricks => 2 as f32, - BlockKind::CrackedNetherBricks => 2 as f32, - BlockKind::QuartzBricks => 0 as f32, + BlockKind::Air => 0f32, + BlockKind::Stone => 1.5f32, + BlockKind::Granite => 1.5f32, + BlockKind::PolishedGranite => 1.5f32, + BlockKind::Diorite => 1.5f32, + BlockKind::PolishedDiorite => 1.5f32, + BlockKind::Andesite => 1.5f32, + BlockKind::PolishedAndesite => 1.5f32, + BlockKind::GrassBlock => 0.6f32, + BlockKind::Dirt => 0.5f32, + BlockKind::CoarseDirt => 0.5f32, + BlockKind::Podzol => 0.5f32, + BlockKind::Cobblestone => 2f32, + BlockKind::OakPlanks => 2f32, + BlockKind::SprucePlanks => 2f32, + BlockKind::BirchPlanks => 2f32, + BlockKind::JunglePlanks => 2f32, + BlockKind::AcaciaPlanks => 2f32, + BlockKind::DarkOakPlanks => 2f32, + BlockKind::OakSapling => 0f32, + BlockKind::SpruceSapling => 0f32, + BlockKind::BirchSapling => 0f32, + BlockKind::JungleSapling => 0f32, + BlockKind::AcaciaSapling => 0f32, + BlockKind::DarkOakSapling => 0f32, + BlockKind::Bedrock => -1f32, + BlockKind::Water => 100f32, + BlockKind::Lava => 100f32, + BlockKind::Sand => 0.5f32, + BlockKind::RedSand => 0.5f32, + BlockKind::Gravel => 0.6f32, + BlockKind::GoldOre => 3f32, + BlockKind::DeepslateGoldOre => 4.5f32, + BlockKind::IronOre => 3f32, + BlockKind::DeepslateIronOre => 4.5f32, + BlockKind::CoalOre => 3f32, + BlockKind::DeepslateCoalOre => 4.5f32, + BlockKind::NetherGoldOre => 3f32, + BlockKind::OakLog => 2f32, + BlockKind::SpruceLog => 2f32, + BlockKind::BirchLog => 2f32, + BlockKind::JungleLog => 2f32, + BlockKind::AcaciaLog => 2f32, + BlockKind::DarkOakLog => 2f32, + BlockKind::StrippedSpruceLog => 2f32, + BlockKind::StrippedBirchLog => 2f32, + BlockKind::StrippedJungleLog => 2f32, + BlockKind::StrippedAcaciaLog => 2f32, + BlockKind::StrippedDarkOakLog => 2f32, + BlockKind::StrippedOakLog => 2f32, + BlockKind::OakWood => 2f32, + BlockKind::SpruceWood => 2f32, + BlockKind::BirchWood => 2f32, + BlockKind::JungleWood => 2f32, + BlockKind::AcaciaWood => 2f32, + BlockKind::DarkOakWood => 2f32, + BlockKind::StrippedOakWood => 2f32, + BlockKind::StrippedSpruceWood => 2f32, + BlockKind::StrippedBirchWood => 2f32, + BlockKind::StrippedJungleWood => 2f32, + BlockKind::StrippedAcaciaWood => 2f32, + BlockKind::StrippedDarkOakWood => 2f32, + BlockKind::OakLeaves => 0.2f32, + BlockKind::SpruceLeaves => 0.2f32, + BlockKind::BirchLeaves => 0.2f32, + BlockKind::JungleLeaves => 0.2f32, + BlockKind::AcaciaLeaves => 0.2f32, + BlockKind::DarkOakLeaves => 0.2f32, + BlockKind::AzaleaLeaves => 0.2f32, + BlockKind::FloweringAzaleaLeaves => 0.2f32, + BlockKind::Sponge => 0.6f32, + BlockKind::WetSponge => 0.6f32, + BlockKind::Glass => 0.3f32, + BlockKind::LapisOre => 3f32, + BlockKind::DeepslateLapisOre => 4.5f32, + BlockKind::LapisBlock => 3f32, + BlockKind::Dispenser => 3.5f32, + BlockKind::Sandstone => 0.8f32, + BlockKind::ChiseledSandstone => 0.8f32, + BlockKind::CutSandstone => 0.8f32, + BlockKind::NoteBlock => 0.8f32, + BlockKind::WhiteBed => 0.2f32, + BlockKind::OrangeBed => 0.2f32, + BlockKind::MagentaBed => 0.2f32, + BlockKind::LightBlueBed => 0.2f32, + BlockKind::YellowBed => 0.2f32, + BlockKind::LimeBed => 0.2f32, + BlockKind::PinkBed => 0.2f32, + BlockKind::GrayBed => 0.2f32, + BlockKind::LightGrayBed => 0.2f32, + BlockKind::CyanBed => 0.2f32, + BlockKind::PurpleBed => 0.2f32, + BlockKind::BlueBed => 0.2f32, + BlockKind::BrownBed => 0.2f32, + BlockKind::GreenBed => 0.2f32, + BlockKind::RedBed => 0.2f32, + BlockKind::BlackBed => 0.2f32, + BlockKind::PoweredRail => 0.7f32, + BlockKind::DetectorRail => 0.7f32, + BlockKind::StickyPiston => 1.5f32, + BlockKind::Cobweb => 4f32, + BlockKind::Grass => 0f32, + BlockKind::Fern => 0f32, + BlockKind::DeadBush => 0f32, + BlockKind::Seagrass => 0f32, + BlockKind::TallSeagrass => 0f32, + BlockKind::Piston => 1.5f32, + BlockKind::PistonHead => 1.5f32, + BlockKind::WhiteWool => 0.8f32, + BlockKind::OrangeWool => 0.8f32, + BlockKind::MagentaWool => 0.8f32, + BlockKind::LightBlueWool => 0.8f32, + BlockKind::YellowWool => 0.8f32, + BlockKind::LimeWool => 0.8f32, + BlockKind::PinkWool => 0.8f32, + BlockKind::GrayWool => 0.8f32, + BlockKind::LightGrayWool => 0.8f32, + BlockKind::CyanWool => 0.8f32, + BlockKind::PurpleWool => 0.8f32, + BlockKind::BlueWool => 0.8f32, + BlockKind::BrownWool => 0.8f32, + BlockKind::GreenWool => 0.8f32, + BlockKind::RedWool => 0.8f32, + BlockKind::BlackWool => 0.8f32, + BlockKind::MovingPiston => -1f32, + BlockKind::Dandelion => 0f32, + BlockKind::Poppy => 0f32, + BlockKind::BlueOrchid => 0f32, + BlockKind::Allium => 0f32, + BlockKind::AzureBluet => 0f32, + BlockKind::RedTulip => 0f32, + BlockKind::OrangeTulip => 0f32, + BlockKind::WhiteTulip => 0f32, + BlockKind::PinkTulip => 0f32, + BlockKind::OxeyeDaisy => 0f32, + BlockKind::Cornflower => 0f32, + BlockKind::WitherRose => 0f32, + BlockKind::LilyOfTheValley => 0f32, + BlockKind::BrownMushroom => 0f32, + BlockKind::RedMushroom => 0f32, + BlockKind::GoldBlock => 3f32, + BlockKind::IronBlock => 5f32, + BlockKind::Bricks => 2f32, + BlockKind::Tnt => 0f32, + BlockKind::Bookshelf => 1.5f32, + BlockKind::MossyCobblestone => 2f32, + BlockKind::Obsidian => 50f32, + BlockKind::Torch => 0f32, + BlockKind::WallTorch => 0f32, + BlockKind::Fire => 0f32, + BlockKind::SoulFire => 0f32, + BlockKind::Spawner => 5f32, + BlockKind::OakStairs => 2f32, + BlockKind::Chest => 2.5f32, + BlockKind::RedstoneWire => 0f32, + BlockKind::DiamondOre => 3f32, + BlockKind::DeepslateDiamondOre => 4.5f32, + BlockKind::DiamondBlock => 5f32, + BlockKind::CraftingTable => 2.5f32, + BlockKind::Wheat => 0f32, + BlockKind::Farmland => 0.6f32, + BlockKind::Furnace => 3.5f32, + BlockKind::OakSign => 1f32, + BlockKind::SpruceSign => 1f32, + BlockKind::BirchSign => 1f32, + BlockKind::AcaciaSign => 1f32, + BlockKind::JungleSign => 1f32, + BlockKind::DarkOakSign => 1f32, + BlockKind::OakDoor => 3f32, + BlockKind::Ladder => 0.4f32, + BlockKind::Rail => 0.7f32, + BlockKind::CobblestoneStairs => 2f32, + BlockKind::OakWallSign => 1f32, + BlockKind::SpruceWallSign => 1f32, + BlockKind::BirchWallSign => 1f32, + BlockKind::AcaciaWallSign => 1f32, + BlockKind::JungleWallSign => 1f32, + BlockKind::DarkOakWallSign => 1f32, + BlockKind::Lever => 0.5f32, + BlockKind::StonePressurePlate => 0.5f32, + BlockKind::IronDoor => 5f32, + BlockKind::OakPressurePlate => 0.5f32, + BlockKind::SprucePressurePlate => 0.5f32, + BlockKind::BirchPressurePlate => 0.5f32, + BlockKind::JunglePressurePlate => 0.5f32, + BlockKind::AcaciaPressurePlate => 0.5f32, + BlockKind::DarkOakPressurePlate => 0.5f32, + BlockKind::RedstoneOre => 3f32, + BlockKind::DeepslateRedstoneOre => 4.5f32, + BlockKind::RedstoneTorch => 0f32, + BlockKind::RedstoneWallTorch => 0f32, + BlockKind::StoneButton => 0.5f32, + BlockKind::Snow => 0.1f32, + BlockKind::Ice => 0.5f32, + BlockKind::SnowBlock => 0.2f32, + BlockKind::Cactus => 0.4f32, + BlockKind::Clay => 0.6f32, + BlockKind::SugarCane => 0f32, + BlockKind::Jukebox => 2f32, + BlockKind::OakFence => 2f32, + BlockKind::Pumpkin => 1f32, + BlockKind::Netherrack => 0.4f32, + BlockKind::SoulSand => 0.5f32, + BlockKind::SoulSoil => 0.5f32, + BlockKind::Basalt => 1.25f32, + BlockKind::PolishedBasalt => 1.25f32, + BlockKind::SoulTorch => 0f32, + BlockKind::SoulWallTorch => 0f32, + BlockKind::Glowstone => 0.3f32, + BlockKind::NetherPortal => -1f32, + BlockKind::CarvedPumpkin => 1f32, + BlockKind::JackOLantern => 1f32, + BlockKind::Cake => 0.5f32, + BlockKind::Repeater => 0f32, + BlockKind::WhiteStainedGlass => 0.3f32, + BlockKind::OrangeStainedGlass => 0.3f32, + BlockKind::MagentaStainedGlass => 0.3f32, + BlockKind::LightBlueStainedGlass => 0.3f32, + BlockKind::YellowStainedGlass => 0.3f32, + BlockKind::LimeStainedGlass => 0.3f32, + BlockKind::PinkStainedGlass => 0.3f32, + BlockKind::GrayStainedGlass => 0.3f32, + BlockKind::LightGrayStainedGlass => 0.3f32, + BlockKind::CyanStainedGlass => 0.3f32, + BlockKind::PurpleStainedGlass => 0.3f32, + BlockKind::BlueStainedGlass => 0.3f32, + BlockKind::BrownStainedGlass => 0.3f32, + BlockKind::GreenStainedGlass => 0.3f32, + BlockKind::RedStainedGlass => 0.3f32, + BlockKind::BlackStainedGlass => 0.3f32, + BlockKind::OakTrapdoor => 3f32, + BlockKind::SpruceTrapdoor => 3f32, + BlockKind::BirchTrapdoor => 3f32, + BlockKind::JungleTrapdoor => 3f32, + BlockKind::AcaciaTrapdoor => 3f32, + BlockKind::DarkOakTrapdoor => 3f32, + BlockKind::StoneBricks => 1.5f32, + BlockKind::MossyStoneBricks => 1.5f32, + BlockKind::CrackedStoneBricks => 1.5f32, + BlockKind::ChiseledStoneBricks => 1.5f32, + BlockKind::InfestedStone => 0f32, + BlockKind::InfestedCobblestone => 0f32, + BlockKind::InfestedStoneBricks => 0f32, + BlockKind::InfestedMossyStoneBricks => 0f32, + BlockKind::InfestedCrackedStoneBricks => 0f32, + BlockKind::InfestedChiseledStoneBricks => 0f32, + BlockKind::BrownMushroomBlock => 0.2f32, + BlockKind::RedMushroomBlock => 0.2f32, + BlockKind::MushroomStem => 0.2f32, + BlockKind::IronBars => 5f32, + BlockKind::Chain => 5f32, + BlockKind::GlassPane => 0.3f32, + BlockKind::Melon => 1f32, + BlockKind::AttachedPumpkinStem => 0f32, + BlockKind::AttachedMelonStem => 0f32, + BlockKind::PumpkinStem => 0f32, + BlockKind::MelonStem => 0f32, + BlockKind::Vine => 0.2f32, + BlockKind::GlowLichen => 0.2f32, + BlockKind::OakFenceGate => 2f32, + BlockKind::BrickStairs => 2f32, + BlockKind::StoneBrickStairs => 1.5f32, + BlockKind::Mycelium => 0.6f32, + BlockKind::LilyPad => 0f32, + BlockKind::NetherBricks => 2f32, + BlockKind::NetherBrickFence => 2f32, + BlockKind::NetherBrickStairs => 2f32, + BlockKind::NetherWart => 0f32, + BlockKind::EnchantingTable => 5f32, + BlockKind::BrewingStand => 0.5f32, + BlockKind::Cauldron => 2f32, + BlockKind::WaterCauldron => 0f32, + BlockKind::LavaCauldron => 0f32, + BlockKind::PowderSnowCauldron => 0f32, + BlockKind::EndPortal => -1f32, + BlockKind::EndPortalFrame => -1f32, + BlockKind::EndStone => 3f32, + BlockKind::DragonEgg => 3f32, + BlockKind::RedstoneLamp => 0.3f32, + BlockKind::Cocoa => 0.2f32, + BlockKind::SandstoneStairs => 0.8f32, + BlockKind::EmeraldOre => 3f32, + BlockKind::DeepslateEmeraldOre => 4.5f32, + BlockKind::EnderChest => 22.5f32, + BlockKind::TripwireHook => 0f32, + BlockKind::Tripwire => 0f32, + BlockKind::EmeraldBlock => 5f32, + BlockKind::SpruceStairs => 2f32, + BlockKind::BirchStairs => 2f32, + BlockKind::JungleStairs => 2f32, + BlockKind::CommandBlock => -1f32, + BlockKind::Beacon => 3f32, + BlockKind::CobblestoneWall => 2f32, + BlockKind::MossyCobblestoneWall => 2f32, + BlockKind::FlowerPot => 0f32, + BlockKind::PottedOakSapling => 0f32, + BlockKind::PottedSpruceSapling => 0f32, + BlockKind::PottedBirchSapling => 0f32, + BlockKind::PottedJungleSapling => 0f32, + BlockKind::PottedAcaciaSapling => 0f32, + BlockKind::PottedDarkOakSapling => 0f32, + BlockKind::PottedFern => 0f32, + BlockKind::PottedDandelion => 0f32, + BlockKind::PottedPoppy => 0f32, + BlockKind::PottedBlueOrchid => 0f32, + BlockKind::PottedAllium => 0f32, + BlockKind::PottedAzureBluet => 0f32, + BlockKind::PottedRedTulip => 0f32, + BlockKind::PottedOrangeTulip => 0f32, + BlockKind::PottedWhiteTulip => 0f32, + BlockKind::PottedPinkTulip => 0f32, + BlockKind::PottedOxeyeDaisy => 0f32, + BlockKind::PottedCornflower => 0f32, + BlockKind::PottedLilyOfTheValley => 0f32, + BlockKind::PottedWitherRose => 0f32, + BlockKind::PottedRedMushroom => 0f32, + BlockKind::PottedBrownMushroom => 0f32, + BlockKind::PottedDeadBush => 0f32, + BlockKind::PottedCactus => 0f32, + BlockKind::Carrots => 0f32, + BlockKind::Potatoes => 0f32, + BlockKind::OakButton => 0.5f32, + BlockKind::SpruceButton => 0.5f32, + BlockKind::BirchButton => 0.5f32, + BlockKind::JungleButton => 0.5f32, + BlockKind::AcaciaButton => 0.5f32, + BlockKind::DarkOakButton => 0.5f32, + BlockKind::SkeletonSkull => 1f32, + BlockKind::SkeletonWallSkull => 1f32, + BlockKind::WitherSkeletonSkull => 1f32, + BlockKind::WitherSkeletonWallSkull => 1f32, + BlockKind::ZombieHead => 1f32, + BlockKind::ZombieWallHead => 1f32, + BlockKind::PlayerHead => 1f32, + BlockKind::PlayerWallHead => 1f32, + BlockKind::CreeperHead => 1f32, + BlockKind::CreeperWallHead => 1f32, + BlockKind::DragonHead => 1f32, + BlockKind::DragonWallHead => 1f32, + BlockKind::Anvil => 5f32, + BlockKind::ChippedAnvil => 5f32, + BlockKind::DamagedAnvil => 5f32, + BlockKind::TrappedChest => 2.5f32, + BlockKind::LightWeightedPressurePlate => 0.5f32, + BlockKind::HeavyWeightedPressurePlate => 0.5f32, + BlockKind::Comparator => 0f32, + BlockKind::DaylightDetector => 0.2f32, + BlockKind::RedstoneBlock => 5f32, + BlockKind::NetherQuartzOre => 3f32, + BlockKind::Hopper => 3f32, + BlockKind::QuartzBlock => 0.8f32, + BlockKind::ChiseledQuartzBlock => 0.8f32, + BlockKind::QuartzPillar => 0.8f32, + BlockKind::QuartzStairs => 0.8f32, + BlockKind::ActivatorRail => 0.7f32, + BlockKind::Dropper => 3.5f32, + BlockKind::WhiteTerracotta => 1.25f32, + BlockKind::OrangeTerracotta => 1.25f32, + BlockKind::MagentaTerracotta => 1.25f32, + BlockKind::LightBlueTerracotta => 1.25f32, + BlockKind::YellowTerracotta => 1.25f32, + BlockKind::LimeTerracotta => 1.25f32, + BlockKind::PinkTerracotta => 1.25f32, + BlockKind::GrayTerracotta => 1.25f32, + BlockKind::LightGrayTerracotta => 1.25f32, + BlockKind::CyanTerracotta => 1.25f32, + BlockKind::PurpleTerracotta => 1.25f32, + BlockKind::BlueTerracotta => 1.25f32, + BlockKind::BrownTerracotta => 1.25f32, + BlockKind::GreenTerracotta => 1.25f32, + BlockKind::RedTerracotta => 1.25f32, + BlockKind::BlackTerracotta => 1.25f32, + BlockKind::WhiteStainedGlassPane => 0.3f32, + BlockKind::OrangeStainedGlassPane => 0.3f32, + BlockKind::MagentaStainedGlassPane => 0.3f32, + BlockKind::LightBlueStainedGlassPane => 0.3f32, + BlockKind::YellowStainedGlassPane => 0.3f32, + BlockKind::LimeStainedGlassPane => 0.3f32, + BlockKind::PinkStainedGlassPane => 0.3f32, + BlockKind::GrayStainedGlassPane => 0.3f32, + BlockKind::LightGrayStainedGlassPane => 0.3f32, + BlockKind::CyanStainedGlassPane => 0.3f32, + BlockKind::PurpleStainedGlassPane => 0.3f32, + BlockKind::BlueStainedGlassPane => 0.3f32, + BlockKind::BrownStainedGlassPane => 0.3f32, + BlockKind::GreenStainedGlassPane => 0.3f32, + BlockKind::RedStainedGlassPane => 0.3f32, + BlockKind::BlackStainedGlassPane => 0.3f32, + BlockKind::AcaciaStairs => 2f32, + BlockKind::DarkOakStairs => 2f32, + BlockKind::SlimeBlock => 0f32, + BlockKind::Barrier => -1f32, + BlockKind::Light => -1f32, + BlockKind::IronTrapdoor => 5f32, + BlockKind::Prismarine => 1.5f32, + BlockKind::PrismarineBricks => 1.5f32, + BlockKind::DarkPrismarine => 1.5f32, + BlockKind::PrismarineStairs => 1.5f32, + BlockKind::PrismarineBrickStairs => 1.5f32, + BlockKind::DarkPrismarineStairs => 1.5f32, + BlockKind::PrismarineSlab => 1.5f32, + BlockKind::PrismarineBrickSlab => 1.5f32, + BlockKind::DarkPrismarineSlab => 1.5f32, + BlockKind::SeaLantern => 0.3f32, + BlockKind::HayBlock => 0.5f32, + BlockKind::WhiteCarpet => 0.1f32, + BlockKind::OrangeCarpet => 0.1f32, + BlockKind::MagentaCarpet => 0.1f32, + BlockKind::LightBlueCarpet => 0.1f32, + BlockKind::YellowCarpet => 0.1f32, + BlockKind::LimeCarpet => 0.1f32, + BlockKind::PinkCarpet => 0.1f32, + BlockKind::GrayCarpet => 0.1f32, + BlockKind::LightGrayCarpet => 0.1f32, + BlockKind::CyanCarpet => 0.1f32, + BlockKind::PurpleCarpet => 0.1f32, + BlockKind::BlueCarpet => 0.1f32, + BlockKind::BrownCarpet => 0.1f32, + BlockKind::GreenCarpet => 0.1f32, + BlockKind::RedCarpet => 0.1f32, + BlockKind::BlackCarpet => 0.1f32, + BlockKind::Terracotta => 1.25f32, + BlockKind::CoalBlock => 5f32, + BlockKind::PackedIce => 0.5f32, + BlockKind::Sunflower => 0f32, + BlockKind::Lilac => 0f32, + BlockKind::RoseBush => 0f32, + BlockKind::Peony => 0f32, + BlockKind::TallGrass => 0f32, + BlockKind::LargeFern => 0f32, + BlockKind::WhiteBanner => 1f32, + BlockKind::OrangeBanner => 1f32, + BlockKind::MagentaBanner => 1f32, + BlockKind::LightBlueBanner => 1f32, + BlockKind::YellowBanner => 1f32, + BlockKind::LimeBanner => 1f32, + BlockKind::PinkBanner => 1f32, + BlockKind::GrayBanner => 1f32, + BlockKind::LightGrayBanner => 1f32, + BlockKind::CyanBanner => 1f32, + BlockKind::PurpleBanner => 1f32, + BlockKind::BlueBanner => 1f32, + BlockKind::BrownBanner => 1f32, + BlockKind::GreenBanner => 1f32, + BlockKind::RedBanner => 1f32, + BlockKind::BlackBanner => 1f32, + BlockKind::WhiteWallBanner => 1f32, + BlockKind::OrangeWallBanner => 1f32, + BlockKind::MagentaWallBanner => 1f32, + BlockKind::LightBlueWallBanner => 1f32, + BlockKind::YellowWallBanner => 1f32, + BlockKind::LimeWallBanner => 1f32, + BlockKind::PinkWallBanner => 1f32, + BlockKind::GrayWallBanner => 1f32, + BlockKind::LightGrayWallBanner => 1f32, + BlockKind::CyanWallBanner => 1f32, + BlockKind::PurpleWallBanner => 1f32, + BlockKind::BlueWallBanner => 1f32, + BlockKind::BrownWallBanner => 1f32, + BlockKind::GreenWallBanner => 1f32, + BlockKind::RedWallBanner => 1f32, + BlockKind::BlackWallBanner => 1f32, + BlockKind::RedSandstone => 0.8f32, + BlockKind::ChiseledRedSandstone => 0.8f32, + BlockKind::CutRedSandstone => 0.8f32, + BlockKind::RedSandstoneStairs => 0.8f32, + BlockKind::OakSlab => 2f32, + BlockKind::SpruceSlab => 2f32, + BlockKind::BirchSlab => 2f32, + BlockKind::JungleSlab => 2f32, + BlockKind::AcaciaSlab => 2f32, + BlockKind::DarkOakSlab => 2f32, + BlockKind::StoneSlab => 2f32, + BlockKind::SmoothStoneSlab => 2f32, + BlockKind::SandstoneSlab => 2f32, + BlockKind::CutSandstoneSlab => 2f32, + BlockKind::PetrifiedOakSlab => 2f32, + BlockKind::CobblestoneSlab => 2f32, + BlockKind::BrickSlab => 2f32, + BlockKind::StoneBrickSlab => 2f32, + BlockKind::NetherBrickSlab => 2f32, + BlockKind::QuartzSlab => 2f32, + BlockKind::RedSandstoneSlab => 2f32, + BlockKind::CutRedSandstoneSlab => 2f32, + BlockKind::PurpurSlab => 2f32, + BlockKind::SmoothStone => 2f32, + BlockKind::SmoothSandstone => 2f32, + BlockKind::SmoothQuartz => 2f32, + BlockKind::SmoothRedSandstone => 2f32, + BlockKind::SpruceFenceGate => 2f32, + BlockKind::BirchFenceGate => 2f32, + BlockKind::JungleFenceGate => 2f32, + BlockKind::AcaciaFenceGate => 2f32, + BlockKind::DarkOakFenceGate => 2f32, + BlockKind::SpruceFence => 2f32, + BlockKind::BirchFence => 2f32, + BlockKind::JungleFence => 2f32, + BlockKind::AcaciaFence => 2f32, + BlockKind::DarkOakFence => 2f32, + BlockKind::SpruceDoor => 3f32, + BlockKind::BirchDoor => 3f32, + BlockKind::JungleDoor => 3f32, + BlockKind::AcaciaDoor => 3f32, + BlockKind::DarkOakDoor => 3f32, + BlockKind::EndRod => 0f32, + BlockKind::ChorusPlant => 0.4f32, + BlockKind::ChorusFlower => 0.4f32, + BlockKind::PurpurBlock => 1.5f32, + BlockKind::PurpurPillar => 1.5f32, + BlockKind::PurpurStairs => 1.5f32, + BlockKind::EndStoneBricks => 3f32, + BlockKind::Beetroots => 0f32, + BlockKind::DirtPath => 0.65f32, + BlockKind::EndGateway => -1f32, + BlockKind::RepeatingCommandBlock => -1f32, + BlockKind::ChainCommandBlock => -1f32, + BlockKind::FrostedIce => 0.5f32, + BlockKind::MagmaBlock => 0.5f32, + BlockKind::NetherWartBlock => 1f32, + BlockKind::RedNetherBricks => 2f32, + BlockKind::BoneBlock => 2f32, + BlockKind::StructureVoid => 0f32, + BlockKind::Observer => 3f32, + BlockKind::ShulkerBox => 2f32, + BlockKind::WhiteShulkerBox => 2f32, + BlockKind::OrangeShulkerBox => 2f32, + BlockKind::MagentaShulkerBox => 2f32, + BlockKind::LightBlueShulkerBox => 2f32, + BlockKind::YellowShulkerBox => 2f32, + BlockKind::LimeShulkerBox => 2f32, + BlockKind::PinkShulkerBox => 2f32, + BlockKind::GrayShulkerBox => 2f32, + BlockKind::LightGrayShulkerBox => 2f32, + BlockKind::CyanShulkerBox => 2f32, + BlockKind::PurpleShulkerBox => 2f32, + BlockKind::BlueShulkerBox => 2f32, + BlockKind::BrownShulkerBox => 2f32, + BlockKind::GreenShulkerBox => 2f32, + BlockKind::RedShulkerBox => 2f32, + BlockKind::BlackShulkerBox => 2f32, + BlockKind::WhiteGlazedTerracotta => 1.4f32, + BlockKind::OrangeGlazedTerracotta => 1.4f32, + BlockKind::MagentaGlazedTerracotta => 1.4f32, + BlockKind::LightBlueGlazedTerracotta => 1.4f32, + BlockKind::YellowGlazedTerracotta => 1.4f32, + BlockKind::LimeGlazedTerracotta => 1.4f32, + BlockKind::PinkGlazedTerracotta => 1.4f32, + BlockKind::GrayGlazedTerracotta => 1.4f32, + BlockKind::LightGrayGlazedTerracotta => 1.4f32, + BlockKind::CyanGlazedTerracotta => 1.4f32, + BlockKind::PurpleGlazedTerracotta => 1.4f32, + BlockKind::BlueGlazedTerracotta => 1.4f32, + BlockKind::BrownGlazedTerracotta => 1.4f32, + BlockKind::GreenGlazedTerracotta => 1.4f32, + BlockKind::RedGlazedTerracotta => 1.4f32, + BlockKind::BlackGlazedTerracotta => 1.4f32, + BlockKind::WhiteConcrete => 1.8f32, + BlockKind::OrangeConcrete => 1.8f32, + BlockKind::MagentaConcrete => 1.8f32, + BlockKind::LightBlueConcrete => 1.8f32, + BlockKind::YellowConcrete => 1.8f32, + BlockKind::LimeConcrete => 1.8f32, + BlockKind::PinkConcrete => 1.8f32, + BlockKind::GrayConcrete => 1.8f32, + BlockKind::LightGrayConcrete => 1.8f32, + BlockKind::CyanConcrete => 1.8f32, + BlockKind::PurpleConcrete => 1.8f32, + BlockKind::BlueConcrete => 1.8f32, + BlockKind::BrownConcrete => 1.8f32, + BlockKind::GreenConcrete => 1.8f32, + BlockKind::RedConcrete => 1.8f32, + BlockKind::BlackConcrete => 1.8f32, + BlockKind::WhiteConcretePowder => 0.5f32, + BlockKind::OrangeConcretePowder => 0.5f32, + BlockKind::MagentaConcretePowder => 0.5f32, + BlockKind::LightBlueConcretePowder => 0.5f32, + BlockKind::YellowConcretePowder => 0.5f32, + BlockKind::LimeConcretePowder => 0.5f32, + BlockKind::PinkConcretePowder => 0.5f32, + BlockKind::GrayConcretePowder => 0.5f32, + BlockKind::LightGrayConcretePowder => 0.5f32, + BlockKind::CyanConcretePowder => 0.5f32, + BlockKind::PurpleConcretePowder => 0.5f32, + BlockKind::BlueConcretePowder => 0.5f32, + BlockKind::BrownConcretePowder => 0.5f32, + BlockKind::GreenConcretePowder => 0.5f32, + BlockKind::RedConcretePowder => 0.5f32, + BlockKind::BlackConcretePowder => 0.5f32, + BlockKind::Kelp => 0f32, + BlockKind::KelpPlant => 0f32, + BlockKind::DriedKelpBlock => 0.5f32, + BlockKind::TurtleEgg => 0.5f32, + BlockKind::DeadTubeCoralBlock => 1.5f32, + BlockKind::DeadBrainCoralBlock => 1.5f32, + BlockKind::DeadBubbleCoralBlock => 1.5f32, + BlockKind::DeadFireCoralBlock => 1.5f32, + BlockKind::DeadHornCoralBlock => 1.5f32, + BlockKind::TubeCoralBlock => 1.5f32, + BlockKind::BrainCoralBlock => 1.5f32, + BlockKind::BubbleCoralBlock => 1.5f32, + BlockKind::FireCoralBlock => 1.5f32, + BlockKind::HornCoralBlock => 1.5f32, + BlockKind::DeadTubeCoral => 0f32, + BlockKind::DeadBrainCoral => 0f32, + BlockKind::DeadBubbleCoral => 0f32, + BlockKind::DeadFireCoral => 0f32, + BlockKind::DeadHornCoral => 0f32, + BlockKind::TubeCoral => 0f32, + BlockKind::BrainCoral => 0f32, + BlockKind::BubbleCoral => 0f32, + BlockKind::FireCoral => 0f32, + BlockKind::HornCoral => 0f32, + BlockKind::DeadTubeCoralFan => 0f32, + BlockKind::DeadBrainCoralFan => 0f32, + BlockKind::DeadBubbleCoralFan => 0f32, + BlockKind::DeadFireCoralFan => 0f32, + BlockKind::DeadHornCoralFan => 0f32, + BlockKind::TubeCoralFan => 0f32, + BlockKind::BrainCoralFan => 0f32, + BlockKind::BubbleCoralFan => 0f32, + BlockKind::FireCoralFan => 0f32, + BlockKind::HornCoralFan => 0f32, + BlockKind::DeadTubeCoralWallFan => 0f32, + BlockKind::DeadBrainCoralWallFan => 0f32, + BlockKind::DeadBubbleCoralWallFan => 0f32, + BlockKind::DeadFireCoralWallFan => 0f32, + BlockKind::DeadHornCoralWallFan => 0f32, + BlockKind::TubeCoralWallFan => 0f32, + BlockKind::BrainCoralWallFan => 0f32, + BlockKind::BubbleCoralWallFan => 0f32, + BlockKind::FireCoralWallFan => 0f32, + BlockKind::HornCoralWallFan => 0f32, + BlockKind::SeaPickle => 0f32, + BlockKind::BlueIce => 2.8f32, + BlockKind::Conduit => 3f32, + BlockKind::BambooSapling => 1f32, + BlockKind::Bamboo => 1f32, + BlockKind::PottedBamboo => 0f32, + BlockKind::VoidAir => 0f32, + BlockKind::CaveAir => 0f32, + BlockKind::BubbleColumn => 0f32, + BlockKind::PolishedGraniteStairs => 1.5f32, + BlockKind::SmoothRedSandstoneStairs => 2f32, + BlockKind::MossyStoneBrickStairs => 1.5f32, + BlockKind::PolishedDioriteStairs => 1.5f32, + BlockKind::MossyCobblestoneStairs => 2f32, + BlockKind::EndStoneBrickStairs => 3f32, + BlockKind::StoneStairs => 1.5f32, + BlockKind::SmoothSandstoneStairs => 2f32, + BlockKind::SmoothQuartzStairs => 2f32, + BlockKind::GraniteStairs => 1.5f32, + BlockKind::AndesiteStairs => 1.5f32, + BlockKind::RedNetherBrickStairs => 2f32, + BlockKind::PolishedAndesiteStairs => 1.5f32, + BlockKind::DioriteStairs => 1.5f32, + BlockKind::PolishedGraniteSlab => 1.5f32, + BlockKind::SmoothRedSandstoneSlab => 2f32, + BlockKind::MossyStoneBrickSlab => 1.5f32, + BlockKind::PolishedDioriteSlab => 1.5f32, + BlockKind::MossyCobblestoneSlab => 2f32, + BlockKind::EndStoneBrickSlab => 3f32, + BlockKind::SmoothSandstoneSlab => 2f32, + BlockKind::SmoothQuartzSlab => 2f32, + BlockKind::GraniteSlab => 1.5f32, + BlockKind::AndesiteSlab => 1.5f32, + BlockKind::RedNetherBrickSlab => 2f32, + BlockKind::PolishedAndesiteSlab => 1.5f32, + BlockKind::DioriteSlab => 1.5f32, + BlockKind::BrickWall => 2f32, + BlockKind::PrismarineWall => 1.5f32, + BlockKind::RedSandstoneWall => 0.8f32, + BlockKind::MossyStoneBrickWall => 1.5f32, + BlockKind::GraniteWall => 1.5f32, + BlockKind::StoneBrickWall => 1.5f32, + BlockKind::NetherBrickWall => 2f32, + BlockKind::AndesiteWall => 1.5f32, + BlockKind::RedNetherBrickWall => 2f32, + BlockKind::SandstoneWall => 0.8f32, + BlockKind::EndStoneBrickWall => 3f32, + BlockKind::DioriteWall => 1.5f32, + BlockKind::Scaffolding => 0f32, + BlockKind::Loom => 2.5f32, + BlockKind::Barrel => 2.5f32, + BlockKind::Smoker => 3.5f32, + BlockKind::BlastFurnace => 3.5f32, + BlockKind::CartographyTable => 2.5f32, + BlockKind::FletchingTable => 2.5f32, + BlockKind::Grindstone => 2f32, + BlockKind::Lectern => 2.5f32, + BlockKind::SmithingTable => 2.5f32, + BlockKind::Stonecutter => 3.5f32, + BlockKind::Bell => 5f32, + BlockKind::Lantern => 3.5f32, + BlockKind::SoulLantern => 3.5f32, + BlockKind::Campfire => 2f32, + BlockKind::SoulCampfire => 2f32, + BlockKind::SweetBerryBush => 0f32, + BlockKind::WarpedStem => 2f32, + BlockKind::StrippedWarpedStem => 2f32, + BlockKind::WarpedHyphae => 2f32, + BlockKind::StrippedWarpedHyphae => 2f32, + BlockKind::WarpedNylium => 0.4f32, + BlockKind::WarpedFungus => 0f32, + BlockKind::WarpedWartBlock => 1f32, + BlockKind::WarpedRoots => 0f32, + BlockKind::NetherSprouts => 0f32, + BlockKind::CrimsonStem => 2f32, + BlockKind::StrippedCrimsonStem => 2f32, + BlockKind::CrimsonHyphae => 2f32, + BlockKind::StrippedCrimsonHyphae => 2f32, + BlockKind::CrimsonNylium => 0.4f32, + BlockKind::CrimsonFungus => 0f32, + BlockKind::Shroomlight => 1f32, + BlockKind::WeepingVines => 0f32, + BlockKind::WeepingVinesPlant => 0f32, + BlockKind::TwistingVines => 0f32, + BlockKind::TwistingVinesPlant => 0f32, + BlockKind::CrimsonRoots => 0f32, + BlockKind::CrimsonPlanks => 2f32, + BlockKind::WarpedPlanks => 2f32, + BlockKind::CrimsonSlab => 2f32, + BlockKind::WarpedSlab => 2f32, + BlockKind::CrimsonPressurePlate => 0.5f32, + BlockKind::WarpedPressurePlate => 0.5f32, + BlockKind::CrimsonFence => 2f32, + BlockKind::WarpedFence => 2f32, + BlockKind::CrimsonTrapdoor => 3f32, + BlockKind::WarpedTrapdoor => 3f32, + BlockKind::CrimsonFenceGate => 2f32, + BlockKind::WarpedFenceGate => 2f32, + BlockKind::CrimsonStairs => 2f32, + BlockKind::WarpedStairs => 2f32, + BlockKind::CrimsonButton => 0.5f32, + BlockKind::WarpedButton => 0.5f32, + BlockKind::CrimsonDoor => 3f32, + BlockKind::WarpedDoor => 3f32, + BlockKind::CrimsonSign => 1f32, + BlockKind::WarpedSign => 1f32, + BlockKind::CrimsonWallSign => 1f32, + BlockKind::WarpedWallSign => 1f32, + BlockKind::StructureBlock => -1f32, + BlockKind::Jigsaw => -1f32, + BlockKind::Composter => 0.6f32, + BlockKind::Target => 0.5f32, + BlockKind::BeeNest => 0.3f32, + BlockKind::Beehive => 0.6f32, + BlockKind::HoneyBlock => 0f32, + BlockKind::HoneycombBlock => 0.6f32, + BlockKind::NetheriteBlock => 50f32, + BlockKind::AncientDebris => 30f32, + BlockKind::CryingObsidian => 50f32, + BlockKind::RespawnAnchor => 50f32, + BlockKind::PottedCrimsonFungus => 0f32, + BlockKind::PottedWarpedFungus => 0f32, + BlockKind::PottedCrimsonRoots => 0f32, + BlockKind::PottedWarpedRoots => 0f32, + BlockKind::Lodestone => 3.5f32, + BlockKind::Blackstone => 1.5f32, + BlockKind::BlackstoneStairs => 1.5f32, + BlockKind::BlackstoneWall => 1.5f32, + BlockKind::BlackstoneSlab => 2f32, + BlockKind::PolishedBlackstone => 2f32, + BlockKind::PolishedBlackstoneBricks => 1.5f32, + BlockKind::CrackedPolishedBlackstoneBricks => 1.5f32, + BlockKind::ChiseledPolishedBlackstone => 1.5f32, + BlockKind::PolishedBlackstoneBrickSlab => 2f32, + BlockKind::PolishedBlackstoneBrickStairs => 1.5f32, + BlockKind::PolishedBlackstoneBrickWall => 1.5f32, + BlockKind::GildedBlackstone => 1.5f32, + BlockKind::PolishedBlackstoneStairs => 2f32, + BlockKind::PolishedBlackstoneSlab => 2f32, + BlockKind::PolishedBlackstonePressurePlate => 0.5f32, + BlockKind::PolishedBlackstoneButton => 0.5f32, + BlockKind::PolishedBlackstoneWall => 2f32, + BlockKind::ChiseledNetherBricks => 2f32, + BlockKind::CrackedNetherBricks => 2f32, + BlockKind::QuartzBricks => 0.8f32, + BlockKind::Candle => 0.1f32, + BlockKind::WhiteCandle => 0.1f32, + BlockKind::OrangeCandle => 0.1f32, + BlockKind::MagentaCandle => 0.1f32, + BlockKind::LightBlueCandle => 0.1f32, + BlockKind::YellowCandle => 0.1f32, + BlockKind::LimeCandle => 0.1f32, + BlockKind::PinkCandle => 0.1f32, + BlockKind::GrayCandle => 0.1f32, + BlockKind::LightGrayCandle => 0.1f32, + BlockKind::CyanCandle => 0.1f32, + BlockKind::PurpleCandle => 0.1f32, + BlockKind::BlueCandle => 0.1f32, + BlockKind::BrownCandle => 0.1f32, + BlockKind::GreenCandle => 0.1f32, + BlockKind::RedCandle => 0.1f32, + BlockKind::BlackCandle => 0.1f32, + BlockKind::CandleCake => 0f32, + BlockKind::WhiteCandleCake => 0f32, + BlockKind::OrangeCandleCake => 0f32, + BlockKind::MagentaCandleCake => 0f32, + BlockKind::LightBlueCandleCake => 0f32, + BlockKind::YellowCandleCake => 0f32, + BlockKind::LimeCandleCake => 0f32, + BlockKind::PinkCandleCake => 0f32, + BlockKind::GrayCandleCake => 0f32, + BlockKind::LightGrayCandleCake => 0f32, + BlockKind::CyanCandleCake => 0f32, + BlockKind::PurpleCandleCake => 0f32, + BlockKind::BlueCandleCake => 0f32, + BlockKind::BrownCandleCake => 0f32, + BlockKind::GreenCandleCake => 0f32, + BlockKind::RedCandleCake => 0f32, + BlockKind::BlackCandleCake => 0f32, + BlockKind::AmethystBlock => 1.5f32, + BlockKind::BuddingAmethyst => 1.5f32, + BlockKind::AmethystCluster => 1.5f32, + BlockKind::LargeAmethystBud => 0f32, + BlockKind::MediumAmethystBud => 0f32, + BlockKind::SmallAmethystBud => 0f32, + BlockKind::Tuff => 1.5f32, + BlockKind::Calcite => 0.75f32, + BlockKind::TintedGlass => 0f32, + BlockKind::PowderSnow => 0.25f32, + BlockKind::SculkSensor => 1.5f32, + BlockKind::OxidizedCopper => 3f32, + BlockKind::WeatheredCopper => 3f32, + BlockKind::ExposedCopper => 3f32, + BlockKind::CopperBlock => 3f32, + BlockKind::CopperOre => 0f32, + BlockKind::DeepslateCopperOre => 4.5f32, + BlockKind::OxidizedCutCopper => 0f32, + BlockKind::WeatheredCutCopper => 0f32, + BlockKind::ExposedCutCopper => 0f32, + BlockKind::CutCopper => 0f32, + BlockKind::OxidizedCutCopperStairs => 0f32, + BlockKind::WeatheredCutCopperStairs => 0f32, + BlockKind::ExposedCutCopperStairs => 0f32, + BlockKind::CutCopperStairs => 0f32, + BlockKind::OxidizedCutCopperSlab => 0f32, + BlockKind::WeatheredCutCopperSlab => 0f32, + BlockKind::ExposedCutCopperSlab => 0f32, + BlockKind::CutCopperSlab => 0f32, + BlockKind::WaxedCopperBlock => 0f32, + BlockKind::WaxedWeatheredCopper => 0f32, + BlockKind::WaxedExposedCopper => 0f32, + BlockKind::WaxedOxidizedCopper => 0f32, + BlockKind::WaxedOxidizedCutCopper => 0f32, + BlockKind::WaxedWeatheredCutCopper => 0f32, + BlockKind::WaxedExposedCutCopper => 0f32, + BlockKind::WaxedCutCopper => 0f32, + BlockKind::WaxedOxidizedCutCopperStairs => 0f32, + BlockKind::WaxedWeatheredCutCopperStairs => 0f32, + BlockKind::WaxedExposedCutCopperStairs => 0f32, + BlockKind::WaxedCutCopperStairs => 0f32, + BlockKind::WaxedOxidizedCutCopperSlab => 0f32, + BlockKind::WaxedWeatheredCutCopperSlab => 0f32, + BlockKind::WaxedExposedCutCopperSlab => 0f32, + BlockKind::WaxedCutCopperSlab => 0f32, + BlockKind::LightningRod => 3f32, + BlockKind::PointedDripstone => 1.5f32, + BlockKind::DripstoneBlock => 1.5f32, + BlockKind::CaveVines => 0f32, + BlockKind::CaveVinesPlant => 0f32, + BlockKind::SporeBlossom => 0f32, + BlockKind::Azalea => 0f32, + BlockKind::FloweringAzalea => 0f32, + BlockKind::MossCarpet => 0.1f32, + BlockKind::MossBlock => 0.1f32, + BlockKind::BigDripleaf => 0.1f32, + BlockKind::BigDripleafStem => 0.1f32, + BlockKind::SmallDripleaf => 0f32, + BlockKind::HangingRoots => 0f32, + BlockKind::RootedDirt => 0.5f32, + BlockKind::Deepslate => 3f32, + BlockKind::CobbledDeepslate => 3.5f32, + BlockKind::CobbledDeepslateStairs => 0f32, + BlockKind::CobbledDeepslateSlab => 0f32, + BlockKind::CobbledDeepslateWall => 0f32, + BlockKind::PolishedDeepslate => 0f32, + BlockKind::PolishedDeepslateStairs => 0f32, + BlockKind::PolishedDeepslateSlab => 0f32, + BlockKind::PolishedDeepslateWall => 0f32, + BlockKind::DeepslateTiles => 0f32, + BlockKind::DeepslateTileStairs => 0f32, + BlockKind::DeepslateTileSlab => 0f32, + BlockKind::DeepslateTileWall => 0f32, + BlockKind::DeepslateBricks => 0f32, + BlockKind::DeepslateBrickStairs => 0f32, + BlockKind::DeepslateBrickSlab => 0f32, + BlockKind::DeepslateBrickWall => 0f32, + BlockKind::ChiseledDeepslate => 0f32, + BlockKind::CrackedDeepslateBricks => 0f32, + BlockKind::CrackedDeepslateTiles => 0f32, + BlockKind::InfestedDeepslate => 0f32, + BlockKind::SmoothBasalt => 0f32, + BlockKind::RawIronBlock => 5f32, + BlockKind::RawCopperBlock => 5f32, + BlockKind::RawGoldBlock => 5f32, + BlockKind::PottedAzaleaBush => 0f32, + BlockKind::PottedFloweringAzaleaBush => 0f32, + } + } +} +impl BlockKind { + #[doc = "Returns the `stack_size` property of this `BlockKind`."] + #[inline] + pub fn stack_size(&self) -> u32 { + match self { + BlockKind::Air => 64u32, + BlockKind::Stone => 64u32, + BlockKind::Granite => 64u32, + BlockKind::PolishedGranite => 64u32, + BlockKind::Diorite => 64u32, + BlockKind::PolishedDiorite => 64u32, + BlockKind::Andesite => 64u32, + BlockKind::PolishedAndesite => 64u32, + BlockKind::GrassBlock => 64u32, + BlockKind::Dirt => 64u32, + BlockKind::CoarseDirt => 64u32, + BlockKind::Podzol => 64u32, + BlockKind::Cobblestone => 64u32, + BlockKind::OakPlanks => 64u32, + BlockKind::SprucePlanks => 64u32, + BlockKind::BirchPlanks => 64u32, + BlockKind::JunglePlanks => 64u32, + BlockKind::AcaciaPlanks => 64u32, + BlockKind::DarkOakPlanks => 64u32, + BlockKind::OakSapling => 64u32, + BlockKind::SpruceSapling => 64u32, + BlockKind::BirchSapling => 64u32, + BlockKind::JungleSapling => 64u32, + BlockKind::AcaciaSapling => 64u32, + BlockKind::DarkOakSapling => 64u32, + BlockKind::Bedrock => 64u32, + BlockKind::Water => 64u32, + BlockKind::Lava => 64u32, + BlockKind::Sand => 64u32, + BlockKind::RedSand => 64u32, + BlockKind::Gravel => 64u32, + BlockKind::GoldOre => 64u32, + BlockKind::DeepslateGoldOre => 64u32, + BlockKind::IronOre => 64u32, + BlockKind::DeepslateIronOre => 64u32, + BlockKind::CoalOre => 64u32, + BlockKind::DeepslateCoalOre => 64u32, + BlockKind::NetherGoldOre => 64u32, + BlockKind::OakLog => 64u32, + BlockKind::SpruceLog => 64u32, + BlockKind::BirchLog => 64u32, + BlockKind::JungleLog => 64u32, + BlockKind::AcaciaLog => 64u32, + BlockKind::DarkOakLog => 64u32, + BlockKind::StrippedSpruceLog => 64u32, + BlockKind::StrippedBirchLog => 64u32, + BlockKind::StrippedJungleLog => 64u32, + BlockKind::StrippedAcaciaLog => 64u32, + BlockKind::StrippedDarkOakLog => 64u32, + BlockKind::StrippedOakLog => 64u32, + BlockKind::OakWood => 64u32, + BlockKind::SpruceWood => 64u32, + BlockKind::BirchWood => 64u32, + BlockKind::JungleWood => 64u32, + BlockKind::AcaciaWood => 64u32, + BlockKind::DarkOakWood => 64u32, + BlockKind::StrippedOakWood => 64u32, + BlockKind::StrippedSpruceWood => 64u32, + BlockKind::StrippedBirchWood => 64u32, + BlockKind::StrippedJungleWood => 64u32, + BlockKind::StrippedAcaciaWood => 64u32, + BlockKind::StrippedDarkOakWood => 64u32, + BlockKind::OakLeaves => 64u32, + BlockKind::SpruceLeaves => 64u32, + BlockKind::BirchLeaves => 64u32, + BlockKind::JungleLeaves => 64u32, + BlockKind::AcaciaLeaves => 64u32, + BlockKind::DarkOakLeaves => 64u32, + BlockKind::AzaleaLeaves => 64u32, + BlockKind::FloweringAzaleaLeaves => 64u32, + BlockKind::Sponge => 64u32, + BlockKind::WetSponge => 64u32, + BlockKind::Glass => 64u32, + BlockKind::LapisOre => 64u32, + BlockKind::DeepslateLapisOre => 64u32, + BlockKind::LapisBlock => 64u32, + BlockKind::Dispenser => 64u32, + BlockKind::Sandstone => 64u32, + BlockKind::ChiseledSandstone => 64u32, + BlockKind::CutSandstone => 64u32, + BlockKind::NoteBlock => 64u32, + BlockKind::WhiteBed => 1u32, + BlockKind::OrangeBed => 1u32, + BlockKind::MagentaBed => 1u32, + BlockKind::LightBlueBed => 1u32, + BlockKind::YellowBed => 1u32, + BlockKind::LimeBed => 1u32, + BlockKind::PinkBed => 1u32, + BlockKind::GrayBed => 1u32, + BlockKind::LightGrayBed => 1u32, + BlockKind::CyanBed => 1u32, + BlockKind::PurpleBed => 1u32, + BlockKind::BlueBed => 1u32, + BlockKind::BrownBed => 1u32, + BlockKind::GreenBed => 1u32, + BlockKind::RedBed => 1u32, + BlockKind::BlackBed => 1u32, + BlockKind::PoweredRail => 64u32, + BlockKind::DetectorRail => 64u32, + BlockKind::StickyPiston => 64u32, + BlockKind::Cobweb => 64u32, + BlockKind::Grass => 64u32, + BlockKind::Fern => 64u32, + BlockKind::DeadBush => 64u32, + BlockKind::Seagrass => 64u32, + BlockKind::TallSeagrass => 64u32, + BlockKind::Piston => 64u32, + BlockKind::PistonHead => 64u32, + BlockKind::WhiteWool => 64u32, + BlockKind::OrangeWool => 64u32, + BlockKind::MagentaWool => 64u32, + BlockKind::LightBlueWool => 64u32, + BlockKind::YellowWool => 64u32, + BlockKind::LimeWool => 64u32, + BlockKind::PinkWool => 64u32, + BlockKind::GrayWool => 64u32, + BlockKind::LightGrayWool => 64u32, + BlockKind::CyanWool => 64u32, + BlockKind::PurpleWool => 64u32, + BlockKind::BlueWool => 64u32, + BlockKind::BrownWool => 64u32, + BlockKind::GreenWool => 64u32, + BlockKind::RedWool => 64u32, + BlockKind::BlackWool => 64u32, + BlockKind::MovingPiston => 64u32, + BlockKind::Dandelion => 64u32, + BlockKind::Poppy => 64u32, + BlockKind::BlueOrchid => 64u32, + BlockKind::Allium => 64u32, + BlockKind::AzureBluet => 64u32, + BlockKind::RedTulip => 64u32, + BlockKind::OrangeTulip => 64u32, + BlockKind::WhiteTulip => 64u32, + BlockKind::PinkTulip => 64u32, + BlockKind::OxeyeDaisy => 64u32, + BlockKind::Cornflower => 64u32, + BlockKind::WitherRose => 64u32, + BlockKind::LilyOfTheValley => 64u32, + BlockKind::BrownMushroom => 64u32, + BlockKind::RedMushroom => 64u32, + BlockKind::GoldBlock => 64u32, + BlockKind::IronBlock => 64u32, + BlockKind::Bricks => 64u32, + BlockKind::Tnt => 64u32, + BlockKind::Bookshelf => 64u32, + BlockKind::MossyCobblestone => 64u32, + BlockKind::Obsidian => 64u32, + BlockKind::Torch => 64u32, + BlockKind::WallTorch => 64u32, + BlockKind::Fire => 64u32, + BlockKind::SoulFire => 64u32, + BlockKind::Spawner => 64u32, + BlockKind::OakStairs => 64u32, + BlockKind::Chest => 64u32, + BlockKind::RedstoneWire => 64u32, + BlockKind::DiamondOre => 64u32, + BlockKind::DeepslateDiamondOre => 64u32, + BlockKind::DiamondBlock => 64u32, + BlockKind::CraftingTable => 64u32, + BlockKind::Wheat => 64u32, + BlockKind::Farmland => 64u32, + BlockKind::Furnace => 64u32, + BlockKind::OakSign => 16u32, + BlockKind::SpruceSign => 16u32, + BlockKind::BirchSign => 16u32, + BlockKind::AcaciaSign => 16u32, + BlockKind::JungleSign => 16u32, + BlockKind::DarkOakSign => 16u32, + BlockKind::OakDoor => 64u32, + BlockKind::Ladder => 64u32, + BlockKind::Rail => 64u32, + BlockKind::CobblestoneStairs => 64u32, + BlockKind::OakWallSign => 16u32, + BlockKind::SpruceWallSign => 16u32, + BlockKind::BirchWallSign => 16u32, + BlockKind::AcaciaWallSign => 16u32, + BlockKind::JungleWallSign => 16u32, + BlockKind::DarkOakWallSign => 16u32, + BlockKind::Lever => 64u32, + BlockKind::StonePressurePlate => 64u32, + BlockKind::IronDoor => 64u32, + BlockKind::OakPressurePlate => 64u32, + BlockKind::SprucePressurePlate => 64u32, + BlockKind::BirchPressurePlate => 64u32, + BlockKind::JunglePressurePlate => 64u32, + BlockKind::AcaciaPressurePlate => 64u32, + BlockKind::DarkOakPressurePlate => 64u32, + BlockKind::RedstoneOre => 64u32, + BlockKind::DeepslateRedstoneOre => 64u32, + BlockKind::RedstoneTorch => 64u32, + BlockKind::RedstoneWallTorch => 64u32, + BlockKind::StoneButton => 64u32, + BlockKind::Snow => 64u32, + BlockKind::Ice => 64u32, + BlockKind::SnowBlock => 64u32, + BlockKind::Cactus => 64u32, + BlockKind::Clay => 64u32, + BlockKind::SugarCane => 64u32, + BlockKind::Jukebox => 64u32, + BlockKind::OakFence => 64u32, + BlockKind::Pumpkin => 64u32, + BlockKind::Netherrack => 64u32, + BlockKind::SoulSand => 64u32, + BlockKind::SoulSoil => 64u32, + BlockKind::Basalt => 64u32, + BlockKind::PolishedBasalt => 64u32, + BlockKind::SoulTorch => 64u32, + BlockKind::SoulWallTorch => 64u32, + BlockKind::Glowstone => 64u32, + BlockKind::NetherPortal => 64u32, + BlockKind::CarvedPumpkin => 64u32, + BlockKind::JackOLantern => 64u32, + BlockKind::Cake => 1u32, + BlockKind::Repeater => 64u32, + BlockKind::WhiteStainedGlass => 64u32, + BlockKind::OrangeStainedGlass => 64u32, + BlockKind::MagentaStainedGlass => 64u32, + BlockKind::LightBlueStainedGlass => 64u32, + BlockKind::YellowStainedGlass => 64u32, + BlockKind::LimeStainedGlass => 64u32, + BlockKind::PinkStainedGlass => 64u32, + BlockKind::GrayStainedGlass => 64u32, + BlockKind::LightGrayStainedGlass => 64u32, + BlockKind::CyanStainedGlass => 64u32, + BlockKind::PurpleStainedGlass => 64u32, + BlockKind::BlueStainedGlass => 64u32, + BlockKind::BrownStainedGlass => 64u32, + BlockKind::GreenStainedGlass => 64u32, + BlockKind::RedStainedGlass => 64u32, + BlockKind::BlackStainedGlass => 64u32, + BlockKind::OakTrapdoor => 64u32, + BlockKind::SpruceTrapdoor => 64u32, + BlockKind::BirchTrapdoor => 64u32, + BlockKind::JungleTrapdoor => 64u32, + BlockKind::AcaciaTrapdoor => 64u32, + BlockKind::DarkOakTrapdoor => 64u32, + BlockKind::StoneBricks => 64u32, + BlockKind::MossyStoneBricks => 64u32, + BlockKind::CrackedStoneBricks => 64u32, + BlockKind::ChiseledStoneBricks => 64u32, + BlockKind::InfestedStone => 64u32, + BlockKind::InfestedCobblestone => 64u32, + BlockKind::InfestedStoneBricks => 64u32, + BlockKind::InfestedMossyStoneBricks => 64u32, + BlockKind::InfestedCrackedStoneBricks => 64u32, + BlockKind::InfestedChiseledStoneBricks => 64u32, + BlockKind::BrownMushroomBlock => 64u32, + BlockKind::RedMushroomBlock => 64u32, + BlockKind::MushroomStem => 64u32, + BlockKind::IronBars => 64u32, + BlockKind::Chain => 64u32, + BlockKind::GlassPane => 64u32, + BlockKind::Melon => 64u32, + BlockKind::AttachedPumpkinStem => 64u32, + BlockKind::AttachedMelonStem => 64u32, + BlockKind::PumpkinStem => 64u32, + BlockKind::MelonStem => 64u32, + BlockKind::Vine => 64u32, + BlockKind::GlowLichen => 64u32, + BlockKind::OakFenceGate => 64u32, + BlockKind::BrickStairs => 64u32, + BlockKind::StoneBrickStairs => 64u32, + BlockKind::Mycelium => 64u32, + BlockKind::LilyPad => 64u32, + BlockKind::NetherBricks => 64u32, + BlockKind::NetherBrickFence => 64u32, + BlockKind::NetherBrickStairs => 64u32, + BlockKind::NetherWart => 64u32, + BlockKind::EnchantingTable => 64u32, + BlockKind::BrewingStand => 64u32, + BlockKind::Cauldron => 64u32, + BlockKind::WaterCauldron => 64u32, + BlockKind::LavaCauldron => 64u32, + BlockKind::PowderSnowCauldron => 64u32, + BlockKind::EndPortal => 64u32, + BlockKind::EndPortalFrame => 64u32, + BlockKind::EndStone => 64u32, + BlockKind::DragonEgg => 64u32, + BlockKind::RedstoneLamp => 64u32, + BlockKind::Cocoa => 64u32, + BlockKind::SandstoneStairs => 64u32, + BlockKind::EmeraldOre => 64u32, + BlockKind::DeepslateEmeraldOre => 64u32, + BlockKind::EnderChest => 64u32, + BlockKind::TripwireHook => 64u32, + BlockKind::Tripwire => 64u32, + BlockKind::EmeraldBlock => 64u32, + BlockKind::SpruceStairs => 64u32, + BlockKind::BirchStairs => 64u32, + BlockKind::JungleStairs => 64u32, + BlockKind::CommandBlock => 64u32, + BlockKind::Beacon => 64u32, + BlockKind::CobblestoneWall => 64u32, + BlockKind::MossyCobblestoneWall => 64u32, + BlockKind::FlowerPot => 64u32, + BlockKind::PottedOakSapling => 64u32, + BlockKind::PottedSpruceSapling => 64u32, + BlockKind::PottedBirchSapling => 64u32, + BlockKind::PottedJungleSapling => 64u32, + BlockKind::PottedAcaciaSapling => 64u32, + BlockKind::PottedDarkOakSapling => 64u32, + BlockKind::PottedFern => 64u32, + BlockKind::PottedDandelion => 64u32, + BlockKind::PottedPoppy => 64u32, + BlockKind::PottedBlueOrchid => 64u32, + BlockKind::PottedAllium => 64u32, + BlockKind::PottedAzureBluet => 64u32, + BlockKind::PottedRedTulip => 64u32, + BlockKind::PottedOrangeTulip => 64u32, + BlockKind::PottedWhiteTulip => 64u32, + BlockKind::PottedPinkTulip => 64u32, + BlockKind::PottedOxeyeDaisy => 64u32, + BlockKind::PottedCornflower => 64u32, + BlockKind::PottedLilyOfTheValley => 64u32, + BlockKind::PottedWitherRose => 64u32, + BlockKind::PottedRedMushroom => 64u32, + BlockKind::PottedBrownMushroom => 64u32, + BlockKind::PottedDeadBush => 64u32, + BlockKind::PottedCactus => 64u32, + BlockKind::Carrots => 64u32, + BlockKind::Potatoes => 64u32, + BlockKind::OakButton => 64u32, + BlockKind::SpruceButton => 64u32, + BlockKind::BirchButton => 64u32, + BlockKind::JungleButton => 64u32, + BlockKind::AcaciaButton => 64u32, + BlockKind::DarkOakButton => 64u32, + BlockKind::SkeletonSkull => 64u32, + BlockKind::SkeletonWallSkull => 64u32, + BlockKind::WitherSkeletonSkull => 64u32, + BlockKind::WitherSkeletonWallSkull => 64u32, + BlockKind::ZombieHead => 64u32, + BlockKind::ZombieWallHead => 64u32, + BlockKind::PlayerHead => 64u32, + BlockKind::PlayerWallHead => 64u32, + BlockKind::CreeperHead => 64u32, + BlockKind::CreeperWallHead => 64u32, + BlockKind::DragonHead => 64u32, + BlockKind::DragonWallHead => 64u32, + BlockKind::Anvil => 64u32, + BlockKind::ChippedAnvil => 64u32, + BlockKind::DamagedAnvil => 64u32, + BlockKind::TrappedChest => 64u32, + BlockKind::LightWeightedPressurePlate => 64u32, + BlockKind::HeavyWeightedPressurePlate => 64u32, + BlockKind::Comparator => 64u32, + BlockKind::DaylightDetector => 64u32, + BlockKind::RedstoneBlock => 64u32, + BlockKind::NetherQuartzOre => 64u32, + BlockKind::Hopper => 64u32, + BlockKind::QuartzBlock => 64u32, + BlockKind::ChiseledQuartzBlock => 64u32, + BlockKind::QuartzPillar => 64u32, + BlockKind::QuartzStairs => 64u32, + BlockKind::ActivatorRail => 64u32, + BlockKind::Dropper => 64u32, + BlockKind::WhiteTerracotta => 64u32, + BlockKind::OrangeTerracotta => 64u32, + BlockKind::MagentaTerracotta => 64u32, + BlockKind::LightBlueTerracotta => 64u32, + BlockKind::YellowTerracotta => 64u32, + BlockKind::LimeTerracotta => 64u32, + BlockKind::PinkTerracotta => 64u32, + BlockKind::GrayTerracotta => 64u32, + BlockKind::LightGrayTerracotta => 64u32, + BlockKind::CyanTerracotta => 64u32, + BlockKind::PurpleTerracotta => 64u32, + BlockKind::BlueTerracotta => 64u32, + BlockKind::BrownTerracotta => 64u32, + BlockKind::GreenTerracotta => 64u32, + BlockKind::RedTerracotta => 64u32, + BlockKind::BlackTerracotta => 64u32, + BlockKind::WhiteStainedGlassPane => 64u32, + BlockKind::OrangeStainedGlassPane => 64u32, + BlockKind::MagentaStainedGlassPane => 64u32, + BlockKind::LightBlueStainedGlassPane => 64u32, + BlockKind::YellowStainedGlassPane => 64u32, + BlockKind::LimeStainedGlassPane => 64u32, + BlockKind::PinkStainedGlassPane => 64u32, + BlockKind::GrayStainedGlassPane => 64u32, + BlockKind::LightGrayStainedGlassPane => 64u32, + BlockKind::CyanStainedGlassPane => 64u32, + BlockKind::PurpleStainedGlassPane => 64u32, + BlockKind::BlueStainedGlassPane => 64u32, + BlockKind::BrownStainedGlassPane => 64u32, + BlockKind::GreenStainedGlassPane => 64u32, + BlockKind::RedStainedGlassPane => 64u32, + BlockKind::BlackStainedGlassPane => 64u32, + BlockKind::AcaciaStairs => 64u32, + BlockKind::DarkOakStairs => 64u32, + BlockKind::SlimeBlock => 64u32, + BlockKind::Barrier => 64u32, + BlockKind::Light => 64u32, + BlockKind::IronTrapdoor => 64u32, + BlockKind::Prismarine => 64u32, + BlockKind::PrismarineBricks => 64u32, + BlockKind::DarkPrismarine => 64u32, + BlockKind::PrismarineStairs => 64u32, + BlockKind::PrismarineBrickStairs => 64u32, + BlockKind::DarkPrismarineStairs => 64u32, + BlockKind::PrismarineSlab => 64u32, + BlockKind::PrismarineBrickSlab => 64u32, + BlockKind::DarkPrismarineSlab => 64u32, + BlockKind::SeaLantern => 64u32, + BlockKind::HayBlock => 64u32, + BlockKind::WhiteCarpet => 64u32, + BlockKind::OrangeCarpet => 64u32, + BlockKind::MagentaCarpet => 64u32, + BlockKind::LightBlueCarpet => 64u32, + BlockKind::YellowCarpet => 64u32, + BlockKind::LimeCarpet => 64u32, + BlockKind::PinkCarpet => 64u32, + BlockKind::GrayCarpet => 64u32, + BlockKind::LightGrayCarpet => 64u32, + BlockKind::CyanCarpet => 64u32, + BlockKind::PurpleCarpet => 64u32, + BlockKind::BlueCarpet => 64u32, + BlockKind::BrownCarpet => 64u32, + BlockKind::GreenCarpet => 64u32, + BlockKind::RedCarpet => 64u32, + BlockKind::BlackCarpet => 64u32, + BlockKind::Terracotta => 64u32, + BlockKind::CoalBlock => 64u32, + BlockKind::PackedIce => 64u32, + BlockKind::Sunflower => 64u32, + BlockKind::Lilac => 64u32, + BlockKind::RoseBush => 64u32, + BlockKind::Peony => 64u32, + BlockKind::TallGrass => 64u32, + BlockKind::LargeFern => 64u32, + BlockKind::WhiteBanner => 16u32, + BlockKind::OrangeBanner => 16u32, + BlockKind::MagentaBanner => 16u32, + BlockKind::LightBlueBanner => 16u32, + BlockKind::YellowBanner => 16u32, + BlockKind::LimeBanner => 16u32, + BlockKind::PinkBanner => 16u32, + BlockKind::GrayBanner => 16u32, + BlockKind::LightGrayBanner => 16u32, + BlockKind::CyanBanner => 16u32, + BlockKind::PurpleBanner => 16u32, + BlockKind::BlueBanner => 16u32, + BlockKind::BrownBanner => 16u32, + BlockKind::GreenBanner => 16u32, + BlockKind::RedBanner => 16u32, + BlockKind::BlackBanner => 16u32, + BlockKind::WhiteWallBanner => 16u32, + BlockKind::OrangeWallBanner => 16u32, + BlockKind::MagentaWallBanner => 16u32, + BlockKind::LightBlueWallBanner => 16u32, + BlockKind::YellowWallBanner => 16u32, + BlockKind::LimeWallBanner => 16u32, + BlockKind::PinkWallBanner => 16u32, + BlockKind::GrayWallBanner => 16u32, + BlockKind::LightGrayWallBanner => 16u32, + BlockKind::CyanWallBanner => 16u32, + BlockKind::PurpleWallBanner => 16u32, + BlockKind::BlueWallBanner => 16u32, + BlockKind::BrownWallBanner => 16u32, + BlockKind::GreenWallBanner => 16u32, + BlockKind::RedWallBanner => 16u32, + BlockKind::BlackWallBanner => 16u32, + BlockKind::RedSandstone => 64u32, + BlockKind::ChiseledRedSandstone => 64u32, + BlockKind::CutRedSandstone => 64u32, + BlockKind::RedSandstoneStairs => 64u32, + BlockKind::OakSlab => 64u32, + BlockKind::SpruceSlab => 64u32, + BlockKind::BirchSlab => 64u32, + BlockKind::JungleSlab => 64u32, + BlockKind::AcaciaSlab => 64u32, + BlockKind::DarkOakSlab => 64u32, + BlockKind::StoneSlab => 64u32, + BlockKind::SmoothStoneSlab => 64u32, + BlockKind::SandstoneSlab => 64u32, + BlockKind::CutSandstoneSlab => 64u32, + BlockKind::PetrifiedOakSlab => 64u32, + BlockKind::CobblestoneSlab => 64u32, + BlockKind::BrickSlab => 64u32, + BlockKind::StoneBrickSlab => 64u32, + BlockKind::NetherBrickSlab => 64u32, + BlockKind::QuartzSlab => 64u32, + BlockKind::RedSandstoneSlab => 64u32, + BlockKind::CutRedSandstoneSlab => 64u32, + BlockKind::PurpurSlab => 64u32, + BlockKind::SmoothStone => 64u32, + BlockKind::SmoothSandstone => 64u32, + BlockKind::SmoothQuartz => 64u32, + BlockKind::SmoothRedSandstone => 64u32, + BlockKind::SpruceFenceGate => 64u32, + BlockKind::BirchFenceGate => 64u32, + BlockKind::JungleFenceGate => 64u32, + BlockKind::AcaciaFenceGate => 64u32, + BlockKind::DarkOakFenceGate => 64u32, + BlockKind::SpruceFence => 64u32, + BlockKind::BirchFence => 64u32, + BlockKind::JungleFence => 64u32, + BlockKind::AcaciaFence => 64u32, + BlockKind::DarkOakFence => 64u32, + BlockKind::SpruceDoor => 64u32, + BlockKind::BirchDoor => 64u32, + BlockKind::JungleDoor => 64u32, + BlockKind::AcaciaDoor => 64u32, + BlockKind::DarkOakDoor => 64u32, + BlockKind::EndRod => 64u32, + BlockKind::ChorusPlant => 64u32, + BlockKind::ChorusFlower => 64u32, + BlockKind::PurpurBlock => 64u32, + BlockKind::PurpurPillar => 64u32, + BlockKind::PurpurStairs => 64u32, + BlockKind::EndStoneBricks => 64u32, + BlockKind::Beetroots => 64u32, + BlockKind::DirtPath => 64u32, + BlockKind::EndGateway => 64u32, + BlockKind::RepeatingCommandBlock => 64u32, + BlockKind::ChainCommandBlock => 64u32, + BlockKind::FrostedIce => 64u32, + BlockKind::MagmaBlock => 64u32, + BlockKind::NetherWartBlock => 64u32, + BlockKind::RedNetherBricks => 64u32, + BlockKind::BoneBlock => 64u32, + BlockKind::StructureVoid => 64u32, + BlockKind::Observer => 64u32, + BlockKind::ShulkerBox => 1u32, + BlockKind::WhiteShulkerBox => 1u32, + BlockKind::OrangeShulkerBox => 1u32, + BlockKind::MagentaShulkerBox => 1u32, + BlockKind::LightBlueShulkerBox => 1u32, + BlockKind::YellowShulkerBox => 1u32, + BlockKind::LimeShulkerBox => 1u32, + BlockKind::PinkShulkerBox => 1u32, + BlockKind::GrayShulkerBox => 1u32, + BlockKind::LightGrayShulkerBox => 1u32, + BlockKind::CyanShulkerBox => 1u32, + BlockKind::PurpleShulkerBox => 1u32, + BlockKind::BlueShulkerBox => 1u32, + BlockKind::BrownShulkerBox => 1u32, + BlockKind::GreenShulkerBox => 1u32, + BlockKind::RedShulkerBox => 1u32, + BlockKind::BlackShulkerBox => 1u32, + BlockKind::WhiteGlazedTerracotta => 64u32, + BlockKind::OrangeGlazedTerracotta => 64u32, + BlockKind::MagentaGlazedTerracotta => 64u32, + BlockKind::LightBlueGlazedTerracotta => 64u32, + BlockKind::YellowGlazedTerracotta => 64u32, + BlockKind::LimeGlazedTerracotta => 64u32, + BlockKind::PinkGlazedTerracotta => 64u32, + BlockKind::GrayGlazedTerracotta => 64u32, + BlockKind::LightGrayGlazedTerracotta => 64u32, + BlockKind::CyanGlazedTerracotta => 64u32, + BlockKind::PurpleGlazedTerracotta => 64u32, + BlockKind::BlueGlazedTerracotta => 64u32, + BlockKind::BrownGlazedTerracotta => 64u32, + BlockKind::GreenGlazedTerracotta => 64u32, + BlockKind::RedGlazedTerracotta => 64u32, + BlockKind::BlackGlazedTerracotta => 64u32, + BlockKind::WhiteConcrete => 64u32, + BlockKind::OrangeConcrete => 64u32, + BlockKind::MagentaConcrete => 64u32, + BlockKind::LightBlueConcrete => 64u32, + BlockKind::YellowConcrete => 64u32, + BlockKind::LimeConcrete => 64u32, + BlockKind::PinkConcrete => 64u32, + BlockKind::GrayConcrete => 64u32, + BlockKind::LightGrayConcrete => 64u32, + BlockKind::CyanConcrete => 64u32, + BlockKind::PurpleConcrete => 64u32, + BlockKind::BlueConcrete => 64u32, + BlockKind::BrownConcrete => 64u32, + BlockKind::GreenConcrete => 64u32, + BlockKind::RedConcrete => 64u32, + BlockKind::BlackConcrete => 64u32, + BlockKind::WhiteConcretePowder => 64u32, + BlockKind::OrangeConcretePowder => 64u32, + BlockKind::MagentaConcretePowder => 64u32, + BlockKind::LightBlueConcretePowder => 64u32, + BlockKind::YellowConcretePowder => 64u32, + BlockKind::LimeConcretePowder => 64u32, + BlockKind::PinkConcretePowder => 64u32, + BlockKind::GrayConcretePowder => 64u32, + BlockKind::LightGrayConcretePowder => 64u32, + BlockKind::CyanConcretePowder => 64u32, + BlockKind::PurpleConcretePowder => 64u32, + BlockKind::BlueConcretePowder => 64u32, + BlockKind::BrownConcretePowder => 64u32, + BlockKind::GreenConcretePowder => 64u32, + BlockKind::RedConcretePowder => 64u32, + BlockKind::BlackConcretePowder => 64u32, + BlockKind::Kelp => 64u32, + BlockKind::KelpPlant => 64u32, + BlockKind::DriedKelpBlock => 64u32, + BlockKind::TurtleEgg => 64u32, + BlockKind::DeadTubeCoralBlock => 64u32, + BlockKind::DeadBrainCoralBlock => 64u32, + BlockKind::DeadBubbleCoralBlock => 64u32, + BlockKind::DeadFireCoralBlock => 64u32, + BlockKind::DeadHornCoralBlock => 64u32, + BlockKind::TubeCoralBlock => 64u32, + BlockKind::BrainCoralBlock => 64u32, + BlockKind::BubbleCoralBlock => 64u32, + BlockKind::FireCoralBlock => 64u32, + BlockKind::HornCoralBlock => 64u32, + BlockKind::DeadTubeCoral => 64u32, + BlockKind::DeadBrainCoral => 64u32, + BlockKind::DeadBubbleCoral => 64u32, + BlockKind::DeadFireCoral => 64u32, + BlockKind::DeadHornCoral => 64u32, + BlockKind::TubeCoral => 64u32, + BlockKind::BrainCoral => 64u32, + BlockKind::BubbleCoral => 64u32, + BlockKind::FireCoral => 64u32, + BlockKind::HornCoral => 64u32, + BlockKind::DeadTubeCoralFan => 64u32, + BlockKind::DeadBrainCoralFan => 64u32, + BlockKind::DeadBubbleCoralFan => 64u32, + BlockKind::DeadFireCoralFan => 64u32, + BlockKind::DeadHornCoralFan => 64u32, + BlockKind::TubeCoralFan => 64u32, + BlockKind::BrainCoralFan => 64u32, + BlockKind::BubbleCoralFan => 64u32, + BlockKind::FireCoralFan => 64u32, + BlockKind::HornCoralFan => 64u32, + BlockKind::DeadTubeCoralWallFan => 64u32, + BlockKind::DeadBrainCoralWallFan => 64u32, + BlockKind::DeadBubbleCoralWallFan => 64u32, + BlockKind::DeadFireCoralWallFan => 64u32, + BlockKind::DeadHornCoralWallFan => 64u32, + BlockKind::TubeCoralWallFan => 64u32, + BlockKind::BrainCoralWallFan => 64u32, + BlockKind::BubbleCoralWallFan => 64u32, + BlockKind::FireCoralWallFan => 64u32, + BlockKind::HornCoralWallFan => 64u32, + BlockKind::SeaPickle => 64u32, + BlockKind::BlueIce => 64u32, + BlockKind::Conduit => 64u32, + BlockKind::BambooSapling => 64u32, + BlockKind::Bamboo => 64u32, + BlockKind::PottedBamboo => 64u32, + BlockKind::VoidAir => 64u32, + BlockKind::CaveAir => 64u32, + BlockKind::BubbleColumn => 64u32, + BlockKind::PolishedGraniteStairs => 64u32, + BlockKind::SmoothRedSandstoneStairs => 64u32, + BlockKind::MossyStoneBrickStairs => 64u32, + BlockKind::PolishedDioriteStairs => 64u32, + BlockKind::MossyCobblestoneStairs => 64u32, + BlockKind::EndStoneBrickStairs => 64u32, + BlockKind::StoneStairs => 64u32, + BlockKind::SmoothSandstoneStairs => 64u32, + BlockKind::SmoothQuartzStairs => 64u32, + BlockKind::GraniteStairs => 64u32, + BlockKind::AndesiteStairs => 64u32, + BlockKind::RedNetherBrickStairs => 64u32, + BlockKind::PolishedAndesiteStairs => 64u32, + BlockKind::DioriteStairs => 64u32, + BlockKind::PolishedGraniteSlab => 64u32, + BlockKind::SmoothRedSandstoneSlab => 64u32, + BlockKind::MossyStoneBrickSlab => 64u32, + BlockKind::PolishedDioriteSlab => 64u32, + BlockKind::MossyCobblestoneSlab => 64u32, + BlockKind::EndStoneBrickSlab => 64u32, + BlockKind::SmoothSandstoneSlab => 64u32, + BlockKind::SmoothQuartzSlab => 64u32, + BlockKind::GraniteSlab => 64u32, + BlockKind::AndesiteSlab => 64u32, + BlockKind::RedNetherBrickSlab => 64u32, + BlockKind::PolishedAndesiteSlab => 64u32, + BlockKind::DioriteSlab => 64u32, + BlockKind::BrickWall => 64u32, + BlockKind::PrismarineWall => 64u32, + BlockKind::RedSandstoneWall => 64u32, + BlockKind::MossyStoneBrickWall => 64u32, + BlockKind::GraniteWall => 64u32, + BlockKind::StoneBrickWall => 64u32, + BlockKind::NetherBrickWall => 64u32, + BlockKind::AndesiteWall => 64u32, + BlockKind::RedNetherBrickWall => 64u32, + BlockKind::SandstoneWall => 64u32, + BlockKind::EndStoneBrickWall => 64u32, + BlockKind::DioriteWall => 64u32, + BlockKind::Scaffolding => 64u32, + BlockKind::Loom => 64u32, + BlockKind::Barrel => 64u32, + BlockKind::Smoker => 64u32, + BlockKind::BlastFurnace => 64u32, + BlockKind::CartographyTable => 64u32, + BlockKind::FletchingTable => 64u32, + BlockKind::Grindstone => 64u32, + BlockKind::Lectern => 64u32, + BlockKind::SmithingTable => 64u32, + BlockKind::Stonecutter => 64u32, + BlockKind::Bell => 64u32, + BlockKind::Lantern => 64u32, + BlockKind::SoulLantern => 64u32, + BlockKind::Campfire => 64u32, + BlockKind::SoulCampfire => 64u32, + BlockKind::SweetBerryBush => 64u32, + BlockKind::WarpedStem => 64u32, + BlockKind::StrippedWarpedStem => 64u32, + BlockKind::WarpedHyphae => 64u32, + BlockKind::StrippedWarpedHyphae => 64u32, + BlockKind::WarpedNylium => 64u32, + BlockKind::WarpedFungus => 64u32, + BlockKind::WarpedWartBlock => 64u32, + BlockKind::WarpedRoots => 64u32, + BlockKind::NetherSprouts => 64u32, + BlockKind::CrimsonStem => 64u32, + BlockKind::StrippedCrimsonStem => 64u32, + BlockKind::CrimsonHyphae => 64u32, + BlockKind::StrippedCrimsonHyphae => 64u32, + BlockKind::CrimsonNylium => 64u32, + BlockKind::CrimsonFungus => 64u32, + BlockKind::Shroomlight => 64u32, + BlockKind::WeepingVines => 64u32, + BlockKind::WeepingVinesPlant => 64u32, + BlockKind::TwistingVines => 64u32, + BlockKind::TwistingVinesPlant => 64u32, + BlockKind::CrimsonRoots => 64u32, + BlockKind::CrimsonPlanks => 64u32, + BlockKind::WarpedPlanks => 64u32, + BlockKind::CrimsonSlab => 64u32, + BlockKind::WarpedSlab => 64u32, + BlockKind::CrimsonPressurePlate => 64u32, + BlockKind::WarpedPressurePlate => 64u32, + BlockKind::CrimsonFence => 64u32, + BlockKind::WarpedFence => 64u32, + BlockKind::CrimsonTrapdoor => 64u32, + BlockKind::WarpedTrapdoor => 64u32, + BlockKind::CrimsonFenceGate => 64u32, + BlockKind::WarpedFenceGate => 64u32, + BlockKind::CrimsonStairs => 64u32, + BlockKind::WarpedStairs => 64u32, + BlockKind::CrimsonButton => 64u32, + BlockKind::WarpedButton => 64u32, + BlockKind::CrimsonDoor => 64u32, + BlockKind::WarpedDoor => 64u32, + BlockKind::CrimsonSign => 16u32, + BlockKind::WarpedSign => 16u32, + BlockKind::CrimsonWallSign => 16u32, + BlockKind::WarpedWallSign => 16u32, + BlockKind::StructureBlock => 64u32, + BlockKind::Jigsaw => 64u32, + BlockKind::Composter => 64u32, + BlockKind::Target => 64u32, + BlockKind::BeeNest => 64u32, + BlockKind::Beehive => 64u32, + BlockKind::HoneyBlock => 64u32, + BlockKind::HoneycombBlock => 64u32, + BlockKind::NetheriteBlock => 64u32, + BlockKind::AncientDebris => 64u32, + BlockKind::CryingObsidian => 64u32, + BlockKind::RespawnAnchor => 64u32, + BlockKind::PottedCrimsonFungus => 64u32, + BlockKind::PottedWarpedFungus => 64u32, + BlockKind::PottedCrimsonRoots => 64u32, + BlockKind::PottedWarpedRoots => 64u32, + BlockKind::Lodestone => 64u32, + BlockKind::Blackstone => 64u32, + BlockKind::BlackstoneStairs => 64u32, + BlockKind::BlackstoneWall => 64u32, + BlockKind::BlackstoneSlab => 64u32, + BlockKind::PolishedBlackstone => 64u32, + BlockKind::PolishedBlackstoneBricks => 64u32, + BlockKind::CrackedPolishedBlackstoneBricks => 64u32, + BlockKind::ChiseledPolishedBlackstone => 64u32, + BlockKind::PolishedBlackstoneBrickSlab => 64u32, + BlockKind::PolishedBlackstoneBrickStairs => 64u32, + BlockKind::PolishedBlackstoneBrickWall => 64u32, + BlockKind::GildedBlackstone => 64u32, + BlockKind::PolishedBlackstoneStairs => 64u32, + BlockKind::PolishedBlackstoneSlab => 64u32, + BlockKind::PolishedBlackstonePressurePlate => 64u32, + BlockKind::PolishedBlackstoneButton => 64u32, + BlockKind::PolishedBlackstoneWall => 64u32, + BlockKind::ChiseledNetherBricks => 64u32, + BlockKind::CrackedNetherBricks => 64u32, + BlockKind::QuartzBricks => 64u32, + BlockKind::Candle => 64u32, + BlockKind::WhiteCandle => 64u32, + BlockKind::OrangeCandle => 64u32, + BlockKind::MagentaCandle => 64u32, + BlockKind::LightBlueCandle => 64u32, + BlockKind::YellowCandle => 64u32, + BlockKind::LimeCandle => 64u32, + BlockKind::PinkCandle => 64u32, + BlockKind::GrayCandle => 64u32, + BlockKind::LightGrayCandle => 64u32, + BlockKind::CyanCandle => 64u32, + BlockKind::PurpleCandle => 64u32, + BlockKind::BlueCandle => 64u32, + BlockKind::BrownCandle => 64u32, + BlockKind::GreenCandle => 64u32, + BlockKind::RedCandle => 64u32, + BlockKind::BlackCandle => 64u32, + BlockKind::CandleCake => 64u32, + BlockKind::WhiteCandleCake => 64u32, + BlockKind::OrangeCandleCake => 64u32, + BlockKind::MagentaCandleCake => 64u32, + BlockKind::LightBlueCandleCake => 64u32, + BlockKind::YellowCandleCake => 64u32, + BlockKind::LimeCandleCake => 64u32, + BlockKind::PinkCandleCake => 64u32, + BlockKind::GrayCandleCake => 64u32, + BlockKind::LightGrayCandleCake => 64u32, + BlockKind::CyanCandleCake => 64u32, + BlockKind::PurpleCandleCake => 64u32, + BlockKind::BlueCandleCake => 64u32, + BlockKind::BrownCandleCake => 64u32, + BlockKind::GreenCandleCake => 64u32, + BlockKind::RedCandleCake => 64u32, + BlockKind::BlackCandleCake => 64u32, + BlockKind::AmethystBlock => 64u32, + BlockKind::BuddingAmethyst => 64u32, + BlockKind::AmethystCluster => 64u32, + BlockKind::LargeAmethystBud => 64u32, + BlockKind::MediumAmethystBud => 64u32, + BlockKind::SmallAmethystBud => 64u32, + BlockKind::Tuff => 64u32, + BlockKind::Calcite => 64u32, + BlockKind::TintedGlass => 64u32, + BlockKind::PowderSnow => 1u32, + BlockKind::SculkSensor => 64u32, + BlockKind::OxidizedCopper => 64u32, + BlockKind::WeatheredCopper => 64u32, + BlockKind::ExposedCopper => 64u32, + BlockKind::CopperBlock => 64u32, + BlockKind::CopperOre => 64u32, + BlockKind::DeepslateCopperOre => 64u32, + BlockKind::OxidizedCutCopper => 64u32, + BlockKind::WeatheredCutCopper => 64u32, + BlockKind::ExposedCutCopper => 64u32, + BlockKind::CutCopper => 64u32, + BlockKind::OxidizedCutCopperStairs => 64u32, + BlockKind::WeatheredCutCopperStairs => 64u32, + BlockKind::ExposedCutCopperStairs => 64u32, + BlockKind::CutCopperStairs => 64u32, + BlockKind::OxidizedCutCopperSlab => 64u32, + BlockKind::WeatheredCutCopperSlab => 64u32, + BlockKind::ExposedCutCopperSlab => 64u32, + BlockKind::CutCopperSlab => 64u32, + BlockKind::WaxedCopperBlock => 64u32, + BlockKind::WaxedWeatheredCopper => 64u32, + BlockKind::WaxedExposedCopper => 64u32, + BlockKind::WaxedOxidizedCopper => 64u32, + BlockKind::WaxedOxidizedCutCopper => 64u32, + BlockKind::WaxedWeatheredCutCopper => 64u32, + BlockKind::WaxedExposedCutCopper => 64u32, + BlockKind::WaxedCutCopper => 64u32, + BlockKind::WaxedOxidizedCutCopperStairs => 64u32, + BlockKind::WaxedWeatheredCutCopperStairs => 64u32, + BlockKind::WaxedExposedCutCopperStairs => 64u32, + BlockKind::WaxedCutCopperStairs => 64u32, + BlockKind::WaxedOxidizedCutCopperSlab => 64u32, + BlockKind::WaxedWeatheredCutCopperSlab => 64u32, + BlockKind::WaxedExposedCutCopperSlab => 64u32, + BlockKind::WaxedCutCopperSlab => 64u32, + BlockKind::LightningRod => 64u32, + BlockKind::PointedDripstone => 64u32, + BlockKind::DripstoneBlock => 64u32, + BlockKind::CaveVines => 64u32, + BlockKind::CaveVinesPlant => 64u32, + BlockKind::SporeBlossom => 64u32, + BlockKind::Azalea => 64u32, + BlockKind::FloweringAzalea => 64u32, + BlockKind::MossCarpet => 64u32, + BlockKind::MossBlock => 64u32, + BlockKind::BigDripleaf => 64u32, + BlockKind::BigDripleafStem => 64u32, + BlockKind::SmallDripleaf => 64u32, + BlockKind::HangingRoots => 64u32, + BlockKind::RootedDirt => 64u32, + BlockKind::Deepslate => 64u32, + BlockKind::CobbledDeepslate => 64u32, + BlockKind::CobbledDeepslateStairs => 64u32, + BlockKind::CobbledDeepslateSlab => 64u32, + BlockKind::CobbledDeepslateWall => 64u32, + BlockKind::PolishedDeepslate => 64u32, + BlockKind::PolishedDeepslateStairs => 64u32, + BlockKind::PolishedDeepslateSlab => 64u32, + BlockKind::PolishedDeepslateWall => 64u32, + BlockKind::DeepslateTiles => 64u32, + BlockKind::DeepslateTileStairs => 64u32, + BlockKind::DeepslateTileSlab => 64u32, + BlockKind::DeepslateTileWall => 64u32, + BlockKind::DeepslateBricks => 64u32, + BlockKind::DeepslateBrickStairs => 64u32, + BlockKind::DeepslateBrickSlab => 64u32, + BlockKind::DeepslateBrickWall => 64u32, + BlockKind::ChiseledDeepslate => 64u32, + BlockKind::CrackedDeepslateBricks => 64u32, + BlockKind::CrackedDeepslateTiles => 64u32, + BlockKind::InfestedDeepslate => 64u32, + BlockKind::SmoothBasalt => 64u32, + BlockKind::RawIronBlock => 64u32, + BlockKind::RawCopperBlock => 64u32, + BlockKind::RawGoldBlock => 64u32, + BlockKind::PottedAzaleaBush => 64u32, + BlockKind::PottedFloweringAzaleaBush => 64u32, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `diggable` property of this `BlockKind`. + #[doc = "Returns the `diggable` property of this `BlockKind`."] + #[inline] pub fn diggable(&self) -> bool { match self { BlockKind::Air => true, @@ -6223,8 +10206,11 @@ impl BlockKind { BlockKind::RedSand => true, BlockKind::Gravel => true, BlockKind::GoldOre => true, + BlockKind::DeepslateGoldOre => true, BlockKind::IronOre => true, + BlockKind::DeepslateIronOre => true, BlockKind::CoalOre => true, + BlockKind::DeepslateCoalOre => true, BlockKind::NetherGoldOre => true, BlockKind::OakLog => true, BlockKind::SpruceLog => true, @@ -6256,10 +10242,13 @@ impl BlockKind { BlockKind::JungleLeaves => true, BlockKind::AcaciaLeaves => true, BlockKind::DarkOakLeaves => true, + BlockKind::AzaleaLeaves => true, + BlockKind::FloweringAzaleaLeaves => true, BlockKind::Sponge => true, BlockKind::WetSponge => true, BlockKind::Glass => true, BlockKind::LapisOre => true, + BlockKind::DeepslateLapisOre => true, BlockKind::LapisBlock => true, BlockKind::Dispenser => true, BlockKind::Sandstone => true, @@ -6341,6 +10330,7 @@ impl BlockKind { BlockKind::Chest => true, BlockKind::RedstoneWire => true, BlockKind::DiamondOre => true, + BlockKind::DeepslateDiamondOre => true, BlockKind::DiamondBlock => true, BlockKind::CraftingTable => true, BlockKind::Wheat => true, @@ -6372,6 +10362,7 @@ impl BlockKind { BlockKind::AcaciaPressurePlate => true, BlockKind::DarkOakPressurePlate => true, BlockKind::RedstoneOre => true, + BlockKind::DeepslateRedstoneOre => true, BlockKind::RedstoneTorch => true, BlockKind::RedstoneWallTorch => true, BlockKind::StoneButton => true, @@ -6441,6 +10432,7 @@ impl BlockKind { BlockKind::PumpkinStem => true, BlockKind::MelonStem => true, BlockKind::Vine => true, + BlockKind::GlowLichen => true, BlockKind::OakFenceGate => true, BlockKind::BrickStairs => true, BlockKind::StoneBrickStairs => true, @@ -6453,6 +10445,9 @@ impl BlockKind { BlockKind::EnchantingTable => true, BlockKind::BrewingStand => true, BlockKind::Cauldron => true, + BlockKind::WaterCauldron => true, + BlockKind::LavaCauldron => true, + BlockKind::PowderSnowCauldron => true, BlockKind::EndPortal => false, BlockKind::EndPortalFrame => false, BlockKind::EndStone => true, @@ -6461,6 +10456,7 @@ impl BlockKind { BlockKind::Cocoa => true, BlockKind::SandstoneStairs => true, BlockKind::EmeraldOre => true, + BlockKind::DeepslateEmeraldOre => true, BlockKind::EnderChest => true, BlockKind::TripwireHook => true, BlockKind::Tripwire => true, @@ -6570,6 +10566,7 @@ impl BlockKind { BlockKind::DarkOakStairs => true, BlockKind::SlimeBlock => true, BlockKind::Barrier => false, + BlockKind::Light => false, BlockKind::IronTrapdoor => true, BlockKind::Prismarine => true, BlockKind::PrismarineBricks => true, @@ -6689,7 +10686,7 @@ impl BlockKind { BlockKind::PurpurStairs => true, BlockKind::EndStoneBricks => true, BlockKind::Beetroots => true, - BlockKind::GrassPath => true, + BlockKind::DirtPath => true, BlockKind::EndGateway => false, BlockKind::RepeatingCommandBlock => false, BlockKind::ChainCommandBlock => false, @@ -6954,13 +10951,133 @@ impl BlockKind { BlockKind::ChiseledNetherBricks => true, BlockKind::CrackedNetherBricks => true, BlockKind::QuartzBricks => true, + BlockKind::Candle => true, + BlockKind::WhiteCandle => true, + BlockKind::OrangeCandle => true, + BlockKind::MagentaCandle => true, + BlockKind::LightBlueCandle => true, + BlockKind::YellowCandle => true, + BlockKind::LimeCandle => true, + BlockKind::PinkCandle => true, + BlockKind::GrayCandle => true, + BlockKind::LightGrayCandle => true, + BlockKind::CyanCandle => true, + BlockKind::PurpleCandle => true, + BlockKind::BlueCandle => true, + BlockKind::BrownCandle => true, + BlockKind::GreenCandle => true, + BlockKind::RedCandle => true, + BlockKind::BlackCandle => true, + BlockKind::CandleCake => true, + BlockKind::WhiteCandleCake => true, + BlockKind::OrangeCandleCake => true, + BlockKind::MagentaCandleCake => true, + BlockKind::LightBlueCandleCake => true, + BlockKind::YellowCandleCake => true, + BlockKind::LimeCandleCake => true, + BlockKind::PinkCandleCake => true, + BlockKind::GrayCandleCake => true, + BlockKind::LightGrayCandleCake => true, + BlockKind::CyanCandleCake => true, + BlockKind::PurpleCandleCake => true, + BlockKind::BlueCandleCake => true, + BlockKind::BrownCandleCake => true, + BlockKind::GreenCandleCake => true, + BlockKind::RedCandleCake => true, + BlockKind::BlackCandleCake => true, + BlockKind::AmethystBlock => true, + BlockKind::BuddingAmethyst => true, + BlockKind::AmethystCluster => true, + BlockKind::LargeAmethystBud => true, + BlockKind::MediumAmethystBud => true, + BlockKind::SmallAmethystBud => true, + BlockKind::Tuff => true, + BlockKind::Calcite => true, + BlockKind::TintedGlass => true, + BlockKind::PowderSnow => true, + BlockKind::SculkSensor => true, + BlockKind::OxidizedCopper => true, + BlockKind::WeatheredCopper => true, + BlockKind::ExposedCopper => true, + BlockKind::CopperBlock => true, + BlockKind::CopperOre => true, + BlockKind::DeepslateCopperOre => true, + BlockKind::OxidizedCutCopper => true, + BlockKind::WeatheredCutCopper => true, + BlockKind::ExposedCutCopper => true, + BlockKind::CutCopper => true, + BlockKind::OxidizedCutCopperStairs => true, + BlockKind::WeatheredCutCopperStairs => true, + BlockKind::ExposedCutCopperStairs => true, + BlockKind::CutCopperStairs => true, + BlockKind::OxidizedCutCopperSlab => true, + BlockKind::WeatheredCutCopperSlab => true, + BlockKind::ExposedCutCopperSlab => true, + BlockKind::CutCopperSlab => true, + BlockKind::WaxedCopperBlock => true, + BlockKind::WaxedWeatheredCopper => true, + BlockKind::WaxedExposedCopper => true, + BlockKind::WaxedOxidizedCopper => true, + BlockKind::WaxedOxidizedCutCopper => true, + BlockKind::WaxedWeatheredCutCopper => true, + BlockKind::WaxedExposedCutCopper => true, + BlockKind::WaxedCutCopper => true, + BlockKind::WaxedOxidizedCutCopperStairs => true, + BlockKind::WaxedWeatheredCutCopperStairs => true, + BlockKind::WaxedExposedCutCopperStairs => true, + BlockKind::WaxedCutCopperStairs => true, + BlockKind::WaxedOxidizedCutCopperSlab => true, + BlockKind::WaxedWeatheredCutCopperSlab => true, + BlockKind::WaxedExposedCutCopperSlab => true, + BlockKind::WaxedCutCopperSlab => true, + BlockKind::LightningRod => true, + BlockKind::PointedDripstone => true, + BlockKind::DripstoneBlock => true, + BlockKind::CaveVines => true, + BlockKind::CaveVinesPlant => true, + BlockKind::SporeBlossom => true, + BlockKind::Azalea => true, + BlockKind::FloweringAzalea => true, + BlockKind::MossCarpet => true, + BlockKind::MossBlock => true, + BlockKind::BigDripleaf => true, + BlockKind::BigDripleafStem => true, + BlockKind::SmallDripleaf => true, + BlockKind::HangingRoots => true, + BlockKind::RootedDirt => true, + BlockKind::Deepslate => true, + BlockKind::CobbledDeepslate => true, + BlockKind::CobbledDeepslateStairs => true, + BlockKind::CobbledDeepslateSlab => true, + BlockKind::CobbledDeepslateWall => true, + BlockKind::PolishedDeepslate => true, + BlockKind::PolishedDeepslateStairs => true, + BlockKind::PolishedDeepslateSlab => true, + BlockKind::PolishedDeepslateWall => true, + BlockKind::DeepslateTiles => true, + BlockKind::DeepslateTileStairs => true, + BlockKind::DeepslateTileSlab => true, + BlockKind::DeepslateTileWall => true, + BlockKind::DeepslateBricks => true, + BlockKind::DeepslateBrickStairs => true, + BlockKind::DeepslateBrickSlab => true, + BlockKind::DeepslateBrickWall => true, + BlockKind::ChiseledDeepslate => true, + BlockKind::CrackedDeepslateBricks => true, + BlockKind::CrackedDeepslateTiles => true, + BlockKind::InfestedDeepslate => true, + BlockKind::SmoothBasalt => true, + BlockKind::RawIronBlock => true, + BlockKind::RawCopperBlock => true, + BlockKind::RawGoldBlock => true, + BlockKind::PottedAzaleaBush => true, + BlockKind::PottedFloweringAzaleaBush => true, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `transparent` property of this `BlockKind`. + #[doc = "Returns the `transparent` property of this `BlockKind`."] + #[inline] pub fn transparent(&self) -> bool { match self { BlockKind::Air => true, @@ -6995,8 +11112,11 @@ impl BlockKind { BlockKind::RedSand => false, BlockKind::Gravel => false, BlockKind::GoldOre => false, + BlockKind::DeepslateGoldOre => false, BlockKind::IronOre => false, + BlockKind::DeepslateIronOre => false, BlockKind::CoalOre => false, + BlockKind::DeepslateCoalOre => false, BlockKind::NetherGoldOre => false, BlockKind::OakLog => false, BlockKind::SpruceLog => false, @@ -7028,10 +11148,13 @@ impl BlockKind { BlockKind::JungleLeaves => true, BlockKind::AcaciaLeaves => true, BlockKind::DarkOakLeaves => true, + BlockKind::AzaleaLeaves => true, + BlockKind::FloweringAzaleaLeaves => true, BlockKind::Sponge => false, BlockKind::WetSponge => false, BlockKind::Glass => true, BlockKind::LapisOre => false, + BlockKind::DeepslateLapisOre => false, BlockKind::LapisBlock => false, BlockKind::Dispenser => false, BlockKind::Sandstone => false, @@ -7056,15 +11179,15 @@ impl BlockKind { BlockKind::BlackBed => true, BlockKind::PoweredRail => true, BlockKind::DetectorRail => true, - BlockKind::StickyPiston => true, + BlockKind::StickyPiston => false, BlockKind::Cobweb => true, - BlockKind::Grass => false, + BlockKind::Grass => true, BlockKind::Fern => true, BlockKind::DeadBush => true, BlockKind::Seagrass => true, BlockKind::TallSeagrass => true, - BlockKind::Piston => true, - BlockKind::PistonHead => true, + BlockKind::Piston => false, + BlockKind::PistonHead => false, BlockKind::WhiteWool => false, BlockKind::OrangeWool => false, BlockKind::MagentaWool => false, @@ -7082,25 +11205,25 @@ impl BlockKind { BlockKind::RedWool => false, BlockKind::BlackWool => false, BlockKind::MovingPiston => true, - BlockKind::Dandelion => false, - BlockKind::Poppy => false, + BlockKind::Dandelion => true, + BlockKind::Poppy => true, BlockKind::BlueOrchid => true, - BlockKind::Allium => false, - BlockKind::AzureBluet => false, + BlockKind::Allium => true, + BlockKind::AzureBluet => true, BlockKind::RedTulip => true, BlockKind::OrangeTulip => true, BlockKind::WhiteTulip => true, BlockKind::PinkTulip => true, - BlockKind::OxeyeDaisy => false, + BlockKind::OxeyeDaisy => true, BlockKind::Cornflower => true, BlockKind::WitherRose => true, BlockKind::LilyOfTheValley => true, - BlockKind::BrownMushroom => false, - BlockKind::RedMushroom => false, + BlockKind::BrownMushroom => true, + BlockKind::RedMushroom => true, BlockKind::GoldBlock => false, BlockKind::IronBlock => false, BlockKind::Bricks => false, - BlockKind::Tnt => true, + BlockKind::Tnt => false, BlockKind::Bookshelf => false, BlockKind::MossyCobblestone => false, BlockKind::Obsidian => false, @@ -7109,15 +11232,16 @@ impl BlockKind { BlockKind::Fire => true, BlockKind::SoulFire => true, BlockKind::Spawner => true, - BlockKind::OakStairs => true, - BlockKind::Chest => true, + BlockKind::OakStairs => false, + BlockKind::Chest => false, BlockKind::RedstoneWire => true, BlockKind::DiamondOre => false, + BlockKind::DeepslateDiamondOre => false, BlockKind::DiamondBlock => false, BlockKind::CraftingTable => false, BlockKind::Wheat => true, - BlockKind::Farmland => true, - BlockKind::Furnace => true, + BlockKind::Farmland => false, + BlockKind::Furnace => false, BlockKind::OakSign => true, BlockKind::SpruceSign => true, BlockKind::BirchSign => true, @@ -7127,7 +11251,7 @@ impl BlockKind { BlockKind::OakDoor => true, BlockKind::Ladder => true, BlockKind::Rail => true, - BlockKind::CobblestoneStairs => true, + BlockKind::CobblestoneStairs => false, BlockKind::OakWallSign => true, BlockKind::SpruceWallSign => true, BlockKind::BirchWallSign => true, @@ -7143,19 +11267,20 @@ impl BlockKind { BlockKind::JunglePressurePlate => true, BlockKind::AcaciaPressurePlate => true, BlockKind::DarkOakPressurePlate => true, - BlockKind::RedstoneOre => true, + BlockKind::RedstoneOre => false, + BlockKind::DeepslateRedstoneOre => false, BlockKind::RedstoneTorch => true, BlockKind::RedstoneWallTorch => true, BlockKind::StoneButton => true, BlockKind::Snow => false, BlockKind::Ice => true, BlockKind::SnowBlock => false, - BlockKind::Cactus => true, + BlockKind::Cactus => false, BlockKind::Clay => false, BlockKind::SugarCane => true, BlockKind::Jukebox => false, - BlockKind::OakFence => true, - BlockKind::Pumpkin => true, + BlockKind::OakFence => false, + BlockKind::Pumpkin => false, BlockKind::Netherrack => false, BlockKind::SoulSand => false, BlockKind::SoulSoil => false, @@ -7163,12 +11288,12 @@ impl BlockKind { BlockKind::PolishedBasalt => false, BlockKind::SoulTorch => true, BlockKind::SoulWallTorch => true, - BlockKind::Glowstone => true, + BlockKind::Glowstone => false, BlockKind::NetherPortal => true, - BlockKind::CarvedPumpkin => true, - BlockKind::JackOLantern => true, - BlockKind::Cake => true, - BlockKind::Repeater => true, + BlockKind::CarvedPumpkin => false, + BlockKind::JackOLantern => false, + BlockKind::Cake => false, + BlockKind::Repeater => false, BlockKind::WhiteStainedGlass => true, BlockKind::OrangeStainedGlass => true, BlockKind::MagentaStainedGlass => true, @@ -7207,43 +11332,48 @@ impl BlockKind { BlockKind::IronBars => true, BlockKind::Chain => true, BlockKind::GlassPane => true, - BlockKind::Melon => true, + BlockKind::Melon => false, BlockKind::AttachedPumpkinStem => true, BlockKind::AttachedMelonStem => true, BlockKind::PumpkinStem => true, BlockKind::MelonStem => true, BlockKind::Vine => true, - BlockKind::OakFenceGate => true, - BlockKind::BrickStairs => true, - BlockKind::StoneBrickStairs => true, + BlockKind::GlowLichen => true, + BlockKind::OakFenceGate => false, + BlockKind::BrickStairs => false, + BlockKind::StoneBrickStairs => false, BlockKind::Mycelium => false, BlockKind::LilyPad => true, BlockKind::NetherBricks => false, - BlockKind::NetherBrickFence => true, - BlockKind::NetherBrickStairs => true, + BlockKind::NetherBrickFence => false, + BlockKind::NetherBrickStairs => false, BlockKind::NetherWart => true, - BlockKind::EnchantingTable => true, + BlockKind::EnchantingTable => false, BlockKind::BrewingStand => true, BlockKind::Cauldron => true, + BlockKind::WaterCauldron => true, + BlockKind::LavaCauldron => true, + BlockKind::PowderSnowCauldron => true, BlockKind::EndPortal => true, - BlockKind::EndPortalFrame => true, + BlockKind::EndPortalFrame => false, BlockKind::EndStone => false, BlockKind::DragonEgg => true, - BlockKind::RedstoneLamp => true, + BlockKind::RedstoneLamp => false, BlockKind::Cocoa => true, - BlockKind::SandstoneStairs => true, + BlockKind::SandstoneStairs => false, BlockKind::EmeraldOre => false, - BlockKind::EnderChest => true, + BlockKind::DeepslateEmeraldOre => false, + BlockKind::EnderChest => false, BlockKind::TripwireHook => true, BlockKind::Tripwire => true, BlockKind::EmeraldBlock => false, - BlockKind::SpruceStairs => true, - BlockKind::BirchStairs => true, - BlockKind::JungleStairs => true, + BlockKind::SpruceStairs => false, + BlockKind::BirchStairs => false, + BlockKind::JungleStairs => false, BlockKind::CommandBlock => false, BlockKind::Beacon => true, - BlockKind::CobblestoneWall => true, - BlockKind::MossyCobblestoneWall => true, + BlockKind::CobblestoneWall => false, + BlockKind::MossyCobblestoneWall => false, BlockKind::FlowerPot => true, BlockKind::PottedOakSapling => true, BlockKind::PottedSpruceSapling => true, @@ -7269,41 +11399,41 @@ impl BlockKind { BlockKind::PottedBrownMushroom => true, BlockKind::PottedDeadBush => true, BlockKind::PottedCactus => true, - BlockKind::Carrots => false, - BlockKind::Potatoes => false, + BlockKind::Carrots => true, + BlockKind::Potatoes => true, BlockKind::OakButton => true, BlockKind::SpruceButton => true, BlockKind::BirchButton => true, BlockKind::JungleButton => true, BlockKind::AcaciaButton => true, BlockKind::DarkOakButton => true, - BlockKind::SkeletonSkull => true, - BlockKind::SkeletonWallSkull => true, - BlockKind::WitherSkeletonSkull => true, - BlockKind::WitherSkeletonWallSkull => true, - BlockKind::ZombieHead => true, - BlockKind::ZombieWallHead => true, - BlockKind::PlayerHead => true, - BlockKind::PlayerWallHead => true, - BlockKind::CreeperHead => true, - BlockKind::CreeperWallHead => true, - BlockKind::DragonHead => true, - BlockKind::DragonWallHead => true, - BlockKind::Anvil => true, - BlockKind::ChippedAnvil => true, - BlockKind::DamagedAnvil => true, - BlockKind::TrappedChest => true, + BlockKind::SkeletonSkull => false, + BlockKind::SkeletonWallSkull => false, + BlockKind::WitherSkeletonSkull => false, + BlockKind::WitherSkeletonWallSkull => false, + BlockKind::ZombieHead => false, + BlockKind::ZombieWallHead => false, + BlockKind::PlayerHead => false, + BlockKind::PlayerWallHead => false, + BlockKind::CreeperHead => false, + BlockKind::CreeperWallHead => false, + BlockKind::DragonHead => false, + BlockKind::DragonWallHead => false, + BlockKind::Anvil => false, + BlockKind::ChippedAnvil => false, + BlockKind::DamagedAnvil => false, + BlockKind::TrappedChest => false, BlockKind::LightWeightedPressurePlate => true, BlockKind::HeavyWeightedPressurePlate => true, - BlockKind::Comparator => true, - BlockKind::DaylightDetector => true, - BlockKind::RedstoneBlock => true, + BlockKind::Comparator => false, + BlockKind::DaylightDetector => false, + BlockKind::RedstoneBlock => false, BlockKind::NetherQuartzOre => false, BlockKind::Hopper => true, BlockKind::QuartzBlock => false, BlockKind::ChiseledQuartzBlock => false, BlockKind::QuartzPillar => false, - BlockKind::QuartzStairs => true, + BlockKind::QuartzStairs => false, BlockKind::ActivatorRail => true, BlockKind::Dropper => false, BlockKind::WhiteTerracotta => false, @@ -7338,45 +11468,46 @@ impl BlockKind { BlockKind::GreenStainedGlassPane => true, BlockKind::RedStainedGlassPane => true, BlockKind::BlackStainedGlassPane => true, - BlockKind::AcaciaStairs => true, - BlockKind::DarkOakStairs => true, + BlockKind::AcaciaStairs => false, + BlockKind::DarkOakStairs => false, BlockKind::SlimeBlock => true, BlockKind::Barrier => true, + BlockKind::Light => true, BlockKind::IronTrapdoor => true, BlockKind::Prismarine => false, BlockKind::PrismarineBricks => false, BlockKind::DarkPrismarine => false, - BlockKind::PrismarineStairs => true, - BlockKind::PrismarineBrickStairs => true, - BlockKind::DarkPrismarineStairs => true, - BlockKind::PrismarineSlab => true, - BlockKind::PrismarineBrickSlab => true, - BlockKind::DarkPrismarineSlab => true, - BlockKind::SeaLantern => true, + BlockKind::PrismarineStairs => false, + BlockKind::PrismarineBrickStairs => false, + BlockKind::DarkPrismarineStairs => false, + BlockKind::PrismarineSlab => false, + BlockKind::PrismarineBrickSlab => false, + BlockKind::DarkPrismarineSlab => false, + BlockKind::SeaLantern => false, BlockKind::HayBlock => false, - BlockKind::WhiteCarpet => true, - BlockKind::OrangeCarpet => true, - BlockKind::MagentaCarpet => true, - BlockKind::LightBlueCarpet => true, - BlockKind::YellowCarpet => true, - BlockKind::LimeCarpet => true, - BlockKind::PinkCarpet => true, - BlockKind::GrayCarpet => true, - BlockKind::LightGrayCarpet => true, - BlockKind::CyanCarpet => true, - BlockKind::PurpleCarpet => true, - BlockKind::BlueCarpet => true, - BlockKind::BrownCarpet => true, - BlockKind::GreenCarpet => true, - BlockKind::RedCarpet => true, - BlockKind::BlackCarpet => true, + BlockKind::WhiteCarpet => false, + BlockKind::OrangeCarpet => false, + BlockKind::MagentaCarpet => false, + BlockKind::LightBlueCarpet => false, + BlockKind::YellowCarpet => false, + BlockKind::LimeCarpet => false, + BlockKind::PinkCarpet => false, + BlockKind::GrayCarpet => false, + BlockKind::LightGrayCarpet => false, + BlockKind::CyanCarpet => false, + BlockKind::PurpleCarpet => false, + BlockKind::BlueCarpet => false, + BlockKind::BrownCarpet => false, + BlockKind::GreenCarpet => false, + BlockKind::RedCarpet => false, + BlockKind::BlackCarpet => false, BlockKind::Terracotta => false, BlockKind::CoalBlock => false, BlockKind::PackedIce => false, BlockKind::Sunflower => true, BlockKind::Lilac => true, BlockKind::RoseBush => true, - BlockKind::Peony => false, + BlockKind::Peony => true, BlockKind::TallGrass => true, BlockKind::LargeFern => true, BlockKind::WhiteBanner => true, @@ -7414,55 +11545,55 @@ impl BlockKind { BlockKind::RedSandstone => false, BlockKind::ChiseledRedSandstone => false, BlockKind::CutRedSandstone => false, - BlockKind::RedSandstoneStairs => true, - BlockKind::OakSlab => true, - BlockKind::SpruceSlab => true, - BlockKind::BirchSlab => true, - BlockKind::JungleSlab => true, - BlockKind::AcaciaSlab => true, - BlockKind::DarkOakSlab => true, - BlockKind::StoneSlab => true, - BlockKind::SmoothStoneSlab => true, - BlockKind::SandstoneSlab => true, - BlockKind::CutSandstoneSlab => true, - BlockKind::PetrifiedOakSlab => true, - BlockKind::CobblestoneSlab => true, - BlockKind::BrickSlab => true, - BlockKind::StoneBrickSlab => true, - BlockKind::NetherBrickSlab => true, - BlockKind::QuartzSlab => true, - BlockKind::RedSandstoneSlab => true, - BlockKind::CutRedSandstoneSlab => true, - BlockKind::PurpurSlab => true, + BlockKind::RedSandstoneStairs => false, + BlockKind::OakSlab => false, + BlockKind::SpruceSlab => false, + BlockKind::BirchSlab => false, + BlockKind::JungleSlab => false, + BlockKind::AcaciaSlab => false, + BlockKind::DarkOakSlab => false, + BlockKind::StoneSlab => false, + BlockKind::SmoothStoneSlab => false, + BlockKind::SandstoneSlab => false, + BlockKind::CutSandstoneSlab => false, + BlockKind::PetrifiedOakSlab => false, + BlockKind::CobblestoneSlab => false, + BlockKind::BrickSlab => false, + BlockKind::StoneBrickSlab => false, + BlockKind::NetherBrickSlab => false, + BlockKind::QuartzSlab => false, + BlockKind::RedSandstoneSlab => false, + BlockKind::CutRedSandstoneSlab => false, + BlockKind::PurpurSlab => false, BlockKind::SmoothStone => false, BlockKind::SmoothSandstone => false, BlockKind::SmoothQuartz => false, BlockKind::SmoothRedSandstone => false, - BlockKind::SpruceFenceGate => true, - BlockKind::BirchFenceGate => true, - BlockKind::JungleFenceGate => true, - BlockKind::AcaciaFenceGate => true, - BlockKind::DarkOakFenceGate => true, - BlockKind::SpruceFence => true, - BlockKind::BirchFence => true, - BlockKind::JungleFence => true, - BlockKind::AcaciaFence => true, - BlockKind::DarkOakFence => true, + BlockKind::SpruceFenceGate => false, + BlockKind::BirchFenceGate => false, + BlockKind::JungleFenceGate => false, + BlockKind::AcaciaFenceGate => false, + BlockKind::DarkOakFenceGate => false, + BlockKind::SpruceFence => false, + BlockKind::BirchFence => false, + BlockKind::JungleFence => false, + BlockKind::AcaciaFence => false, + BlockKind::DarkOakFence => false, BlockKind::SpruceDoor => true, BlockKind::BirchDoor => true, BlockKind::JungleDoor => true, BlockKind::AcaciaDoor => true, BlockKind::DarkOakDoor => true, - BlockKind::EndRod => false, + BlockKind::EndRod => true, BlockKind::ChorusPlant => true, BlockKind::ChorusFlower => true, BlockKind::PurpurBlock => false, BlockKind::PurpurPillar => false, - BlockKind::PurpurStairs => true, + BlockKind::PurpurStairs => false, BlockKind::EndStoneBricks => false, BlockKind::Beetroots => true, - BlockKind::GrassPath => true, - BlockKind::EndGateway => false, + BlockKind::DirtPath => false, + BlockKind::EndGateway => true, BlockKind::RepeatingCommandBlock => false, BlockKind::ChainCommandBlock => false, BlockKind::FrostedIce => true, @@ -7470,8 +11601,8 @@ impl BlockKind { BlockKind::NetherWartBlock => false, BlockKind::RedNetherBricks => false, BlockKind::BoneBlock => false, - BlockKind::StructureVoid => false, - BlockKind::Observer => true, + BlockKind::StructureVoid => true, + BlockKind::Observer => false, BlockKind::ShulkerBox => true, BlockKind::WhiteShulkerBox => true, BlockKind::OrangeShulkerBox => true, @@ -7540,7 +11671,7 @@ impl BlockKind { BlockKind::Kelp => true, BlockKind::KelpPlant => true, BlockKind::DriedKelpBlock => false, - BlockKind::TurtleEgg => false, + BlockKind::TurtleEgg => true, BlockKind::DeadTubeCoralBlock => false, BlockKind::DeadBrainCoralBlock => false, BlockKind::DeadBubbleCoralBlock => false, @@ -7581,70 +11712,70 @@ impl BlockKind { BlockKind::BubbleCoralWallFan => true, BlockKind::FireCoralWallFan => true, BlockKind::HornCoralWallFan => true, - BlockKind::SeaPickle => false, + BlockKind::SeaPickle => true, BlockKind::BlueIce => false, - BlockKind::Conduit => false, - BlockKind::BambooSapling => false, - BlockKind::Bamboo => false, + BlockKind::Conduit => true, + BlockKind::BambooSapling => true, + BlockKind::Bamboo => true, BlockKind::PottedBamboo => true, BlockKind::VoidAir => true, BlockKind::CaveAir => true, BlockKind::BubbleColumn => true, - BlockKind::PolishedGraniteStairs => true, - BlockKind::SmoothRedSandstoneStairs => true, - BlockKind::MossyStoneBrickStairs => true, - BlockKind::PolishedDioriteStairs => true, - BlockKind::MossyCobblestoneStairs => true, - BlockKind::EndStoneBrickStairs => true, - BlockKind::StoneStairs => true, - BlockKind::SmoothSandstoneStairs => true, - BlockKind::SmoothQuartzStairs => true, - BlockKind::GraniteStairs => true, - BlockKind::AndesiteStairs => true, - BlockKind::RedNetherBrickStairs => true, - BlockKind::PolishedAndesiteStairs => true, - BlockKind::DioriteStairs => true, - BlockKind::PolishedGraniteSlab => true, - BlockKind::SmoothRedSandstoneSlab => true, - BlockKind::MossyStoneBrickSlab => true, - BlockKind::PolishedDioriteSlab => true, - BlockKind::MossyCobblestoneSlab => true, - BlockKind::EndStoneBrickSlab => true, - BlockKind::SmoothSandstoneSlab => true, - BlockKind::SmoothQuartzSlab => true, - BlockKind::GraniteSlab => true, - BlockKind::AndesiteSlab => true, - BlockKind::RedNetherBrickSlab => true, - BlockKind::PolishedAndesiteSlab => true, - BlockKind::DioriteSlab => true, - BlockKind::BrickWall => true, - BlockKind::PrismarineWall => true, - BlockKind::RedSandstoneWall => true, - BlockKind::MossyStoneBrickWall => true, - BlockKind::GraniteWall => true, - BlockKind::StoneBrickWall => true, - BlockKind::NetherBrickWall => true, - BlockKind::AndesiteWall => true, - BlockKind::RedNetherBrickWall => true, - BlockKind::SandstoneWall => true, - BlockKind::EndStoneBrickWall => true, - BlockKind::DioriteWall => true, + BlockKind::PolishedGraniteStairs => false, + BlockKind::SmoothRedSandstoneStairs => false, + BlockKind::MossyStoneBrickStairs => false, + BlockKind::PolishedDioriteStairs => false, + BlockKind::MossyCobblestoneStairs => false, + BlockKind::EndStoneBrickStairs => false, + BlockKind::StoneStairs => false, + BlockKind::SmoothSandstoneStairs => false, + BlockKind::SmoothQuartzStairs => false, + BlockKind::GraniteStairs => false, + BlockKind::AndesiteStairs => false, + BlockKind::RedNetherBrickStairs => false, + BlockKind::PolishedAndesiteStairs => false, + BlockKind::DioriteStairs => false, + BlockKind::PolishedGraniteSlab => false, + BlockKind::SmoothRedSandstoneSlab => false, + BlockKind::MossyStoneBrickSlab => false, + BlockKind::PolishedDioriteSlab => false, + BlockKind::MossyCobblestoneSlab => false, + BlockKind::EndStoneBrickSlab => false, + BlockKind::SmoothSandstoneSlab => false, + BlockKind::SmoothQuartzSlab => false, + BlockKind::GraniteSlab => false, + BlockKind::AndesiteSlab => false, + BlockKind::RedNetherBrickSlab => false, + BlockKind::PolishedAndesiteSlab => false, + BlockKind::DioriteSlab => false, + BlockKind::BrickWall => false, + BlockKind::PrismarineWall => false, + BlockKind::RedSandstoneWall => false, + BlockKind::MossyStoneBrickWall => false, + BlockKind::GraniteWall => false, + BlockKind::StoneBrickWall => false, + BlockKind::NetherBrickWall => false, + BlockKind::AndesiteWall => false, + BlockKind::RedNetherBrickWall => false, + BlockKind::SandstoneWall => false, + BlockKind::EndStoneBrickWall => false, + BlockKind::DioriteWall => false, BlockKind::Scaffolding => true, BlockKind::Loom => false, - BlockKind::Barrel => true, - BlockKind::Smoker => true, - BlockKind::BlastFurnace => true, + BlockKind::Barrel => false, + BlockKind::Smoker => false, + BlockKind::BlastFurnace => false, BlockKind::CartographyTable => false, BlockKind::FletchingTable => false, - BlockKind::Grindstone => true, + BlockKind::Grindstone => false, BlockKind::Lectern => false, BlockKind::SmithingTable => false, BlockKind::Stonecutter => false, - BlockKind::Bell => true, + BlockKind::Bell => false, BlockKind::Lantern => true, BlockKind::SoulLantern => true, - BlockKind::Campfire => false, - BlockKind::SoulCampfire => false, + BlockKind::Campfire => true, + BlockKind::SoulCampfire => true, BlockKind::SweetBerryBush => true, BlockKind::WarpedStem => false, BlockKind::StrippedWarpedStem => false, @@ -7669,18 +11800,18 @@ impl BlockKind { BlockKind::CrimsonRoots => true, BlockKind::CrimsonPlanks => false, BlockKind::WarpedPlanks => false, - BlockKind::CrimsonSlab => true, - BlockKind::WarpedSlab => true, + BlockKind::CrimsonSlab => false, + BlockKind::WarpedSlab => false, BlockKind::CrimsonPressurePlate => true, BlockKind::WarpedPressurePlate => true, - BlockKind::CrimsonFence => true, - BlockKind::WarpedFence => true, + BlockKind::CrimsonFence => false, + BlockKind::WarpedFence => false, BlockKind::CrimsonTrapdoor => true, BlockKind::WarpedTrapdoor => true, - BlockKind::CrimsonFenceGate => true, - BlockKind::WarpedFenceGate => true, - BlockKind::CrimsonStairs => true, - BlockKind::WarpedStairs => true, + BlockKind::CrimsonFenceGate => false, + BlockKind::WarpedFenceGate => false, + BlockKind::CrimsonStairs => false, + BlockKind::WarpedStairs => false, BlockKind::CrimsonButton => true, BlockKind::WarpedButton => true, BlockKind::CrimsonDoor => true, @@ -7691,8 +11822,8 @@ impl BlockKind { BlockKind::WarpedWallSign => true, BlockKind::StructureBlock => false, BlockKind::Jigsaw => false, - BlockKind::Composter => true, - BlockKind::Target => true, + BlockKind::Composter => false, + BlockKind::Target => false, BlockKind::BeeNest => false, BlockKind::Beehive => false, BlockKind::HoneyBlock => true, @@ -7707,1589 +11838,4695 @@ impl BlockKind { BlockKind::PottedWarpedRoots => true, BlockKind::Lodestone => false, BlockKind::Blackstone => false, - BlockKind::BlackstoneStairs => true, - BlockKind::BlackstoneWall => true, - BlockKind::BlackstoneSlab => true, + BlockKind::BlackstoneStairs => false, + BlockKind::BlackstoneWall => false, + BlockKind::BlackstoneSlab => false, BlockKind::PolishedBlackstone => false, BlockKind::PolishedBlackstoneBricks => false, BlockKind::CrackedPolishedBlackstoneBricks => false, - BlockKind::ChiseledPolishedBlackstone => true, - BlockKind::PolishedBlackstoneBrickSlab => true, - BlockKind::PolishedBlackstoneBrickStairs => true, - BlockKind::PolishedBlackstoneBrickWall => true, + BlockKind::ChiseledPolishedBlackstone => false, + BlockKind::PolishedBlackstoneBrickSlab => false, + BlockKind::PolishedBlackstoneBrickStairs => false, + BlockKind::PolishedBlackstoneBrickWall => false, BlockKind::GildedBlackstone => false, - BlockKind::PolishedBlackstoneStairs => true, - BlockKind::PolishedBlackstoneSlab => true, + BlockKind::PolishedBlackstoneStairs => false, + BlockKind::PolishedBlackstoneSlab => false, BlockKind::PolishedBlackstonePressurePlate => true, BlockKind::PolishedBlackstoneButton => true, - BlockKind::PolishedBlackstoneWall => true, + BlockKind::PolishedBlackstoneWall => false, BlockKind::ChiseledNetherBricks => false, BlockKind::CrackedNetherBricks => false, BlockKind::QuartzBricks => false, + BlockKind::Candle => true, + BlockKind::WhiteCandle => true, + BlockKind::OrangeCandle => true, + BlockKind::MagentaCandle => true, + BlockKind::LightBlueCandle => true, + BlockKind::YellowCandle => true, + BlockKind::LimeCandle => true, + BlockKind::PinkCandle => true, + BlockKind::GrayCandle => true, + BlockKind::LightGrayCandle => true, + BlockKind::CyanCandle => true, + BlockKind::PurpleCandle => true, + BlockKind::BlueCandle => true, + BlockKind::BrownCandle => true, + BlockKind::GreenCandle => true, + BlockKind::RedCandle => true, + BlockKind::BlackCandle => true, + BlockKind::CandleCake => false, + BlockKind::WhiteCandleCake => false, + BlockKind::OrangeCandleCake => false, + BlockKind::MagentaCandleCake => false, + BlockKind::LightBlueCandleCake => false, + BlockKind::YellowCandleCake => false, + BlockKind::LimeCandleCake => false, + BlockKind::PinkCandleCake => false, + BlockKind::GrayCandleCake => false, + BlockKind::LightGrayCandleCake => false, + BlockKind::CyanCandleCake => false, + BlockKind::PurpleCandleCake => false, + BlockKind::BlueCandleCake => false, + BlockKind::BrownCandleCake => false, + BlockKind::GreenCandleCake => false, + BlockKind::RedCandleCake => false, + BlockKind::BlackCandleCake => false, + BlockKind::AmethystBlock => false, + BlockKind::BuddingAmethyst => false, + BlockKind::AmethystCluster => true, + BlockKind::LargeAmethystBud => true, + BlockKind::MediumAmethystBud => true, + BlockKind::SmallAmethystBud => true, + BlockKind::Tuff => false, + BlockKind::Calcite => false, + BlockKind::TintedGlass => true, + BlockKind::PowderSnow => false, + BlockKind::SculkSensor => false, + BlockKind::OxidizedCopper => false, + BlockKind::WeatheredCopper => false, + BlockKind::ExposedCopper => false, + BlockKind::CopperBlock => false, + BlockKind::CopperOre => false, + BlockKind::DeepslateCopperOre => false, + BlockKind::OxidizedCutCopper => false, + BlockKind::WeatheredCutCopper => false, + BlockKind::ExposedCutCopper => false, + BlockKind::CutCopper => false, + BlockKind::OxidizedCutCopperStairs => false, + BlockKind::WeatheredCutCopperStairs => false, + BlockKind::ExposedCutCopperStairs => false, + BlockKind::CutCopperStairs => false, + BlockKind::OxidizedCutCopperSlab => false, + BlockKind::WeatheredCutCopperSlab => false, + BlockKind::ExposedCutCopperSlab => false, + BlockKind::CutCopperSlab => false, + BlockKind::WaxedCopperBlock => false, + BlockKind::WaxedWeatheredCopper => false, + BlockKind::WaxedExposedCopper => false, + BlockKind::WaxedOxidizedCopper => false, + BlockKind::WaxedOxidizedCutCopper => false, + BlockKind::WaxedWeatheredCutCopper => false, + BlockKind::WaxedExposedCutCopper => false, + BlockKind::WaxedCutCopper => false, + BlockKind::WaxedOxidizedCutCopperStairs => false, + BlockKind::WaxedWeatheredCutCopperStairs => false, + BlockKind::WaxedExposedCutCopperStairs => false, + BlockKind::WaxedCutCopperStairs => false, + BlockKind::WaxedOxidizedCutCopperSlab => false, + BlockKind::WaxedWeatheredCutCopperSlab => false, + BlockKind::WaxedExposedCutCopperSlab => false, + BlockKind::WaxedCutCopperSlab => false, + BlockKind::LightningRod => true, + BlockKind::PointedDripstone => true, + BlockKind::DripstoneBlock => false, + BlockKind::CaveVines => true, + BlockKind::CaveVinesPlant => true, + BlockKind::SporeBlossom => true, + BlockKind::Azalea => true, + BlockKind::FloweringAzalea => true, + BlockKind::MossCarpet => false, + BlockKind::MossBlock => false, + BlockKind::BigDripleaf => false, + BlockKind::BigDripleafStem => true, + BlockKind::SmallDripleaf => true, + BlockKind::HangingRoots => true, + BlockKind::RootedDirt => false, + BlockKind::Deepslate => false, + BlockKind::CobbledDeepslate => false, + BlockKind::CobbledDeepslateStairs => false, + BlockKind::CobbledDeepslateSlab => false, + BlockKind::CobbledDeepslateWall => false, + BlockKind::PolishedDeepslate => false, + BlockKind::PolishedDeepslateStairs => false, + BlockKind::PolishedDeepslateSlab => false, + BlockKind::PolishedDeepslateWall => false, + BlockKind::DeepslateTiles => false, + BlockKind::DeepslateTileStairs => false, + BlockKind::DeepslateTileSlab => false, + BlockKind::DeepslateTileWall => false, + BlockKind::DeepslateBricks => false, + BlockKind::DeepslateBrickStairs => false, + BlockKind::DeepslateBrickSlab => false, + BlockKind::DeepslateBrickWall => false, + BlockKind::ChiseledDeepslate => false, + BlockKind::CrackedDeepslateBricks => false, + BlockKind::CrackedDeepslateTiles => false, + BlockKind::InfestedDeepslate => false, + BlockKind::SmoothBasalt => false, + BlockKind::RawIronBlock => false, + BlockKind::RawCopperBlock => false, + BlockKind::RawGoldBlock => false, + BlockKind::PottedAzaleaBush => true, + BlockKind::PottedFloweringAzaleaBush => true, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `light_emission` property of this `BlockKind`. - pub fn light_emission(&self) -> u8 { + #[doc = "Returns the `default_state_id` property of this `BlockKind`."] + #[inline] + pub fn default_state_id(&self) -> u16 { match self { - BlockKind::Air => 0, - BlockKind::Stone => 0, - BlockKind::Granite => 0, - BlockKind::PolishedGranite => 0, - BlockKind::Diorite => 0, - BlockKind::PolishedDiorite => 0, - BlockKind::Andesite => 0, - BlockKind::PolishedAndesite => 0, - BlockKind::GrassBlock => 0, - BlockKind::Dirt => 0, - BlockKind::CoarseDirt => 0, - BlockKind::Podzol => 0, - BlockKind::Cobblestone => 0, - BlockKind::OakPlanks => 0, - BlockKind::SprucePlanks => 0, - BlockKind::BirchPlanks => 0, - BlockKind::JunglePlanks => 0, - BlockKind::AcaciaPlanks => 0, - BlockKind::DarkOakPlanks => 0, - BlockKind::OakSapling => 0, - BlockKind::SpruceSapling => 0, - BlockKind::BirchSapling => 0, - BlockKind::JungleSapling => 0, - BlockKind::AcaciaSapling => 0, - BlockKind::DarkOakSapling => 0, - BlockKind::Bedrock => 0, - BlockKind::Water => 0, - BlockKind::Lava => 15, - BlockKind::Sand => 0, - BlockKind::RedSand => 0, - BlockKind::Gravel => 0, - BlockKind::GoldOre => 0, - BlockKind::IronOre => 0, - BlockKind::CoalOre => 0, - BlockKind::NetherGoldOre => 0, - BlockKind::OakLog => 0, - BlockKind::SpruceLog => 0, - BlockKind::BirchLog => 0, - BlockKind::JungleLog => 0, - BlockKind::AcaciaLog => 0, - BlockKind::DarkOakLog => 0, - BlockKind::StrippedSpruceLog => 0, - BlockKind::StrippedBirchLog => 0, - BlockKind::StrippedJungleLog => 0, - BlockKind::StrippedAcaciaLog => 0, - BlockKind::StrippedDarkOakLog => 0, - BlockKind::StrippedOakLog => 0, - BlockKind::OakWood => 0, - BlockKind::SpruceWood => 0, - BlockKind::BirchWood => 0, - BlockKind::JungleWood => 0, - BlockKind::AcaciaWood => 0, - BlockKind::DarkOakWood => 0, - BlockKind::StrippedOakWood => 0, - BlockKind::StrippedSpruceWood => 0, - BlockKind::StrippedBirchWood => 0, - BlockKind::StrippedJungleWood => 0, - BlockKind::StrippedAcaciaWood => 0, - BlockKind::StrippedDarkOakWood => 0, - BlockKind::OakLeaves => 0, - BlockKind::SpruceLeaves => 0, - BlockKind::BirchLeaves => 0, - BlockKind::JungleLeaves => 0, - BlockKind::AcaciaLeaves => 0, - BlockKind::DarkOakLeaves => 0, - BlockKind::Sponge => 0, - BlockKind::WetSponge => 0, - BlockKind::Glass => 0, - BlockKind::LapisOre => 0, - BlockKind::LapisBlock => 0, - BlockKind::Dispenser => 0, - BlockKind::Sandstone => 0, - BlockKind::ChiseledSandstone => 0, - BlockKind::CutSandstone => 0, - BlockKind::NoteBlock => 0, - BlockKind::WhiteBed => 0, - BlockKind::OrangeBed => 0, - BlockKind::MagentaBed => 0, - BlockKind::LightBlueBed => 0, - BlockKind::YellowBed => 0, - BlockKind::LimeBed => 0, - BlockKind::PinkBed => 0, - BlockKind::GrayBed => 0, - BlockKind::LightGrayBed => 0, - BlockKind::CyanBed => 0, - BlockKind::PurpleBed => 0, - BlockKind::BlueBed => 0, - BlockKind::BrownBed => 0, - BlockKind::GreenBed => 0, - BlockKind::RedBed => 0, - BlockKind::BlackBed => 0, - BlockKind::PoweredRail => 0, - BlockKind::DetectorRail => 0, - BlockKind::StickyPiston => 0, - BlockKind::Cobweb => 0, - BlockKind::Grass => 0, - BlockKind::Fern => 0, - BlockKind::DeadBush => 0, - BlockKind::Seagrass => 0, - BlockKind::TallSeagrass => 0, - BlockKind::Piston => 0, - BlockKind::PistonHead => 0, - BlockKind::WhiteWool => 0, - BlockKind::OrangeWool => 0, - BlockKind::MagentaWool => 0, - BlockKind::LightBlueWool => 0, - BlockKind::YellowWool => 0, - BlockKind::LimeWool => 0, - BlockKind::PinkWool => 0, - BlockKind::GrayWool => 0, - BlockKind::LightGrayWool => 0, - BlockKind::CyanWool => 0, - BlockKind::PurpleWool => 0, - BlockKind::BlueWool => 0, - BlockKind::BrownWool => 0, - BlockKind::GreenWool => 0, - BlockKind::RedWool => 0, - BlockKind::BlackWool => 0, - BlockKind::MovingPiston => 0, - BlockKind::Dandelion => 0, - BlockKind::Poppy => 0, - BlockKind::BlueOrchid => 0, - BlockKind::Allium => 0, - BlockKind::AzureBluet => 0, - BlockKind::RedTulip => 0, - BlockKind::OrangeTulip => 0, - BlockKind::WhiteTulip => 0, - BlockKind::PinkTulip => 0, - BlockKind::OxeyeDaisy => 0, - BlockKind::Cornflower => 0, - BlockKind::WitherRose => 0, - BlockKind::LilyOfTheValley => 0, - BlockKind::BrownMushroom => 1, - BlockKind::RedMushroom => 1, - BlockKind::GoldBlock => 0, - BlockKind::IronBlock => 0, - BlockKind::Bricks => 0, - BlockKind::Tnt => 0, - BlockKind::Bookshelf => 0, - BlockKind::MossyCobblestone => 0, - BlockKind::Obsidian => 0, - BlockKind::Torch => 14, - BlockKind::WallTorch => 14, - BlockKind::Fire => 15, - BlockKind::SoulFire => 0, - BlockKind::Spawner => 0, - BlockKind::OakStairs => 0, - BlockKind::Chest => 0, - BlockKind::RedstoneWire => 0, - BlockKind::DiamondOre => 0, - BlockKind::DiamondBlock => 0, - BlockKind::CraftingTable => 0, - BlockKind::Wheat => 0, - BlockKind::Farmland => 0, - BlockKind::Furnace => 13, - BlockKind::OakSign => 0, - BlockKind::SpruceSign => 0, - BlockKind::BirchSign => 0, - BlockKind::AcaciaSign => 0, - BlockKind::JungleSign => 0, - BlockKind::DarkOakSign => 0, - BlockKind::OakDoor => 0, - BlockKind::Ladder => 0, - BlockKind::Rail => 0, - BlockKind::CobblestoneStairs => 0, - BlockKind::OakWallSign => 0, - BlockKind::SpruceWallSign => 0, - BlockKind::BirchWallSign => 0, - BlockKind::AcaciaWallSign => 0, - BlockKind::JungleWallSign => 0, - BlockKind::DarkOakWallSign => 0, - BlockKind::Lever => 0, - BlockKind::StonePressurePlate => 0, - BlockKind::IronDoor => 0, - BlockKind::OakPressurePlate => 0, - BlockKind::SprucePressurePlate => 0, - BlockKind::BirchPressurePlate => 0, - BlockKind::JunglePressurePlate => 0, - BlockKind::AcaciaPressurePlate => 0, - BlockKind::DarkOakPressurePlate => 0, - BlockKind::RedstoneOre => 9, - BlockKind::RedstoneTorch => 7, - BlockKind::RedstoneWallTorch => 7, - BlockKind::StoneButton => 0, - BlockKind::Snow => 0, - BlockKind::Ice => 0, - BlockKind::SnowBlock => 0, - BlockKind::Cactus => 0, - BlockKind::Clay => 0, - BlockKind::SugarCane => 0, - BlockKind::Jukebox => 0, - BlockKind::OakFence => 0, - BlockKind::Pumpkin => 0, - BlockKind::Netherrack => 0, - BlockKind::SoulSand => 0, - BlockKind::SoulSoil => 0, - BlockKind::Basalt => 0, - BlockKind::PolishedBasalt => 0, - BlockKind::SoulTorch => 0, - BlockKind::SoulWallTorch => 0, - BlockKind::Glowstone => 15, - BlockKind::NetherPortal => 11, - BlockKind::CarvedPumpkin => 0, - BlockKind::JackOLantern => 15, - BlockKind::Cake => 0, - BlockKind::Repeater => 0, - BlockKind::WhiteStainedGlass => 0, - BlockKind::OrangeStainedGlass => 0, - BlockKind::MagentaStainedGlass => 0, - BlockKind::LightBlueStainedGlass => 0, - BlockKind::YellowStainedGlass => 0, - BlockKind::LimeStainedGlass => 0, - BlockKind::PinkStainedGlass => 0, - BlockKind::GrayStainedGlass => 0, - BlockKind::LightGrayStainedGlass => 0, - BlockKind::CyanStainedGlass => 0, - BlockKind::PurpleStainedGlass => 0, - BlockKind::BlueStainedGlass => 0, - BlockKind::BrownStainedGlass => 0, - BlockKind::GreenStainedGlass => 0, - BlockKind::RedStainedGlass => 0, - BlockKind::BlackStainedGlass => 0, - BlockKind::OakTrapdoor => 0, - BlockKind::SpruceTrapdoor => 0, - BlockKind::BirchTrapdoor => 0, - BlockKind::JungleTrapdoor => 0, - BlockKind::AcaciaTrapdoor => 0, - BlockKind::DarkOakTrapdoor => 0, - BlockKind::StoneBricks => 0, - BlockKind::MossyStoneBricks => 0, - BlockKind::CrackedStoneBricks => 0, - BlockKind::ChiseledStoneBricks => 0, - BlockKind::InfestedStone => 0, - BlockKind::InfestedCobblestone => 0, - BlockKind::InfestedStoneBricks => 0, - BlockKind::InfestedMossyStoneBricks => 0, - BlockKind::InfestedCrackedStoneBricks => 0, - BlockKind::InfestedChiseledStoneBricks => 0, - BlockKind::BrownMushroomBlock => 0, - BlockKind::RedMushroomBlock => 0, - BlockKind::MushroomStem => 0, - BlockKind::IronBars => 0, - BlockKind::Chain => 0, - BlockKind::GlassPane => 0, - BlockKind::Melon => 0, - BlockKind::AttachedPumpkinStem => 0, - BlockKind::AttachedMelonStem => 0, - BlockKind::PumpkinStem => 0, - BlockKind::MelonStem => 0, - BlockKind::Vine => 0, - BlockKind::OakFenceGate => 0, - BlockKind::BrickStairs => 0, - BlockKind::StoneBrickStairs => 0, - BlockKind::Mycelium => 0, - BlockKind::LilyPad => 0, - BlockKind::NetherBricks => 0, - BlockKind::NetherBrickFence => 0, - BlockKind::NetherBrickStairs => 0, - BlockKind::NetherWart => 0, - BlockKind::EnchantingTable => 0, - BlockKind::BrewingStand => 1, - BlockKind::Cauldron => 0, - BlockKind::EndPortal => 15, - BlockKind::EndPortalFrame => 1, - BlockKind::EndStone => 0, - BlockKind::DragonEgg => 0, - BlockKind::RedstoneLamp => 15, - BlockKind::Cocoa => 0, - BlockKind::SandstoneStairs => 0, - BlockKind::EmeraldOre => 0, - BlockKind::EnderChest => 0, - BlockKind::TripwireHook => 0, - BlockKind::Tripwire => 0, - BlockKind::EmeraldBlock => 0, - BlockKind::SpruceStairs => 0, - BlockKind::BirchStairs => 0, - BlockKind::JungleStairs => 0, - BlockKind::CommandBlock => 0, - BlockKind::Beacon => 15, - BlockKind::CobblestoneWall => 0, - BlockKind::MossyCobblestoneWall => 0, - BlockKind::FlowerPot => 0, - BlockKind::PottedOakSapling => 0, - BlockKind::PottedSpruceSapling => 0, - BlockKind::PottedBirchSapling => 0, - BlockKind::PottedJungleSapling => 0, - BlockKind::PottedAcaciaSapling => 0, - BlockKind::PottedDarkOakSapling => 0, - BlockKind::PottedFern => 0, - BlockKind::PottedDandelion => 0, - BlockKind::PottedPoppy => 0, - BlockKind::PottedBlueOrchid => 0, - BlockKind::PottedAllium => 0, - BlockKind::PottedAzureBluet => 0, - BlockKind::PottedRedTulip => 0, - BlockKind::PottedOrangeTulip => 0, - BlockKind::PottedWhiteTulip => 0, - BlockKind::PottedPinkTulip => 0, - BlockKind::PottedOxeyeDaisy => 0, - BlockKind::PottedCornflower => 0, - BlockKind::PottedLilyOfTheValley => 0, - BlockKind::PottedWitherRose => 0, - BlockKind::PottedRedMushroom => 0, - BlockKind::PottedBrownMushroom => 0, - BlockKind::PottedDeadBush => 0, - BlockKind::PottedCactus => 0, - BlockKind::Carrots => 0, - BlockKind::Potatoes => 0, - BlockKind::OakButton => 0, - BlockKind::SpruceButton => 0, - BlockKind::BirchButton => 0, - BlockKind::JungleButton => 0, - BlockKind::AcaciaButton => 0, - BlockKind::DarkOakButton => 0, - BlockKind::SkeletonSkull => 0, - BlockKind::SkeletonWallSkull => 0, - BlockKind::WitherSkeletonSkull => 0, - BlockKind::WitherSkeletonWallSkull => 0, - BlockKind::ZombieHead => 0, - BlockKind::ZombieWallHead => 0, - BlockKind::PlayerHead => 0, - BlockKind::PlayerWallHead => 0, - BlockKind::CreeperHead => 0, - BlockKind::CreeperWallHead => 0, - BlockKind::DragonHead => 0, - BlockKind::DragonWallHead => 0, - BlockKind::Anvil => 0, - BlockKind::ChippedAnvil => 0, - BlockKind::DamagedAnvil => 0, - BlockKind::TrappedChest => 0, - BlockKind::LightWeightedPressurePlate => 0, - BlockKind::HeavyWeightedPressurePlate => 0, - BlockKind::Comparator => 0, - BlockKind::DaylightDetector => 0, - BlockKind::RedstoneBlock => 0, - BlockKind::NetherQuartzOre => 0, - BlockKind::Hopper => 0, - BlockKind::QuartzBlock => 0, - BlockKind::ChiseledQuartzBlock => 0, - BlockKind::QuartzPillar => 0, - BlockKind::QuartzStairs => 0, - BlockKind::ActivatorRail => 0, - BlockKind::Dropper => 0, - BlockKind::WhiteTerracotta => 0, - BlockKind::OrangeTerracotta => 0, - BlockKind::MagentaTerracotta => 0, - BlockKind::LightBlueTerracotta => 0, - BlockKind::YellowTerracotta => 0, - BlockKind::LimeTerracotta => 0, - BlockKind::PinkTerracotta => 0, - BlockKind::GrayTerracotta => 0, - BlockKind::LightGrayTerracotta => 0, - BlockKind::CyanTerracotta => 0, - BlockKind::PurpleTerracotta => 0, - BlockKind::BlueTerracotta => 0, - BlockKind::BrownTerracotta => 0, - BlockKind::GreenTerracotta => 0, - BlockKind::RedTerracotta => 0, - BlockKind::BlackTerracotta => 0, - BlockKind::WhiteStainedGlassPane => 0, - BlockKind::OrangeStainedGlassPane => 0, - BlockKind::MagentaStainedGlassPane => 0, - BlockKind::LightBlueStainedGlassPane => 0, - BlockKind::YellowStainedGlassPane => 0, - BlockKind::LimeStainedGlassPane => 0, - BlockKind::PinkStainedGlassPane => 0, - BlockKind::GrayStainedGlassPane => 0, - BlockKind::LightGrayStainedGlassPane => 0, - BlockKind::CyanStainedGlassPane => 0, - BlockKind::PurpleStainedGlassPane => 0, - BlockKind::BlueStainedGlassPane => 0, - BlockKind::BrownStainedGlassPane => 0, - BlockKind::GreenStainedGlassPane => 0, - BlockKind::RedStainedGlassPane => 0, - BlockKind::BlackStainedGlassPane => 0, - BlockKind::AcaciaStairs => 0, - BlockKind::DarkOakStairs => 0, - BlockKind::SlimeBlock => 0, - BlockKind::Barrier => 0, - BlockKind::IronTrapdoor => 0, - BlockKind::Prismarine => 0, - BlockKind::PrismarineBricks => 0, - BlockKind::DarkPrismarine => 0, - BlockKind::PrismarineStairs => 0, - BlockKind::PrismarineBrickStairs => 0, - BlockKind::DarkPrismarineStairs => 0, - BlockKind::PrismarineSlab => 0, - BlockKind::PrismarineBrickSlab => 0, - BlockKind::DarkPrismarineSlab => 0, - BlockKind::SeaLantern => 15, - BlockKind::HayBlock => 0, - BlockKind::WhiteCarpet => 0, - BlockKind::OrangeCarpet => 0, - BlockKind::MagentaCarpet => 0, - BlockKind::LightBlueCarpet => 0, - BlockKind::YellowCarpet => 0, - BlockKind::LimeCarpet => 0, - BlockKind::PinkCarpet => 0, - BlockKind::GrayCarpet => 0, - BlockKind::LightGrayCarpet => 0, - BlockKind::CyanCarpet => 0, - BlockKind::PurpleCarpet => 0, - BlockKind::BlueCarpet => 0, - BlockKind::BrownCarpet => 0, - BlockKind::GreenCarpet => 0, - BlockKind::RedCarpet => 0, - BlockKind::BlackCarpet => 0, - BlockKind::Terracotta => 0, - BlockKind::CoalBlock => 0, - BlockKind::PackedIce => 0, - BlockKind::Sunflower => 0, - BlockKind::Lilac => 0, - BlockKind::RoseBush => 0, - BlockKind::Peony => 0, - BlockKind::TallGrass => 0, - BlockKind::LargeFern => 0, - BlockKind::WhiteBanner => 0, - BlockKind::OrangeBanner => 0, - BlockKind::MagentaBanner => 0, - BlockKind::LightBlueBanner => 0, - BlockKind::YellowBanner => 0, - BlockKind::LimeBanner => 0, - BlockKind::PinkBanner => 0, - BlockKind::GrayBanner => 0, - BlockKind::LightGrayBanner => 0, - BlockKind::CyanBanner => 0, - BlockKind::PurpleBanner => 0, - BlockKind::BlueBanner => 0, - BlockKind::BrownBanner => 0, - BlockKind::GreenBanner => 0, - BlockKind::RedBanner => 0, - BlockKind::BlackBanner => 0, - BlockKind::WhiteWallBanner => 0, - BlockKind::OrangeWallBanner => 0, - BlockKind::MagentaWallBanner => 0, - BlockKind::LightBlueWallBanner => 0, - BlockKind::YellowWallBanner => 0, - BlockKind::LimeWallBanner => 0, - BlockKind::PinkWallBanner => 0, - BlockKind::GrayWallBanner => 0, - BlockKind::LightGrayWallBanner => 0, - BlockKind::CyanWallBanner => 0, - BlockKind::PurpleWallBanner => 0, - BlockKind::BlueWallBanner => 0, - BlockKind::BrownWallBanner => 0, - BlockKind::GreenWallBanner => 0, - BlockKind::RedWallBanner => 0, - BlockKind::BlackWallBanner => 0, - BlockKind::RedSandstone => 0, - BlockKind::ChiseledRedSandstone => 0, - BlockKind::CutRedSandstone => 0, - BlockKind::RedSandstoneStairs => 0, - BlockKind::OakSlab => 0, - BlockKind::SpruceSlab => 0, - BlockKind::BirchSlab => 0, - BlockKind::JungleSlab => 0, - BlockKind::AcaciaSlab => 0, - BlockKind::DarkOakSlab => 0, - BlockKind::StoneSlab => 0, - BlockKind::SmoothStoneSlab => 0, - BlockKind::SandstoneSlab => 0, - BlockKind::CutSandstoneSlab => 0, - BlockKind::PetrifiedOakSlab => 0, - BlockKind::CobblestoneSlab => 0, - BlockKind::BrickSlab => 0, - BlockKind::StoneBrickSlab => 0, - BlockKind::NetherBrickSlab => 0, - BlockKind::QuartzSlab => 0, - BlockKind::RedSandstoneSlab => 0, - BlockKind::CutRedSandstoneSlab => 0, - BlockKind::PurpurSlab => 0, - BlockKind::SmoothStone => 0, - BlockKind::SmoothSandstone => 0, - BlockKind::SmoothQuartz => 0, - BlockKind::SmoothRedSandstone => 0, - BlockKind::SpruceFenceGate => 0, - BlockKind::BirchFenceGate => 0, - BlockKind::JungleFenceGate => 0, - BlockKind::AcaciaFenceGate => 0, - BlockKind::DarkOakFenceGate => 0, - BlockKind::SpruceFence => 0, - BlockKind::BirchFence => 0, - BlockKind::JungleFence => 0, - BlockKind::AcaciaFence => 0, - BlockKind::DarkOakFence => 0, - BlockKind::SpruceDoor => 0, - BlockKind::BirchDoor => 0, - BlockKind::JungleDoor => 0, - BlockKind::AcaciaDoor => 0, - BlockKind::DarkOakDoor => 0, - BlockKind::EndRod => 14, - BlockKind::ChorusPlant => 0, - BlockKind::ChorusFlower => 0, - BlockKind::PurpurBlock => 0, - BlockKind::PurpurPillar => 0, - BlockKind::PurpurStairs => 0, - BlockKind::EndStoneBricks => 0, - BlockKind::Beetroots => 0, - BlockKind::GrassPath => 0, - BlockKind::EndGateway => 15, - BlockKind::RepeatingCommandBlock => 0, - BlockKind::ChainCommandBlock => 0, - BlockKind::FrostedIce => 0, - BlockKind::MagmaBlock => 0, - BlockKind::NetherWartBlock => 0, - BlockKind::RedNetherBricks => 0, - BlockKind::BoneBlock => 0, - BlockKind::StructureVoid => 0, - BlockKind::Observer => 0, - BlockKind::ShulkerBox => 0, - BlockKind::WhiteShulkerBox => 0, - BlockKind::OrangeShulkerBox => 0, - BlockKind::MagentaShulkerBox => 0, - BlockKind::LightBlueShulkerBox => 0, - BlockKind::YellowShulkerBox => 0, - BlockKind::LimeShulkerBox => 0, - BlockKind::PinkShulkerBox => 0, - BlockKind::GrayShulkerBox => 0, - BlockKind::LightGrayShulkerBox => 0, - BlockKind::CyanShulkerBox => 0, - BlockKind::PurpleShulkerBox => 0, - BlockKind::BlueShulkerBox => 0, - BlockKind::BrownShulkerBox => 0, - BlockKind::GreenShulkerBox => 0, - BlockKind::RedShulkerBox => 0, - BlockKind::BlackShulkerBox => 0, - BlockKind::WhiteGlazedTerracotta => 0, - BlockKind::OrangeGlazedTerracotta => 0, - BlockKind::MagentaGlazedTerracotta => 0, - BlockKind::LightBlueGlazedTerracotta => 0, - BlockKind::YellowGlazedTerracotta => 0, - BlockKind::LimeGlazedTerracotta => 0, - BlockKind::PinkGlazedTerracotta => 0, - BlockKind::GrayGlazedTerracotta => 0, - BlockKind::LightGrayGlazedTerracotta => 0, - BlockKind::CyanGlazedTerracotta => 0, - BlockKind::PurpleGlazedTerracotta => 0, - BlockKind::BlueGlazedTerracotta => 0, - BlockKind::BrownGlazedTerracotta => 0, - BlockKind::GreenGlazedTerracotta => 0, - BlockKind::RedGlazedTerracotta => 0, - BlockKind::BlackGlazedTerracotta => 0, - BlockKind::WhiteConcrete => 0, - BlockKind::OrangeConcrete => 0, - BlockKind::MagentaConcrete => 0, - BlockKind::LightBlueConcrete => 0, - BlockKind::YellowConcrete => 0, - BlockKind::LimeConcrete => 0, - BlockKind::PinkConcrete => 0, - BlockKind::GrayConcrete => 0, - BlockKind::LightGrayConcrete => 0, - BlockKind::CyanConcrete => 0, - BlockKind::PurpleConcrete => 0, - BlockKind::BlueConcrete => 0, - BlockKind::BrownConcrete => 0, - BlockKind::GreenConcrete => 0, - BlockKind::RedConcrete => 0, - BlockKind::BlackConcrete => 0, - BlockKind::WhiteConcretePowder => 0, - BlockKind::OrangeConcretePowder => 0, - BlockKind::MagentaConcretePowder => 0, - BlockKind::LightBlueConcretePowder => 0, - BlockKind::YellowConcretePowder => 0, - BlockKind::LimeConcretePowder => 0, - BlockKind::PinkConcretePowder => 0, - BlockKind::GrayConcretePowder => 0, - BlockKind::LightGrayConcretePowder => 0, - BlockKind::CyanConcretePowder => 0, - BlockKind::PurpleConcretePowder => 0, - BlockKind::BlueConcretePowder => 0, - BlockKind::BrownConcretePowder => 0, - BlockKind::GreenConcretePowder => 0, - BlockKind::RedConcretePowder => 0, - BlockKind::BlackConcretePowder => 0, - BlockKind::Kelp => 0, - BlockKind::KelpPlant => 0, - BlockKind::DriedKelpBlock => 0, - BlockKind::TurtleEgg => 0, - BlockKind::DeadTubeCoralBlock => 0, - BlockKind::DeadBrainCoralBlock => 0, - BlockKind::DeadBubbleCoralBlock => 0, - BlockKind::DeadFireCoralBlock => 0, - BlockKind::DeadHornCoralBlock => 0, - BlockKind::TubeCoralBlock => 0, - BlockKind::BrainCoralBlock => 0, - BlockKind::BubbleCoralBlock => 0, - BlockKind::FireCoralBlock => 0, - BlockKind::HornCoralBlock => 0, - BlockKind::DeadTubeCoral => 0, - BlockKind::DeadBrainCoral => 0, - BlockKind::DeadBubbleCoral => 0, - BlockKind::DeadFireCoral => 0, - BlockKind::DeadHornCoral => 0, - BlockKind::TubeCoral => 0, - BlockKind::BrainCoral => 0, - BlockKind::BubbleCoral => 0, - BlockKind::FireCoral => 0, - BlockKind::HornCoral => 0, - BlockKind::DeadTubeCoralFan => 0, - BlockKind::DeadBrainCoralFan => 0, - BlockKind::DeadBubbleCoralFan => 0, - BlockKind::DeadFireCoralFan => 0, - BlockKind::DeadHornCoralFan => 0, - BlockKind::TubeCoralFan => 0, - BlockKind::BrainCoralFan => 0, - BlockKind::BubbleCoralFan => 0, - BlockKind::FireCoralFan => 0, - BlockKind::HornCoralFan => 0, - BlockKind::DeadTubeCoralWallFan => 0, - BlockKind::DeadBrainCoralWallFan => 0, - BlockKind::DeadBubbleCoralWallFan => 0, - BlockKind::DeadFireCoralWallFan => 0, - BlockKind::DeadHornCoralWallFan => 0, - BlockKind::TubeCoralWallFan => 0, - BlockKind::BrainCoralWallFan => 0, - BlockKind::BubbleCoralWallFan => 0, - BlockKind::FireCoralWallFan => 0, - BlockKind::HornCoralWallFan => 0, - BlockKind::SeaPickle => 0, - BlockKind::BlueIce => 0, - BlockKind::Conduit => 0, - BlockKind::BambooSapling => 0, - BlockKind::Bamboo => 0, - BlockKind::PottedBamboo => 0, - BlockKind::VoidAir => 0, - BlockKind::CaveAir => 0, - BlockKind::BubbleColumn => 0, - BlockKind::PolishedGraniteStairs => 0, - BlockKind::SmoothRedSandstoneStairs => 0, - BlockKind::MossyStoneBrickStairs => 0, - BlockKind::PolishedDioriteStairs => 0, - BlockKind::MossyCobblestoneStairs => 0, - BlockKind::EndStoneBrickStairs => 0, - BlockKind::StoneStairs => 0, - BlockKind::SmoothSandstoneStairs => 0, - BlockKind::SmoothQuartzStairs => 0, - BlockKind::GraniteStairs => 0, - BlockKind::AndesiteStairs => 0, - BlockKind::RedNetherBrickStairs => 0, - BlockKind::PolishedAndesiteStairs => 0, - BlockKind::DioriteStairs => 0, - BlockKind::PolishedGraniteSlab => 0, - BlockKind::SmoothRedSandstoneSlab => 0, - BlockKind::MossyStoneBrickSlab => 0, - BlockKind::PolishedDioriteSlab => 0, - BlockKind::MossyCobblestoneSlab => 0, - BlockKind::EndStoneBrickSlab => 0, - BlockKind::SmoothSandstoneSlab => 0, - BlockKind::SmoothQuartzSlab => 0, - BlockKind::GraniteSlab => 0, - BlockKind::AndesiteSlab => 0, - BlockKind::RedNetherBrickSlab => 0, - BlockKind::PolishedAndesiteSlab => 0, - BlockKind::DioriteSlab => 0, - BlockKind::BrickWall => 0, - BlockKind::PrismarineWall => 0, - BlockKind::RedSandstoneWall => 0, - BlockKind::MossyStoneBrickWall => 0, - BlockKind::GraniteWall => 0, - BlockKind::StoneBrickWall => 0, - BlockKind::NetherBrickWall => 0, - BlockKind::AndesiteWall => 0, - BlockKind::RedNetherBrickWall => 0, - BlockKind::SandstoneWall => 0, - BlockKind::EndStoneBrickWall => 0, - BlockKind::DioriteWall => 0, - BlockKind::Scaffolding => 0, - BlockKind::Loom => 0, - BlockKind::Barrel => 0, - BlockKind::Smoker => 0, - BlockKind::BlastFurnace => 0, - BlockKind::CartographyTable => 0, - BlockKind::FletchingTable => 0, - BlockKind::Grindstone => 0, - BlockKind::Lectern => 0, - BlockKind::SmithingTable => 0, - BlockKind::Stonecutter => 0, - BlockKind::Bell => 0, - BlockKind::Lantern => 0, - BlockKind::SoulLantern => 0, - BlockKind::Campfire => 0, - BlockKind::SoulCampfire => 0, - BlockKind::SweetBerryBush => 0, - BlockKind::WarpedStem => 0, - BlockKind::StrippedWarpedStem => 0, - BlockKind::WarpedHyphae => 0, - BlockKind::StrippedWarpedHyphae => 0, - BlockKind::WarpedNylium => 0, - BlockKind::WarpedFungus => 0, - BlockKind::WarpedWartBlock => 0, - BlockKind::WarpedRoots => 0, - BlockKind::NetherSprouts => 0, - BlockKind::CrimsonStem => 0, - BlockKind::StrippedCrimsonStem => 0, - BlockKind::CrimsonHyphae => 0, - BlockKind::StrippedCrimsonHyphae => 0, - BlockKind::CrimsonNylium => 0, - BlockKind::CrimsonFungus => 0, - BlockKind::Shroomlight => 0, - BlockKind::WeepingVines => 0, - BlockKind::WeepingVinesPlant => 0, - BlockKind::TwistingVines => 0, - BlockKind::TwistingVinesPlant => 0, - BlockKind::CrimsonRoots => 0, - BlockKind::CrimsonPlanks => 0, - BlockKind::WarpedPlanks => 0, - BlockKind::CrimsonSlab => 0, - BlockKind::WarpedSlab => 0, - BlockKind::CrimsonPressurePlate => 0, - BlockKind::WarpedPressurePlate => 0, - BlockKind::CrimsonFence => 0, - BlockKind::WarpedFence => 0, - BlockKind::CrimsonTrapdoor => 0, - BlockKind::WarpedTrapdoor => 0, - BlockKind::CrimsonFenceGate => 0, - BlockKind::WarpedFenceGate => 0, - BlockKind::CrimsonStairs => 0, - BlockKind::WarpedStairs => 0, - BlockKind::CrimsonButton => 0, - BlockKind::WarpedButton => 0, - BlockKind::CrimsonDoor => 0, - BlockKind::WarpedDoor => 0, - BlockKind::CrimsonSign => 0, - BlockKind::WarpedSign => 0, - BlockKind::CrimsonWallSign => 0, - BlockKind::WarpedWallSign => 0, - BlockKind::StructureBlock => 0, - BlockKind::Jigsaw => 0, - BlockKind::Composter => 0, - BlockKind::Target => 0, - BlockKind::BeeNest => 0, - BlockKind::Beehive => 0, - BlockKind::HoneyBlock => 0, - BlockKind::HoneycombBlock => 0, - BlockKind::NetheriteBlock => 0, - BlockKind::AncientDebris => 0, - BlockKind::CryingObsidian => 0, - BlockKind::RespawnAnchor => 2, - BlockKind::PottedCrimsonFungus => 0, - BlockKind::PottedWarpedFungus => 0, - BlockKind::PottedCrimsonRoots => 0, - BlockKind::PottedWarpedRoots => 0, - BlockKind::Lodestone => 0, - BlockKind::Blackstone => 0, - BlockKind::BlackstoneStairs => 0, - BlockKind::BlackstoneWall => 0, - BlockKind::BlackstoneSlab => 0, - BlockKind::PolishedBlackstone => 0, - BlockKind::PolishedBlackstoneBricks => 0, - BlockKind::CrackedPolishedBlackstoneBricks => 0, - BlockKind::ChiseledPolishedBlackstone => 0, - BlockKind::PolishedBlackstoneBrickSlab => 0, - BlockKind::PolishedBlackstoneBrickStairs => 0, - BlockKind::PolishedBlackstoneBrickWall => 0, - BlockKind::GildedBlackstone => 0, - BlockKind::PolishedBlackstoneStairs => 0, - BlockKind::PolishedBlackstoneSlab => 0, - BlockKind::PolishedBlackstonePressurePlate => 0, - BlockKind::PolishedBlackstoneButton => 0, - BlockKind::PolishedBlackstoneWall => 0, - BlockKind::ChiseledNetherBricks => 0, - BlockKind::CrackedNetherBricks => 0, - BlockKind::QuartzBricks => 0, + BlockKind::Air => 0u16, + BlockKind::Stone => 1u16, + BlockKind::Granite => 2u16, + BlockKind::PolishedGranite => 3u16, + BlockKind::Diorite => 4u16, + BlockKind::PolishedDiorite => 5u16, + BlockKind::Andesite => 6u16, + BlockKind::PolishedAndesite => 7u16, + BlockKind::GrassBlock => 9u16, + BlockKind::Dirt => 10u16, + BlockKind::CoarseDirt => 11u16, + BlockKind::Podzol => 13u16, + BlockKind::Cobblestone => 14u16, + BlockKind::OakPlanks => 15u16, + BlockKind::SprucePlanks => 16u16, + BlockKind::BirchPlanks => 17u16, + BlockKind::JunglePlanks => 18u16, + BlockKind::AcaciaPlanks => 19u16, + BlockKind::DarkOakPlanks => 20u16, + BlockKind::OakSapling => 21u16, + BlockKind::SpruceSapling => 23u16, + BlockKind::BirchSapling => 25u16, + BlockKind::JungleSapling => 27u16, + BlockKind::AcaciaSapling => 29u16, + BlockKind::DarkOakSapling => 31u16, + BlockKind::Bedrock => 33u16, + BlockKind::Water => 34u16, + BlockKind::Lava => 50u16, + BlockKind::Sand => 66u16, + BlockKind::RedSand => 67u16, + BlockKind::Gravel => 68u16, + BlockKind::GoldOre => 69u16, + BlockKind::DeepslateGoldOre => 70u16, + BlockKind::IronOre => 71u16, + BlockKind::DeepslateIronOre => 72u16, + BlockKind::CoalOre => 73u16, + BlockKind::DeepslateCoalOre => 74u16, + BlockKind::NetherGoldOre => 75u16, + BlockKind::OakLog => 77u16, + BlockKind::SpruceLog => 80u16, + BlockKind::BirchLog => 83u16, + BlockKind::JungleLog => 86u16, + BlockKind::AcaciaLog => 89u16, + BlockKind::DarkOakLog => 92u16, + BlockKind::StrippedSpruceLog => 95u16, + BlockKind::StrippedBirchLog => 98u16, + BlockKind::StrippedJungleLog => 101u16, + BlockKind::StrippedAcaciaLog => 104u16, + BlockKind::StrippedDarkOakLog => 107u16, + BlockKind::StrippedOakLog => 110u16, + BlockKind::OakWood => 113u16, + BlockKind::SpruceWood => 116u16, + BlockKind::BirchWood => 119u16, + BlockKind::JungleWood => 122u16, + BlockKind::AcaciaWood => 125u16, + BlockKind::DarkOakWood => 128u16, + BlockKind::StrippedOakWood => 131u16, + BlockKind::StrippedSpruceWood => 134u16, + BlockKind::StrippedBirchWood => 137u16, + BlockKind::StrippedJungleWood => 140u16, + BlockKind::StrippedAcaciaWood => 143u16, + BlockKind::StrippedDarkOakWood => 146u16, + BlockKind::OakLeaves => 161u16, + BlockKind::SpruceLeaves => 175u16, + BlockKind::BirchLeaves => 189u16, + BlockKind::JungleLeaves => 203u16, + BlockKind::AcaciaLeaves => 217u16, + BlockKind::DarkOakLeaves => 231u16, + BlockKind::AzaleaLeaves => 245u16, + BlockKind::FloweringAzaleaLeaves => 259u16, + BlockKind::Sponge => 260u16, + BlockKind::WetSponge => 261u16, + BlockKind::Glass => 262u16, + BlockKind::LapisOre => 263u16, + BlockKind::DeepslateLapisOre => 264u16, + BlockKind::LapisBlock => 265u16, + BlockKind::Dispenser => 267u16, + BlockKind::Sandstone => 278u16, + BlockKind::ChiseledSandstone => 279u16, + BlockKind::CutSandstone => 280u16, + BlockKind::NoteBlock => 282u16, + BlockKind::WhiteBed => 1084u16, + BlockKind::OrangeBed => 1100u16, + BlockKind::MagentaBed => 1116u16, + BlockKind::LightBlueBed => 1132u16, + BlockKind::YellowBed => 1148u16, + BlockKind::LimeBed => 1164u16, + BlockKind::PinkBed => 1180u16, + BlockKind::GrayBed => 1196u16, + BlockKind::LightGrayBed => 1212u16, + BlockKind::CyanBed => 1228u16, + BlockKind::PurpleBed => 1244u16, + BlockKind::BlueBed => 1260u16, + BlockKind::BrownBed => 1276u16, + BlockKind::GreenBed => 1292u16, + BlockKind::RedBed => 1308u16, + BlockKind::BlackBed => 1324u16, + BlockKind::PoweredRail => 1350u16, + BlockKind::DetectorRail => 1374u16, + BlockKind::StickyPiston => 1391u16, + BlockKind::Cobweb => 1397u16, + BlockKind::Grass => 1398u16, + BlockKind::Fern => 1399u16, + BlockKind::DeadBush => 1400u16, + BlockKind::Seagrass => 1401u16, + BlockKind::TallSeagrass => 1403u16, + BlockKind::Piston => 1410u16, + BlockKind::PistonHead => 1418u16, + BlockKind::WhiteWool => 1440u16, + BlockKind::OrangeWool => 1441u16, + BlockKind::MagentaWool => 1442u16, + BlockKind::LightBlueWool => 1443u16, + BlockKind::YellowWool => 1444u16, + BlockKind::LimeWool => 1445u16, + BlockKind::PinkWool => 1446u16, + BlockKind::GrayWool => 1447u16, + BlockKind::LightGrayWool => 1448u16, + BlockKind::CyanWool => 1449u16, + BlockKind::PurpleWool => 1450u16, + BlockKind::BlueWool => 1451u16, + BlockKind::BrownWool => 1452u16, + BlockKind::GreenWool => 1453u16, + BlockKind::RedWool => 1454u16, + BlockKind::BlackWool => 1455u16, + BlockKind::MovingPiston => 1456u16, + BlockKind::Dandelion => 1468u16, + BlockKind::Poppy => 1469u16, + BlockKind::BlueOrchid => 1470u16, + BlockKind::Allium => 1471u16, + BlockKind::AzureBluet => 1472u16, + BlockKind::RedTulip => 1473u16, + BlockKind::OrangeTulip => 1474u16, + BlockKind::WhiteTulip => 1475u16, + BlockKind::PinkTulip => 1476u16, + BlockKind::OxeyeDaisy => 1477u16, + BlockKind::Cornflower => 1478u16, + BlockKind::WitherRose => 1479u16, + BlockKind::LilyOfTheValley => 1480u16, + BlockKind::BrownMushroom => 1481u16, + BlockKind::RedMushroom => 1482u16, + BlockKind::GoldBlock => 1483u16, + BlockKind::IronBlock => 1484u16, + BlockKind::Bricks => 1485u16, + BlockKind::Tnt => 1487u16, + BlockKind::Bookshelf => 1488u16, + BlockKind::MossyCobblestone => 1489u16, + BlockKind::Obsidian => 1490u16, + BlockKind::Torch => 1491u16, + BlockKind::WallTorch => 1492u16, + BlockKind::Fire => 1527u16, + BlockKind::SoulFire => 2008u16, + BlockKind::Spawner => 2009u16, + BlockKind::OakStairs => 2021u16, + BlockKind::Chest => 2091u16, + BlockKind::RedstoneWire => 3274u16, + BlockKind::DiamondOre => 3410u16, + BlockKind::DeepslateDiamondOre => 3411u16, + BlockKind::DiamondBlock => 3412u16, + BlockKind::CraftingTable => 3413u16, + BlockKind::Wheat => 3414u16, + BlockKind::Farmland => 3422u16, + BlockKind::Furnace => 3431u16, + BlockKind::OakSign => 3439u16, + BlockKind::SpruceSign => 3471u16, + BlockKind::BirchSign => 3503u16, + BlockKind::AcaciaSign => 3535u16, + BlockKind::JungleSign => 3567u16, + BlockKind::DarkOakSign => 3599u16, + BlockKind::OakDoor => 3641u16, + BlockKind::Ladder => 3695u16, + BlockKind::Rail => 3703u16, + BlockKind::CobblestoneStairs => 3733u16, + BlockKind::OakWallSign => 3803u16, + BlockKind::SpruceWallSign => 3811u16, + BlockKind::BirchWallSign => 3819u16, + BlockKind::AcaciaWallSign => 3827u16, + BlockKind::JungleWallSign => 3835u16, + BlockKind::DarkOakWallSign => 3843u16, + BlockKind::Lever => 3859u16, + BlockKind::StonePressurePlate => 3875u16, + BlockKind::IronDoor => 3887u16, + BlockKind::OakPressurePlate => 3941u16, + BlockKind::SprucePressurePlate => 3943u16, + BlockKind::BirchPressurePlate => 3945u16, + BlockKind::JunglePressurePlate => 3947u16, + BlockKind::AcaciaPressurePlate => 3949u16, + BlockKind::DarkOakPressurePlate => 3951u16, + BlockKind::RedstoneOre => 3953u16, + BlockKind::DeepslateRedstoneOre => 3955u16, + BlockKind::RedstoneTorch => 3956u16, + BlockKind::RedstoneWallTorch => 3958u16, + BlockKind::StoneButton => 3975u16, + BlockKind::Snow => 3990u16, + BlockKind::Ice => 3998u16, + BlockKind::SnowBlock => 3999u16, + BlockKind::Cactus => 4000u16, + BlockKind::Clay => 4016u16, + BlockKind::SugarCane => 4017u16, + BlockKind::Jukebox => 4034u16, + BlockKind::OakFence => 4066u16, + BlockKind::Pumpkin => 4067u16, + BlockKind::Netherrack => 4068u16, + BlockKind::SoulSand => 4069u16, + BlockKind::SoulSoil => 4070u16, + BlockKind::Basalt => 4072u16, + BlockKind::PolishedBasalt => 4075u16, + BlockKind::SoulTorch => 4077u16, + BlockKind::SoulWallTorch => 4078u16, + BlockKind::Glowstone => 4082u16, + BlockKind::NetherPortal => 4083u16, + BlockKind::CarvedPumpkin => 4085u16, + BlockKind::JackOLantern => 4089u16, + BlockKind::Cake => 4093u16, + BlockKind::Repeater => 4103u16, + BlockKind::WhiteStainedGlass => 4164u16, + BlockKind::OrangeStainedGlass => 4165u16, + BlockKind::MagentaStainedGlass => 4166u16, + BlockKind::LightBlueStainedGlass => 4167u16, + BlockKind::YellowStainedGlass => 4168u16, + BlockKind::LimeStainedGlass => 4169u16, + BlockKind::PinkStainedGlass => 4170u16, + BlockKind::GrayStainedGlass => 4171u16, + BlockKind::LightGrayStainedGlass => 4172u16, + BlockKind::CyanStainedGlass => 4173u16, + BlockKind::PurpleStainedGlass => 4174u16, + BlockKind::BlueStainedGlass => 4175u16, + BlockKind::BrownStainedGlass => 4176u16, + BlockKind::GreenStainedGlass => 4177u16, + BlockKind::RedStainedGlass => 4178u16, + BlockKind::BlackStainedGlass => 4179u16, + BlockKind::OakTrapdoor => 4195u16, + BlockKind::SpruceTrapdoor => 4259u16, + BlockKind::BirchTrapdoor => 4323u16, + BlockKind::JungleTrapdoor => 4387u16, + BlockKind::AcaciaTrapdoor => 4451u16, + BlockKind::DarkOakTrapdoor => 4515u16, + BlockKind::StoneBricks => 4564u16, + BlockKind::MossyStoneBricks => 4565u16, + BlockKind::CrackedStoneBricks => 4566u16, + BlockKind::ChiseledStoneBricks => 4567u16, + BlockKind::InfestedStone => 4568u16, + BlockKind::InfestedCobblestone => 4569u16, + BlockKind::InfestedStoneBricks => 4570u16, + BlockKind::InfestedMossyStoneBricks => 4571u16, + BlockKind::InfestedCrackedStoneBricks => 4572u16, + BlockKind::InfestedChiseledStoneBricks => 4573u16, + BlockKind::BrownMushroomBlock => 4574u16, + BlockKind::RedMushroomBlock => 4638u16, + BlockKind::MushroomStem => 4702u16, + BlockKind::IronBars => 4797u16, + BlockKind::Chain => 4801u16, + BlockKind::GlassPane => 4835u16, + BlockKind::Melon => 4836u16, + BlockKind::AttachedPumpkinStem => 4837u16, + BlockKind::AttachedMelonStem => 4841u16, + BlockKind::PumpkinStem => 4845u16, + BlockKind::MelonStem => 4853u16, + BlockKind::Vine => 4892u16, + BlockKind::GlowLichen => 5020u16, + BlockKind::OakFenceGate => 5028u16, + BlockKind::BrickStairs => 5064u16, + BlockKind::StoneBrickStairs => 5144u16, + BlockKind::Mycelium => 5214u16, + BlockKind::LilyPad => 5215u16, + BlockKind::NetherBricks => 5216u16, + BlockKind::NetherBrickFence => 5248u16, + BlockKind::NetherBrickStairs => 5260u16, + BlockKind::NetherWart => 5329u16, + BlockKind::EnchantingTable => 5333u16, + BlockKind::BrewingStand => 5341u16, + BlockKind::Cauldron => 5342u16, + BlockKind::WaterCauldron => 5343u16, + BlockKind::LavaCauldron => 5346u16, + BlockKind::PowderSnowCauldron => 5347u16, + BlockKind::EndPortal => 5350u16, + BlockKind::EndPortalFrame => 5355u16, + BlockKind::EndStone => 5359u16, + BlockKind::DragonEgg => 5360u16, + BlockKind::RedstoneLamp => 5362u16, + BlockKind::Cocoa => 5363u16, + BlockKind::SandstoneStairs => 5386u16, + BlockKind::EmeraldOre => 5455u16, + BlockKind::DeepslateEmeraldOre => 5456u16, + BlockKind::EnderChest => 5458u16, + BlockKind::TripwireHook => 5474u16, + BlockKind::Tripwire => 5608u16, + BlockKind::EmeraldBlock => 5609u16, + BlockKind::SpruceStairs => 5621u16, + BlockKind::BirchStairs => 5701u16, + BlockKind::JungleStairs => 5781u16, + BlockKind::CommandBlock => 5856u16, + BlockKind::Beacon => 5862u16, + BlockKind::CobblestoneWall => 5866u16, + BlockKind::MossyCobblestoneWall => 6190u16, + BlockKind::FlowerPot => 6511u16, + BlockKind::PottedOakSapling => 6512u16, + BlockKind::PottedSpruceSapling => 6513u16, + BlockKind::PottedBirchSapling => 6514u16, + BlockKind::PottedJungleSapling => 6515u16, + BlockKind::PottedAcaciaSapling => 6516u16, + BlockKind::PottedDarkOakSapling => 6517u16, + BlockKind::PottedFern => 6518u16, + BlockKind::PottedDandelion => 6519u16, + BlockKind::PottedPoppy => 6520u16, + BlockKind::PottedBlueOrchid => 6521u16, + BlockKind::PottedAllium => 6522u16, + BlockKind::PottedAzureBluet => 6523u16, + BlockKind::PottedRedTulip => 6524u16, + BlockKind::PottedOrangeTulip => 6525u16, + BlockKind::PottedWhiteTulip => 6526u16, + BlockKind::PottedPinkTulip => 6527u16, + BlockKind::PottedOxeyeDaisy => 6528u16, + BlockKind::PottedCornflower => 6529u16, + BlockKind::PottedLilyOfTheValley => 6530u16, + BlockKind::PottedWitherRose => 6531u16, + BlockKind::PottedRedMushroom => 6532u16, + BlockKind::PottedBrownMushroom => 6533u16, + BlockKind::PottedDeadBush => 6534u16, + BlockKind::PottedCactus => 6535u16, + BlockKind::Carrots => 6536u16, + BlockKind::Potatoes => 6544u16, + BlockKind::OakButton => 6561u16, + BlockKind::SpruceButton => 6585u16, + BlockKind::BirchButton => 6609u16, + BlockKind::JungleButton => 6633u16, + BlockKind::AcaciaButton => 6657u16, + BlockKind::DarkOakButton => 6681u16, + BlockKind::SkeletonSkull => 6696u16, + BlockKind::SkeletonWallSkull => 6712u16, + BlockKind::WitherSkeletonSkull => 6716u16, + BlockKind::WitherSkeletonWallSkull => 6732u16, + BlockKind::ZombieHead => 6736u16, + BlockKind::ZombieWallHead => 6752u16, + BlockKind::PlayerHead => 6756u16, + BlockKind::PlayerWallHead => 6772u16, + BlockKind::CreeperHead => 6776u16, + BlockKind::CreeperWallHead => 6792u16, + BlockKind::DragonHead => 6796u16, + BlockKind::DragonWallHead => 6812u16, + BlockKind::Anvil => 6816u16, + BlockKind::ChippedAnvil => 6820u16, + BlockKind::DamagedAnvil => 6824u16, + BlockKind::TrappedChest => 6829u16, + BlockKind::LightWeightedPressurePlate => 6852u16, + BlockKind::HeavyWeightedPressurePlate => 6868u16, + BlockKind::Comparator => 6885u16, + BlockKind::DaylightDetector => 6916u16, + BlockKind::RedstoneBlock => 6932u16, + BlockKind::NetherQuartzOre => 6933u16, + BlockKind::Hopper => 6934u16, + BlockKind::QuartzBlock => 6944u16, + BlockKind::ChiseledQuartzBlock => 6945u16, + BlockKind::QuartzPillar => 6947u16, + BlockKind::QuartzStairs => 6960u16, + BlockKind::ActivatorRail => 7042u16, + BlockKind::Dropper => 7054u16, + BlockKind::WhiteTerracotta => 7065u16, + BlockKind::OrangeTerracotta => 7066u16, + BlockKind::MagentaTerracotta => 7067u16, + BlockKind::LightBlueTerracotta => 7068u16, + BlockKind::YellowTerracotta => 7069u16, + BlockKind::LimeTerracotta => 7070u16, + BlockKind::PinkTerracotta => 7071u16, + BlockKind::GrayTerracotta => 7072u16, + BlockKind::LightGrayTerracotta => 7073u16, + BlockKind::CyanTerracotta => 7074u16, + BlockKind::PurpleTerracotta => 7075u16, + BlockKind::BlueTerracotta => 7076u16, + BlockKind::BrownTerracotta => 7077u16, + BlockKind::GreenTerracotta => 7078u16, + BlockKind::RedTerracotta => 7079u16, + BlockKind::BlackTerracotta => 7080u16, + BlockKind::WhiteStainedGlassPane => 7112u16, + BlockKind::OrangeStainedGlassPane => 7144u16, + BlockKind::MagentaStainedGlassPane => 7176u16, + BlockKind::LightBlueStainedGlassPane => 7208u16, + BlockKind::YellowStainedGlassPane => 7240u16, + BlockKind::LimeStainedGlassPane => 7272u16, + BlockKind::PinkStainedGlassPane => 7304u16, + BlockKind::GrayStainedGlassPane => 7336u16, + BlockKind::LightGrayStainedGlassPane => 7368u16, + BlockKind::CyanStainedGlassPane => 7400u16, + BlockKind::PurpleStainedGlassPane => 7432u16, + BlockKind::BlueStainedGlassPane => 7464u16, + BlockKind::BrownStainedGlassPane => 7496u16, + BlockKind::GreenStainedGlassPane => 7528u16, + BlockKind::RedStainedGlassPane => 7560u16, + BlockKind::BlackStainedGlassPane => 7592u16, + BlockKind::AcaciaStairs => 7604u16, + BlockKind::DarkOakStairs => 7684u16, + BlockKind::SlimeBlock => 7753u16, + BlockKind::Barrier => 7754u16, + BlockKind::Light => 7786u16, + BlockKind::IronTrapdoor => 7802u16, + BlockKind::Prismarine => 7851u16, + BlockKind::PrismarineBricks => 7852u16, + BlockKind::DarkPrismarine => 7853u16, + BlockKind::PrismarineStairs => 7865u16, + BlockKind::PrismarineBrickStairs => 7945u16, + BlockKind::DarkPrismarineStairs => 8025u16, + BlockKind::PrismarineSlab => 8097u16, + BlockKind::PrismarineBrickSlab => 8103u16, + BlockKind::DarkPrismarineSlab => 8109u16, + BlockKind::SeaLantern => 8112u16, + BlockKind::HayBlock => 8114u16, + BlockKind::WhiteCarpet => 8116u16, + BlockKind::OrangeCarpet => 8117u16, + BlockKind::MagentaCarpet => 8118u16, + BlockKind::LightBlueCarpet => 8119u16, + BlockKind::YellowCarpet => 8120u16, + BlockKind::LimeCarpet => 8121u16, + BlockKind::PinkCarpet => 8122u16, + BlockKind::GrayCarpet => 8123u16, + BlockKind::LightGrayCarpet => 8124u16, + BlockKind::CyanCarpet => 8125u16, + BlockKind::PurpleCarpet => 8126u16, + BlockKind::BlueCarpet => 8127u16, + BlockKind::BrownCarpet => 8128u16, + BlockKind::GreenCarpet => 8129u16, + BlockKind::RedCarpet => 8130u16, + BlockKind::BlackCarpet => 8131u16, + BlockKind::Terracotta => 8132u16, + BlockKind::CoalBlock => 8133u16, + BlockKind::PackedIce => 8134u16, + BlockKind::Sunflower => 8136u16, + BlockKind::Lilac => 8138u16, + BlockKind::RoseBush => 8140u16, + BlockKind::Peony => 8142u16, + BlockKind::TallGrass => 8144u16, + BlockKind::LargeFern => 8146u16, + BlockKind::WhiteBanner => 8147u16, + BlockKind::OrangeBanner => 8163u16, + BlockKind::MagentaBanner => 8179u16, + BlockKind::LightBlueBanner => 8195u16, + BlockKind::YellowBanner => 8211u16, + BlockKind::LimeBanner => 8227u16, + BlockKind::PinkBanner => 8243u16, + BlockKind::GrayBanner => 8259u16, + BlockKind::LightGrayBanner => 8275u16, + BlockKind::CyanBanner => 8291u16, + BlockKind::PurpleBanner => 8307u16, + BlockKind::BlueBanner => 8323u16, + BlockKind::BrownBanner => 8339u16, + BlockKind::GreenBanner => 8355u16, + BlockKind::RedBanner => 8371u16, + BlockKind::BlackBanner => 8387u16, + BlockKind::WhiteWallBanner => 8403u16, + BlockKind::OrangeWallBanner => 8407u16, + BlockKind::MagentaWallBanner => 8411u16, + BlockKind::LightBlueWallBanner => 8415u16, + BlockKind::YellowWallBanner => 8419u16, + BlockKind::LimeWallBanner => 8423u16, + BlockKind::PinkWallBanner => 8427u16, + BlockKind::GrayWallBanner => 8431u16, + BlockKind::LightGrayWallBanner => 8435u16, + BlockKind::CyanWallBanner => 8439u16, + BlockKind::PurpleWallBanner => 8443u16, + BlockKind::BlueWallBanner => 8447u16, + BlockKind::BrownWallBanner => 8451u16, + BlockKind::GreenWallBanner => 8455u16, + BlockKind::RedWallBanner => 8459u16, + BlockKind::BlackWallBanner => 8463u16, + BlockKind::RedSandstone => 8467u16, + BlockKind::ChiseledRedSandstone => 8468u16, + BlockKind::CutRedSandstone => 8469u16, + BlockKind::RedSandstoneStairs => 8481u16, + BlockKind::OakSlab => 8553u16, + BlockKind::SpruceSlab => 8559u16, + BlockKind::BirchSlab => 8565u16, + BlockKind::JungleSlab => 8571u16, + BlockKind::AcaciaSlab => 8577u16, + BlockKind::DarkOakSlab => 8583u16, + BlockKind::StoneSlab => 8589u16, + BlockKind::SmoothStoneSlab => 8595u16, + BlockKind::SandstoneSlab => 8601u16, + BlockKind::CutSandstoneSlab => 8607u16, + BlockKind::PetrifiedOakSlab => 8613u16, + BlockKind::CobblestoneSlab => 8619u16, + BlockKind::BrickSlab => 8625u16, + BlockKind::StoneBrickSlab => 8631u16, + BlockKind::NetherBrickSlab => 8637u16, + BlockKind::QuartzSlab => 8643u16, + BlockKind::RedSandstoneSlab => 8649u16, + BlockKind::CutRedSandstoneSlab => 8655u16, + BlockKind::PurpurSlab => 8661u16, + BlockKind::SmoothStone => 8664u16, + BlockKind::SmoothSandstone => 8665u16, + BlockKind::SmoothQuartz => 8666u16, + BlockKind::SmoothRedSandstone => 8667u16, + BlockKind::SpruceFenceGate => 8675u16, + BlockKind::BirchFenceGate => 8707u16, + BlockKind::JungleFenceGate => 8739u16, + BlockKind::AcaciaFenceGate => 8771u16, + BlockKind::DarkOakFenceGate => 8803u16, + BlockKind::SpruceFence => 8859u16, + BlockKind::BirchFence => 8891u16, + BlockKind::JungleFence => 8923u16, + BlockKind::AcaciaFence => 8955u16, + BlockKind::DarkOakFence => 8987u16, + BlockKind::SpruceDoor => 8999u16, + BlockKind::BirchDoor => 9063u16, + BlockKind::JungleDoor => 9127u16, + BlockKind::AcaciaDoor => 9191u16, + BlockKind::DarkOakDoor => 9255u16, + BlockKind::EndRod => 9312u16, + BlockKind::ChorusPlant => 9377u16, + BlockKind::ChorusFlower => 9378u16, + BlockKind::PurpurBlock => 9384u16, + BlockKind::PurpurPillar => 9386u16, + BlockKind::PurpurStairs => 9399u16, + BlockKind::EndStoneBricks => 9468u16, + BlockKind::Beetroots => 9469u16, + BlockKind::DirtPath => 9473u16, + BlockKind::EndGateway => 9474u16, + BlockKind::RepeatingCommandBlock => 9481u16, + BlockKind::ChainCommandBlock => 9493u16, + BlockKind::FrostedIce => 9499u16, + BlockKind::MagmaBlock => 9503u16, + BlockKind::NetherWartBlock => 9504u16, + BlockKind::RedNetherBricks => 9505u16, + BlockKind::BoneBlock => 9507u16, + BlockKind::StructureVoid => 9509u16, + BlockKind::Observer => 9515u16, + BlockKind::ShulkerBox => 9526u16, + BlockKind::WhiteShulkerBox => 9532u16, + BlockKind::OrangeShulkerBox => 9538u16, + BlockKind::MagentaShulkerBox => 9544u16, + BlockKind::LightBlueShulkerBox => 9550u16, + BlockKind::YellowShulkerBox => 9556u16, + BlockKind::LimeShulkerBox => 9562u16, + BlockKind::PinkShulkerBox => 9568u16, + BlockKind::GrayShulkerBox => 9574u16, + BlockKind::LightGrayShulkerBox => 9580u16, + BlockKind::CyanShulkerBox => 9586u16, + BlockKind::PurpleShulkerBox => 9592u16, + BlockKind::BlueShulkerBox => 9598u16, + BlockKind::BrownShulkerBox => 9604u16, + BlockKind::GreenShulkerBox => 9610u16, + BlockKind::RedShulkerBox => 9616u16, + BlockKind::BlackShulkerBox => 9622u16, + BlockKind::WhiteGlazedTerracotta => 9624u16, + BlockKind::OrangeGlazedTerracotta => 9628u16, + BlockKind::MagentaGlazedTerracotta => 9632u16, + BlockKind::LightBlueGlazedTerracotta => 9636u16, + BlockKind::YellowGlazedTerracotta => 9640u16, + BlockKind::LimeGlazedTerracotta => 9644u16, + BlockKind::PinkGlazedTerracotta => 9648u16, + BlockKind::GrayGlazedTerracotta => 9652u16, + BlockKind::LightGrayGlazedTerracotta => 9656u16, + BlockKind::CyanGlazedTerracotta => 9660u16, + BlockKind::PurpleGlazedTerracotta => 9664u16, + BlockKind::BlueGlazedTerracotta => 9668u16, + BlockKind::BrownGlazedTerracotta => 9672u16, + BlockKind::GreenGlazedTerracotta => 9676u16, + BlockKind::RedGlazedTerracotta => 9680u16, + BlockKind::BlackGlazedTerracotta => 9684u16, + BlockKind::WhiteConcrete => 9688u16, + BlockKind::OrangeConcrete => 9689u16, + BlockKind::MagentaConcrete => 9690u16, + BlockKind::LightBlueConcrete => 9691u16, + BlockKind::YellowConcrete => 9692u16, + BlockKind::LimeConcrete => 9693u16, + BlockKind::PinkConcrete => 9694u16, + BlockKind::GrayConcrete => 9695u16, + BlockKind::LightGrayConcrete => 9696u16, + BlockKind::CyanConcrete => 9697u16, + BlockKind::PurpleConcrete => 9698u16, + BlockKind::BlueConcrete => 9699u16, + BlockKind::BrownConcrete => 9700u16, + BlockKind::GreenConcrete => 9701u16, + BlockKind::RedConcrete => 9702u16, + BlockKind::BlackConcrete => 9703u16, + BlockKind::WhiteConcretePowder => 9704u16, + BlockKind::OrangeConcretePowder => 9705u16, + BlockKind::MagentaConcretePowder => 9706u16, + BlockKind::LightBlueConcretePowder => 9707u16, + BlockKind::YellowConcretePowder => 9708u16, + BlockKind::LimeConcretePowder => 9709u16, + BlockKind::PinkConcretePowder => 9710u16, + BlockKind::GrayConcretePowder => 9711u16, + BlockKind::LightGrayConcretePowder => 9712u16, + BlockKind::CyanConcretePowder => 9713u16, + BlockKind::PurpleConcretePowder => 9714u16, + BlockKind::BlueConcretePowder => 9715u16, + BlockKind::BrownConcretePowder => 9716u16, + BlockKind::GreenConcretePowder => 9717u16, + BlockKind::RedConcretePowder => 9718u16, + BlockKind::BlackConcretePowder => 9719u16, + BlockKind::Kelp => 9720u16, + BlockKind::KelpPlant => 9746u16, + BlockKind::DriedKelpBlock => 9747u16, + BlockKind::TurtleEgg => 9748u16, + BlockKind::DeadTubeCoralBlock => 9760u16, + BlockKind::DeadBrainCoralBlock => 9761u16, + BlockKind::DeadBubbleCoralBlock => 9762u16, + BlockKind::DeadFireCoralBlock => 9763u16, + BlockKind::DeadHornCoralBlock => 9764u16, + BlockKind::TubeCoralBlock => 9765u16, + BlockKind::BrainCoralBlock => 9766u16, + BlockKind::BubbleCoralBlock => 9767u16, + BlockKind::FireCoralBlock => 9768u16, + BlockKind::HornCoralBlock => 9769u16, + BlockKind::DeadTubeCoral => 9770u16, + BlockKind::DeadBrainCoral => 9772u16, + BlockKind::DeadBubbleCoral => 9774u16, + BlockKind::DeadFireCoral => 9776u16, + BlockKind::DeadHornCoral => 9778u16, + BlockKind::TubeCoral => 9780u16, + BlockKind::BrainCoral => 9782u16, + BlockKind::BubbleCoral => 9784u16, + BlockKind::FireCoral => 9786u16, + BlockKind::HornCoral => 9788u16, + BlockKind::DeadTubeCoralFan => 9790u16, + BlockKind::DeadBrainCoralFan => 9792u16, + BlockKind::DeadBubbleCoralFan => 9794u16, + BlockKind::DeadFireCoralFan => 9796u16, + BlockKind::DeadHornCoralFan => 9798u16, + BlockKind::TubeCoralFan => 9800u16, + BlockKind::BrainCoralFan => 9802u16, + BlockKind::BubbleCoralFan => 9804u16, + BlockKind::FireCoralFan => 9806u16, + BlockKind::HornCoralFan => 9808u16, + BlockKind::DeadTubeCoralWallFan => 9810u16, + BlockKind::DeadBrainCoralWallFan => 9818u16, + BlockKind::DeadBubbleCoralWallFan => 9826u16, + BlockKind::DeadFireCoralWallFan => 9834u16, + BlockKind::DeadHornCoralWallFan => 9842u16, + BlockKind::TubeCoralWallFan => 9850u16, + BlockKind::BrainCoralWallFan => 9858u16, + BlockKind::BubbleCoralWallFan => 9866u16, + BlockKind::FireCoralWallFan => 9874u16, + BlockKind::HornCoralWallFan => 9882u16, + BlockKind::SeaPickle => 9890u16, + BlockKind::BlueIce => 9898u16, + BlockKind::Conduit => 9899u16, + BlockKind::BambooSapling => 9901u16, + BlockKind::Bamboo => 9902u16, + BlockKind::PottedBamboo => 9914u16, + BlockKind::VoidAir => 9915u16, + BlockKind::CaveAir => 9916u16, + BlockKind::BubbleColumn => 9917u16, + BlockKind::PolishedGraniteStairs => 9930u16, + BlockKind::SmoothRedSandstoneStairs => 10010u16, + BlockKind::MossyStoneBrickStairs => 10090u16, + BlockKind::PolishedDioriteStairs => 10170u16, + BlockKind::MossyCobblestoneStairs => 10250u16, + BlockKind::EndStoneBrickStairs => 10330u16, + BlockKind::StoneStairs => 10410u16, + BlockKind::SmoothSandstoneStairs => 10490u16, + BlockKind::SmoothQuartzStairs => 10570u16, + BlockKind::GraniteStairs => 10650u16, + BlockKind::AndesiteStairs => 10730u16, + BlockKind::RedNetherBrickStairs => 10810u16, + BlockKind::PolishedAndesiteStairs => 10890u16, + BlockKind::DioriteStairs => 10970u16, + BlockKind::PolishedGraniteSlab => 11042u16, + BlockKind::SmoothRedSandstoneSlab => 11048u16, + BlockKind::MossyStoneBrickSlab => 11054u16, + BlockKind::PolishedDioriteSlab => 11060u16, + BlockKind::MossyCobblestoneSlab => 11066u16, + BlockKind::EndStoneBrickSlab => 11072u16, + BlockKind::SmoothSandstoneSlab => 11078u16, + BlockKind::SmoothQuartzSlab => 11084u16, + BlockKind::GraniteSlab => 11090u16, + BlockKind::AndesiteSlab => 11096u16, + BlockKind::RedNetherBrickSlab => 11102u16, + BlockKind::PolishedAndesiteSlab => 11108u16, + BlockKind::DioriteSlab => 11114u16, + BlockKind::BrickWall => 11120u16, + BlockKind::PrismarineWall => 11444u16, + BlockKind::RedSandstoneWall => 11768u16, + BlockKind::MossyStoneBrickWall => 12092u16, + BlockKind::GraniteWall => 12416u16, + BlockKind::StoneBrickWall => 12740u16, + BlockKind::NetherBrickWall => 13064u16, + BlockKind::AndesiteWall => 13388u16, + BlockKind::RedNetherBrickWall => 13712u16, + BlockKind::SandstoneWall => 14036u16, + BlockKind::EndStoneBrickWall => 14360u16, + BlockKind::DioriteWall => 14684u16, + BlockKind::Scaffolding => 15036u16, + BlockKind::Loom => 15037u16, + BlockKind::Barrel => 15042u16, + BlockKind::Smoker => 15054u16, + BlockKind::BlastFurnace => 15062u16, + BlockKind::CartographyTable => 15069u16, + BlockKind::FletchingTable => 15070u16, + BlockKind::Grindstone => 15075u16, + BlockKind::Lectern => 15086u16, + BlockKind::SmithingTable => 15099u16, + BlockKind::Stonecutter => 15100u16, + BlockKind::Bell => 15105u16, + BlockKind::Lantern => 15139u16, + BlockKind::SoulLantern => 15143u16, + BlockKind::Campfire => 15147u16, + BlockKind::SoulCampfire => 15179u16, + BlockKind::SweetBerryBush => 15208u16, + BlockKind::WarpedStem => 15213u16, + BlockKind::StrippedWarpedStem => 15216u16, + BlockKind::WarpedHyphae => 15219u16, + BlockKind::StrippedWarpedHyphae => 15222u16, + BlockKind::WarpedNylium => 15224u16, + BlockKind::WarpedFungus => 15225u16, + BlockKind::WarpedWartBlock => 15226u16, + BlockKind::WarpedRoots => 15227u16, + BlockKind::NetherSprouts => 15228u16, + BlockKind::CrimsonStem => 15230u16, + BlockKind::StrippedCrimsonStem => 15233u16, + BlockKind::CrimsonHyphae => 15236u16, + BlockKind::StrippedCrimsonHyphae => 15239u16, + BlockKind::CrimsonNylium => 15241u16, + BlockKind::CrimsonFungus => 15242u16, + BlockKind::Shroomlight => 15243u16, + BlockKind::WeepingVines => 15244u16, + BlockKind::WeepingVinesPlant => 15270u16, + BlockKind::TwistingVines => 15271u16, + BlockKind::TwistingVinesPlant => 15297u16, + BlockKind::CrimsonRoots => 15298u16, + BlockKind::CrimsonPlanks => 15299u16, + BlockKind::WarpedPlanks => 15300u16, + BlockKind::CrimsonSlab => 15304u16, + BlockKind::WarpedSlab => 15310u16, + BlockKind::CrimsonPressurePlate => 15314u16, + BlockKind::WarpedPressurePlate => 15316u16, + BlockKind::CrimsonFence => 15348u16, + BlockKind::WarpedFence => 15380u16, + BlockKind::CrimsonTrapdoor => 15396u16, + BlockKind::WarpedTrapdoor => 15460u16, + BlockKind::CrimsonFenceGate => 15516u16, + BlockKind::WarpedFenceGate => 15548u16, + BlockKind::CrimsonStairs => 15584u16, + BlockKind::WarpedStairs => 15664u16, + BlockKind::CrimsonButton => 15742u16, + BlockKind::WarpedButton => 15766u16, + BlockKind::CrimsonDoor => 15792u16, + BlockKind::WarpedDoor => 15856u16, + BlockKind::CrimsonSign => 15910u16, + BlockKind::WarpedSign => 15942u16, + BlockKind::CrimsonWallSign => 15974u16, + BlockKind::WarpedWallSign => 15982u16, + BlockKind::StructureBlock => 15990u16, + BlockKind::Jigsaw => 16003u16, + BlockKind::Composter => 16005u16, + BlockKind::Target => 16014u16, + BlockKind::BeeNest => 16030u16, + BlockKind::Beehive => 16054u16, + BlockKind::HoneyBlock => 16078u16, + BlockKind::HoneycombBlock => 16079u16, + BlockKind::NetheriteBlock => 16080u16, + BlockKind::AncientDebris => 16081u16, + BlockKind::CryingObsidian => 16082u16, + BlockKind::RespawnAnchor => 16083u16, + BlockKind::PottedCrimsonFungus => 16088u16, + BlockKind::PottedWarpedFungus => 16089u16, + BlockKind::PottedCrimsonRoots => 16090u16, + BlockKind::PottedWarpedRoots => 16091u16, + BlockKind::Lodestone => 16092u16, + BlockKind::Blackstone => 16093u16, + BlockKind::BlackstoneStairs => 16105u16, + BlockKind::BlackstoneWall => 16177u16, + BlockKind::BlackstoneSlab => 16501u16, + BlockKind::PolishedBlackstone => 16504u16, + BlockKind::PolishedBlackstoneBricks => 16505u16, + BlockKind::CrackedPolishedBlackstoneBricks => 16506u16, + BlockKind::ChiseledPolishedBlackstone => 16507u16, + BlockKind::PolishedBlackstoneBrickSlab => 16511u16, + BlockKind::PolishedBlackstoneBrickStairs => 16525u16, + BlockKind::PolishedBlackstoneBrickWall => 16597u16, + BlockKind::GildedBlackstone => 16918u16, + BlockKind::PolishedBlackstoneStairs => 16930u16, + BlockKind::PolishedBlackstoneSlab => 17002u16, + BlockKind::PolishedBlackstonePressurePlate => 17006u16, + BlockKind::PolishedBlackstoneButton => 17016u16, + BlockKind::PolishedBlackstoneWall => 17034u16, + BlockKind::ChiseledNetherBricks => 17355u16, + BlockKind::CrackedNetherBricks => 17356u16, + BlockKind::QuartzBricks => 17357u16, + BlockKind::Candle => 17361u16, + BlockKind::WhiteCandle => 17377u16, + BlockKind::OrangeCandle => 17393u16, + BlockKind::MagentaCandle => 17409u16, + BlockKind::LightBlueCandle => 17425u16, + BlockKind::YellowCandle => 17441u16, + BlockKind::LimeCandle => 17457u16, + BlockKind::PinkCandle => 17473u16, + BlockKind::GrayCandle => 17489u16, + BlockKind::LightGrayCandle => 17505u16, + BlockKind::CyanCandle => 17521u16, + BlockKind::PurpleCandle => 17537u16, + BlockKind::BlueCandle => 17553u16, + BlockKind::BrownCandle => 17569u16, + BlockKind::GreenCandle => 17585u16, + BlockKind::RedCandle => 17601u16, + BlockKind::BlackCandle => 17617u16, + BlockKind::CandleCake => 17631u16, + BlockKind::WhiteCandleCake => 17633u16, + BlockKind::OrangeCandleCake => 17635u16, + BlockKind::MagentaCandleCake => 17637u16, + BlockKind::LightBlueCandleCake => 17639u16, + BlockKind::YellowCandleCake => 17641u16, + BlockKind::LimeCandleCake => 17643u16, + BlockKind::PinkCandleCake => 17645u16, + BlockKind::GrayCandleCake => 17647u16, + BlockKind::LightGrayCandleCake => 17649u16, + BlockKind::CyanCandleCake => 17651u16, + BlockKind::PurpleCandleCake => 17653u16, + BlockKind::BlueCandleCake => 17655u16, + BlockKind::BrownCandleCake => 17657u16, + BlockKind::GreenCandleCake => 17659u16, + BlockKind::RedCandleCake => 17661u16, + BlockKind::BlackCandleCake => 17663u16, + BlockKind::AmethystBlock => 17664u16, + BlockKind::BuddingAmethyst => 17665u16, + BlockKind::AmethystCluster => 17675u16, + BlockKind::LargeAmethystBud => 17687u16, + BlockKind::MediumAmethystBud => 17699u16, + BlockKind::SmallAmethystBud => 17711u16, + BlockKind::Tuff => 17714u16, + BlockKind::Calcite => 17715u16, + BlockKind::TintedGlass => 17716u16, + BlockKind::PowderSnow => 17717u16, + BlockKind::SculkSensor => 17719u16, + BlockKind::OxidizedCopper => 17814u16, + BlockKind::WeatheredCopper => 17815u16, + BlockKind::ExposedCopper => 17816u16, + BlockKind::CopperBlock => 17817u16, + BlockKind::CopperOre => 17818u16, + BlockKind::DeepslateCopperOre => 17819u16, + BlockKind::OxidizedCutCopper => 17820u16, + BlockKind::WeatheredCutCopper => 17821u16, + BlockKind::ExposedCutCopper => 17822u16, + BlockKind::CutCopper => 17823u16, + BlockKind::OxidizedCutCopperStairs => 17835u16, + BlockKind::WeatheredCutCopperStairs => 17915u16, + BlockKind::ExposedCutCopperStairs => 17995u16, + BlockKind::CutCopperStairs => 18075u16, + BlockKind::OxidizedCutCopperSlab => 18147u16, + BlockKind::WeatheredCutCopperSlab => 18153u16, + BlockKind::ExposedCutCopperSlab => 18159u16, + BlockKind::CutCopperSlab => 18165u16, + BlockKind::WaxedCopperBlock => 18168u16, + BlockKind::WaxedWeatheredCopper => 18169u16, + BlockKind::WaxedExposedCopper => 18170u16, + BlockKind::WaxedOxidizedCopper => 18171u16, + BlockKind::WaxedOxidizedCutCopper => 18172u16, + BlockKind::WaxedWeatheredCutCopper => 18173u16, + BlockKind::WaxedExposedCutCopper => 18174u16, + BlockKind::WaxedCutCopper => 18175u16, + BlockKind::WaxedOxidizedCutCopperStairs => 18187u16, + BlockKind::WaxedWeatheredCutCopperStairs => 18267u16, + BlockKind::WaxedExposedCutCopperStairs => 18347u16, + BlockKind::WaxedCutCopperStairs => 18427u16, + BlockKind::WaxedOxidizedCutCopperSlab => 18499u16, + BlockKind::WaxedWeatheredCutCopperSlab => 18505u16, + BlockKind::WaxedExposedCutCopperSlab => 18511u16, + BlockKind::WaxedCutCopperSlab => 18517u16, + BlockKind::LightningRod => 18539u16, + BlockKind::PointedDripstone => 18549u16, + BlockKind::DripstoneBlock => 18564u16, + BlockKind::CaveVines => 18566u16, + BlockKind::CaveVinesPlant => 18618u16, + BlockKind::SporeBlossom => 18619u16, + BlockKind::Azalea => 18620u16, + BlockKind::FloweringAzalea => 18621u16, + BlockKind::MossCarpet => 18622u16, + BlockKind::MossBlock => 18623u16, + BlockKind::BigDripleaf => 18625u16, + BlockKind::BigDripleafStem => 18657u16, + BlockKind::SmallDripleaf => 18667u16, + BlockKind::HangingRoots => 18681u16, + BlockKind::RootedDirt => 18682u16, + BlockKind::Deepslate => 18684u16, + BlockKind::CobbledDeepslate => 18686u16, + BlockKind::CobbledDeepslateStairs => 18698u16, + BlockKind::CobbledDeepslateSlab => 18770u16, + BlockKind::CobbledDeepslateWall => 18776u16, + BlockKind::PolishedDeepslate => 19097u16, + BlockKind::PolishedDeepslateStairs => 19109u16, + BlockKind::PolishedDeepslateSlab => 19181u16, + BlockKind::PolishedDeepslateWall => 19187u16, + BlockKind::DeepslateTiles => 19508u16, + BlockKind::DeepslateTileStairs => 19520u16, + BlockKind::DeepslateTileSlab => 19592u16, + BlockKind::DeepslateTileWall => 19598u16, + BlockKind::DeepslateBricks => 19919u16, + BlockKind::DeepslateBrickStairs => 19931u16, + BlockKind::DeepslateBrickSlab => 20003u16, + BlockKind::DeepslateBrickWall => 20009u16, + BlockKind::ChiseledDeepslate => 20330u16, + BlockKind::CrackedDeepslateBricks => 20331u16, + BlockKind::CrackedDeepslateTiles => 20332u16, + BlockKind::InfestedDeepslate => 20334u16, + BlockKind::SmoothBasalt => 20336u16, + BlockKind::RawIronBlock => 20337u16, + BlockKind::RawCopperBlock => 20338u16, + BlockKind::RawGoldBlock => 20339u16, + BlockKind::PottedAzaleaBush => 20340u16, + BlockKind::PottedFloweringAzaleaBush => 20341u16, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `light_filter` property of this `BlockKind`. - pub fn light_filter(&self) -> u8 { + #[doc = "Returns the `min_state_id` property of this `BlockKind`."] + #[inline] + pub fn min_state_id(&self) -> u16 { match self { - BlockKind::Air => 0, - BlockKind::Stone => 15, - BlockKind::Granite => 15, - BlockKind::PolishedGranite => 15, - BlockKind::Diorite => 15, - BlockKind::PolishedDiorite => 15, - BlockKind::Andesite => 15, - BlockKind::PolishedAndesite => 15, - BlockKind::GrassBlock => 15, - BlockKind::Dirt => 15, - BlockKind::CoarseDirt => 15, - BlockKind::Podzol => 15, - BlockKind::Cobblestone => 15, - BlockKind::OakPlanks => 15, - BlockKind::SprucePlanks => 15, - BlockKind::BirchPlanks => 15, - BlockKind::JunglePlanks => 15, - BlockKind::AcaciaPlanks => 15, - BlockKind::DarkOakPlanks => 15, - BlockKind::OakSapling => 0, - BlockKind::SpruceSapling => 0, - BlockKind::BirchSapling => 0, - BlockKind::JungleSapling => 0, - BlockKind::AcaciaSapling => 0, - BlockKind::DarkOakSapling => 0, - BlockKind::Bedrock => 15, - BlockKind::Water => 2, - BlockKind::Lava => 0, - BlockKind::Sand => 15, - BlockKind::RedSand => 15, - BlockKind::Gravel => 15, - BlockKind::GoldOre => 15, - BlockKind::IronOre => 15, - BlockKind::CoalOre => 15, - BlockKind::NetherGoldOre => 15, - BlockKind::OakLog => 15, - BlockKind::SpruceLog => 15, - BlockKind::BirchLog => 15, - BlockKind::JungleLog => 15, - BlockKind::AcaciaLog => 15, - BlockKind::DarkOakLog => 15, - BlockKind::StrippedSpruceLog => 15, - BlockKind::StrippedBirchLog => 15, - BlockKind::StrippedJungleLog => 15, - BlockKind::StrippedAcaciaLog => 15, - BlockKind::StrippedDarkOakLog => 15, - BlockKind::StrippedOakLog => 15, - BlockKind::OakWood => 15, - BlockKind::SpruceWood => 15, - BlockKind::BirchWood => 15, - BlockKind::JungleWood => 15, - BlockKind::AcaciaWood => 15, - BlockKind::DarkOakWood => 15, - BlockKind::StrippedOakWood => 15, - BlockKind::StrippedSpruceWood => 15, - BlockKind::StrippedBirchWood => 15, - BlockKind::StrippedJungleWood => 15, - BlockKind::StrippedAcaciaWood => 15, - BlockKind::StrippedDarkOakWood => 15, - BlockKind::OakLeaves => 0, - BlockKind::SpruceLeaves => 0, - BlockKind::BirchLeaves => 0, - BlockKind::JungleLeaves => 0, - BlockKind::AcaciaLeaves => 0, - BlockKind::DarkOakLeaves => 0, - BlockKind::Sponge => 15, - BlockKind::WetSponge => 15, - BlockKind::Glass => 0, - BlockKind::LapisOre => 15, - BlockKind::LapisBlock => 15, - BlockKind::Dispenser => 15, - BlockKind::Sandstone => 15, - BlockKind::ChiseledSandstone => 15, - BlockKind::CutSandstone => 15, - BlockKind::NoteBlock => 15, - BlockKind::WhiteBed => 0, - BlockKind::OrangeBed => 0, - BlockKind::MagentaBed => 0, - BlockKind::LightBlueBed => 0, - BlockKind::YellowBed => 0, - BlockKind::LimeBed => 0, - BlockKind::PinkBed => 0, - BlockKind::GrayBed => 0, - BlockKind::LightGrayBed => 0, - BlockKind::CyanBed => 0, - BlockKind::PurpleBed => 0, - BlockKind::BlueBed => 0, - BlockKind::BrownBed => 0, - BlockKind::GreenBed => 0, - BlockKind::RedBed => 0, - BlockKind::BlackBed => 0, - BlockKind::PoweredRail => 0, - BlockKind::DetectorRail => 0, - BlockKind::StickyPiston => 0, - BlockKind::Cobweb => 0, - BlockKind::Grass => 15, - BlockKind::Fern => 0, - BlockKind::DeadBush => 0, - BlockKind::Seagrass => 0, - BlockKind::TallSeagrass => 0, - BlockKind::Piston => 0, - BlockKind::PistonHead => 0, - BlockKind::WhiteWool => 15, - BlockKind::OrangeWool => 15, - BlockKind::MagentaWool => 15, - BlockKind::LightBlueWool => 15, - BlockKind::YellowWool => 15, - BlockKind::LimeWool => 15, - BlockKind::PinkWool => 15, - BlockKind::GrayWool => 15, - BlockKind::LightGrayWool => 15, - BlockKind::CyanWool => 15, - BlockKind::PurpleWool => 15, - BlockKind::BlueWool => 15, - BlockKind::BrownWool => 15, - BlockKind::GreenWool => 15, - BlockKind::RedWool => 15, - BlockKind::BlackWool => 15, - BlockKind::MovingPiston => 0, - BlockKind::Dandelion => 15, - BlockKind::Poppy => 15, - BlockKind::BlueOrchid => 0, - BlockKind::Allium => 15, - BlockKind::AzureBluet => 15, - BlockKind::RedTulip => 0, - BlockKind::OrangeTulip => 0, - BlockKind::WhiteTulip => 0, - BlockKind::PinkTulip => 0, - BlockKind::OxeyeDaisy => 15, - BlockKind::Cornflower => 0, - BlockKind::WitherRose => 0, - BlockKind::LilyOfTheValley => 0, - BlockKind::BrownMushroom => 15, - BlockKind::RedMushroom => 15, - BlockKind::GoldBlock => 15, - BlockKind::IronBlock => 15, - BlockKind::Bricks => 15, - BlockKind::Tnt => 0, - BlockKind::Bookshelf => 15, - BlockKind::MossyCobblestone => 15, - BlockKind::Obsidian => 15, - BlockKind::Torch => 0, - BlockKind::WallTorch => 0, - BlockKind::Fire => 0, - BlockKind::SoulFire => 15, - BlockKind::Spawner => 0, - BlockKind::OakStairs => 15, - BlockKind::Chest => 0, - BlockKind::RedstoneWire => 0, - BlockKind::DiamondOre => 15, - BlockKind::DiamondBlock => 15, - BlockKind::CraftingTable => 15, - BlockKind::Wheat => 0, - BlockKind::Farmland => 0, - BlockKind::Furnace => 0, - BlockKind::OakSign => 0, - BlockKind::SpruceSign => 0, - BlockKind::BirchSign => 0, - BlockKind::AcaciaSign => 0, - BlockKind::JungleSign => 0, - BlockKind::DarkOakSign => 0, - BlockKind::OakDoor => 0, - BlockKind::Ladder => 0, - BlockKind::Rail => 0, - BlockKind::CobblestoneStairs => 15, - BlockKind::OakWallSign => 0, - BlockKind::SpruceWallSign => 0, - BlockKind::BirchWallSign => 0, - BlockKind::AcaciaWallSign => 0, - BlockKind::JungleWallSign => 0, - BlockKind::DarkOakWallSign => 0, - BlockKind::Lever => 0, - BlockKind::StonePressurePlate => 0, - BlockKind::IronDoor => 0, - BlockKind::OakPressurePlate => 0, - BlockKind::SprucePressurePlate => 0, - BlockKind::BirchPressurePlate => 0, - BlockKind::JunglePressurePlate => 0, - BlockKind::AcaciaPressurePlate => 0, - BlockKind::DarkOakPressurePlate => 0, - BlockKind::RedstoneOre => 0, - BlockKind::RedstoneTorch => 0, - BlockKind::RedstoneWallTorch => 0, - BlockKind::StoneButton => 0, - BlockKind::Snow => 15, - BlockKind::Ice => 0, - BlockKind::SnowBlock => 15, - BlockKind::Cactus => 0, - BlockKind::Clay => 15, - BlockKind::SugarCane => 0, - BlockKind::Jukebox => 15, - BlockKind::OakFence => 0, - BlockKind::Pumpkin => 15, - BlockKind::Netherrack => 15, - BlockKind::SoulSand => 15, - BlockKind::SoulSoil => 15, - BlockKind::Basalt => 15, - BlockKind::PolishedBasalt => 15, - BlockKind::SoulTorch => 0, - BlockKind::SoulWallTorch => 0, - BlockKind::Glowstone => 0, - BlockKind::NetherPortal => 0, - BlockKind::CarvedPumpkin => 15, - BlockKind::JackOLantern => 15, - BlockKind::Cake => 0, - BlockKind::Repeater => 0, - BlockKind::WhiteStainedGlass => 0, - BlockKind::OrangeStainedGlass => 0, - BlockKind::MagentaStainedGlass => 0, - BlockKind::LightBlueStainedGlass => 0, - BlockKind::YellowStainedGlass => 0, - BlockKind::LimeStainedGlass => 0, - BlockKind::PinkStainedGlass => 0, - BlockKind::GrayStainedGlass => 0, - BlockKind::LightGrayStainedGlass => 0, - BlockKind::CyanStainedGlass => 0, - BlockKind::PurpleStainedGlass => 0, - BlockKind::BlueStainedGlass => 0, - BlockKind::BrownStainedGlass => 0, - BlockKind::GreenStainedGlass => 0, - BlockKind::RedStainedGlass => 0, - BlockKind::BlackStainedGlass => 0, - BlockKind::OakTrapdoor => 0, - BlockKind::SpruceTrapdoor => 0, - BlockKind::BirchTrapdoor => 0, - BlockKind::JungleTrapdoor => 0, - BlockKind::AcaciaTrapdoor => 0, - BlockKind::DarkOakTrapdoor => 0, - BlockKind::StoneBricks => 15, - BlockKind::MossyStoneBricks => 15, - BlockKind::CrackedStoneBricks => 15, - BlockKind::ChiseledStoneBricks => 15, - BlockKind::InfestedStone => 15, - BlockKind::InfestedCobblestone => 15, - BlockKind::InfestedStoneBricks => 15, - BlockKind::InfestedMossyStoneBricks => 15, - BlockKind::InfestedCrackedStoneBricks => 15, - BlockKind::InfestedChiseledStoneBricks => 15, - BlockKind::BrownMushroomBlock => 15, - BlockKind::RedMushroomBlock => 15, - BlockKind::MushroomStem => 15, - BlockKind::IronBars => 0, - BlockKind::Chain => 0, - BlockKind::GlassPane => 0, - BlockKind::Melon => 15, - BlockKind::AttachedPumpkinStem => 0, - BlockKind::AttachedMelonStem => 0, - BlockKind::PumpkinStem => 0, - BlockKind::MelonStem => 0, - BlockKind::Vine => 0, - BlockKind::OakFenceGate => 0, - BlockKind::BrickStairs => 15, - BlockKind::StoneBrickStairs => 15, - BlockKind::Mycelium => 15, - BlockKind::LilyPad => 0, - BlockKind::NetherBricks => 15, - BlockKind::NetherBrickFence => 0, - BlockKind::NetherBrickStairs => 15, - BlockKind::NetherWart => 0, - BlockKind::EnchantingTable => 0, - BlockKind::BrewingStand => 0, - BlockKind::Cauldron => 0, - BlockKind::EndPortal => 0, - BlockKind::EndPortalFrame => 0, - BlockKind::EndStone => 15, - BlockKind::DragonEgg => 0, - BlockKind::RedstoneLamp => 0, - BlockKind::Cocoa => 0, - BlockKind::SandstoneStairs => 15, - BlockKind::EmeraldOre => 15, - BlockKind::EnderChest => 0, - BlockKind::TripwireHook => 0, - BlockKind::Tripwire => 0, - BlockKind::EmeraldBlock => 15, - BlockKind::SpruceStairs => 15, - BlockKind::BirchStairs => 15, - BlockKind::JungleStairs => 15, - BlockKind::CommandBlock => 15, - BlockKind::Beacon => 0, - BlockKind::CobblestoneWall => 0, - BlockKind::MossyCobblestoneWall => 0, - BlockKind::FlowerPot => 0, - BlockKind::PottedOakSapling => 0, - BlockKind::PottedSpruceSapling => 0, - BlockKind::PottedBirchSapling => 0, - BlockKind::PottedJungleSapling => 0, - BlockKind::PottedAcaciaSapling => 0, - BlockKind::PottedDarkOakSapling => 0, - BlockKind::PottedFern => 0, - BlockKind::PottedDandelion => 0, - BlockKind::PottedPoppy => 0, - BlockKind::PottedBlueOrchid => 0, - BlockKind::PottedAllium => 0, - BlockKind::PottedAzureBluet => 0, - BlockKind::PottedRedTulip => 0, - BlockKind::PottedOrangeTulip => 0, - BlockKind::PottedWhiteTulip => 0, - BlockKind::PottedPinkTulip => 0, - BlockKind::PottedOxeyeDaisy => 0, - BlockKind::PottedCornflower => 0, - BlockKind::PottedLilyOfTheValley => 0, - BlockKind::PottedWitherRose => 0, - BlockKind::PottedRedMushroom => 0, - BlockKind::PottedBrownMushroom => 0, - BlockKind::PottedDeadBush => 0, - BlockKind::PottedCactus => 0, - BlockKind::Carrots => 15, - BlockKind::Potatoes => 15, - BlockKind::OakButton => 0, - BlockKind::SpruceButton => 0, - BlockKind::BirchButton => 0, - BlockKind::JungleButton => 0, - BlockKind::AcaciaButton => 0, - BlockKind::DarkOakButton => 0, - BlockKind::SkeletonSkull => 0, - BlockKind::SkeletonWallSkull => 0, - BlockKind::WitherSkeletonSkull => 0, - BlockKind::WitherSkeletonWallSkull => 0, - BlockKind::ZombieHead => 0, - BlockKind::ZombieWallHead => 0, - BlockKind::PlayerHead => 0, - BlockKind::PlayerWallHead => 0, - BlockKind::CreeperHead => 0, - BlockKind::CreeperWallHead => 0, - BlockKind::DragonHead => 0, - BlockKind::DragonWallHead => 0, - BlockKind::Anvil => 0, - BlockKind::ChippedAnvil => 0, - BlockKind::DamagedAnvil => 0, - BlockKind::TrappedChest => 0, - BlockKind::LightWeightedPressurePlate => 0, - BlockKind::HeavyWeightedPressurePlate => 0, - BlockKind::Comparator => 0, - BlockKind::DaylightDetector => 0, - BlockKind::RedstoneBlock => 0, - BlockKind::NetherQuartzOre => 15, - BlockKind::Hopper => 0, - BlockKind::QuartzBlock => 15, - BlockKind::ChiseledQuartzBlock => 15, - BlockKind::QuartzPillar => 15, - BlockKind::QuartzStairs => 15, - BlockKind::ActivatorRail => 0, - BlockKind::Dropper => 15, - BlockKind::WhiteTerracotta => 15, - BlockKind::OrangeTerracotta => 15, - BlockKind::MagentaTerracotta => 15, - BlockKind::LightBlueTerracotta => 15, - BlockKind::YellowTerracotta => 15, - BlockKind::LimeTerracotta => 15, - BlockKind::PinkTerracotta => 15, - BlockKind::GrayTerracotta => 15, - BlockKind::LightGrayTerracotta => 15, - BlockKind::CyanTerracotta => 15, - BlockKind::PurpleTerracotta => 15, - BlockKind::BlueTerracotta => 15, - BlockKind::BrownTerracotta => 15, - BlockKind::GreenTerracotta => 15, - BlockKind::RedTerracotta => 15, - BlockKind::BlackTerracotta => 15, - BlockKind::WhiteStainedGlassPane => 0, - BlockKind::OrangeStainedGlassPane => 0, - BlockKind::MagentaStainedGlassPane => 0, - BlockKind::LightBlueStainedGlassPane => 0, - BlockKind::YellowStainedGlassPane => 0, - BlockKind::LimeStainedGlassPane => 0, - BlockKind::PinkStainedGlassPane => 0, - BlockKind::GrayStainedGlassPane => 0, - BlockKind::LightGrayStainedGlassPane => 0, - BlockKind::CyanStainedGlassPane => 0, - BlockKind::PurpleStainedGlassPane => 0, - BlockKind::BlueStainedGlassPane => 0, - BlockKind::BrownStainedGlassPane => 0, - BlockKind::GreenStainedGlassPane => 0, - BlockKind::RedStainedGlassPane => 0, - BlockKind::BlackStainedGlassPane => 0, - BlockKind::AcaciaStairs => 15, - BlockKind::DarkOakStairs => 15, - BlockKind::SlimeBlock => 0, - BlockKind::Barrier => 0, - BlockKind::IronTrapdoor => 0, - BlockKind::Prismarine => 15, - BlockKind::PrismarineBricks => 15, - BlockKind::DarkPrismarine => 15, - BlockKind::PrismarineStairs => 15, - BlockKind::PrismarineBrickStairs => 15, - BlockKind::DarkPrismarineStairs => 15, - BlockKind::PrismarineSlab => 0, - BlockKind::PrismarineBrickSlab => 0, - BlockKind::DarkPrismarineSlab => 0, - BlockKind::SeaLantern => 0, - BlockKind::HayBlock => 15, - BlockKind::WhiteCarpet => 0, - BlockKind::OrangeCarpet => 0, - BlockKind::MagentaCarpet => 0, - BlockKind::LightBlueCarpet => 0, - BlockKind::YellowCarpet => 0, - BlockKind::LimeCarpet => 0, - BlockKind::PinkCarpet => 0, - BlockKind::GrayCarpet => 0, - BlockKind::LightGrayCarpet => 0, - BlockKind::CyanCarpet => 0, - BlockKind::PurpleCarpet => 0, - BlockKind::BlueCarpet => 0, - BlockKind::BrownCarpet => 0, - BlockKind::GreenCarpet => 0, - BlockKind::RedCarpet => 0, - BlockKind::BlackCarpet => 0, - BlockKind::Terracotta => 15, - BlockKind::CoalBlock => 15, - BlockKind::PackedIce => 15, - BlockKind::Sunflower => 0, - BlockKind::Lilac => 0, - BlockKind::RoseBush => 0, - BlockKind::Peony => 15, - BlockKind::TallGrass => 0, - BlockKind::LargeFern => 0, - BlockKind::WhiteBanner => 0, - BlockKind::OrangeBanner => 0, - BlockKind::MagentaBanner => 0, - BlockKind::LightBlueBanner => 0, - BlockKind::YellowBanner => 0, - BlockKind::LimeBanner => 0, - BlockKind::PinkBanner => 0, - BlockKind::GrayBanner => 0, - BlockKind::LightGrayBanner => 0, - BlockKind::CyanBanner => 0, - BlockKind::PurpleBanner => 0, - BlockKind::BlueBanner => 0, - BlockKind::BrownBanner => 0, - BlockKind::GreenBanner => 0, - BlockKind::RedBanner => 0, - BlockKind::BlackBanner => 0, - BlockKind::WhiteWallBanner => 0, - BlockKind::OrangeWallBanner => 0, - BlockKind::MagentaWallBanner => 0, - BlockKind::LightBlueWallBanner => 0, - BlockKind::YellowWallBanner => 0, - BlockKind::LimeWallBanner => 0, - BlockKind::PinkWallBanner => 0, - BlockKind::GrayWallBanner => 0, - BlockKind::LightGrayWallBanner => 0, - BlockKind::CyanWallBanner => 0, - BlockKind::PurpleWallBanner => 0, - BlockKind::BlueWallBanner => 0, - BlockKind::BrownWallBanner => 0, - BlockKind::GreenWallBanner => 0, - BlockKind::RedWallBanner => 0, - BlockKind::BlackWallBanner => 0, - BlockKind::RedSandstone => 15, - BlockKind::ChiseledRedSandstone => 15, - BlockKind::CutRedSandstone => 15, - BlockKind::RedSandstoneStairs => 15, - BlockKind::OakSlab => 0, - BlockKind::SpruceSlab => 0, - BlockKind::BirchSlab => 0, - BlockKind::JungleSlab => 0, - BlockKind::AcaciaSlab => 0, - BlockKind::DarkOakSlab => 0, - BlockKind::StoneSlab => 0, - BlockKind::SmoothStoneSlab => 0, - BlockKind::SandstoneSlab => 0, - BlockKind::CutSandstoneSlab => 0, - BlockKind::PetrifiedOakSlab => 0, - BlockKind::CobblestoneSlab => 0, - BlockKind::BrickSlab => 0, - BlockKind::StoneBrickSlab => 0, - BlockKind::NetherBrickSlab => 0, - BlockKind::QuartzSlab => 0, - BlockKind::RedSandstoneSlab => 0, - BlockKind::CutRedSandstoneSlab => 0, - BlockKind::PurpurSlab => 0, - BlockKind::SmoothStone => 15, - BlockKind::SmoothSandstone => 15, - BlockKind::SmoothQuartz => 15, - BlockKind::SmoothRedSandstone => 15, - BlockKind::SpruceFenceGate => 0, - BlockKind::BirchFenceGate => 0, - BlockKind::JungleFenceGate => 0, - BlockKind::AcaciaFenceGate => 0, - BlockKind::DarkOakFenceGate => 0, - BlockKind::SpruceFence => 0, - BlockKind::BirchFence => 0, - BlockKind::JungleFence => 0, - BlockKind::AcaciaFence => 0, - BlockKind::DarkOakFence => 0, - BlockKind::SpruceDoor => 0, - BlockKind::BirchDoor => 0, - BlockKind::JungleDoor => 0, - BlockKind::AcaciaDoor => 0, - BlockKind::DarkOakDoor => 0, - BlockKind::EndRod => 15, - BlockKind::ChorusPlant => 0, - BlockKind::ChorusFlower => 0, - BlockKind::PurpurBlock => 15, - BlockKind::PurpurPillar => 15, - BlockKind::PurpurStairs => 15, - BlockKind::EndStoneBricks => 15, - BlockKind::Beetroots => 0, - BlockKind::GrassPath => 0, - BlockKind::EndGateway => 15, - BlockKind::RepeatingCommandBlock => 15, - BlockKind::ChainCommandBlock => 15, - BlockKind::FrostedIce => 2, - BlockKind::MagmaBlock => 15, - BlockKind::NetherWartBlock => 15, - BlockKind::RedNetherBricks => 15, - BlockKind::BoneBlock => 15, - BlockKind::StructureVoid => 15, - BlockKind::Observer => 0, - BlockKind::ShulkerBox => 0, - BlockKind::WhiteShulkerBox => 0, - BlockKind::OrangeShulkerBox => 0, - BlockKind::MagentaShulkerBox => 0, - BlockKind::LightBlueShulkerBox => 0, - BlockKind::YellowShulkerBox => 0, - BlockKind::LimeShulkerBox => 0, - BlockKind::PinkShulkerBox => 0, - BlockKind::GrayShulkerBox => 0, - BlockKind::LightGrayShulkerBox => 0, - BlockKind::CyanShulkerBox => 0, - BlockKind::PurpleShulkerBox => 0, - BlockKind::BlueShulkerBox => 0, - BlockKind::BrownShulkerBox => 0, - BlockKind::GreenShulkerBox => 0, - BlockKind::RedShulkerBox => 0, - BlockKind::BlackShulkerBox => 0, - BlockKind::WhiteGlazedTerracotta => 15, - BlockKind::OrangeGlazedTerracotta => 15, - BlockKind::MagentaGlazedTerracotta => 15, - BlockKind::LightBlueGlazedTerracotta => 15, - BlockKind::YellowGlazedTerracotta => 15, - BlockKind::LimeGlazedTerracotta => 15, - BlockKind::PinkGlazedTerracotta => 15, - BlockKind::GrayGlazedTerracotta => 15, - BlockKind::LightGrayGlazedTerracotta => 15, - BlockKind::CyanGlazedTerracotta => 15, - BlockKind::PurpleGlazedTerracotta => 15, - BlockKind::BlueGlazedTerracotta => 15, - BlockKind::BrownGlazedTerracotta => 15, - BlockKind::GreenGlazedTerracotta => 15, - BlockKind::RedGlazedTerracotta => 15, - BlockKind::BlackGlazedTerracotta => 15, - BlockKind::WhiteConcrete => 15, - BlockKind::OrangeConcrete => 15, - BlockKind::MagentaConcrete => 15, - BlockKind::LightBlueConcrete => 15, - BlockKind::YellowConcrete => 15, - BlockKind::LimeConcrete => 15, - BlockKind::PinkConcrete => 15, - BlockKind::GrayConcrete => 15, - BlockKind::LightGrayConcrete => 15, - BlockKind::CyanConcrete => 15, - BlockKind::PurpleConcrete => 15, - BlockKind::BlueConcrete => 15, - BlockKind::BrownConcrete => 15, - BlockKind::GreenConcrete => 15, - BlockKind::RedConcrete => 15, - BlockKind::BlackConcrete => 15, - BlockKind::WhiteConcretePowder => 15, - BlockKind::OrangeConcretePowder => 15, - BlockKind::MagentaConcretePowder => 15, - BlockKind::LightBlueConcretePowder => 15, - BlockKind::YellowConcretePowder => 15, - BlockKind::LimeConcretePowder => 15, - BlockKind::PinkConcretePowder => 15, - BlockKind::GrayConcretePowder => 15, - BlockKind::LightGrayConcretePowder => 15, - BlockKind::CyanConcretePowder => 15, - BlockKind::PurpleConcretePowder => 15, - BlockKind::BlueConcretePowder => 15, - BlockKind::BrownConcretePowder => 15, - BlockKind::GreenConcretePowder => 15, - BlockKind::RedConcretePowder => 15, - BlockKind::BlackConcretePowder => 15, - BlockKind::Kelp => 0, - BlockKind::KelpPlant => 0, - BlockKind::DriedKelpBlock => 15, - BlockKind::TurtleEgg => 15, - BlockKind::DeadTubeCoralBlock => 15, - BlockKind::DeadBrainCoralBlock => 15, - BlockKind::DeadBubbleCoralBlock => 15, - BlockKind::DeadFireCoralBlock => 15, - BlockKind::DeadHornCoralBlock => 15, - BlockKind::TubeCoralBlock => 15, - BlockKind::BrainCoralBlock => 15, - BlockKind::BubbleCoralBlock => 15, - BlockKind::FireCoralBlock => 15, - BlockKind::HornCoralBlock => 15, - BlockKind::DeadTubeCoral => 0, - BlockKind::DeadBrainCoral => 0, - BlockKind::DeadBubbleCoral => 0, - BlockKind::DeadFireCoral => 0, - BlockKind::DeadHornCoral => 0, - BlockKind::TubeCoral => 0, - BlockKind::BrainCoral => 0, - BlockKind::BubbleCoral => 0, - BlockKind::FireCoral => 0, - BlockKind::HornCoral => 0, - BlockKind::DeadTubeCoralFan => 0, - BlockKind::DeadBrainCoralFan => 0, - BlockKind::DeadBubbleCoralFan => 0, - BlockKind::DeadFireCoralFan => 0, - BlockKind::DeadHornCoralFan => 0, - BlockKind::TubeCoralFan => 0, - BlockKind::BrainCoralFan => 0, - BlockKind::BubbleCoralFan => 0, - BlockKind::FireCoralFan => 0, - BlockKind::HornCoralFan => 0, - BlockKind::DeadTubeCoralWallFan => 0, - BlockKind::DeadBrainCoralWallFan => 0, - BlockKind::DeadBubbleCoralWallFan => 0, - BlockKind::DeadFireCoralWallFan => 0, - BlockKind::DeadHornCoralWallFan => 0, - BlockKind::TubeCoralWallFan => 0, - BlockKind::BrainCoralWallFan => 0, - BlockKind::BubbleCoralWallFan => 0, - BlockKind::FireCoralWallFan => 0, - BlockKind::HornCoralWallFan => 0, - BlockKind::SeaPickle => 15, - BlockKind::BlueIce => 15, - BlockKind::Conduit => 15, - BlockKind::BambooSapling => 15, - BlockKind::Bamboo => 15, - BlockKind::PottedBamboo => 0, - BlockKind::VoidAir => 0, - BlockKind::CaveAir => 0, - BlockKind::BubbleColumn => 0, - BlockKind::PolishedGraniteStairs => 15, - BlockKind::SmoothRedSandstoneStairs => 15, - BlockKind::MossyStoneBrickStairs => 15, - BlockKind::PolishedDioriteStairs => 15, - BlockKind::MossyCobblestoneStairs => 15, - BlockKind::EndStoneBrickStairs => 15, - BlockKind::StoneStairs => 15, - BlockKind::SmoothSandstoneStairs => 15, - BlockKind::SmoothQuartzStairs => 15, - BlockKind::GraniteStairs => 15, - BlockKind::AndesiteStairs => 15, - BlockKind::RedNetherBrickStairs => 15, - BlockKind::PolishedAndesiteStairs => 15, - BlockKind::DioriteStairs => 15, - BlockKind::PolishedGraniteSlab => 0, - BlockKind::SmoothRedSandstoneSlab => 0, - BlockKind::MossyStoneBrickSlab => 0, - BlockKind::PolishedDioriteSlab => 0, - BlockKind::MossyCobblestoneSlab => 0, - BlockKind::EndStoneBrickSlab => 0, - BlockKind::SmoothSandstoneSlab => 0, - BlockKind::SmoothQuartzSlab => 0, - BlockKind::GraniteSlab => 0, - BlockKind::AndesiteSlab => 0, - BlockKind::RedNetherBrickSlab => 0, - BlockKind::PolishedAndesiteSlab => 0, - BlockKind::DioriteSlab => 0, - BlockKind::BrickWall => 0, - BlockKind::PrismarineWall => 0, - BlockKind::RedSandstoneWall => 0, - BlockKind::MossyStoneBrickWall => 0, - BlockKind::GraniteWall => 0, - BlockKind::StoneBrickWall => 0, - BlockKind::NetherBrickWall => 0, - BlockKind::AndesiteWall => 0, - BlockKind::RedNetherBrickWall => 0, - BlockKind::SandstoneWall => 0, - BlockKind::EndStoneBrickWall => 0, - BlockKind::DioriteWall => 0, - BlockKind::Scaffolding => 15, - BlockKind::Loom => 15, - BlockKind::Barrel => 0, - BlockKind::Smoker => 15, - BlockKind::BlastFurnace => 15, - BlockKind::CartographyTable => 15, - BlockKind::FletchingTable => 15, - BlockKind::Grindstone => 0, - BlockKind::Lectern => 15, - BlockKind::SmithingTable => 15, - BlockKind::Stonecutter => 15, - BlockKind::Bell => 0, - BlockKind::Lantern => 0, - BlockKind::SoulLantern => 0, - BlockKind::Campfire => 15, - BlockKind::SoulCampfire => 15, - BlockKind::SweetBerryBush => 0, - BlockKind::WarpedStem => 15, - BlockKind::StrippedWarpedStem => 15, - BlockKind::WarpedHyphae => 15, - BlockKind::StrippedWarpedHyphae => 15, - BlockKind::WarpedNylium => 15, - BlockKind::WarpedFungus => 0, - BlockKind::WarpedWartBlock => 15, - BlockKind::WarpedRoots => 0, - BlockKind::NetherSprouts => 0, - BlockKind::CrimsonStem => 15, - BlockKind::StrippedCrimsonStem => 15, - BlockKind::CrimsonHyphae => 15, - BlockKind::StrippedCrimsonHyphae => 15, - BlockKind::CrimsonNylium => 15, - BlockKind::CrimsonFungus => 0, - BlockKind::Shroomlight => 15, - BlockKind::WeepingVines => 0, - BlockKind::WeepingVinesPlant => 0, - BlockKind::TwistingVines => 0, - BlockKind::TwistingVinesPlant => 0, - BlockKind::CrimsonRoots => 0, - BlockKind::CrimsonPlanks => 15, - BlockKind::WarpedPlanks => 15, - BlockKind::CrimsonSlab => 15, - BlockKind::WarpedSlab => 15, - BlockKind::CrimsonPressurePlate => 0, - BlockKind::WarpedPressurePlate => 0, - BlockKind::CrimsonFence => 0, - BlockKind::WarpedFence => 0, - BlockKind::CrimsonTrapdoor => 0, - BlockKind::WarpedTrapdoor => 0, - BlockKind::CrimsonFenceGate => 0, - BlockKind::WarpedFenceGate => 0, - BlockKind::CrimsonStairs => 15, - BlockKind::WarpedStairs => 15, - BlockKind::CrimsonButton => 0, - BlockKind::WarpedButton => 0, - BlockKind::CrimsonDoor => 0, - BlockKind::WarpedDoor => 0, - BlockKind::CrimsonSign => 0, - BlockKind::WarpedSign => 0, - BlockKind::CrimsonWallSign => 0, - BlockKind::WarpedWallSign => 0, - BlockKind::StructureBlock => 15, - BlockKind::Jigsaw => 15, - BlockKind::Composter => 0, - BlockKind::Target => 15, - BlockKind::BeeNest => 15, - BlockKind::Beehive => 15, - BlockKind::HoneyBlock => 15, - BlockKind::HoneycombBlock => 15, - BlockKind::NetheriteBlock => 15, - BlockKind::AncientDebris => 15, - BlockKind::CryingObsidian => 15, - BlockKind::RespawnAnchor => 15, - BlockKind::PottedCrimsonFungus => 0, - BlockKind::PottedWarpedFungus => 0, - BlockKind::PottedCrimsonRoots => 0, - BlockKind::PottedWarpedRoots => 0, - BlockKind::Lodestone => 15, - BlockKind::Blackstone => 15, - BlockKind::BlackstoneStairs => 15, - BlockKind::BlackstoneWall => 0, - BlockKind::BlackstoneSlab => 15, - BlockKind::PolishedBlackstone => 15, - BlockKind::PolishedBlackstoneBricks => 15, - BlockKind::CrackedPolishedBlackstoneBricks => 15, - BlockKind::ChiseledPolishedBlackstone => 15, - BlockKind::PolishedBlackstoneBrickSlab => 15, - BlockKind::PolishedBlackstoneBrickStairs => 15, - BlockKind::PolishedBlackstoneBrickWall => 0, - BlockKind::GildedBlackstone => 15, - BlockKind::PolishedBlackstoneStairs => 15, - BlockKind::PolishedBlackstoneSlab => 15, - BlockKind::PolishedBlackstonePressurePlate => 0, - BlockKind::PolishedBlackstoneButton => 0, - BlockKind::PolishedBlackstoneWall => 0, - BlockKind::ChiseledNetherBricks => 15, - BlockKind::CrackedNetherBricks => 15, - BlockKind::QuartzBricks => 15, + BlockKind::Air => 0u16, + BlockKind::Stone => 1u16, + BlockKind::Granite => 2u16, + BlockKind::PolishedGranite => 3u16, + BlockKind::Diorite => 4u16, + BlockKind::PolishedDiorite => 5u16, + BlockKind::Andesite => 6u16, + BlockKind::PolishedAndesite => 7u16, + BlockKind::GrassBlock => 8u16, + BlockKind::Dirt => 10u16, + BlockKind::CoarseDirt => 11u16, + BlockKind::Podzol => 12u16, + BlockKind::Cobblestone => 14u16, + BlockKind::OakPlanks => 15u16, + BlockKind::SprucePlanks => 16u16, + BlockKind::BirchPlanks => 17u16, + BlockKind::JunglePlanks => 18u16, + BlockKind::AcaciaPlanks => 19u16, + BlockKind::DarkOakPlanks => 20u16, + BlockKind::OakSapling => 21u16, + BlockKind::SpruceSapling => 23u16, + BlockKind::BirchSapling => 25u16, + BlockKind::JungleSapling => 27u16, + BlockKind::AcaciaSapling => 29u16, + BlockKind::DarkOakSapling => 31u16, + BlockKind::Bedrock => 33u16, + BlockKind::Water => 34u16, + BlockKind::Lava => 50u16, + BlockKind::Sand => 66u16, + BlockKind::RedSand => 67u16, + BlockKind::Gravel => 68u16, + BlockKind::GoldOre => 69u16, + BlockKind::DeepslateGoldOre => 70u16, + BlockKind::IronOre => 71u16, + BlockKind::DeepslateIronOre => 72u16, + BlockKind::CoalOre => 73u16, + BlockKind::DeepslateCoalOre => 74u16, + BlockKind::NetherGoldOre => 75u16, + BlockKind::OakLog => 76u16, + BlockKind::SpruceLog => 79u16, + BlockKind::BirchLog => 82u16, + BlockKind::JungleLog => 85u16, + BlockKind::AcaciaLog => 88u16, + BlockKind::DarkOakLog => 91u16, + BlockKind::StrippedSpruceLog => 94u16, + BlockKind::StrippedBirchLog => 97u16, + BlockKind::StrippedJungleLog => 100u16, + BlockKind::StrippedAcaciaLog => 103u16, + BlockKind::StrippedDarkOakLog => 106u16, + BlockKind::StrippedOakLog => 109u16, + BlockKind::OakWood => 112u16, + BlockKind::SpruceWood => 115u16, + BlockKind::BirchWood => 118u16, + BlockKind::JungleWood => 121u16, + BlockKind::AcaciaWood => 124u16, + BlockKind::DarkOakWood => 127u16, + BlockKind::StrippedOakWood => 130u16, + BlockKind::StrippedSpruceWood => 133u16, + BlockKind::StrippedBirchWood => 136u16, + BlockKind::StrippedJungleWood => 139u16, + BlockKind::StrippedAcaciaWood => 142u16, + BlockKind::StrippedDarkOakWood => 145u16, + BlockKind::OakLeaves => 148u16, + BlockKind::SpruceLeaves => 162u16, + BlockKind::BirchLeaves => 176u16, + BlockKind::JungleLeaves => 190u16, + BlockKind::AcaciaLeaves => 204u16, + BlockKind::DarkOakLeaves => 218u16, + BlockKind::AzaleaLeaves => 232u16, + BlockKind::FloweringAzaleaLeaves => 246u16, + BlockKind::Sponge => 260u16, + BlockKind::WetSponge => 261u16, + BlockKind::Glass => 262u16, + BlockKind::LapisOre => 263u16, + BlockKind::DeepslateLapisOre => 264u16, + BlockKind::LapisBlock => 265u16, + BlockKind::Dispenser => 266u16, + BlockKind::Sandstone => 278u16, + BlockKind::ChiseledSandstone => 279u16, + BlockKind::CutSandstone => 280u16, + BlockKind::NoteBlock => 281u16, + BlockKind::WhiteBed => 1081u16, + BlockKind::OrangeBed => 1097u16, + BlockKind::MagentaBed => 1113u16, + BlockKind::LightBlueBed => 1129u16, + BlockKind::YellowBed => 1145u16, + BlockKind::LimeBed => 1161u16, + BlockKind::PinkBed => 1177u16, + BlockKind::GrayBed => 1193u16, + BlockKind::LightGrayBed => 1209u16, + BlockKind::CyanBed => 1225u16, + BlockKind::PurpleBed => 1241u16, + BlockKind::BlueBed => 1257u16, + BlockKind::BrownBed => 1273u16, + BlockKind::GreenBed => 1289u16, + BlockKind::RedBed => 1305u16, + BlockKind::BlackBed => 1321u16, + BlockKind::PoweredRail => 1337u16, + BlockKind::DetectorRail => 1361u16, + BlockKind::StickyPiston => 1385u16, + BlockKind::Cobweb => 1397u16, + BlockKind::Grass => 1398u16, + BlockKind::Fern => 1399u16, + BlockKind::DeadBush => 1400u16, + BlockKind::Seagrass => 1401u16, + BlockKind::TallSeagrass => 1402u16, + BlockKind::Piston => 1404u16, + BlockKind::PistonHead => 1416u16, + BlockKind::WhiteWool => 1440u16, + BlockKind::OrangeWool => 1441u16, + BlockKind::MagentaWool => 1442u16, + BlockKind::LightBlueWool => 1443u16, + BlockKind::YellowWool => 1444u16, + BlockKind::LimeWool => 1445u16, + BlockKind::PinkWool => 1446u16, + BlockKind::GrayWool => 1447u16, + BlockKind::LightGrayWool => 1448u16, + BlockKind::CyanWool => 1449u16, + BlockKind::PurpleWool => 1450u16, + BlockKind::BlueWool => 1451u16, + BlockKind::BrownWool => 1452u16, + BlockKind::GreenWool => 1453u16, + BlockKind::RedWool => 1454u16, + BlockKind::BlackWool => 1455u16, + BlockKind::MovingPiston => 1456u16, + BlockKind::Dandelion => 1468u16, + BlockKind::Poppy => 1469u16, + BlockKind::BlueOrchid => 1470u16, + BlockKind::Allium => 1471u16, + BlockKind::AzureBluet => 1472u16, + BlockKind::RedTulip => 1473u16, + BlockKind::OrangeTulip => 1474u16, + BlockKind::WhiteTulip => 1475u16, + BlockKind::PinkTulip => 1476u16, + BlockKind::OxeyeDaisy => 1477u16, + BlockKind::Cornflower => 1478u16, + BlockKind::WitherRose => 1479u16, + BlockKind::LilyOfTheValley => 1480u16, + BlockKind::BrownMushroom => 1481u16, + BlockKind::RedMushroom => 1482u16, + BlockKind::GoldBlock => 1483u16, + BlockKind::IronBlock => 1484u16, + BlockKind::Bricks => 1485u16, + BlockKind::Tnt => 1486u16, + BlockKind::Bookshelf => 1488u16, + BlockKind::MossyCobblestone => 1489u16, + BlockKind::Obsidian => 1490u16, + BlockKind::Torch => 1491u16, + BlockKind::WallTorch => 1492u16, + BlockKind::Fire => 1496u16, + BlockKind::SoulFire => 2008u16, + BlockKind::Spawner => 2009u16, + BlockKind::OakStairs => 2010u16, + BlockKind::Chest => 2090u16, + BlockKind::RedstoneWire => 2114u16, + BlockKind::DiamondOre => 3410u16, + BlockKind::DeepslateDiamondOre => 3411u16, + BlockKind::DiamondBlock => 3412u16, + BlockKind::CraftingTable => 3413u16, + BlockKind::Wheat => 3414u16, + BlockKind::Farmland => 3422u16, + BlockKind::Furnace => 3430u16, + BlockKind::OakSign => 3438u16, + BlockKind::SpruceSign => 3470u16, + BlockKind::BirchSign => 3502u16, + BlockKind::AcaciaSign => 3534u16, + BlockKind::JungleSign => 3566u16, + BlockKind::DarkOakSign => 3598u16, + BlockKind::OakDoor => 3630u16, + BlockKind::Ladder => 3694u16, + BlockKind::Rail => 3702u16, + BlockKind::CobblestoneStairs => 3722u16, + BlockKind::OakWallSign => 3802u16, + BlockKind::SpruceWallSign => 3810u16, + BlockKind::BirchWallSign => 3818u16, + BlockKind::AcaciaWallSign => 3826u16, + BlockKind::JungleWallSign => 3834u16, + BlockKind::DarkOakWallSign => 3842u16, + BlockKind::Lever => 3850u16, + BlockKind::StonePressurePlate => 3874u16, + BlockKind::IronDoor => 3876u16, + BlockKind::OakPressurePlate => 3940u16, + BlockKind::SprucePressurePlate => 3942u16, + BlockKind::BirchPressurePlate => 3944u16, + BlockKind::JunglePressurePlate => 3946u16, + BlockKind::AcaciaPressurePlate => 3948u16, + BlockKind::DarkOakPressurePlate => 3950u16, + BlockKind::RedstoneOre => 3952u16, + BlockKind::DeepslateRedstoneOre => 3954u16, + BlockKind::RedstoneTorch => 3956u16, + BlockKind::RedstoneWallTorch => 3958u16, + BlockKind::StoneButton => 3966u16, + BlockKind::Snow => 3990u16, + BlockKind::Ice => 3998u16, + BlockKind::SnowBlock => 3999u16, + BlockKind::Cactus => 4000u16, + BlockKind::Clay => 4016u16, + BlockKind::SugarCane => 4017u16, + BlockKind::Jukebox => 4033u16, + BlockKind::OakFence => 4035u16, + BlockKind::Pumpkin => 4067u16, + BlockKind::Netherrack => 4068u16, + BlockKind::SoulSand => 4069u16, + BlockKind::SoulSoil => 4070u16, + BlockKind::Basalt => 4071u16, + BlockKind::PolishedBasalt => 4074u16, + BlockKind::SoulTorch => 4077u16, + BlockKind::SoulWallTorch => 4078u16, + BlockKind::Glowstone => 4082u16, + BlockKind::NetherPortal => 4083u16, + BlockKind::CarvedPumpkin => 4085u16, + BlockKind::JackOLantern => 4089u16, + BlockKind::Cake => 4093u16, + BlockKind::Repeater => 4100u16, + BlockKind::WhiteStainedGlass => 4164u16, + BlockKind::OrangeStainedGlass => 4165u16, + BlockKind::MagentaStainedGlass => 4166u16, + BlockKind::LightBlueStainedGlass => 4167u16, + BlockKind::YellowStainedGlass => 4168u16, + BlockKind::LimeStainedGlass => 4169u16, + BlockKind::PinkStainedGlass => 4170u16, + BlockKind::GrayStainedGlass => 4171u16, + BlockKind::LightGrayStainedGlass => 4172u16, + BlockKind::CyanStainedGlass => 4173u16, + BlockKind::PurpleStainedGlass => 4174u16, + BlockKind::BlueStainedGlass => 4175u16, + BlockKind::BrownStainedGlass => 4176u16, + BlockKind::GreenStainedGlass => 4177u16, + BlockKind::RedStainedGlass => 4178u16, + BlockKind::BlackStainedGlass => 4179u16, + BlockKind::OakTrapdoor => 4180u16, + BlockKind::SpruceTrapdoor => 4244u16, + BlockKind::BirchTrapdoor => 4308u16, + BlockKind::JungleTrapdoor => 4372u16, + BlockKind::AcaciaTrapdoor => 4436u16, + BlockKind::DarkOakTrapdoor => 4500u16, + BlockKind::StoneBricks => 4564u16, + BlockKind::MossyStoneBricks => 4565u16, + BlockKind::CrackedStoneBricks => 4566u16, + BlockKind::ChiseledStoneBricks => 4567u16, + BlockKind::InfestedStone => 4568u16, + BlockKind::InfestedCobblestone => 4569u16, + BlockKind::InfestedStoneBricks => 4570u16, + BlockKind::InfestedMossyStoneBricks => 4571u16, + BlockKind::InfestedCrackedStoneBricks => 4572u16, + BlockKind::InfestedChiseledStoneBricks => 4573u16, + BlockKind::BrownMushroomBlock => 4574u16, + BlockKind::RedMushroomBlock => 4638u16, + BlockKind::MushroomStem => 4702u16, + BlockKind::IronBars => 4766u16, + BlockKind::Chain => 4798u16, + BlockKind::GlassPane => 4804u16, + BlockKind::Melon => 4836u16, + BlockKind::AttachedPumpkinStem => 4837u16, + BlockKind::AttachedMelonStem => 4841u16, + BlockKind::PumpkinStem => 4845u16, + BlockKind::MelonStem => 4853u16, + BlockKind::Vine => 4861u16, + BlockKind::GlowLichen => 4893u16, + BlockKind::OakFenceGate => 5021u16, + BlockKind::BrickStairs => 5053u16, + BlockKind::StoneBrickStairs => 5133u16, + BlockKind::Mycelium => 5213u16, + BlockKind::LilyPad => 5215u16, + BlockKind::NetherBricks => 5216u16, + BlockKind::NetherBrickFence => 5217u16, + BlockKind::NetherBrickStairs => 5249u16, + BlockKind::NetherWart => 5329u16, + BlockKind::EnchantingTable => 5333u16, + BlockKind::BrewingStand => 5334u16, + BlockKind::Cauldron => 5342u16, + BlockKind::WaterCauldron => 5343u16, + BlockKind::LavaCauldron => 5346u16, + BlockKind::PowderSnowCauldron => 5347u16, + BlockKind::EndPortal => 5350u16, + BlockKind::EndPortalFrame => 5351u16, + BlockKind::EndStone => 5359u16, + BlockKind::DragonEgg => 5360u16, + BlockKind::RedstoneLamp => 5361u16, + BlockKind::Cocoa => 5363u16, + BlockKind::SandstoneStairs => 5375u16, + BlockKind::EmeraldOre => 5455u16, + BlockKind::DeepslateEmeraldOre => 5456u16, + BlockKind::EnderChest => 5457u16, + BlockKind::TripwireHook => 5465u16, + BlockKind::Tripwire => 5481u16, + BlockKind::EmeraldBlock => 5609u16, + BlockKind::SpruceStairs => 5610u16, + BlockKind::BirchStairs => 5690u16, + BlockKind::JungleStairs => 5770u16, + BlockKind::CommandBlock => 5850u16, + BlockKind::Beacon => 5862u16, + BlockKind::CobblestoneWall => 5863u16, + BlockKind::MossyCobblestoneWall => 6187u16, + BlockKind::FlowerPot => 6511u16, + BlockKind::PottedOakSapling => 6512u16, + BlockKind::PottedSpruceSapling => 6513u16, + BlockKind::PottedBirchSapling => 6514u16, + BlockKind::PottedJungleSapling => 6515u16, + BlockKind::PottedAcaciaSapling => 6516u16, + BlockKind::PottedDarkOakSapling => 6517u16, + BlockKind::PottedFern => 6518u16, + BlockKind::PottedDandelion => 6519u16, + BlockKind::PottedPoppy => 6520u16, + BlockKind::PottedBlueOrchid => 6521u16, + BlockKind::PottedAllium => 6522u16, + BlockKind::PottedAzureBluet => 6523u16, + BlockKind::PottedRedTulip => 6524u16, + BlockKind::PottedOrangeTulip => 6525u16, + BlockKind::PottedWhiteTulip => 6526u16, + BlockKind::PottedPinkTulip => 6527u16, + BlockKind::PottedOxeyeDaisy => 6528u16, + BlockKind::PottedCornflower => 6529u16, + BlockKind::PottedLilyOfTheValley => 6530u16, + BlockKind::PottedWitherRose => 6531u16, + BlockKind::PottedRedMushroom => 6532u16, + BlockKind::PottedBrownMushroom => 6533u16, + BlockKind::PottedDeadBush => 6534u16, + BlockKind::PottedCactus => 6535u16, + BlockKind::Carrots => 6536u16, + BlockKind::Potatoes => 6544u16, + BlockKind::OakButton => 6552u16, + BlockKind::SpruceButton => 6576u16, + BlockKind::BirchButton => 6600u16, + BlockKind::JungleButton => 6624u16, + BlockKind::AcaciaButton => 6648u16, + BlockKind::DarkOakButton => 6672u16, + BlockKind::SkeletonSkull => 6696u16, + BlockKind::SkeletonWallSkull => 6712u16, + BlockKind::WitherSkeletonSkull => 6716u16, + BlockKind::WitherSkeletonWallSkull => 6732u16, + BlockKind::ZombieHead => 6736u16, + BlockKind::ZombieWallHead => 6752u16, + BlockKind::PlayerHead => 6756u16, + BlockKind::PlayerWallHead => 6772u16, + BlockKind::CreeperHead => 6776u16, + BlockKind::CreeperWallHead => 6792u16, + BlockKind::DragonHead => 6796u16, + BlockKind::DragonWallHead => 6812u16, + BlockKind::Anvil => 6816u16, + BlockKind::ChippedAnvil => 6820u16, + BlockKind::DamagedAnvil => 6824u16, + BlockKind::TrappedChest => 6828u16, + BlockKind::LightWeightedPressurePlate => 6852u16, + BlockKind::HeavyWeightedPressurePlate => 6868u16, + BlockKind::Comparator => 6884u16, + BlockKind::DaylightDetector => 6900u16, + BlockKind::RedstoneBlock => 6932u16, + BlockKind::NetherQuartzOre => 6933u16, + BlockKind::Hopper => 6934u16, + BlockKind::QuartzBlock => 6944u16, + BlockKind::ChiseledQuartzBlock => 6945u16, + BlockKind::QuartzPillar => 6946u16, + BlockKind::QuartzStairs => 6949u16, + BlockKind::ActivatorRail => 7029u16, + BlockKind::Dropper => 7053u16, + BlockKind::WhiteTerracotta => 7065u16, + BlockKind::OrangeTerracotta => 7066u16, + BlockKind::MagentaTerracotta => 7067u16, + BlockKind::LightBlueTerracotta => 7068u16, + BlockKind::YellowTerracotta => 7069u16, + BlockKind::LimeTerracotta => 7070u16, + BlockKind::PinkTerracotta => 7071u16, + BlockKind::GrayTerracotta => 7072u16, + BlockKind::LightGrayTerracotta => 7073u16, + BlockKind::CyanTerracotta => 7074u16, + BlockKind::PurpleTerracotta => 7075u16, + BlockKind::BlueTerracotta => 7076u16, + BlockKind::BrownTerracotta => 7077u16, + BlockKind::GreenTerracotta => 7078u16, + BlockKind::RedTerracotta => 7079u16, + BlockKind::BlackTerracotta => 7080u16, + BlockKind::WhiteStainedGlassPane => 7081u16, + BlockKind::OrangeStainedGlassPane => 7113u16, + BlockKind::MagentaStainedGlassPane => 7145u16, + BlockKind::LightBlueStainedGlassPane => 7177u16, + BlockKind::YellowStainedGlassPane => 7209u16, + BlockKind::LimeStainedGlassPane => 7241u16, + BlockKind::PinkStainedGlassPane => 7273u16, + BlockKind::GrayStainedGlassPane => 7305u16, + BlockKind::LightGrayStainedGlassPane => 7337u16, + BlockKind::CyanStainedGlassPane => 7369u16, + BlockKind::PurpleStainedGlassPane => 7401u16, + BlockKind::BlueStainedGlassPane => 7433u16, + BlockKind::BrownStainedGlassPane => 7465u16, + BlockKind::GreenStainedGlassPane => 7497u16, + BlockKind::RedStainedGlassPane => 7529u16, + BlockKind::BlackStainedGlassPane => 7561u16, + BlockKind::AcaciaStairs => 7593u16, + BlockKind::DarkOakStairs => 7673u16, + BlockKind::SlimeBlock => 7753u16, + BlockKind::Barrier => 7754u16, + BlockKind::Light => 7755u16, + BlockKind::IronTrapdoor => 7787u16, + BlockKind::Prismarine => 7851u16, + BlockKind::PrismarineBricks => 7852u16, + BlockKind::DarkPrismarine => 7853u16, + BlockKind::PrismarineStairs => 7854u16, + BlockKind::PrismarineBrickStairs => 7934u16, + BlockKind::DarkPrismarineStairs => 8014u16, + BlockKind::PrismarineSlab => 8094u16, + BlockKind::PrismarineBrickSlab => 8100u16, + BlockKind::DarkPrismarineSlab => 8106u16, + BlockKind::SeaLantern => 8112u16, + BlockKind::HayBlock => 8113u16, + BlockKind::WhiteCarpet => 8116u16, + BlockKind::OrangeCarpet => 8117u16, + BlockKind::MagentaCarpet => 8118u16, + BlockKind::LightBlueCarpet => 8119u16, + BlockKind::YellowCarpet => 8120u16, + BlockKind::LimeCarpet => 8121u16, + BlockKind::PinkCarpet => 8122u16, + BlockKind::GrayCarpet => 8123u16, + BlockKind::LightGrayCarpet => 8124u16, + BlockKind::CyanCarpet => 8125u16, + BlockKind::PurpleCarpet => 8126u16, + BlockKind::BlueCarpet => 8127u16, + BlockKind::BrownCarpet => 8128u16, + BlockKind::GreenCarpet => 8129u16, + BlockKind::RedCarpet => 8130u16, + BlockKind::BlackCarpet => 8131u16, + BlockKind::Terracotta => 8132u16, + BlockKind::CoalBlock => 8133u16, + BlockKind::PackedIce => 8134u16, + BlockKind::Sunflower => 8135u16, + BlockKind::Lilac => 8137u16, + BlockKind::RoseBush => 8139u16, + BlockKind::Peony => 8141u16, + BlockKind::TallGrass => 8143u16, + BlockKind::LargeFern => 8145u16, + BlockKind::WhiteBanner => 8147u16, + BlockKind::OrangeBanner => 8163u16, + BlockKind::MagentaBanner => 8179u16, + BlockKind::LightBlueBanner => 8195u16, + BlockKind::YellowBanner => 8211u16, + BlockKind::LimeBanner => 8227u16, + BlockKind::PinkBanner => 8243u16, + BlockKind::GrayBanner => 8259u16, + BlockKind::LightGrayBanner => 8275u16, + BlockKind::CyanBanner => 8291u16, + BlockKind::PurpleBanner => 8307u16, + BlockKind::BlueBanner => 8323u16, + BlockKind::BrownBanner => 8339u16, + BlockKind::GreenBanner => 8355u16, + BlockKind::RedBanner => 8371u16, + BlockKind::BlackBanner => 8387u16, + BlockKind::WhiteWallBanner => 8403u16, + BlockKind::OrangeWallBanner => 8407u16, + BlockKind::MagentaWallBanner => 8411u16, + BlockKind::LightBlueWallBanner => 8415u16, + BlockKind::YellowWallBanner => 8419u16, + BlockKind::LimeWallBanner => 8423u16, + BlockKind::PinkWallBanner => 8427u16, + BlockKind::GrayWallBanner => 8431u16, + BlockKind::LightGrayWallBanner => 8435u16, + BlockKind::CyanWallBanner => 8439u16, + BlockKind::PurpleWallBanner => 8443u16, + BlockKind::BlueWallBanner => 8447u16, + BlockKind::BrownWallBanner => 8451u16, + BlockKind::GreenWallBanner => 8455u16, + BlockKind::RedWallBanner => 8459u16, + BlockKind::BlackWallBanner => 8463u16, + BlockKind::RedSandstone => 8467u16, + BlockKind::ChiseledRedSandstone => 8468u16, + BlockKind::CutRedSandstone => 8469u16, + BlockKind::RedSandstoneStairs => 8470u16, + BlockKind::OakSlab => 8550u16, + BlockKind::SpruceSlab => 8556u16, + BlockKind::BirchSlab => 8562u16, + BlockKind::JungleSlab => 8568u16, + BlockKind::AcaciaSlab => 8574u16, + BlockKind::DarkOakSlab => 8580u16, + BlockKind::StoneSlab => 8586u16, + BlockKind::SmoothStoneSlab => 8592u16, + BlockKind::SandstoneSlab => 8598u16, + BlockKind::CutSandstoneSlab => 8604u16, + BlockKind::PetrifiedOakSlab => 8610u16, + BlockKind::CobblestoneSlab => 8616u16, + BlockKind::BrickSlab => 8622u16, + BlockKind::StoneBrickSlab => 8628u16, + BlockKind::NetherBrickSlab => 8634u16, + BlockKind::QuartzSlab => 8640u16, + BlockKind::RedSandstoneSlab => 8646u16, + BlockKind::CutRedSandstoneSlab => 8652u16, + BlockKind::PurpurSlab => 8658u16, + BlockKind::SmoothStone => 8664u16, + BlockKind::SmoothSandstone => 8665u16, + BlockKind::SmoothQuartz => 8666u16, + BlockKind::SmoothRedSandstone => 8667u16, + BlockKind::SpruceFenceGate => 8668u16, + BlockKind::BirchFenceGate => 8700u16, + BlockKind::JungleFenceGate => 8732u16, + BlockKind::AcaciaFenceGate => 8764u16, + BlockKind::DarkOakFenceGate => 8796u16, + BlockKind::SpruceFence => 8828u16, + BlockKind::BirchFence => 8860u16, + BlockKind::JungleFence => 8892u16, + BlockKind::AcaciaFence => 8924u16, + BlockKind::DarkOakFence => 8956u16, + BlockKind::SpruceDoor => 8988u16, + BlockKind::BirchDoor => 9052u16, + BlockKind::JungleDoor => 9116u16, + BlockKind::AcaciaDoor => 9180u16, + BlockKind::DarkOakDoor => 9244u16, + BlockKind::EndRod => 9308u16, + BlockKind::ChorusPlant => 9314u16, + BlockKind::ChorusFlower => 9378u16, + BlockKind::PurpurBlock => 9384u16, + BlockKind::PurpurPillar => 9385u16, + BlockKind::PurpurStairs => 9388u16, + BlockKind::EndStoneBricks => 9468u16, + BlockKind::Beetroots => 9469u16, + BlockKind::DirtPath => 9473u16, + BlockKind::EndGateway => 9474u16, + BlockKind::RepeatingCommandBlock => 9475u16, + BlockKind::ChainCommandBlock => 9487u16, + BlockKind::FrostedIce => 9499u16, + BlockKind::MagmaBlock => 9503u16, + BlockKind::NetherWartBlock => 9504u16, + BlockKind::RedNetherBricks => 9505u16, + BlockKind::BoneBlock => 9506u16, + BlockKind::StructureVoid => 9509u16, + BlockKind::Observer => 9510u16, + BlockKind::ShulkerBox => 9522u16, + BlockKind::WhiteShulkerBox => 9528u16, + BlockKind::OrangeShulkerBox => 9534u16, + BlockKind::MagentaShulkerBox => 9540u16, + BlockKind::LightBlueShulkerBox => 9546u16, + BlockKind::YellowShulkerBox => 9552u16, + BlockKind::LimeShulkerBox => 9558u16, + BlockKind::PinkShulkerBox => 9564u16, + BlockKind::GrayShulkerBox => 9570u16, + BlockKind::LightGrayShulkerBox => 9576u16, + BlockKind::CyanShulkerBox => 9582u16, + BlockKind::PurpleShulkerBox => 9588u16, + BlockKind::BlueShulkerBox => 9594u16, + BlockKind::BrownShulkerBox => 9600u16, + BlockKind::GreenShulkerBox => 9606u16, + BlockKind::RedShulkerBox => 9612u16, + BlockKind::BlackShulkerBox => 9618u16, + BlockKind::WhiteGlazedTerracotta => 9624u16, + BlockKind::OrangeGlazedTerracotta => 9628u16, + BlockKind::MagentaGlazedTerracotta => 9632u16, + BlockKind::LightBlueGlazedTerracotta => 9636u16, + BlockKind::YellowGlazedTerracotta => 9640u16, + BlockKind::LimeGlazedTerracotta => 9644u16, + BlockKind::PinkGlazedTerracotta => 9648u16, + BlockKind::GrayGlazedTerracotta => 9652u16, + BlockKind::LightGrayGlazedTerracotta => 9656u16, + BlockKind::CyanGlazedTerracotta => 9660u16, + BlockKind::PurpleGlazedTerracotta => 9664u16, + BlockKind::BlueGlazedTerracotta => 9668u16, + BlockKind::BrownGlazedTerracotta => 9672u16, + BlockKind::GreenGlazedTerracotta => 9676u16, + BlockKind::RedGlazedTerracotta => 9680u16, + BlockKind::BlackGlazedTerracotta => 9684u16, + BlockKind::WhiteConcrete => 9688u16, + BlockKind::OrangeConcrete => 9689u16, + BlockKind::MagentaConcrete => 9690u16, + BlockKind::LightBlueConcrete => 9691u16, + BlockKind::YellowConcrete => 9692u16, + BlockKind::LimeConcrete => 9693u16, + BlockKind::PinkConcrete => 9694u16, + BlockKind::GrayConcrete => 9695u16, + BlockKind::LightGrayConcrete => 9696u16, + BlockKind::CyanConcrete => 9697u16, + BlockKind::PurpleConcrete => 9698u16, + BlockKind::BlueConcrete => 9699u16, + BlockKind::BrownConcrete => 9700u16, + BlockKind::GreenConcrete => 9701u16, + BlockKind::RedConcrete => 9702u16, + BlockKind::BlackConcrete => 9703u16, + BlockKind::WhiteConcretePowder => 9704u16, + BlockKind::OrangeConcretePowder => 9705u16, + BlockKind::MagentaConcretePowder => 9706u16, + BlockKind::LightBlueConcretePowder => 9707u16, + BlockKind::YellowConcretePowder => 9708u16, + BlockKind::LimeConcretePowder => 9709u16, + BlockKind::PinkConcretePowder => 9710u16, + BlockKind::GrayConcretePowder => 9711u16, + BlockKind::LightGrayConcretePowder => 9712u16, + BlockKind::CyanConcretePowder => 9713u16, + BlockKind::PurpleConcretePowder => 9714u16, + BlockKind::BlueConcretePowder => 9715u16, + BlockKind::BrownConcretePowder => 9716u16, + BlockKind::GreenConcretePowder => 9717u16, + BlockKind::RedConcretePowder => 9718u16, + BlockKind::BlackConcretePowder => 9719u16, + BlockKind::Kelp => 9720u16, + BlockKind::KelpPlant => 9746u16, + BlockKind::DriedKelpBlock => 9747u16, + BlockKind::TurtleEgg => 9748u16, + BlockKind::DeadTubeCoralBlock => 9760u16, + BlockKind::DeadBrainCoralBlock => 9761u16, + BlockKind::DeadBubbleCoralBlock => 9762u16, + BlockKind::DeadFireCoralBlock => 9763u16, + BlockKind::DeadHornCoralBlock => 9764u16, + BlockKind::TubeCoralBlock => 9765u16, + BlockKind::BrainCoralBlock => 9766u16, + BlockKind::BubbleCoralBlock => 9767u16, + BlockKind::FireCoralBlock => 9768u16, + BlockKind::HornCoralBlock => 9769u16, + BlockKind::DeadTubeCoral => 9770u16, + BlockKind::DeadBrainCoral => 9772u16, + BlockKind::DeadBubbleCoral => 9774u16, + BlockKind::DeadFireCoral => 9776u16, + BlockKind::DeadHornCoral => 9778u16, + BlockKind::TubeCoral => 9780u16, + BlockKind::BrainCoral => 9782u16, + BlockKind::BubbleCoral => 9784u16, + BlockKind::FireCoral => 9786u16, + BlockKind::HornCoral => 9788u16, + BlockKind::DeadTubeCoralFan => 9790u16, + BlockKind::DeadBrainCoralFan => 9792u16, + BlockKind::DeadBubbleCoralFan => 9794u16, + BlockKind::DeadFireCoralFan => 9796u16, + BlockKind::DeadHornCoralFan => 9798u16, + BlockKind::TubeCoralFan => 9800u16, + BlockKind::BrainCoralFan => 9802u16, + BlockKind::BubbleCoralFan => 9804u16, + BlockKind::FireCoralFan => 9806u16, + BlockKind::HornCoralFan => 9808u16, + BlockKind::DeadTubeCoralWallFan => 9810u16, + BlockKind::DeadBrainCoralWallFan => 9818u16, + BlockKind::DeadBubbleCoralWallFan => 9826u16, + BlockKind::DeadFireCoralWallFan => 9834u16, + BlockKind::DeadHornCoralWallFan => 9842u16, + BlockKind::TubeCoralWallFan => 9850u16, + BlockKind::BrainCoralWallFan => 9858u16, + BlockKind::BubbleCoralWallFan => 9866u16, + BlockKind::FireCoralWallFan => 9874u16, + BlockKind::HornCoralWallFan => 9882u16, + BlockKind::SeaPickle => 9890u16, + BlockKind::BlueIce => 9898u16, + BlockKind::Conduit => 9899u16, + BlockKind::BambooSapling => 9901u16, + BlockKind::Bamboo => 9902u16, + BlockKind::PottedBamboo => 9914u16, + BlockKind::VoidAir => 9915u16, + BlockKind::CaveAir => 9916u16, + BlockKind::BubbleColumn => 9917u16, + BlockKind::PolishedGraniteStairs => 9919u16, + BlockKind::SmoothRedSandstoneStairs => 9999u16, + BlockKind::MossyStoneBrickStairs => 10079u16, + BlockKind::PolishedDioriteStairs => 10159u16, + BlockKind::MossyCobblestoneStairs => 10239u16, + BlockKind::EndStoneBrickStairs => 10319u16, + BlockKind::StoneStairs => 10399u16, + BlockKind::SmoothSandstoneStairs => 10479u16, + BlockKind::SmoothQuartzStairs => 10559u16, + BlockKind::GraniteStairs => 10639u16, + BlockKind::AndesiteStairs => 10719u16, + BlockKind::RedNetherBrickStairs => 10799u16, + BlockKind::PolishedAndesiteStairs => 10879u16, + BlockKind::DioriteStairs => 10959u16, + BlockKind::PolishedGraniteSlab => 11039u16, + BlockKind::SmoothRedSandstoneSlab => 11045u16, + BlockKind::MossyStoneBrickSlab => 11051u16, + BlockKind::PolishedDioriteSlab => 11057u16, + BlockKind::MossyCobblestoneSlab => 11063u16, + BlockKind::EndStoneBrickSlab => 11069u16, + BlockKind::SmoothSandstoneSlab => 11075u16, + BlockKind::SmoothQuartzSlab => 11081u16, + BlockKind::GraniteSlab => 11087u16, + BlockKind::AndesiteSlab => 11093u16, + BlockKind::RedNetherBrickSlab => 11099u16, + BlockKind::PolishedAndesiteSlab => 11105u16, + BlockKind::DioriteSlab => 11111u16, + BlockKind::BrickWall => 11117u16, + BlockKind::PrismarineWall => 11441u16, + BlockKind::RedSandstoneWall => 11765u16, + BlockKind::MossyStoneBrickWall => 12089u16, + BlockKind::GraniteWall => 12413u16, + BlockKind::StoneBrickWall => 12737u16, + BlockKind::NetherBrickWall => 13061u16, + BlockKind::AndesiteWall => 13385u16, + BlockKind::RedNetherBrickWall => 13709u16, + BlockKind::SandstoneWall => 14033u16, + BlockKind::EndStoneBrickWall => 14357u16, + BlockKind::DioriteWall => 14681u16, + BlockKind::Scaffolding => 15005u16, + BlockKind::Loom => 15037u16, + BlockKind::Barrel => 15041u16, + BlockKind::Smoker => 15053u16, + BlockKind::BlastFurnace => 15061u16, + BlockKind::CartographyTable => 15069u16, + BlockKind::FletchingTable => 15070u16, + BlockKind::Grindstone => 15071u16, + BlockKind::Lectern => 15083u16, + BlockKind::SmithingTable => 15099u16, + BlockKind::Stonecutter => 15100u16, + BlockKind::Bell => 15104u16, + BlockKind::Lantern => 15136u16, + BlockKind::SoulLantern => 15140u16, + BlockKind::Campfire => 15144u16, + BlockKind::SoulCampfire => 15176u16, + BlockKind::SweetBerryBush => 15208u16, + BlockKind::WarpedStem => 15212u16, + BlockKind::StrippedWarpedStem => 15215u16, + BlockKind::WarpedHyphae => 15218u16, + BlockKind::StrippedWarpedHyphae => 15221u16, + BlockKind::WarpedNylium => 15224u16, + BlockKind::WarpedFungus => 15225u16, + BlockKind::WarpedWartBlock => 15226u16, + BlockKind::WarpedRoots => 15227u16, + BlockKind::NetherSprouts => 15228u16, + BlockKind::CrimsonStem => 15229u16, + BlockKind::StrippedCrimsonStem => 15232u16, + BlockKind::CrimsonHyphae => 15235u16, + BlockKind::StrippedCrimsonHyphae => 15238u16, + BlockKind::CrimsonNylium => 15241u16, + BlockKind::CrimsonFungus => 15242u16, + BlockKind::Shroomlight => 15243u16, + BlockKind::WeepingVines => 15244u16, + BlockKind::WeepingVinesPlant => 15270u16, + BlockKind::TwistingVines => 15271u16, + BlockKind::TwistingVinesPlant => 15297u16, + BlockKind::CrimsonRoots => 15298u16, + BlockKind::CrimsonPlanks => 15299u16, + BlockKind::WarpedPlanks => 15300u16, + BlockKind::CrimsonSlab => 15301u16, + BlockKind::WarpedSlab => 15307u16, + BlockKind::CrimsonPressurePlate => 15313u16, + BlockKind::WarpedPressurePlate => 15315u16, + BlockKind::CrimsonFence => 15317u16, + BlockKind::WarpedFence => 15349u16, + BlockKind::CrimsonTrapdoor => 15381u16, + BlockKind::WarpedTrapdoor => 15445u16, + BlockKind::CrimsonFenceGate => 15509u16, + BlockKind::WarpedFenceGate => 15541u16, + BlockKind::CrimsonStairs => 15573u16, + BlockKind::WarpedStairs => 15653u16, + BlockKind::CrimsonButton => 15733u16, + BlockKind::WarpedButton => 15757u16, + BlockKind::CrimsonDoor => 15781u16, + BlockKind::WarpedDoor => 15845u16, + BlockKind::CrimsonSign => 15909u16, + BlockKind::WarpedSign => 15941u16, + BlockKind::CrimsonWallSign => 15973u16, + BlockKind::WarpedWallSign => 15981u16, + BlockKind::StructureBlock => 15989u16, + BlockKind::Jigsaw => 15993u16, + BlockKind::Composter => 16005u16, + BlockKind::Target => 16014u16, + BlockKind::BeeNest => 16030u16, + BlockKind::Beehive => 16054u16, + BlockKind::HoneyBlock => 16078u16, + BlockKind::HoneycombBlock => 16079u16, + BlockKind::NetheriteBlock => 16080u16, + BlockKind::AncientDebris => 16081u16, + BlockKind::CryingObsidian => 16082u16, + BlockKind::RespawnAnchor => 16083u16, + BlockKind::PottedCrimsonFungus => 16088u16, + BlockKind::PottedWarpedFungus => 16089u16, + BlockKind::PottedCrimsonRoots => 16090u16, + BlockKind::PottedWarpedRoots => 16091u16, + BlockKind::Lodestone => 16092u16, + BlockKind::Blackstone => 16093u16, + BlockKind::BlackstoneStairs => 16094u16, + BlockKind::BlackstoneWall => 16174u16, + BlockKind::BlackstoneSlab => 16498u16, + BlockKind::PolishedBlackstone => 16504u16, + BlockKind::PolishedBlackstoneBricks => 16505u16, + BlockKind::CrackedPolishedBlackstoneBricks => 16506u16, + BlockKind::ChiseledPolishedBlackstone => 16507u16, + BlockKind::PolishedBlackstoneBrickSlab => 16508u16, + BlockKind::PolishedBlackstoneBrickStairs => 16514u16, + BlockKind::PolishedBlackstoneBrickWall => 16594u16, + BlockKind::GildedBlackstone => 16918u16, + BlockKind::PolishedBlackstoneStairs => 16919u16, + BlockKind::PolishedBlackstoneSlab => 16999u16, + BlockKind::PolishedBlackstonePressurePlate => 17005u16, + BlockKind::PolishedBlackstoneButton => 17007u16, + BlockKind::PolishedBlackstoneWall => 17031u16, + BlockKind::ChiseledNetherBricks => 17355u16, + BlockKind::CrackedNetherBricks => 17356u16, + BlockKind::QuartzBricks => 17357u16, + BlockKind::Candle => 17358u16, + BlockKind::WhiteCandle => 17374u16, + BlockKind::OrangeCandle => 17390u16, + BlockKind::MagentaCandle => 17406u16, + BlockKind::LightBlueCandle => 17422u16, + BlockKind::YellowCandle => 17438u16, + BlockKind::LimeCandle => 17454u16, + BlockKind::PinkCandle => 17470u16, + BlockKind::GrayCandle => 17486u16, + BlockKind::LightGrayCandle => 17502u16, + BlockKind::CyanCandle => 17518u16, + BlockKind::PurpleCandle => 17534u16, + BlockKind::BlueCandle => 17550u16, + BlockKind::BrownCandle => 17566u16, + BlockKind::GreenCandle => 17582u16, + BlockKind::RedCandle => 17598u16, + BlockKind::BlackCandle => 17614u16, + BlockKind::CandleCake => 17630u16, + BlockKind::WhiteCandleCake => 17632u16, + BlockKind::OrangeCandleCake => 17634u16, + BlockKind::MagentaCandleCake => 17636u16, + BlockKind::LightBlueCandleCake => 17638u16, + BlockKind::YellowCandleCake => 17640u16, + BlockKind::LimeCandleCake => 17642u16, + BlockKind::PinkCandleCake => 17644u16, + BlockKind::GrayCandleCake => 17646u16, + BlockKind::LightGrayCandleCake => 17648u16, + BlockKind::CyanCandleCake => 17650u16, + BlockKind::PurpleCandleCake => 17652u16, + BlockKind::BlueCandleCake => 17654u16, + BlockKind::BrownCandleCake => 17656u16, + BlockKind::GreenCandleCake => 17658u16, + BlockKind::RedCandleCake => 17660u16, + BlockKind::BlackCandleCake => 17662u16, + BlockKind::AmethystBlock => 17664u16, + BlockKind::BuddingAmethyst => 17665u16, + BlockKind::AmethystCluster => 17666u16, + BlockKind::LargeAmethystBud => 17678u16, + BlockKind::MediumAmethystBud => 17690u16, + BlockKind::SmallAmethystBud => 17702u16, + BlockKind::Tuff => 17714u16, + BlockKind::Calcite => 17715u16, + BlockKind::TintedGlass => 17716u16, + BlockKind::PowderSnow => 17717u16, + BlockKind::SculkSensor => 17718u16, + BlockKind::OxidizedCopper => 17814u16, + BlockKind::WeatheredCopper => 17815u16, + BlockKind::ExposedCopper => 17816u16, + BlockKind::CopperBlock => 17817u16, + BlockKind::CopperOre => 17818u16, + BlockKind::DeepslateCopperOre => 17819u16, + BlockKind::OxidizedCutCopper => 17820u16, + BlockKind::WeatheredCutCopper => 17821u16, + BlockKind::ExposedCutCopper => 17822u16, + BlockKind::CutCopper => 17823u16, + BlockKind::OxidizedCutCopperStairs => 17824u16, + BlockKind::WeatheredCutCopperStairs => 17904u16, + BlockKind::ExposedCutCopperStairs => 17984u16, + BlockKind::CutCopperStairs => 18064u16, + BlockKind::OxidizedCutCopperSlab => 18144u16, + BlockKind::WeatheredCutCopperSlab => 18150u16, + BlockKind::ExposedCutCopperSlab => 18156u16, + BlockKind::CutCopperSlab => 18162u16, + BlockKind::WaxedCopperBlock => 18168u16, + BlockKind::WaxedWeatheredCopper => 18169u16, + BlockKind::WaxedExposedCopper => 18170u16, + BlockKind::WaxedOxidizedCopper => 18171u16, + BlockKind::WaxedOxidizedCutCopper => 18172u16, + BlockKind::WaxedWeatheredCutCopper => 18173u16, + BlockKind::WaxedExposedCutCopper => 18174u16, + BlockKind::WaxedCutCopper => 18175u16, + BlockKind::WaxedOxidizedCutCopperStairs => 18176u16, + BlockKind::WaxedWeatheredCutCopperStairs => 18256u16, + BlockKind::WaxedExposedCutCopperStairs => 18336u16, + BlockKind::WaxedCutCopperStairs => 18416u16, + BlockKind::WaxedOxidizedCutCopperSlab => 18496u16, + BlockKind::WaxedWeatheredCutCopperSlab => 18502u16, + BlockKind::WaxedExposedCutCopperSlab => 18508u16, + BlockKind::WaxedCutCopperSlab => 18514u16, + BlockKind::LightningRod => 18520u16, + BlockKind::PointedDripstone => 18544u16, + BlockKind::DripstoneBlock => 18564u16, + BlockKind::CaveVines => 18565u16, + BlockKind::CaveVinesPlant => 18617u16, + BlockKind::SporeBlossom => 18619u16, + BlockKind::Azalea => 18620u16, + BlockKind::FloweringAzalea => 18621u16, + BlockKind::MossCarpet => 18622u16, + BlockKind::MossBlock => 18623u16, + BlockKind::BigDripleaf => 18624u16, + BlockKind::BigDripleafStem => 18656u16, + BlockKind::SmallDripleaf => 18664u16, + BlockKind::HangingRoots => 18680u16, + BlockKind::RootedDirt => 18682u16, + BlockKind::Deepslate => 18683u16, + BlockKind::CobbledDeepslate => 18686u16, + BlockKind::CobbledDeepslateStairs => 18687u16, + BlockKind::CobbledDeepslateSlab => 18767u16, + BlockKind::CobbledDeepslateWall => 18773u16, + BlockKind::PolishedDeepslate => 19097u16, + BlockKind::PolishedDeepslateStairs => 19098u16, + BlockKind::PolishedDeepslateSlab => 19178u16, + BlockKind::PolishedDeepslateWall => 19184u16, + BlockKind::DeepslateTiles => 19508u16, + BlockKind::DeepslateTileStairs => 19509u16, + BlockKind::DeepslateTileSlab => 19589u16, + BlockKind::DeepslateTileWall => 19595u16, + BlockKind::DeepslateBricks => 19919u16, + BlockKind::DeepslateBrickStairs => 19920u16, + BlockKind::DeepslateBrickSlab => 20000u16, + BlockKind::DeepslateBrickWall => 20006u16, + BlockKind::ChiseledDeepslate => 20330u16, + BlockKind::CrackedDeepslateBricks => 20331u16, + BlockKind::CrackedDeepslateTiles => 20332u16, + BlockKind::InfestedDeepslate => 20333u16, + BlockKind::SmoothBasalt => 20336u16, + BlockKind::RawIronBlock => 20337u16, + BlockKind::RawCopperBlock => 20338u16, + BlockKind::RawGoldBlock => 20339u16, + BlockKind::PottedAzaleaBush => 20340u16, + BlockKind::PottedFloweringAzaleaBush => 20341u16, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `solid` property of this `BlockKind`. - pub fn solid(&self) -> bool { + #[doc = "Returns the `max_state_id` property of this `BlockKind`."] + #[inline] + pub fn max_state_id(&self) -> u16 { match self { - BlockKind::Air => false, - BlockKind::Stone => true, - BlockKind::Granite => true, - BlockKind::PolishedGranite => true, - BlockKind::Diorite => true, - BlockKind::PolishedDiorite => true, - BlockKind::Andesite => true, - BlockKind::PolishedAndesite => true, - BlockKind::GrassBlock => true, - BlockKind::Dirt => true, - BlockKind::CoarseDirt => true, + BlockKind::Air => 0u16, + BlockKind::Stone => 1u16, + BlockKind::Granite => 2u16, + BlockKind::PolishedGranite => 3u16, + BlockKind::Diorite => 4u16, + BlockKind::PolishedDiorite => 5u16, + BlockKind::Andesite => 6u16, + BlockKind::PolishedAndesite => 7u16, + BlockKind::GrassBlock => 9u16, + BlockKind::Dirt => 10u16, + BlockKind::CoarseDirt => 11u16, + BlockKind::Podzol => 13u16, + BlockKind::Cobblestone => 14u16, + BlockKind::OakPlanks => 15u16, + BlockKind::SprucePlanks => 16u16, + BlockKind::BirchPlanks => 17u16, + BlockKind::JunglePlanks => 18u16, + BlockKind::AcaciaPlanks => 19u16, + BlockKind::DarkOakPlanks => 20u16, + BlockKind::OakSapling => 22u16, + BlockKind::SpruceSapling => 24u16, + BlockKind::BirchSapling => 26u16, + BlockKind::JungleSapling => 28u16, + BlockKind::AcaciaSapling => 30u16, + BlockKind::DarkOakSapling => 32u16, + BlockKind::Bedrock => 33u16, + BlockKind::Water => 49u16, + BlockKind::Lava => 65u16, + BlockKind::Sand => 66u16, + BlockKind::RedSand => 67u16, + BlockKind::Gravel => 68u16, + BlockKind::GoldOre => 69u16, + BlockKind::DeepslateGoldOre => 70u16, + BlockKind::IronOre => 71u16, + BlockKind::DeepslateIronOre => 72u16, + BlockKind::CoalOre => 73u16, + BlockKind::DeepslateCoalOre => 74u16, + BlockKind::NetherGoldOre => 75u16, + BlockKind::OakLog => 78u16, + BlockKind::SpruceLog => 81u16, + BlockKind::BirchLog => 84u16, + BlockKind::JungleLog => 87u16, + BlockKind::AcaciaLog => 90u16, + BlockKind::DarkOakLog => 93u16, + BlockKind::StrippedSpruceLog => 96u16, + BlockKind::StrippedBirchLog => 99u16, + BlockKind::StrippedJungleLog => 102u16, + BlockKind::StrippedAcaciaLog => 105u16, + BlockKind::StrippedDarkOakLog => 108u16, + BlockKind::StrippedOakLog => 111u16, + BlockKind::OakWood => 114u16, + BlockKind::SpruceWood => 117u16, + BlockKind::BirchWood => 120u16, + BlockKind::JungleWood => 123u16, + BlockKind::AcaciaWood => 126u16, + BlockKind::DarkOakWood => 129u16, + BlockKind::StrippedOakWood => 132u16, + BlockKind::StrippedSpruceWood => 135u16, + BlockKind::StrippedBirchWood => 138u16, + BlockKind::StrippedJungleWood => 141u16, + BlockKind::StrippedAcaciaWood => 144u16, + BlockKind::StrippedDarkOakWood => 147u16, + BlockKind::OakLeaves => 161u16, + BlockKind::SpruceLeaves => 175u16, + BlockKind::BirchLeaves => 189u16, + BlockKind::JungleLeaves => 203u16, + BlockKind::AcaciaLeaves => 217u16, + BlockKind::DarkOakLeaves => 231u16, + BlockKind::AzaleaLeaves => 245u16, + BlockKind::FloweringAzaleaLeaves => 259u16, + BlockKind::Sponge => 260u16, + BlockKind::WetSponge => 261u16, + BlockKind::Glass => 262u16, + BlockKind::LapisOre => 263u16, + BlockKind::DeepslateLapisOre => 264u16, + BlockKind::LapisBlock => 265u16, + BlockKind::Dispenser => 277u16, + BlockKind::Sandstone => 278u16, + BlockKind::ChiseledSandstone => 279u16, + BlockKind::CutSandstone => 280u16, + BlockKind::NoteBlock => 1080u16, + BlockKind::WhiteBed => 1096u16, + BlockKind::OrangeBed => 1112u16, + BlockKind::MagentaBed => 1128u16, + BlockKind::LightBlueBed => 1144u16, + BlockKind::YellowBed => 1160u16, + BlockKind::LimeBed => 1176u16, + BlockKind::PinkBed => 1192u16, + BlockKind::GrayBed => 1208u16, + BlockKind::LightGrayBed => 1224u16, + BlockKind::CyanBed => 1240u16, + BlockKind::PurpleBed => 1256u16, + BlockKind::BlueBed => 1272u16, + BlockKind::BrownBed => 1288u16, + BlockKind::GreenBed => 1304u16, + BlockKind::RedBed => 1320u16, + BlockKind::BlackBed => 1336u16, + BlockKind::PoweredRail => 1360u16, + BlockKind::DetectorRail => 1384u16, + BlockKind::StickyPiston => 1396u16, + BlockKind::Cobweb => 1397u16, + BlockKind::Grass => 1398u16, + BlockKind::Fern => 1399u16, + BlockKind::DeadBush => 1400u16, + BlockKind::Seagrass => 1401u16, + BlockKind::TallSeagrass => 1403u16, + BlockKind::Piston => 1415u16, + BlockKind::PistonHead => 1439u16, + BlockKind::WhiteWool => 1440u16, + BlockKind::OrangeWool => 1441u16, + BlockKind::MagentaWool => 1442u16, + BlockKind::LightBlueWool => 1443u16, + BlockKind::YellowWool => 1444u16, + BlockKind::LimeWool => 1445u16, + BlockKind::PinkWool => 1446u16, + BlockKind::GrayWool => 1447u16, + BlockKind::LightGrayWool => 1448u16, + BlockKind::CyanWool => 1449u16, + BlockKind::PurpleWool => 1450u16, + BlockKind::BlueWool => 1451u16, + BlockKind::BrownWool => 1452u16, + BlockKind::GreenWool => 1453u16, + BlockKind::RedWool => 1454u16, + BlockKind::BlackWool => 1455u16, + BlockKind::MovingPiston => 1467u16, + BlockKind::Dandelion => 1468u16, + BlockKind::Poppy => 1469u16, + BlockKind::BlueOrchid => 1470u16, + BlockKind::Allium => 1471u16, + BlockKind::AzureBluet => 1472u16, + BlockKind::RedTulip => 1473u16, + BlockKind::OrangeTulip => 1474u16, + BlockKind::WhiteTulip => 1475u16, + BlockKind::PinkTulip => 1476u16, + BlockKind::OxeyeDaisy => 1477u16, + BlockKind::Cornflower => 1478u16, + BlockKind::WitherRose => 1479u16, + BlockKind::LilyOfTheValley => 1480u16, + BlockKind::BrownMushroom => 1481u16, + BlockKind::RedMushroom => 1482u16, + BlockKind::GoldBlock => 1483u16, + BlockKind::IronBlock => 1484u16, + BlockKind::Bricks => 1485u16, + BlockKind::Tnt => 1487u16, + BlockKind::Bookshelf => 1488u16, + BlockKind::MossyCobblestone => 1489u16, + BlockKind::Obsidian => 1490u16, + BlockKind::Torch => 1491u16, + BlockKind::WallTorch => 1495u16, + BlockKind::Fire => 2007u16, + BlockKind::SoulFire => 2008u16, + BlockKind::Spawner => 2009u16, + BlockKind::OakStairs => 2089u16, + BlockKind::Chest => 2113u16, + BlockKind::RedstoneWire => 3409u16, + BlockKind::DiamondOre => 3410u16, + BlockKind::DeepslateDiamondOre => 3411u16, + BlockKind::DiamondBlock => 3412u16, + BlockKind::CraftingTable => 3413u16, + BlockKind::Wheat => 3421u16, + BlockKind::Farmland => 3429u16, + BlockKind::Furnace => 3437u16, + BlockKind::OakSign => 3469u16, + BlockKind::SpruceSign => 3501u16, + BlockKind::BirchSign => 3533u16, + BlockKind::AcaciaSign => 3565u16, + BlockKind::JungleSign => 3597u16, + BlockKind::DarkOakSign => 3629u16, + BlockKind::OakDoor => 3693u16, + BlockKind::Ladder => 3701u16, + BlockKind::Rail => 3721u16, + BlockKind::CobblestoneStairs => 3801u16, + BlockKind::OakWallSign => 3809u16, + BlockKind::SpruceWallSign => 3817u16, + BlockKind::BirchWallSign => 3825u16, + BlockKind::AcaciaWallSign => 3833u16, + BlockKind::JungleWallSign => 3841u16, + BlockKind::DarkOakWallSign => 3849u16, + BlockKind::Lever => 3873u16, + BlockKind::StonePressurePlate => 3875u16, + BlockKind::IronDoor => 3939u16, + BlockKind::OakPressurePlate => 3941u16, + BlockKind::SprucePressurePlate => 3943u16, + BlockKind::BirchPressurePlate => 3945u16, + BlockKind::JunglePressurePlate => 3947u16, + BlockKind::AcaciaPressurePlate => 3949u16, + BlockKind::DarkOakPressurePlate => 3951u16, + BlockKind::RedstoneOre => 3953u16, + BlockKind::DeepslateRedstoneOre => 3955u16, + BlockKind::RedstoneTorch => 3957u16, + BlockKind::RedstoneWallTorch => 3965u16, + BlockKind::StoneButton => 3989u16, + BlockKind::Snow => 3997u16, + BlockKind::Ice => 3998u16, + BlockKind::SnowBlock => 3999u16, + BlockKind::Cactus => 4015u16, + BlockKind::Clay => 4016u16, + BlockKind::SugarCane => 4032u16, + BlockKind::Jukebox => 4034u16, + BlockKind::OakFence => 4066u16, + BlockKind::Pumpkin => 4067u16, + BlockKind::Netherrack => 4068u16, + BlockKind::SoulSand => 4069u16, + BlockKind::SoulSoil => 4070u16, + BlockKind::Basalt => 4073u16, + BlockKind::PolishedBasalt => 4076u16, + BlockKind::SoulTorch => 4077u16, + BlockKind::SoulWallTorch => 4081u16, + BlockKind::Glowstone => 4082u16, + BlockKind::NetherPortal => 4084u16, + BlockKind::CarvedPumpkin => 4088u16, + BlockKind::JackOLantern => 4092u16, + BlockKind::Cake => 4099u16, + BlockKind::Repeater => 4163u16, + BlockKind::WhiteStainedGlass => 4164u16, + BlockKind::OrangeStainedGlass => 4165u16, + BlockKind::MagentaStainedGlass => 4166u16, + BlockKind::LightBlueStainedGlass => 4167u16, + BlockKind::YellowStainedGlass => 4168u16, + BlockKind::LimeStainedGlass => 4169u16, + BlockKind::PinkStainedGlass => 4170u16, + BlockKind::GrayStainedGlass => 4171u16, + BlockKind::LightGrayStainedGlass => 4172u16, + BlockKind::CyanStainedGlass => 4173u16, + BlockKind::PurpleStainedGlass => 4174u16, + BlockKind::BlueStainedGlass => 4175u16, + BlockKind::BrownStainedGlass => 4176u16, + BlockKind::GreenStainedGlass => 4177u16, + BlockKind::RedStainedGlass => 4178u16, + BlockKind::BlackStainedGlass => 4179u16, + BlockKind::OakTrapdoor => 4243u16, + BlockKind::SpruceTrapdoor => 4307u16, + BlockKind::BirchTrapdoor => 4371u16, + BlockKind::JungleTrapdoor => 4435u16, + BlockKind::AcaciaTrapdoor => 4499u16, + BlockKind::DarkOakTrapdoor => 4563u16, + BlockKind::StoneBricks => 4564u16, + BlockKind::MossyStoneBricks => 4565u16, + BlockKind::CrackedStoneBricks => 4566u16, + BlockKind::ChiseledStoneBricks => 4567u16, + BlockKind::InfestedStone => 4568u16, + BlockKind::InfestedCobblestone => 4569u16, + BlockKind::InfestedStoneBricks => 4570u16, + BlockKind::InfestedMossyStoneBricks => 4571u16, + BlockKind::InfestedCrackedStoneBricks => 4572u16, + BlockKind::InfestedChiseledStoneBricks => 4573u16, + BlockKind::BrownMushroomBlock => 4637u16, + BlockKind::RedMushroomBlock => 4701u16, + BlockKind::MushroomStem => 4765u16, + BlockKind::IronBars => 4797u16, + BlockKind::Chain => 4803u16, + BlockKind::GlassPane => 4835u16, + BlockKind::Melon => 4836u16, + BlockKind::AttachedPumpkinStem => 4840u16, + BlockKind::AttachedMelonStem => 4844u16, + BlockKind::PumpkinStem => 4852u16, + BlockKind::MelonStem => 4860u16, + BlockKind::Vine => 4892u16, + BlockKind::GlowLichen => 5020u16, + BlockKind::OakFenceGate => 5052u16, + BlockKind::BrickStairs => 5132u16, + BlockKind::StoneBrickStairs => 5212u16, + BlockKind::Mycelium => 5214u16, + BlockKind::LilyPad => 5215u16, + BlockKind::NetherBricks => 5216u16, + BlockKind::NetherBrickFence => 5248u16, + BlockKind::NetherBrickStairs => 5328u16, + BlockKind::NetherWart => 5332u16, + BlockKind::EnchantingTable => 5333u16, + BlockKind::BrewingStand => 5341u16, + BlockKind::Cauldron => 5342u16, + BlockKind::WaterCauldron => 5345u16, + BlockKind::LavaCauldron => 5346u16, + BlockKind::PowderSnowCauldron => 5349u16, + BlockKind::EndPortal => 5350u16, + BlockKind::EndPortalFrame => 5358u16, + BlockKind::EndStone => 5359u16, + BlockKind::DragonEgg => 5360u16, + BlockKind::RedstoneLamp => 5362u16, + BlockKind::Cocoa => 5374u16, + BlockKind::SandstoneStairs => 5454u16, + BlockKind::EmeraldOre => 5455u16, + BlockKind::DeepslateEmeraldOre => 5456u16, + BlockKind::EnderChest => 5464u16, + BlockKind::TripwireHook => 5480u16, + BlockKind::Tripwire => 5608u16, + BlockKind::EmeraldBlock => 5609u16, + BlockKind::SpruceStairs => 5689u16, + BlockKind::BirchStairs => 5769u16, + BlockKind::JungleStairs => 5849u16, + BlockKind::CommandBlock => 5861u16, + BlockKind::Beacon => 5862u16, + BlockKind::CobblestoneWall => 6186u16, + BlockKind::MossyCobblestoneWall => 6510u16, + BlockKind::FlowerPot => 6511u16, + BlockKind::PottedOakSapling => 6512u16, + BlockKind::PottedSpruceSapling => 6513u16, + BlockKind::PottedBirchSapling => 6514u16, + BlockKind::PottedJungleSapling => 6515u16, + BlockKind::PottedAcaciaSapling => 6516u16, + BlockKind::PottedDarkOakSapling => 6517u16, + BlockKind::PottedFern => 6518u16, + BlockKind::PottedDandelion => 6519u16, + BlockKind::PottedPoppy => 6520u16, + BlockKind::PottedBlueOrchid => 6521u16, + BlockKind::PottedAllium => 6522u16, + BlockKind::PottedAzureBluet => 6523u16, + BlockKind::PottedRedTulip => 6524u16, + BlockKind::PottedOrangeTulip => 6525u16, + BlockKind::PottedWhiteTulip => 6526u16, + BlockKind::PottedPinkTulip => 6527u16, + BlockKind::PottedOxeyeDaisy => 6528u16, + BlockKind::PottedCornflower => 6529u16, + BlockKind::PottedLilyOfTheValley => 6530u16, + BlockKind::PottedWitherRose => 6531u16, + BlockKind::PottedRedMushroom => 6532u16, + BlockKind::PottedBrownMushroom => 6533u16, + BlockKind::PottedDeadBush => 6534u16, + BlockKind::PottedCactus => 6535u16, + BlockKind::Carrots => 6543u16, + BlockKind::Potatoes => 6551u16, + BlockKind::OakButton => 6575u16, + BlockKind::SpruceButton => 6599u16, + BlockKind::BirchButton => 6623u16, + BlockKind::JungleButton => 6647u16, + BlockKind::AcaciaButton => 6671u16, + BlockKind::DarkOakButton => 6695u16, + BlockKind::SkeletonSkull => 6711u16, + BlockKind::SkeletonWallSkull => 6715u16, + BlockKind::WitherSkeletonSkull => 6731u16, + BlockKind::WitherSkeletonWallSkull => 6735u16, + BlockKind::ZombieHead => 6751u16, + BlockKind::ZombieWallHead => 6755u16, + BlockKind::PlayerHead => 6771u16, + BlockKind::PlayerWallHead => 6775u16, + BlockKind::CreeperHead => 6791u16, + BlockKind::CreeperWallHead => 6795u16, + BlockKind::DragonHead => 6811u16, + BlockKind::DragonWallHead => 6815u16, + BlockKind::Anvil => 6819u16, + BlockKind::ChippedAnvil => 6823u16, + BlockKind::DamagedAnvil => 6827u16, + BlockKind::TrappedChest => 6851u16, + BlockKind::LightWeightedPressurePlate => 6867u16, + BlockKind::HeavyWeightedPressurePlate => 6883u16, + BlockKind::Comparator => 6899u16, + BlockKind::DaylightDetector => 6931u16, + BlockKind::RedstoneBlock => 6932u16, + BlockKind::NetherQuartzOre => 6933u16, + BlockKind::Hopper => 6943u16, + BlockKind::QuartzBlock => 6944u16, + BlockKind::ChiseledQuartzBlock => 6945u16, + BlockKind::QuartzPillar => 6948u16, + BlockKind::QuartzStairs => 7028u16, + BlockKind::ActivatorRail => 7052u16, + BlockKind::Dropper => 7064u16, + BlockKind::WhiteTerracotta => 7065u16, + BlockKind::OrangeTerracotta => 7066u16, + BlockKind::MagentaTerracotta => 7067u16, + BlockKind::LightBlueTerracotta => 7068u16, + BlockKind::YellowTerracotta => 7069u16, + BlockKind::LimeTerracotta => 7070u16, + BlockKind::PinkTerracotta => 7071u16, + BlockKind::GrayTerracotta => 7072u16, + BlockKind::LightGrayTerracotta => 7073u16, + BlockKind::CyanTerracotta => 7074u16, + BlockKind::PurpleTerracotta => 7075u16, + BlockKind::BlueTerracotta => 7076u16, + BlockKind::BrownTerracotta => 7077u16, + BlockKind::GreenTerracotta => 7078u16, + BlockKind::RedTerracotta => 7079u16, + BlockKind::BlackTerracotta => 7080u16, + BlockKind::WhiteStainedGlassPane => 7112u16, + BlockKind::OrangeStainedGlassPane => 7144u16, + BlockKind::MagentaStainedGlassPane => 7176u16, + BlockKind::LightBlueStainedGlassPane => 7208u16, + BlockKind::YellowStainedGlassPane => 7240u16, + BlockKind::LimeStainedGlassPane => 7272u16, + BlockKind::PinkStainedGlassPane => 7304u16, + BlockKind::GrayStainedGlassPane => 7336u16, + BlockKind::LightGrayStainedGlassPane => 7368u16, + BlockKind::CyanStainedGlassPane => 7400u16, + BlockKind::PurpleStainedGlassPane => 7432u16, + BlockKind::BlueStainedGlassPane => 7464u16, + BlockKind::BrownStainedGlassPane => 7496u16, + BlockKind::GreenStainedGlassPane => 7528u16, + BlockKind::RedStainedGlassPane => 7560u16, + BlockKind::BlackStainedGlassPane => 7592u16, + BlockKind::AcaciaStairs => 7672u16, + BlockKind::DarkOakStairs => 7752u16, + BlockKind::SlimeBlock => 7753u16, + BlockKind::Barrier => 7754u16, + BlockKind::Light => 7786u16, + BlockKind::IronTrapdoor => 7850u16, + BlockKind::Prismarine => 7851u16, + BlockKind::PrismarineBricks => 7852u16, + BlockKind::DarkPrismarine => 7853u16, + BlockKind::PrismarineStairs => 7933u16, + BlockKind::PrismarineBrickStairs => 8013u16, + BlockKind::DarkPrismarineStairs => 8093u16, + BlockKind::PrismarineSlab => 8099u16, + BlockKind::PrismarineBrickSlab => 8105u16, + BlockKind::DarkPrismarineSlab => 8111u16, + BlockKind::SeaLantern => 8112u16, + BlockKind::HayBlock => 8115u16, + BlockKind::WhiteCarpet => 8116u16, + BlockKind::OrangeCarpet => 8117u16, + BlockKind::MagentaCarpet => 8118u16, + BlockKind::LightBlueCarpet => 8119u16, + BlockKind::YellowCarpet => 8120u16, + BlockKind::LimeCarpet => 8121u16, + BlockKind::PinkCarpet => 8122u16, + BlockKind::GrayCarpet => 8123u16, + BlockKind::LightGrayCarpet => 8124u16, + BlockKind::CyanCarpet => 8125u16, + BlockKind::PurpleCarpet => 8126u16, + BlockKind::BlueCarpet => 8127u16, + BlockKind::BrownCarpet => 8128u16, + BlockKind::GreenCarpet => 8129u16, + BlockKind::RedCarpet => 8130u16, + BlockKind::BlackCarpet => 8131u16, + BlockKind::Terracotta => 8132u16, + BlockKind::CoalBlock => 8133u16, + BlockKind::PackedIce => 8134u16, + BlockKind::Sunflower => 8136u16, + BlockKind::Lilac => 8138u16, + BlockKind::RoseBush => 8140u16, + BlockKind::Peony => 8142u16, + BlockKind::TallGrass => 8144u16, + BlockKind::LargeFern => 8146u16, + BlockKind::WhiteBanner => 8162u16, + BlockKind::OrangeBanner => 8178u16, + BlockKind::MagentaBanner => 8194u16, + BlockKind::LightBlueBanner => 8210u16, + BlockKind::YellowBanner => 8226u16, + BlockKind::LimeBanner => 8242u16, + BlockKind::PinkBanner => 8258u16, + BlockKind::GrayBanner => 8274u16, + BlockKind::LightGrayBanner => 8290u16, + BlockKind::CyanBanner => 8306u16, + BlockKind::PurpleBanner => 8322u16, + BlockKind::BlueBanner => 8338u16, + BlockKind::BrownBanner => 8354u16, + BlockKind::GreenBanner => 8370u16, + BlockKind::RedBanner => 8386u16, + BlockKind::BlackBanner => 8402u16, + BlockKind::WhiteWallBanner => 8406u16, + BlockKind::OrangeWallBanner => 8410u16, + BlockKind::MagentaWallBanner => 8414u16, + BlockKind::LightBlueWallBanner => 8418u16, + BlockKind::YellowWallBanner => 8422u16, + BlockKind::LimeWallBanner => 8426u16, + BlockKind::PinkWallBanner => 8430u16, + BlockKind::GrayWallBanner => 8434u16, + BlockKind::LightGrayWallBanner => 8438u16, + BlockKind::CyanWallBanner => 8442u16, + BlockKind::PurpleWallBanner => 8446u16, + BlockKind::BlueWallBanner => 8450u16, + BlockKind::BrownWallBanner => 8454u16, + BlockKind::GreenWallBanner => 8458u16, + BlockKind::RedWallBanner => 8462u16, + BlockKind::BlackWallBanner => 8466u16, + BlockKind::RedSandstone => 8467u16, + BlockKind::ChiseledRedSandstone => 8468u16, + BlockKind::CutRedSandstone => 8469u16, + BlockKind::RedSandstoneStairs => 8549u16, + BlockKind::OakSlab => 8555u16, + BlockKind::SpruceSlab => 8561u16, + BlockKind::BirchSlab => 8567u16, + BlockKind::JungleSlab => 8573u16, + BlockKind::AcaciaSlab => 8579u16, + BlockKind::DarkOakSlab => 8585u16, + BlockKind::StoneSlab => 8591u16, + BlockKind::SmoothStoneSlab => 8597u16, + BlockKind::SandstoneSlab => 8603u16, + BlockKind::CutSandstoneSlab => 8609u16, + BlockKind::PetrifiedOakSlab => 8615u16, + BlockKind::CobblestoneSlab => 8621u16, + BlockKind::BrickSlab => 8627u16, + BlockKind::StoneBrickSlab => 8633u16, + BlockKind::NetherBrickSlab => 8639u16, + BlockKind::QuartzSlab => 8645u16, + BlockKind::RedSandstoneSlab => 8651u16, + BlockKind::CutRedSandstoneSlab => 8657u16, + BlockKind::PurpurSlab => 8663u16, + BlockKind::SmoothStone => 8664u16, + BlockKind::SmoothSandstone => 8665u16, + BlockKind::SmoothQuartz => 8666u16, + BlockKind::SmoothRedSandstone => 8667u16, + BlockKind::SpruceFenceGate => 8699u16, + BlockKind::BirchFenceGate => 8731u16, + BlockKind::JungleFenceGate => 8763u16, + BlockKind::AcaciaFenceGate => 8795u16, + BlockKind::DarkOakFenceGate => 8827u16, + BlockKind::SpruceFence => 8859u16, + BlockKind::BirchFence => 8891u16, + BlockKind::JungleFence => 8923u16, + BlockKind::AcaciaFence => 8955u16, + BlockKind::DarkOakFence => 8987u16, + BlockKind::SpruceDoor => 9051u16, + BlockKind::BirchDoor => 9115u16, + BlockKind::JungleDoor => 9179u16, + BlockKind::AcaciaDoor => 9243u16, + BlockKind::DarkOakDoor => 9307u16, + BlockKind::EndRod => 9313u16, + BlockKind::ChorusPlant => 9377u16, + BlockKind::ChorusFlower => 9383u16, + BlockKind::PurpurBlock => 9384u16, + BlockKind::PurpurPillar => 9387u16, + BlockKind::PurpurStairs => 9467u16, + BlockKind::EndStoneBricks => 9468u16, + BlockKind::Beetroots => 9472u16, + BlockKind::DirtPath => 9473u16, + BlockKind::EndGateway => 9474u16, + BlockKind::RepeatingCommandBlock => 9486u16, + BlockKind::ChainCommandBlock => 9498u16, + BlockKind::FrostedIce => 9502u16, + BlockKind::MagmaBlock => 9503u16, + BlockKind::NetherWartBlock => 9504u16, + BlockKind::RedNetherBricks => 9505u16, + BlockKind::BoneBlock => 9508u16, + BlockKind::StructureVoid => 9509u16, + BlockKind::Observer => 9521u16, + BlockKind::ShulkerBox => 9527u16, + BlockKind::WhiteShulkerBox => 9533u16, + BlockKind::OrangeShulkerBox => 9539u16, + BlockKind::MagentaShulkerBox => 9545u16, + BlockKind::LightBlueShulkerBox => 9551u16, + BlockKind::YellowShulkerBox => 9557u16, + BlockKind::LimeShulkerBox => 9563u16, + BlockKind::PinkShulkerBox => 9569u16, + BlockKind::GrayShulkerBox => 9575u16, + BlockKind::LightGrayShulkerBox => 9581u16, + BlockKind::CyanShulkerBox => 9587u16, + BlockKind::PurpleShulkerBox => 9593u16, + BlockKind::BlueShulkerBox => 9599u16, + BlockKind::BrownShulkerBox => 9605u16, + BlockKind::GreenShulkerBox => 9611u16, + BlockKind::RedShulkerBox => 9617u16, + BlockKind::BlackShulkerBox => 9623u16, + BlockKind::WhiteGlazedTerracotta => 9627u16, + BlockKind::OrangeGlazedTerracotta => 9631u16, + BlockKind::MagentaGlazedTerracotta => 9635u16, + BlockKind::LightBlueGlazedTerracotta => 9639u16, + BlockKind::YellowGlazedTerracotta => 9643u16, + BlockKind::LimeGlazedTerracotta => 9647u16, + BlockKind::PinkGlazedTerracotta => 9651u16, + BlockKind::GrayGlazedTerracotta => 9655u16, + BlockKind::LightGrayGlazedTerracotta => 9659u16, + BlockKind::CyanGlazedTerracotta => 9663u16, + BlockKind::PurpleGlazedTerracotta => 9667u16, + BlockKind::BlueGlazedTerracotta => 9671u16, + BlockKind::BrownGlazedTerracotta => 9675u16, + BlockKind::GreenGlazedTerracotta => 9679u16, + BlockKind::RedGlazedTerracotta => 9683u16, + BlockKind::BlackGlazedTerracotta => 9687u16, + BlockKind::WhiteConcrete => 9688u16, + BlockKind::OrangeConcrete => 9689u16, + BlockKind::MagentaConcrete => 9690u16, + BlockKind::LightBlueConcrete => 9691u16, + BlockKind::YellowConcrete => 9692u16, + BlockKind::LimeConcrete => 9693u16, + BlockKind::PinkConcrete => 9694u16, + BlockKind::GrayConcrete => 9695u16, + BlockKind::LightGrayConcrete => 9696u16, + BlockKind::CyanConcrete => 9697u16, + BlockKind::PurpleConcrete => 9698u16, + BlockKind::BlueConcrete => 9699u16, + BlockKind::BrownConcrete => 9700u16, + BlockKind::GreenConcrete => 9701u16, + BlockKind::RedConcrete => 9702u16, + BlockKind::BlackConcrete => 9703u16, + BlockKind::WhiteConcretePowder => 9704u16, + BlockKind::OrangeConcretePowder => 9705u16, + BlockKind::MagentaConcretePowder => 9706u16, + BlockKind::LightBlueConcretePowder => 9707u16, + BlockKind::YellowConcretePowder => 9708u16, + BlockKind::LimeConcretePowder => 9709u16, + BlockKind::PinkConcretePowder => 9710u16, + BlockKind::GrayConcretePowder => 9711u16, + BlockKind::LightGrayConcretePowder => 9712u16, + BlockKind::CyanConcretePowder => 9713u16, + BlockKind::PurpleConcretePowder => 9714u16, + BlockKind::BlueConcretePowder => 9715u16, + BlockKind::BrownConcretePowder => 9716u16, + BlockKind::GreenConcretePowder => 9717u16, + BlockKind::RedConcretePowder => 9718u16, + BlockKind::BlackConcretePowder => 9719u16, + BlockKind::Kelp => 9745u16, + BlockKind::KelpPlant => 9746u16, + BlockKind::DriedKelpBlock => 9747u16, + BlockKind::TurtleEgg => 9759u16, + BlockKind::DeadTubeCoralBlock => 9760u16, + BlockKind::DeadBrainCoralBlock => 9761u16, + BlockKind::DeadBubbleCoralBlock => 9762u16, + BlockKind::DeadFireCoralBlock => 9763u16, + BlockKind::DeadHornCoralBlock => 9764u16, + BlockKind::TubeCoralBlock => 9765u16, + BlockKind::BrainCoralBlock => 9766u16, + BlockKind::BubbleCoralBlock => 9767u16, + BlockKind::FireCoralBlock => 9768u16, + BlockKind::HornCoralBlock => 9769u16, + BlockKind::DeadTubeCoral => 9771u16, + BlockKind::DeadBrainCoral => 9773u16, + BlockKind::DeadBubbleCoral => 9775u16, + BlockKind::DeadFireCoral => 9777u16, + BlockKind::DeadHornCoral => 9779u16, + BlockKind::TubeCoral => 9781u16, + BlockKind::BrainCoral => 9783u16, + BlockKind::BubbleCoral => 9785u16, + BlockKind::FireCoral => 9787u16, + BlockKind::HornCoral => 9789u16, + BlockKind::DeadTubeCoralFan => 9791u16, + BlockKind::DeadBrainCoralFan => 9793u16, + BlockKind::DeadBubbleCoralFan => 9795u16, + BlockKind::DeadFireCoralFan => 9797u16, + BlockKind::DeadHornCoralFan => 9799u16, + BlockKind::TubeCoralFan => 9801u16, + BlockKind::BrainCoralFan => 9803u16, + BlockKind::BubbleCoralFan => 9805u16, + BlockKind::FireCoralFan => 9807u16, + BlockKind::HornCoralFan => 9809u16, + BlockKind::DeadTubeCoralWallFan => 9817u16, + BlockKind::DeadBrainCoralWallFan => 9825u16, + BlockKind::DeadBubbleCoralWallFan => 9833u16, + BlockKind::DeadFireCoralWallFan => 9841u16, + BlockKind::DeadHornCoralWallFan => 9849u16, + BlockKind::TubeCoralWallFan => 9857u16, + BlockKind::BrainCoralWallFan => 9865u16, + BlockKind::BubbleCoralWallFan => 9873u16, + BlockKind::FireCoralWallFan => 9881u16, + BlockKind::HornCoralWallFan => 9889u16, + BlockKind::SeaPickle => 9897u16, + BlockKind::BlueIce => 9898u16, + BlockKind::Conduit => 9900u16, + BlockKind::BambooSapling => 9901u16, + BlockKind::Bamboo => 9913u16, + BlockKind::PottedBamboo => 9914u16, + BlockKind::VoidAir => 9915u16, + BlockKind::CaveAir => 9916u16, + BlockKind::BubbleColumn => 9918u16, + BlockKind::PolishedGraniteStairs => 9998u16, + BlockKind::SmoothRedSandstoneStairs => 10078u16, + BlockKind::MossyStoneBrickStairs => 10158u16, + BlockKind::PolishedDioriteStairs => 10238u16, + BlockKind::MossyCobblestoneStairs => 10318u16, + BlockKind::EndStoneBrickStairs => 10398u16, + BlockKind::StoneStairs => 10478u16, + BlockKind::SmoothSandstoneStairs => 10558u16, + BlockKind::SmoothQuartzStairs => 10638u16, + BlockKind::GraniteStairs => 10718u16, + BlockKind::AndesiteStairs => 10798u16, + BlockKind::RedNetherBrickStairs => 10878u16, + BlockKind::PolishedAndesiteStairs => 10958u16, + BlockKind::DioriteStairs => 11038u16, + BlockKind::PolishedGraniteSlab => 11044u16, + BlockKind::SmoothRedSandstoneSlab => 11050u16, + BlockKind::MossyStoneBrickSlab => 11056u16, + BlockKind::PolishedDioriteSlab => 11062u16, + BlockKind::MossyCobblestoneSlab => 11068u16, + BlockKind::EndStoneBrickSlab => 11074u16, + BlockKind::SmoothSandstoneSlab => 11080u16, + BlockKind::SmoothQuartzSlab => 11086u16, + BlockKind::GraniteSlab => 11092u16, + BlockKind::AndesiteSlab => 11098u16, + BlockKind::RedNetherBrickSlab => 11104u16, + BlockKind::PolishedAndesiteSlab => 11110u16, + BlockKind::DioriteSlab => 11116u16, + BlockKind::BrickWall => 11440u16, + BlockKind::PrismarineWall => 11764u16, + BlockKind::RedSandstoneWall => 12088u16, + BlockKind::MossyStoneBrickWall => 12412u16, + BlockKind::GraniteWall => 12736u16, + BlockKind::StoneBrickWall => 13060u16, + BlockKind::NetherBrickWall => 13384u16, + BlockKind::AndesiteWall => 13708u16, + BlockKind::RedNetherBrickWall => 14032u16, + BlockKind::SandstoneWall => 14356u16, + BlockKind::EndStoneBrickWall => 14680u16, + BlockKind::DioriteWall => 15004u16, + BlockKind::Scaffolding => 15036u16, + BlockKind::Loom => 15040u16, + BlockKind::Barrel => 15052u16, + BlockKind::Smoker => 15060u16, + BlockKind::BlastFurnace => 15068u16, + BlockKind::CartographyTable => 15069u16, + BlockKind::FletchingTable => 15070u16, + BlockKind::Grindstone => 15082u16, + BlockKind::Lectern => 15098u16, + BlockKind::SmithingTable => 15099u16, + BlockKind::Stonecutter => 15103u16, + BlockKind::Bell => 15135u16, + BlockKind::Lantern => 15139u16, + BlockKind::SoulLantern => 15143u16, + BlockKind::Campfire => 15175u16, + BlockKind::SoulCampfire => 15207u16, + BlockKind::SweetBerryBush => 15211u16, + BlockKind::WarpedStem => 15214u16, + BlockKind::StrippedWarpedStem => 15217u16, + BlockKind::WarpedHyphae => 15220u16, + BlockKind::StrippedWarpedHyphae => 15223u16, + BlockKind::WarpedNylium => 15224u16, + BlockKind::WarpedFungus => 15225u16, + BlockKind::WarpedWartBlock => 15226u16, + BlockKind::WarpedRoots => 15227u16, + BlockKind::NetherSprouts => 15228u16, + BlockKind::CrimsonStem => 15231u16, + BlockKind::StrippedCrimsonStem => 15234u16, + BlockKind::CrimsonHyphae => 15237u16, + BlockKind::StrippedCrimsonHyphae => 15240u16, + BlockKind::CrimsonNylium => 15241u16, + BlockKind::CrimsonFungus => 15242u16, + BlockKind::Shroomlight => 15243u16, + BlockKind::WeepingVines => 15269u16, + BlockKind::WeepingVinesPlant => 15270u16, + BlockKind::TwistingVines => 15296u16, + BlockKind::TwistingVinesPlant => 15297u16, + BlockKind::CrimsonRoots => 15298u16, + BlockKind::CrimsonPlanks => 15299u16, + BlockKind::WarpedPlanks => 15300u16, + BlockKind::CrimsonSlab => 15306u16, + BlockKind::WarpedSlab => 15312u16, + BlockKind::CrimsonPressurePlate => 15314u16, + BlockKind::WarpedPressurePlate => 15316u16, + BlockKind::CrimsonFence => 15348u16, + BlockKind::WarpedFence => 15380u16, + BlockKind::CrimsonTrapdoor => 15444u16, + BlockKind::WarpedTrapdoor => 15508u16, + BlockKind::CrimsonFenceGate => 15540u16, + BlockKind::WarpedFenceGate => 15572u16, + BlockKind::CrimsonStairs => 15652u16, + BlockKind::WarpedStairs => 15732u16, + BlockKind::CrimsonButton => 15756u16, + BlockKind::WarpedButton => 15780u16, + BlockKind::CrimsonDoor => 15844u16, + BlockKind::WarpedDoor => 15908u16, + BlockKind::CrimsonSign => 15940u16, + BlockKind::WarpedSign => 15972u16, + BlockKind::CrimsonWallSign => 15980u16, + BlockKind::WarpedWallSign => 15988u16, + BlockKind::StructureBlock => 15992u16, + BlockKind::Jigsaw => 16004u16, + BlockKind::Composter => 16013u16, + BlockKind::Target => 16029u16, + BlockKind::BeeNest => 16053u16, + BlockKind::Beehive => 16077u16, + BlockKind::HoneyBlock => 16078u16, + BlockKind::HoneycombBlock => 16079u16, + BlockKind::NetheriteBlock => 16080u16, + BlockKind::AncientDebris => 16081u16, + BlockKind::CryingObsidian => 16082u16, + BlockKind::RespawnAnchor => 16087u16, + BlockKind::PottedCrimsonFungus => 16088u16, + BlockKind::PottedWarpedFungus => 16089u16, + BlockKind::PottedCrimsonRoots => 16090u16, + BlockKind::PottedWarpedRoots => 16091u16, + BlockKind::Lodestone => 16092u16, + BlockKind::Blackstone => 16093u16, + BlockKind::BlackstoneStairs => 16173u16, + BlockKind::BlackstoneWall => 16497u16, + BlockKind::BlackstoneSlab => 16503u16, + BlockKind::PolishedBlackstone => 16504u16, + BlockKind::PolishedBlackstoneBricks => 16505u16, + BlockKind::CrackedPolishedBlackstoneBricks => 16506u16, + BlockKind::ChiseledPolishedBlackstone => 16507u16, + BlockKind::PolishedBlackstoneBrickSlab => 16513u16, + BlockKind::PolishedBlackstoneBrickStairs => 16593u16, + BlockKind::PolishedBlackstoneBrickWall => 16917u16, + BlockKind::GildedBlackstone => 16918u16, + BlockKind::PolishedBlackstoneStairs => 16998u16, + BlockKind::PolishedBlackstoneSlab => 17004u16, + BlockKind::PolishedBlackstonePressurePlate => 17006u16, + BlockKind::PolishedBlackstoneButton => 17030u16, + BlockKind::PolishedBlackstoneWall => 17354u16, + BlockKind::ChiseledNetherBricks => 17355u16, + BlockKind::CrackedNetherBricks => 17356u16, + BlockKind::QuartzBricks => 17357u16, + BlockKind::Candle => 17373u16, + BlockKind::WhiteCandle => 17389u16, + BlockKind::OrangeCandle => 17405u16, + BlockKind::MagentaCandle => 17421u16, + BlockKind::LightBlueCandle => 17437u16, + BlockKind::YellowCandle => 17453u16, + BlockKind::LimeCandle => 17469u16, + BlockKind::PinkCandle => 17485u16, + BlockKind::GrayCandle => 17501u16, + BlockKind::LightGrayCandle => 17517u16, + BlockKind::CyanCandle => 17533u16, + BlockKind::PurpleCandle => 17549u16, + BlockKind::BlueCandle => 17565u16, + BlockKind::BrownCandle => 17581u16, + BlockKind::GreenCandle => 17597u16, + BlockKind::RedCandle => 17613u16, + BlockKind::BlackCandle => 17629u16, + BlockKind::CandleCake => 17631u16, + BlockKind::WhiteCandleCake => 17633u16, + BlockKind::OrangeCandleCake => 17635u16, + BlockKind::MagentaCandleCake => 17637u16, + BlockKind::LightBlueCandleCake => 17639u16, + BlockKind::YellowCandleCake => 17641u16, + BlockKind::LimeCandleCake => 17643u16, + BlockKind::PinkCandleCake => 17645u16, + BlockKind::GrayCandleCake => 17647u16, + BlockKind::LightGrayCandleCake => 17649u16, + BlockKind::CyanCandleCake => 17651u16, + BlockKind::PurpleCandleCake => 17653u16, + BlockKind::BlueCandleCake => 17655u16, + BlockKind::BrownCandleCake => 17657u16, + BlockKind::GreenCandleCake => 17659u16, + BlockKind::RedCandleCake => 17661u16, + BlockKind::BlackCandleCake => 17663u16, + BlockKind::AmethystBlock => 17664u16, + BlockKind::BuddingAmethyst => 17665u16, + BlockKind::AmethystCluster => 17677u16, + BlockKind::LargeAmethystBud => 17689u16, + BlockKind::MediumAmethystBud => 17701u16, + BlockKind::SmallAmethystBud => 17713u16, + BlockKind::Tuff => 17714u16, + BlockKind::Calcite => 17715u16, + BlockKind::TintedGlass => 17716u16, + BlockKind::PowderSnow => 17717u16, + BlockKind::SculkSensor => 17813u16, + BlockKind::OxidizedCopper => 17814u16, + BlockKind::WeatheredCopper => 17815u16, + BlockKind::ExposedCopper => 17816u16, + BlockKind::CopperBlock => 17817u16, + BlockKind::CopperOre => 17818u16, + BlockKind::DeepslateCopperOre => 17819u16, + BlockKind::OxidizedCutCopper => 17820u16, + BlockKind::WeatheredCutCopper => 17821u16, + BlockKind::ExposedCutCopper => 17822u16, + BlockKind::CutCopper => 17823u16, + BlockKind::OxidizedCutCopperStairs => 17903u16, + BlockKind::WeatheredCutCopperStairs => 17983u16, + BlockKind::ExposedCutCopperStairs => 18063u16, + BlockKind::CutCopperStairs => 18143u16, + BlockKind::OxidizedCutCopperSlab => 18149u16, + BlockKind::WeatheredCutCopperSlab => 18155u16, + BlockKind::ExposedCutCopperSlab => 18161u16, + BlockKind::CutCopperSlab => 18167u16, + BlockKind::WaxedCopperBlock => 18168u16, + BlockKind::WaxedWeatheredCopper => 18169u16, + BlockKind::WaxedExposedCopper => 18170u16, + BlockKind::WaxedOxidizedCopper => 18171u16, + BlockKind::WaxedOxidizedCutCopper => 18172u16, + BlockKind::WaxedWeatheredCutCopper => 18173u16, + BlockKind::WaxedExposedCutCopper => 18174u16, + BlockKind::WaxedCutCopper => 18175u16, + BlockKind::WaxedOxidizedCutCopperStairs => 18255u16, + BlockKind::WaxedWeatheredCutCopperStairs => 18335u16, + BlockKind::WaxedExposedCutCopperStairs => 18415u16, + BlockKind::WaxedCutCopperStairs => 18495u16, + BlockKind::WaxedOxidizedCutCopperSlab => 18501u16, + BlockKind::WaxedWeatheredCutCopperSlab => 18507u16, + BlockKind::WaxedExposedCutCopperSlab => 18513u16, + BlockKind::WaxedCutCopperSlab => 18519u16, + BlockKind::LightningRod => 18543u16, + BlockKind::PointedDripstone => 18563u16, + BlockKind::DripstoneBlock => 18564u16, + BlockKind::CaveVines => 18616u16, + BlockKind::CaveVinesPlant => 18618u16, + BlockKind::SporeBlossom => 18619u16, + BlockKind::Azalea => 18620u16, + BlockKind::FloweringAzalea => 18621u16, + BlockKind::MossCarpet => 18622u16, + BlockKind::MossBlock => 18623u16, + BlockKind::BigDripleaf => 18655u16, + BlockKind::BigDripleafStem => 18663u16, + BlockKind::SmallDripleaf => 18679u16, + BlockKind::HangingRoots => 18681u16, + BlockKind::RootedDirt => 18682u16, + BlockKind::Deepslate => 18685u16, + BlockKind::CobbledDeepslate => 18686u16, + BlockKind::CobbledDeepslateStairs => 18766u16, + BlockKind::CobbledDeepslateSlab => 18772u16, + BlockKind::CobbledDeepslateWall => 19096u16, + BlockKind::PolishedDeepslate => 19097u16, + BlockKind::PolishedDeepslateStairs => 19177u16, + BlockKind::PolishedDeepslateSlab => 19183u16, + BlockKind::PolishedDeepslateWall => 19507u16, + BlockKind::DeepslateTiles => 19508u16, + BlockKind::DeepslateTileStairs => 19588u16, + BlockKind::DeepslateTileSlab => 19594u16, + BlockKind::DeepslateTileWall => 19918u16, + BlockKind::DeepslateBricks => 19919u16, + BlockKind::DeepslateBrickStairs => 19999u16, + BlockKind::DeepslateBrickSlab => 20005u16, + BlockKind::DeepslateBrickWall => 20329u16, + BlockKind::ChiseledDeepslate => 20330u16, + BlockKind::CrackedDeepslateBricks => 20331u16, + BlockKind::CrackedDeepslateTiles => 20332u16, + BlockKind::InfestedDeepslate => 20335u16, + BlockKind::SmoothBasalt => 20336u16, + BlockKind::RawIronBlock => 20337u16, + BlockKind::RawCopperBlock => 20338u16, + BlockKind::RawGoldBlock => 20339u16, + BlockKind::PottedAzaleaBush => 20340u16, + BlockKind::PottedFloweringAzaleaBush => 20341u16, + } + } +} +impl BlockKind { + #[doc = "Returns the `light_emission` property of this `BlockKind`."] + #[inline] + pub fn light_emission(&self) -> u8 { + match self { + BlockKind::Air => 0u8, + BlockKind::Stone => 0u8, + BlockKind::Granite => 0u8, + BlockKind::PolishedGranite => 0u8, + BlockKind::Diorite => 0u8, + BlockKind::PolishedDiorite => 0u8, + BlockKind::Andesite => 0u8, + BlockKind::PolishedAndesite => 0u8, + BlockKind::GrassBlock => 0u8, + BlockKind::Dirt => 0u8, + BlockKind::CoarseDirt => 0u8, + BlockKind::Podzol => 0u8, + BlockKind::Cobblestone => 0u8, + BlockKind::OakPlanks => 0u8, + BlockKind::SprucePlanks => 0u8, + BlockKind::BirchPlanks => 0u8, + BlockKind::JunglePlanks => 0u8, + BlockKind::AcaciaPlanks => 0u8, + BlockKind::DarkOakPlanks => 0u8, + BlockKind::OakSapling => 0u8, + BlockKind::SpruceSapling => 0u8, + BlockKind::BirchSapling => 0u8, + BlockKind::JungleSapling => 0u8, + BlockKind::AcaciaSapling => 0u8, + BlockKind::DarkOakSapling => 0u8, + BlockKind::Bedrock => 0u8, + BlockKind::Water => 0u8, + BlockKind::Lava => 15u8, + BlockKind::Sand => 0u8, + BlockKind::RedSand => 0u8, + BlockKind::Gravel => 0u8, + BlockKind::GoldOre => 0u8, + BlockKind::DeepslateGoldOre => 0u8, + BlockKind::IronOre => 0u8, + BlockKind::DeepslateIronOre => 0u8, + BlockKind::CoalOre => 0u8, + BlockKind::DeepslateCoalOre => 0u8, + BlockKind::NetherGoldOre => 0u8, + BlockKind::OakLog => 0u8, + BlockKind::SpruceLog => 0u8, + BlockKind::BirchLog => 0u8, + BlockKind::JungleLog => 0u8, + BlockKind::AcaciaLog => 0u8, + BlockKind::DarkOakLog => 0u8, + BlockKind::StrippedSpruceLog => 0u8, + BlockKind::StrippedBirchLog => 0u8, + BlockKind::StrippedJungleLog => 0u8, + BlockKind::StrippedAcaciaLog => 0u8, + BlockKind::StrippedDarkOakLog => 0u8, + BlockKind::StrippedOakLog => 0u8, + BlockKind::OakWood => 0u8, + BlockKind::SpruceWood => 0u8, + BlockKind::BirchWood => 0u8, + BlockKind::JungleWood => 0u8, + BlockKind::AcaciaWood => 0u8, + BlockKind::DarkOakWood => 0u8, + BlockKind::StrippedOakWood => 0u8, + BlockKind::StrippedSpruceWood => 0u8, + BlockKind::StrippedBirchWood => 0u8, + BlockKind::StrippedJungleWood => 0u8, + BlockKind::StrippedAcaciaWood => 0u8, + BlockKind::StrippedDarkOakWood => 0u8, + BlockKind::OakLeaves => 0u8, + BlockKind::SpruceLeaves => 0u8, + BlockKind::BirchLeaves => 0u8, + BlockKind::JungleLeaves => 0u8, + BlockKind::AcaciaLeaves => 0u8, + BlockKind::DarkOakLeaves => 0u8, + BlockKind::AzaleaLeaves => 0u8, + BlockKind::FloweringAzaleaLeaves => 0u8, + BlockKind::Sponge => 0u8, + BlockKind::WetSponge => 0u8, + BlockKind::Glass => 0u8, + BlockKind::LapisOre => 0u8, + BlockKind::DeepslateLapisOre => 0u8, + BlockKind::LapisBlock => 0u8, + BlockKind::Dispenser => 0u8, + BlockKind::Sandstone => 0u8, + BlockKind::ChiseledSandstone => 0u8, + BlockKind::CutSandstone => 0u8, + BlockKind::NoteBlock => 0u8, + BlockKind::WhiteBed => 0u8, + BlockKind::OrangeBed => 0u8, + BlockKind::MagentaBed => 0u8, + BlockKind::LightBlueBed => 0u8, + BlockKind::YellowBed => 0u8, + BlockKind::LimeBed => 0u8, + BlockKind::PinkBed => 0u8, + BlockKind::GrayBed => 0u8, + BlockKind::LightGrayBed => 0u8, + BlockKind::CyanBed => 0u8, + BlockKind::PurpleBed => 0u8, + BlockKind::BlueBed => 0u8, + BlockKind::BrownBed => 0u8, + BlockKind::GreenBed => 0u8, + BlockKind::RedBed => 0u8, + BlockKind::BlackBed => 0u8, + BlockKind::PoweredRail => 0u8, + BlockKind::DetectorRail => 0u8, + BlockKind::StickyPiston => 0u8, + BlockKind::Cobweb => 0u8, + BlockKind::Grass => 0u8, + BlockKind::Fern => 0u8, + BlockKind::DeadBush => 0u8, + BlockKind::Seagrass => 0u8, + BlockKind::TallSeagrass => 0u8, + BlockKind::Piston => 0u8, + BlockKind::PistonHead => 0u8, + BlockKind::WhiteWool => 0u8, + BlockKind::OrangeWool => 0u8, + BlockKind::MagentaWool => 0u8, + BlockKind::LightBlueWool => 0u8, + BlockKind::YellowWool => 0u8, + BlockKind::LimeWool => 0u8, + BlockKind::PinkWool => 0u8, + BlockKind::GrayWool => 0u8, + BlockKind::LightGrayWool => 0u8, + BlockKind::CyanWool => 0u8, + BlockKind::PurpleWool => 0u8, + BlockKind::BlueWool => 0u8, + BlockKind::BrownWool => 0u8, + BlockKind::GreenWool => 0u8, + BlockKind::RedWool => 0u8, + BlockKind::BlackWool => 0u8, + BlockKind::MovingPiston => 0u8, + BlockKind::Dandelion => 0u8, + BlockKind::Poppy => 0u8, + BlockKind::BlueOrchid => 0u8, + BlockKind::Allium => 0u8, + BlockKind::AzureBluet => 0u8, + BlockKind::RedTulip => 0u8, + BlockKind::OrangeTulip => 0u8, + BlockKind::WhiteTulip => 0u8, + BlockKind::PinkTulip => 0u8, + BlockKind::OxeyeDaisy => 0u8, + BlockKind::Cornflower => 0u8, + BlockKind::WitherRose => 0u8, + BlockKind::LilyOfTheValley => 0u8, + BlockKind::BrownMushroom => 1u8, + BlockKind::RedMushroom => 0u8, + BlockKind::GoldBlock => 0u8, + BlockKind::IronBlock => 0u8, + BlockKind::Bricks => 0u8, + BlockKind::Tnt => 0u8, + BlockKind::Bookshelf => 0u8, + BlockKind::MossyCobblestone => 0u8, + BlockKind::Obsidian => 0u8, + BlockKind::Torch => 14u8, + BlockKind::WallTorch => 14u8, + BlockKind::Fire => 15u8, + BlockKind::SoulFire => 10u8, + BlockKind::Spawner => 0u8, + BlockKind::OakStairs => 0u8, + BlockKind::Chest => 0u8, + BlockKind::RedstoneWire => 0u8, + BlockKind::DiamondOre => 0u8, + BlockKind::DeepslateDiamondOre => 0u8, + BlockKind::DiamondBlock => 0u8, + BlockKind::CraftingTable => 0u8, + BlockKind::Wheat => 0u8, + BlockKind::Farmland => 0u8, + BlockKind::Furnace => 0u8, + BlockKind::OakSign => 0u8, + BlockKind::SpruceSign => 0u8, + BlockKind::BirchSign => 0u8, + BlockKind::AcaciaSign => 0u8, + BlockKind::JungleSign => 0u8, + BlockKind::DarkOakSign => 0u8, + BlockKind::OakDoor => 0u8, + BlockKind::Ladder => 0u8, + BlockKind::Rail => 0u8, + BlockKind::CobblestoneStairs => 0u8, + BlockKind::OakWallSign => 0u8, + BlockKind::SpruceWallSign => 0u8, + BlockKind::BirchWallSign => 0u8, + BlockKind::AcaciaWallSign => 0u8, + BlockKind::JungleWallSign => 0u8, + BlockKind::DarkOakWallSign => 0u8, + BlockKind::Lever => 0u8, + BlockKind::StonePressurePlate => 0u8, + BlockKind::IronDoor => 0u8, + BlockKind::OakPressurePlate => 0u8, + BlockKind::SprucePressurePlate => 0u8, + BlockKind::BirchPressurePlate => 0u8, + BlockKind::JunglePressurePlate => 0u8, + BlockKind::AcaciaPressurePlate => 0u8, + BlockKind::DarkOakPressurePlate => 0u8, + BlockKind::RedstoneOre => 0u8, + BlockKind::DeepslateRedstoneOre => 0u8, + BlockKind::RedstoneTorch => 7u8, + BlockKind::RedstoneWallTorch => 7u8, + BlockKind::StoneButton => 0u8, + BlockKind::Snow => 0u8, + BlockKind::Ice => 0u8, + BlockKind::SnowBlock => 0u8, + BlockKind::Cactus => 0u8, + BlockKind::Clay => 0u8, + BlockKind::SugarCane => 0u8, + BlockKind::Jukebox => 0u8, + BlockKind::OakFence => 0u8, + BlockKind::Pumpkin => 0u8, + BlockKind::Netherrack => 0u8, + BlockKind::SoulSand => 0u8, + BlockKind::SoulSoil => 0u8, + BlockKind::Basalt => 0u8, + BlockKind::PolishedBasalt => 0u8, + BlockKind::SoulTorch => 10u8, + BlockKind::SoulWallTorch => 10u8, + BlockKind::Glowstone => 15u8, + BlockKind::NetherPortal => 11u8, + BlockKind::CarvedPumpkin => 0u8, + BlockKind::JackOLantern => 15u8, + BlockKind::Cake => 0u8, + BlockKind::Repeater => 0u8, + BlockKind::WhiteStainedGlass => 0u8, + BlockKind::OrangeStainedGlass => 0u8, + BlockKind::MagentaStainedGlass => 0u8, + BlockKind::LightBlueStainedGlass => 0u8, + BlockKind::YellowStainedGlass => 0u8, + BlockKind::LimeStainedGlass => 0u8, + BlockKind::PinkStainedGlass => 0u8, + BlockKind::GrayStainedGlass => 0u8, + BlockKind::LightGrayStainedGlass => 0u8, + BlockKind::CyanStainedGlass => 0u8, + BlockKind::PurpleStainedGlass => 0u8, + BlockKind::BlueStainedGlass => 0u8, + BlockKind::BrownStainedGlass => 0u8, + BlockKind::GreenStainedGlass => 0u8, + BlockKind::RedStainedGlass => 0u8, + BlockKind::BlackStainedGlass => 0u8, + BlockKind::OakTrapdoor => 0u8, + BlockKind::SpruceTrapdoor => 0u8, + BlockKind::BirchTrapdoor => 0u8, + BlockKind::JungleTrapdoor => 0u8, + BlockKind::AcaciaTrapdoor => 0u8, + BlockKind::DarkOakTrapdoor => 0u8, + BlockKind::StoneBricks => 0u8, + BlockKind::MossyStoneBricks => 0u8, + BlockKind::CrackedStoneBricks => 0u8, + BlockKind::ChiseledStoneBricks => 0u8, + BlockKind::InfestedStone => 0u8, + BlockKind::InfestedCobblestone => 0u8, + BlockKind::InfestedStoneBricks => 0u8, + BlockKind::InfestedMossyStoneBricks => 0u8, + BlockKind::InfestedCrackedStoneBricks => 0u8, + BlockKind::InfestedChiseledStoneBricks => 0u8, + BlockKind::BrownMushroomBlock => 0u8, + BlockKind::RedMushroomBlock => 0u8, + BlockKind::MushroomStem => 0u8, + BlockKind::IronBars => 0u8, + BlockKind::Chain => 0u8, + BlockKind::GlassPane => 0u8, + BlockKind::Melon => 0u8, + BlockKind::AttachedPumpkinStem => 0u8, + BlockKind::AttachedMelonStem => 0u8, + BlockKind::PumpkinStem => 0u8, + BlockKind::MelonStem => 0u8, + BlockKind::Vine => 0u8, + BlockKind::GlowLichen => 0u8, + BlockKind::OakFenceGate => 0u8, + BlockKind::BrickStairs => 0u8, + BlockKind::StoneBrickStairs => 0u8, + BlockKind::Mycelium => 0u8, + BlockKind::LilyPad => 0u8, + BlockKind::NetherBricks => 0u8, + BlockKind::NetherBrickFence => 0u8, + BlockKind::NetherBrickStairs => 0u8, + BlockKind::NetherWart => 0u8, + BlockKind::EnchantingTable => 0u8, + BlockKind::BrewingStand => 1u8, + BlockKind::Cauldron => 0u8, + BlockKind::WaterCauldron => 0u8, + BlockKind::LavaCauldron => 15u8, + BlockKind::PowderSnowCauldron => 0u8, + BlockKind::EndPortal => 15u8, + BlockKind::EndPortalFrame => 1u8, + BlockKind::EndStone => 0u8, + BlockKind::DragonEgg => 1u8, + BlockKind::RedstoneLamp => 0u8, + BlockKind::Cocoa => 0u8, + BlockKind::SandstoneStairs => 0u8, + BlockKind::EmeraldOre => 0u8, + BlockKind::DeepslateEmeraldOre => 0u8, + BlockKind::EnderChest => 7u8, + BlockKind::TripwireHook => 0u8, + BlockKind::Tripwire => 0u8, + BlockKind::EmeraldBlock => 0u8, + BlockKind::SpruceStairs => 0u8, + BlockKind::BirchStairs => 0u8, + BlockKind::JungleStairs => 0u8, + BlockKind::CommandBlock => 0u8, + BlockKind::Beacon => 15u8, + BlockKind::CobblestoneWall => 0u8, + BlockKind::MossyCobblestoneWall => 0u8, + BlockKind::FlowerPot => 0u8, + BlockKind::PottedOakSapling => 0u8, + BlockKind::PottedSpruceSapling => 0u8, + BlockKind::PottedBirchSapling => 0u8, + BlockKind::PottedJungleSapling => 0u8, + BlockKind::PottedAcaciaSapling => 0u8, + BlockKind::PottedDarkOakSapling => 0u8, + BlockKind::PottedFern => 0u8, + BlockKind::PottedDandelion => 0u8, + BlockKind::PottedPoppy => 0u8, + BlockKind::PottedBlueOrchid => 0u8, + BlockKind::PottedAllium => 0u8, + BlockKind::PottedAzureBluet => 0u8, + BlockKind::PottedRedTulip => 0u8, + BlockKind::PottedOrangeTulip => 0u8, + BlockKind::PottedWhiteTulip => 0u8, + BlockKind::PottedPinkTulip => 0u8, + BlockKind::PottedOxeyeDaisy => 0u8, + BlockKind::PottedCornflower => 0u8, + BlockKind::PottedLilyOfTheValley => 0u8, + BlockKind::PottedWitherRose => 0u8, + BlockKind::PottedRedMushroom => 0u8, + BlockKind::PottedBrownMushroom => 0u8, + BlockKind::PottedDeadBush => 0u8, + BlockKind::PottedCactus => 0u8, + BlockKind::Carrots => 0u8, + BlockKind::Potatoes => 0u8, + BlockKind::OakButton => 0u8, + BlockKind::SpruceButton => 0u8, + BlockKind::BirchButton => 0u8, + BlockKind::JungleButton => 0u8, + BlockKind::AcaciaButton => 0u8, + BlockKind::DarkOakButton => 0u8, + BlockKind::SkeletonSkull => 0u8, + BlockKind::SkeletonWallSkull => 0u8, + BlockKind::WitherSkeletonSkull => 0u8, + BlockKind::WitherSkeletonWallSkull => 0u8, + BlockKind::ZombieHead => 0u8, + BlockKind::ZombieWallHead => 0u8, + BlockKind::PlayerHead => 0u8, + BlockKind::PlayerWallHead => 0u8, + BlockKind::CreeperHead => 0u8, + BlockKind::CreeperWallHead => 0u8, + BlockKind::DragonHead => 0u8, + BlockKind::DragonWallHead => 0u8, + BlockKind::Anvil => 0u8, + BlockKind::ChippedAnvil => 0u8, + BlockKind::DamagedAnvil => 0u8, + BlockKind::TrappedChest => 0u8, + BlockKind::LightWeightedPressurePlate => 0u8, + BlockKind::HeavyWeightedPressurePlate => 0u8, + BlockKind::Comparator => 0u8, + BlockKind::DaylightDetector => 0u8, + BlockKind::RedstoneBlock => 0u8, + BlockKind::NetherQuartzOre => 0u8, + BlockKind::Hopper => 0u8, + BlockKind::QuartzBlock => 0u8, + BlockKind::ChiseledQuartzBlock => 0u8, + BlockKind::QuartzPillar => 0u8, + BlockKind::QuartzStairs => 0u8, + BlockKind::ActivatorRail => 0u8, + BlockKind::Dropper => 0u8, + BlockKind::WhiteTerracotta => 0u8, + BlockKind::OrangeTerracotta => 0u8, + BlockKind::MagentaTerracotta => 0u8, + BlockKind::LightBlueTerracotta => 0u8, + BlockKind::YellowTerracotta => 0u8, + BlockKind::LimeTerracotta => 0u8, + BlockKind::PinkTerracotta => 0u8, + BlockKind::GrayTerracotta => 0u8, + BlockKind::LightGrayTerracotta => 0u8, + BlockKind::CyanTerracotta => 0u8, + BlockKind::PurpleTerracotta => 0u8, + BlockKind::BlueTerracotta => 0u8, + BlockKind::BrownTerracotta => 0u8, + BlockKind::GreenTerracotta => 0u8, + BlockKind::RedTerracotta => 0u8, + BlockKind::BlackTerracotta => 0u8, + BlockKind::WhiteStainedGlassPane => 0u8, + BlockKind::OrangeStainedGlassPane => 0u8, + BlockKind::MagentaStainedGlassPane => 0u8, + BlockKind::LightBlueStainedGlassPane => 0u8, + BlockKind::YellowStainedGlassPane => 0u8, + BlockKind::LimeStainedGlassPane => 0u8, + BlockKind::PinkStainedGlassPane => 0u8, + BlockKind::GrayStainedGlassPane => 0u8, + BlockKind::LightGrayStainedGlassPane => 0u8, + BlockKind::CyanStainedGlassPane => 0u8, + BlockKind::PurpleStainedGlassPane => 0u8, + BlockKind::BlueStainedGlassPane => 0u8, + BlockKind::BrownStainedGlassPane => 0u8, + BlockKind::GreenStainedGlassPane => 0u8, + BlockKind::RedStainedGlassPane => 0u8, + BlockKind::BlackStainedGlassPane => 0u8, + BlockKind::AcaciaStairs => 0u8, + BlockKind::DarkOakStairs => 0u8, + BlockKind::SlimeBlock => 0u8, + BlockKind::Barrier => 0u8, + BlockKind::Light => 15u8, + BlockKind::IronTrapdoor => 0u8, + BlockKind::Prismarine => 0u8, + BlockKind::PrismarineBricks => 0u8, + BlockKind::DarkPrismarine => 0u8, + BlockKind::PrismarineStairs => 0u8, + BlockKind::PrismarineBrickStairs => 0u8, + BlockKind::DarkPrismarineStairs => 0u8, + BlockKind::PrismarineSlab => 0u8, + BlockKind::PrismarineBrickSlab => 0u8, + BlockKind::DarkPrismarineSlab => 0u8, + BlockKind::SeaLantern => 15u8, + BlockKind::HayBlock => 0u8, + BlockKind::WhiteCarpet => 0u8, + BlockKind::OrangeCarpet => 0u8, + BlockKind::MagentaCarpet => 0u8, + BlockKind::LightBlueCarpet => 0u8, + BlockKind::YellowCarpet => 0u8, + BlockKind::LimeCarpet => 0u8, + BlockKind::PinkCarpet => 0u8, + BlockKind::GrayCarpet => 0u8, + BlockKind::LightGrayCarpet => 0u8, + BlockKind::CyanCarpet => 0u8, + BlockKind::PurpleCarpet => 0u8, + BlockKind::BlueCarpet => 0u8, + BlockKind::BrownCarpet => 0u8, + BlockKind::GreenCarpet => 0u8, + BlockKind::RedCarpet => 0u8, + BlockKind::BlackCarpet => 0u8, + BlockKind::Terracotta => 0u8, + BlockKind::CoalBlock => 0u8, + BlockKind::PackedIce => 0u8, + BlockKind::Sunflower => 0u8, + BlockKind::Lilac => 0u8, + BlockKind::RoseBush => 0u8, + BlockKind::Peony => 0u8, + BlockKind::TallGrass => 0u8, + BlockKind::LargeFern => 0u8, + BlockKind::WhiteBanner => 0u8, + BlockKind::OrangeBanner => 0u8, + BlockKind::MagentaBanner => 0u8, + BlockKind::LightBlueBanner => 0u8, + BlockKind::YellowBanner => 0u8, + BlockKind::LimeBanner => 0u8, + BlockKind::PinkBanner => 0u8, + BlockKind::GrayBanner => 0u8, + BlockKind::LightGrayBanner => 0u8, + BlockKind::CyanBanner => 0u8, + BlockKind::PurpleBanner => 0u8, + BlockKind::BlueBanner => 0u8, + BlockKind::BrownBanner => 0u8, + BlockKind::GreenBanner => 0u8, + BlockKind::RedBanner => 0u8, + BlockKind::BlackBanner => 0u8, + BlockKind::WhiteWallBanner => 0u8, + BlockKind::OrangeWallBanner => 0u8, + BlockKind::MagentaWallBanner => 0u8, + BlockKind::LightBlueWallBanner => 0u8, + BlockKind::YellowWallBanner => 0u8, + BlockKind::LimeWallBanner => 0u8, + BlockKind::PinkWallBanner => 0u8, + BlockKind::GrayWallBanner => 0u8, + BlockKind::LightGrayWallBanner => 0u8, + BlockKind::CyanWallBanner => 0u8, + BlockKind::PurpleWallBanner => 0u8, + BlockKind::BlueWallBanner => 0u8, + BlockKind::BrownWallBanner => 0u8, + BlockKind::GreenWallBanner => 0u8, + BlockKind::RedWallBanner => 0u8, + BlockKind::BlackWallBanner => 0u8, + BlockKind::RedSandstone => 0u8, + BlockKind::ChiseledRedSandstone => 0u8, + BlockKind::CutRedSandstone => 0u8, + BlockKind::RedSandstoneStairs => 0u8, + BlockKind::OakSlab => 0u8, + BlockKind::SpruceSlab => 0u8, + BlockKind::BirchSlab => 0u8, + BlockKind::JungleSlab => 0u8, + BlockKind::AcaciaSlab => 0u8, + BlockKind::DarkOakSlab => 0u8, + BlockKind::StoneSlab => 0u8, + BlockKind::SmoothStoneSlab => 0u8, + BlockKind::SandstoneSlab => 0u8, + BlockKind::CutSandstoneSlab => 0u8, + BlockKind::PetrifiedOakSlab => 0u8, + BlockKind::CobblestoneSlab => 0u8, + BlockKind::BrickSlab => 0u8, + BlockKind::StoneBrickSlab => 0u8, + BlockKind::NetherBrickSlab => 0u8, + BlockKind::QuartzSlab => 0u8, + BlockKind::RedSandstoneSlab => 0u8, + BlockKind::CutRedSandstoneSlab => 0u8, + BlockKind::PurpurSlab => 0u8, + BlockKind::SmoothStone => 0u8, + BlockKind::SmoothSandstone => 0u8, + BlockKind::SmoothQuartz => 0u8, + BlockKind::SmoothRedSandstone => 0u8, + BlockKind::SpruceFenceGate => 0u8, + BlockKind::BirchFenceGate => 0u8, + BlockKind::JungleFenceGate => 0u8, + BlockKind::AcaciaFenceGate => 0u8, + BlockKind::DarkOakFenceGate => 0u8, + BlockKind::SpruceFence => 0u8, + BlockKind::BirchFence => 0u8, + BlockKind::JungleFence => 0u8, + BlockKind::AcaciaFence => 0u8, + BlockKind::DarkOakFence => 0u8, + BlockKind::SpruceDoor => 0u8, + BlockKind::BirchDoor => 0u8, + BlockKind::JungleDoor => 0u8, + BlockKind::AcaciaDoor => 0u8, + BlockKind::DarkOakDoor => 0u8, + BlockKind::EndRod => 14u8, + BlockKind::ChorusPlant => 0u8, + BlockKind::ChorusFlower => 0u8, + BlockKind::PurpurBlock => 0u8, + BlockKind::PurpurPillar => 0u8, + BlockKind::PurpurStairs => 0u8, + BlockKind::EndStoneBricks => 0u8, + BlockKind::Beetroots => 0u8, + BlockKind::DirtPath => 0u8, + BlockKind::EndGateway => 15u8, + BlockKind::RepeatingCommandBlock => 0u8, + BlockKind::ChainCommandBlock => 0u8, + BlockKind::FrostedIce => 0u8, + BlockKind::MagmaBlock => 3u8, + BlockKind::NetherWartBlock => 0u8, + BlockKind::RedNetherBricks => 0u8, + BlockKind::BoneBlock => 0u8, + BlockKind::StructureVoid => 0u8, + BlockKind::Observer => 0u8, + BlockKind::ShulkerBox => 0u8, + BlockKind::WhiteShulkerBox => 0u8, + BlockKind::OrangeShulkerBox => 0u8, + BlockKind::MagentaShulkerBox => 0u8, + BlockKind::LightBlueShulkerBox => 0u8, + BlockKind::YellowShulkerBox => 0u8, + BlockKind::LimeShulkerBox => 0u8, + BlockKind::PinkShulkerBox => 0u8, + BlockKind::GrayShulkerBox => 0u8, + BlockKind::LightGrayShulkerBox => 0u8, + BlockKind::CyanShulkerBox => 0u8, + BlockKind::PurpleShulkerBox => 0u8, + BlockKind::BlueShulkerBox => 0u8, + BlockKind::BrownShulkerBox => 0u8, + BlockKind::GreenShulkerBox => 0u8, + BlockKind::RedShulkerBox => 0u8, + BlockKind::BlackShulkerBox => 0u8, + BlockKind::WhiteGlazedTerracotta => 0u8, + BlockKind::OrangeGlazedTerracotta => 0u8, + BlockKind::MagentaGlazedTerracotta => 0u8, + BlockKind::LightBlueGlazedTerracotta => 0u8, + BlockKind::YellowGlazedTerracotta => 0u8, + BlockKind::LimeGlazedTerracotta => 0u8, + BlockKind::PinkGlazedTerracotta => 0u8, + BlockKind::GrayGlazedTerracotta => 0u8, + BlockKind::LightGrayGlazedTerracotta => 0u8, + BlockKind::CyanGlazedTerracotta => 0u8, + BlockKind::PurpleGlazedTerracotta => 0u8, + BlockKind::BlueGlazedTerracotta => 0u8, + BlockKind::BrownGlazedTerracotta => 0u8, + BlockKind::GreenGlazedTerracotta => 0u8, + BlockKind::RedGlazedTerracotta => 0u8, + BlockKind::BlackGlazedTerracotta => 0u8, + BlockKind::WhiteConcrete => 0u8, + BlockKind::OrangeConcrete => 0u8, + BlockKind::MagentaConcrete => 0u8, + BlockKind::LightBlueConcrete => 0u8, + BlockKind::YellowConcrete => 0u8, + BlockKind::LimeConcrete => 0u8, + BlockKind::PinkConcrete => 0u8, + BlockKind::GrayConcrete => 0u8, + BlockKind::LightGrayConcrete => 0u8, + BlockKind::CyanConcrete => 0u8, + BlockKind::PurpleConcrete => 0u8, + BlockKind::BlueConcrete => 0u8, + BlockKind::BrownConcrete => 0u8, + BlockKind::GreenConcrete => 0u8, + BlockKind::RedConcrete => 0u8, + BlockKind::BlackConcrete => 0u8, + BlockKind::WhiteConcretePowder => 0u8, + BlockKind::OrangeConcretePowder => 0u8, + BlockKind::MagentaConcretePowder => 0u8, + BlockKind::LightBlueConcretePowder => 0u8, + BlockKind::YellowConcretePowder => 0u8, + BlockKind::LimeConcretePowder => 0u8, + BlockKind::PinkConcretePowder => 0u8, + BlockKind::GrayConcretePowder => 0u8, + BlockKind::LightGrayConcretePowder => 0u8, + BlockKind::CyanConcretePowder => 0u8, + BlockKind::PurpleConcretePowder => 0u8, + BlockKind::BlueConcretePowder => 0u8, + BlockKind::BrownConcretePowder => 0u8, + BlockKind::GreenConcretePowder => 0u8, + BlockKind::RedConcretePowder => 0u8, + BlockKind::BlackConcretePowder => 0u8, + BlockKind::Kelp => 0u8, + BlockKind::KelpPlant => 0u8, + BlockKind::DriedKelpBlock => 0u8, + BlockKind::TurtleEgg => 0u8, + BlockKind::DeadTubeCoralBlock => 0u8, + BlockKind::DeadBrainCoralBlock => 0u8, + BlockKind::DeadBubbleCoralBlock => 0u8, + BlockKind::DeadFireCoralBlock => 0u8, + BlockKind::DeadHornCoralBlock => 0u8, + BlockKind::TubeCoralBlock => 0u8, + BlockKind::BrainCoralBlock => 0u8, + BlockKind::BubbleCoralBlock => 0u8, + BlockKind::FireCoralBlock => 0u8, + BlockKind::HornCoralBlock => 0u8, + BlockKind::DeadTubeCoral => 0u8, + BlockKind::DeadBrainCoral => 0u8, + BlockKind::DeadBubbleCoral => 0u8, + BlockKind::DeadFireCoral => 0u8, + BlockKind::DeadHornCoral => 0u8, + BlockKind::TubeCoral => 0u8, + BlockKind::BrainCoral => 0u8, + BlockKind::BubbleCoral => 0u8, + BlockKind::FireCoral => 0u8, + BlockKind::HornCoral => 0u8, + BlockKind::DeadTubeCoralFan => 0u8, + BlockKind::DeadBrainCoralFan => 0u8, + BlockKind::DeadBubbleCoralFan => 0u8, + BlockKind::DeadFireCoralFan => 0u8, + BlockKind::DeadHornCoralFan => 0u8, + BlockKind::TubeCoralFan => 0u8, + BlockKind::BrainCoralFan => 0u8, + BlockKind::BubbleCoralFan => 0u8, + BlockKind::FireCoralFan => 0u8, + BlockKind::HornCoralFan => 0u8, + BlockKind::DeadTubeCoralWallFan => 0u8, + BlockKind::DeadBrainCoralWallFan => 0u8, + BlockKind::DeadBubbleCoralWallFan => 0u8, + BlockKind::DeadFireCoralWallFan => 0u8, + BlockKind::DeadHornCoralWallFan => 0u8, + BlockKind::TubeCoralWallFan => 0u8, + BlockKind::BrainCoralWallFan => 0u8, + BlockKind::BubbleCoralWallFan => 0u8, + BlockKind::FireCoralWallFan => 0u8, + BlockKind::HornCoralWallFan => 0u8, + BlockKind::SeaPickle => 6u8, + BlockKind::BlueIce => 0u8, + BlockKind::Conduit => 15u8, + BlockKind::BambooSapling => 0u8, + BlockKind::Bamboo => 0u8, + BlockKind::PottedBamboo => 0u8, + BlockKind::VoidAir => 0u8, + BlockKind::CaveAir => 0u8, + BlockKind::BubbleColumn => 0u8, + BlockKind::PolishedGraniteStairs => 0u8, + BlockKind::SmoothRedSandstoneStairs => 0u8, + BlockKind::MossyStoneBrickStairs => 0u8, + BlockKind::PolishedDioriteStairs => 0u8, + BlockKind::MossyCobblestoneStairs => 0u8, + BlockKind::EndStoneBrickStairs => 0u8, + BlockKind::StoneStairs => 0u8, + BlockKind::SmoothSandstoneStairs => 0u8, + BlockKind::SmoothQuartzStairs => 0u8, + BlockKind::GraniteStairs => 0u8, + BlockKind::AndesiteStairs => 0u8, + BlockKind::RedNetherBrickStairs => 0u8, + BlockKind::PolishedAndesiteStairs => 0u8, + BlockKind::DioriteStairs => 0u8, + BlockKind::PolishedGraniteSlab => 0u8, + BlockKind::SmoothRedSandstoneSlab => 0u8, + BlockKind::MossyStoneBrickSlab => 0u8, + BlockKind::PolishedDioriteSlab => 0u8, + BlockKind::MossyCobblestoneSlab => 0u8, + BlockKind::EndStoneBrickSlab => 0u8, + BlockKind::SmoothSandstoneSlab => 0u8, + BlockKind::SmoothQuartzSlab => 0u8, + BlockKind::GraniteSlab => 0u8, + BlockKind::AndesiteSlab => 0u8, + BlockKind::RedNetherBrickSlab => 0u8, + BlockKind::PolishedAndesiteSlab => 0u8, + BlockKind::DioriteSlab => 0u8, + BlockKind::BrickWall => 0u8, + BlockKind::PrismarineWall => 0u8, + BlockKind::RedSandstoneWall => 0u8, + BlockKind::MossyStoneBrickWall => 0u8, + BlockKind::GraniteWall => 0u8, + BlockKind::StoneBrickWall => 0u8, + BlockKind::NetherBrickWall => 0u8, + BlockKind::AndesiteWall => 0u8, + BlockKind::RedNetherBrickWall => 0u8, + BlockKind::SandstoneWall => 0u8, + BlockKind::EndStoneBrickWall => 0u8, + BlockKind::DioriteWall => 0u8, + BlockKind::Scaffolding => 0u8, + BlockKind::Loom => 0u8, + BlockKind::Barrel => 0u8, + BlockKind::Smoker => 0u8, + BlockKind::BlastFurnace => 0u8, + BlockKind::CartographyTable => 0u8, + BlockKind::FletchingTable => 0u8, + BlockKind::Grindstone => 0u8, + BlockKind::Lectern => 0u8, + BlockKind::SmithingTable => 0u8, + BlockKind::Stonecutter => 0u8, + BlockKind::Bell => 0u8, + BlockKind::Lantern => 15u8, + BlockKind::SoulLantern => 10u8, + BlockKind::Campfire => 15u8, + BlockKind::SoulCampfire => 10u8, + BlockKind::SweetBerryBush => 0u8, + BlockKind::WarpedStem => 0u8, + BlockKind::StrippedWarpedStem => 0u8, + BlockKind::WarpedHyphae => 0u8, + BlockKind::StrippedWarpedHyphae => 0u8, + BlockKind::WarpedNylium => 0u8, + BlockKind::WarpedFungus => 0u8, + BlockKind::WarpedWartBlock => 0u8, + BlockKind::WarpedRoots => 0u8, + BlockKind::NetherSprouts => 0u8, + BlockKind::CrimsonStem => 0u8, + BlockKind::StrippedCrimsonStem => 0u8, + BlockKind::CrimsonHyphae => 0u8, + BlockKind::StrippedCrimsonHyphae => 0u8, + BlockKind::CrimsonNylium => 0u8, + BlockKind::CrimsonFungus => 0u8, + BlockKind::Shroomlight => 15u8, + BlockKind::WeepingVines => 0u8, + BlockKind::WeepingVinesPlant => 0u8, + BlockKind::TwistingVines => 0u8, + BlockKind::TwistingVinesPlant => 0u8, + BlockKind::CrimsonRoots => 0u8, + BlockKind::CrimsonPlanks => 0u8, + BlockKind::WarpedPlanks => 0u8, + BlockKind::CrimsonSlab => 0u8, + BlockKind::WarpedSlab => 0u8, + BlockKind::CrimsonPressurePlate => 0u8, + BlockKind::WarpedPressurePlate => 0u8, + BlockKind::CrimsonFence => 0u8, + BlockKind::WarpedFence => 0u8, + BlockKind::CrimsonTrapdoor => 0u8, + BlockKind::WarpedTrapdoor => 0u8, + BlockKind::CrimsonFenceGate => 0u8, + BlockKind::WarpedFenceGate => 0u8, + BlockKind::CrimsonStairs => 0u8, + BlockKind::WarpedStairs => 0u8, + BlockKind::CrimsonButton => 0u8, + BlockKind::WarpedButton => 0u8, + BlockKind::CrimsonDoor => 0u8, + BlockKind::WarpedDoor => 0u8, + BlockKind::CrimsonSign => 0u8, + BlockKind::WarpedSign => 0u8, + BlockKind::CrimsonWallSign => 0u8, + BlockKind::WarpedWallSign => 0u8, + BlockKind::StructureBlock => 0u8, + BlockKind::Jigsaw => 0u8, + BlockKind::Composter => 0u8, + BlockKind::Target => 0u8, + BlockKind::BeeNest => 0u8, + BlockKind::Beehive => 0u8, + BlockKind::HoneyBlock => 0u8, + BlockKind::HoneycombBlock => 0u8, + BlockKind::NetheriteBlock => 0u8, + BlockKind::AncientDebris => 0u8, + BlockKind::CryingObsidian => 10u8, + BlockKind::RespawnAnchor => 0u8, + BlockKind::PottedCrimsonFungus => 0u8, + BlockKind::PottedWarpedFungus => 0u8, + BlockKind::PottedCrimsonRoots => 0u8, + BlockKind::PottedWarpedRoots => 0u8, + BlockKind::Lodestone => 0u8, + BlockKind::Blackstone => 0u8, + BlockKind::BlackstoneStairs => 0u8, + BlockKind::BlackstoneWall => 0u8, + BlockKind::BlackstoneSlab => 0u8, + BlockKind::PolishedBlackstone => 0u8, + BlockKind::PolishedBlackstoneBricks => 0u8, + BlockKind::CrackedPolishedBlackstoneBricks => 0u8, + BlockKind::ChiseledPolishedBlackstone => 0u8, + BlockKind::PolishedBlackstoneBrickSlab => 0u8, + BlockKind::PolishedBlackstoneBrickStairs => 0u8, + BlockKind::PolishedBlackstoneBrickWall => 0u8, + BlockKind::GildedBlackstone => 0u8, + BlockKind::PolishedBlackstoneStairs => 0u8, + BlockKind::PolishedBlackstoneSlab => 0u8, + BlockKind::PolishedBlackstonePressurePlate => 0u8, + BlockKind::PolishedBlackstoneButton => 0u8, + BlockKind::PolishedBlackstoneWall => 0u8, + BlockKind::ChiseledNetherBricks => 0u8, + BlockKind::CrackedNetherBricks => 0u8, + BlockKind::QuartzBricks => 0u8, + BlockKind::Candle => 0u8, + BlockKind::WhiteCandle => 0u8, + BlockKind::OrangeCandle => 0u8, + BlockKind::MagentaCandle => 0u8, + BlockKind::LightBlueCandle => 0u8, + BlockKind::YellowCandle => 0u8, + BlockKind::LimeCandle => 0u8, + BlockKind::PinkCandle => 0u8, + BlockKind::GrayCandle => 0u8, + BlockKind::LightGrayCandle => 0u8, + BlockKind::CyanCandle => 0u8, + BlockKind::PurpleCandle => 0u8, + BlockKind::BlueCandle => 0u8, + BlockKind::BrownCandle => 0u8, + BlockKind::GreenCandle => 0u8, + BlockKind::RedCandle => 0u8, + BlockKind::BlackCandle => 0u8, + BlockKind::CandleCake => 0u8, + BlockKind::WhiteCandleCake => 0u8, + BlockKind::OrangeCandleCake => 0u8, + BlockKind::MagentaCandleCake => 0u8, + BlockKind::LightBlueCandleCake => 0u8, + BlockKind::YellowCandleCake => 0u8, + BlockKind::LimeCandleCake => 0u8, + BlockKind::PinkCandleCake => 0u8, + BlockKind::GrayCandleCake => 0u8, + BlockKind::LightGrayCandleCake => 0u8, + BlockKind::CyanCandleCake => 0u8, + BlockKind::PurpleCandleCake => 0u8, + BlockKind::BlueCandleCake => 0u8, + BlockKind::BrownCandleCake => 0u8, + BlockKind::GreenCandleCake => 0u8, + BlockKind::RedCandleCake => 0u8, + BlockKind::BlackCandleCake => 0u8, + BlockKind::AmethystBlock => 0u8, + BlockKind::BuddingAmethyst => 0u8, + BlockKind::AmethystCluster => 5u8, + BlockKind::LargeAmethystBud => 4u8, + BlockKind::MediumAmethystBud => 2u8, + BlockKind::SmallAmethystBud => 1u8, + BlockKind::Tuff => 0u8, + BlockKind::Calcite => 0u8, + BlockKind::TintedGlass => 0u8, + BlockKind::PowderSnow => 0u8, + BlockKind::SculkSensor => 1u8, + BlockKind::OxidizedCopper => 0u8, + BlockKind::WeatheredCopper => 0u8, + BlockKind::ExposedCopper => 0u8, + BlockKind::CopperBlock => 0u8, + BlockKind::CopperOre => 0u8, + BlockKind::DeepslateCopperOre => 0u8, + BlockKind::OxidizedCutCopper => 0u8, + BlockKind::WeatheredCutCopper => 0u8, + BlockKind::ExposedCutCopper => 0u8, + BlockKind::CutCopper => 0u8, + BlockKind::OxidizedCutCopperStairs => 0u8, + BlockKind::WeatheredCutCopperStairs => 0u8, + BlockKind::ExposedCutCopperStairs => 0u8, + BlockKind::CutCopperStairs => 0u8, + BlockKind::OxidizedCutCopperSlab => 0u8, + BlockKind::WeatheredCutCopperSlab => 0u8, + BlockKind::ExposedCutCopperSlab => 0u8, + BlockKind::CutCopperSlab => 0u8, + BlockKind::WaxedCopperBlock => 0u8, + BlockKind::WaxedWeatheredCopper => 0u8, + BlockKind::WaxedExposedCopper => 0u8, + BlockKind::WaxedOxidizedCopper => 0u8, + BlockKind::WaxedOxidizedCutCopper => 0u8, + BlockKind::WaxedWeatheredCutCopper => 0u8, + BlockKind::WaxedExposedCutCopper => 0u8, + BlockKind::WaxedCutCopper => 0u8, + BlockKind::WaxedOxidizedCutCopperStairs => 0u8, + BlockKind::WaxedWeatheredCutCopperStairs => 0u8, + BlockKind::WaxedExposedCutCopperStairs => 0u8, + BlockKind::WaxedCutCopperStairs => 0u8, + BlockKind::WaxedOxidizedCutCopperSlab => 0u8, + BlockKind::WaxedWeatheredCutCopperSlab => 0u8, + BlockKind::WaxedExposedCutCopperSlab => 0u8, + BlockKind::WaxedCutCopperSlab => 0u8, + BlockKind::LightningRod => 0u8, + BlockKind::PointedDripstone => 0u8, + BlockKind::DripstoneBlock => 0u8, + BlockKind::CaveVines => 0u8, + BlockKind::CaveVinesPlant => 0u8, + BlockKind::SporeBlossom => 0u8, + BlockKind::Azalea => 0u8, + BlockKind::FloweringAzalea => 0u8, + BlockKind::MossCarpet => 0u8, + BlockKind::MossBlock => 0u8, + BlockKind::BigDripleaf => 0u8, + BlockKind::BigDripleafStem => 0u8, + BlockKind::SmallDripleaf => 0u8, + BlockKind::HangingRoots => 0u8, + BlockKind::RootedDirt => 0u8, + BlockKind::Deepslate => 0u8, + BlockKind::CobbledDeepslate => 0u8, + BlockKind::CobbledDeepslateStairs => 0u8, + BlockKind::CobbledDeepslateSlab => 0u8, + BlockKind::CobbledDeepslateWall => 0u8, + BlockKind::PolishedDeepslate => 0u8, + BlockKind::PolishedDeepslateStairs => 0u8, + BlockKind::PolishedDeepslateSlab => 0u8, + BlockKind::PolishedDeepslateWall => 0u8, + BlockKind::DeepslateTiles => 0u8, + BlockKind::DeepslateTileStairs => 0u8, + BlockKind::DeepslateTileSlab => 0u8, + BlockKind::DeepslateTileWall => 0u8, + BlockKind::DeepslateBricks => 0u8, + BlockKind::DeepslateBrickStairs => 0u8, + BlockKind::DeepslateBrickSlab => 0u8, + BlockKind::DeepslateBrickWall => 0u8, + BlockKind::ChiseledDeepslate => 0u8, + BlockKind::CrackedDeepslateBricks => 0u8, + BlockKind::CrackedDeepslateTiles => 0u8, + BlockKind::InfestedDeepslate => 0u8, + BlockKind::SmoothBasalt => 0u8, + BlockKind::RawIronBlock => 0u8, + BlockKind::RawCopperBlock => 0u8, + BlockKind::RawGoldBlock => 0u8, + BlockKind::PottedAzaleaBush => 0u8, + BlockKind::PottedFloweringAzaleaBush => 0u8, + } + } +} +impl BlockKind { + #[doc = "Returns the `light_filter` property of this `BlockKind`."] + #[inline] + pub fn light_filter(&self) -> u8 { + match self { + BlockKind::Air => 0u8, + BlockKind::Stone => 15u8, + BlockKind::Granite => 15u8, + BlockKind::PolishedGranite => 15u8, + BlockKind::Diorite => 15u8, + BlockKind::PolishedDiorite => 15u8, + BlockKind::Andesite => 15u8, + BlockKind::PolishedAndesite => 15u8, + BlockKind::GrassBlock => 15u8, + BlockKind::Dirt => 15u8, + BlockKind::CoarseDirt => 15u8, + BlockKind::Podzol => 15u8, + BlockKind::Cobblestone => 15u8, + BlockKind::OakPlanks => 15u8, + BlockKind::SprucePlanks => 15u8, + BlockKind::BirchPlanks => 15u8, + BlockKind::JunglePlanks => 15u8, + BlockKind::AcaciaPlanks => 15u8, + BlockKind::DarkOakPlanks => 15u8, + BlockKind::OakSapling => 0u8, + BlockKind::SpruceSapling => 0u8, + BlockKind::BirchSapling => 0u8, + BlockKind::JungleSapling => 0u8, + BlockKind::AcaciaSapling => 0u8, + BlockKind::DarkOakSapling => 0u8, + BlockKind::Bedrock => 15u8, + BlockKind::Water => 1u8, + BlockKind::Lava => 1u8, + BlockKind::Sand => 15u8, + BlockKind::RedSand => 15u8, + BlockKind::Gravel => 15u8, + BlockKind::GoldOre => 15u8, + BlockKind::DeepslateGoldOre => 15u8, + BlockKind::IronOre => 15u8, + BlockKind::DeepslateIronOre => 15u8, + BlockKind::CoalOre => 15u8, + BlockKind::DeepslateCoalOre => 15u8, + BlockKind::NetherGoldOre => 15u8, + BlockKind::OakLog => 15u8, + BlockKind::SpruceLog => 15u8, + BlockKind::BirchLog => 15u8, + BlockKind::JungleLog => 15u8, + BlockKind::AcaciaLog => 15u8, + BlockKind::DarkOakLog => 15u8, + BlockKind::StrippedSpruceLog => 15u8, + BlockKind::StrippedBirchLog => 15u8, + BlockKind::StrippedJungleLog => 15u8, + BlockKind::StrippedAcaciaLog => 15u8, + BlockKind::StrippedDarkOakLog => 15u8, + BlockKind::StrippedOakLog => 15u8, + BlockKind::OakWood => 15u8, + BlockKind::SpruceWood => 15u8, + BlockKind::BirchWood => 15u8, + BlockKind::JungleWood => 15u8, + BlockKind::AcaciaWood => 15u8, + BlockKind::DarkOakWood => 15u8, + BlockKind::StrippedOakWood => 15u8, + BlockKind::StrippedSpruceWood => 15u8, + BlockKind::StrippedBirchWood => 15u8, + BlockKind::StrippedJungleWood => 15u8, + BlockKind::StrippedAcaciaWood => 15u8, + BlockKind::StrippedDarkOakWood => 15u8, + BlockKind::OakLeaves => 1u8, + BlockKind::SpruceLeaves => 1u8, + BlockKind::BirchLeaves => 1u8, + BlockKind::JungleLeaves => 1u8, + BlockKind::AcaciaLeaves => 1u8, + BlockKind::DarkOakLeaves => 1u8, + BlockKind::AzaleaLeaves => 1u8, + BlockKind::FloweringAzaleaLeaves => 1u8, + BlockKind::Sponge => 15u8, + BlockKind::WetSponge => 15u8, + BlockKind::Glass => 0u8, + BlockKind::LapisOre => 15u8, + BlockKind::DeepslateLapisOre => 15u8, + BlockKind::LapisBlock => 15u8, + BlockKind::Dispenser => 15u8, + BlockKind::Sandstone => 15u8, + BlockKind::ChiseledSandstone => 15u8, + BlockKind::CutSandstone => 15u8, + BlockKind::NoteBlock => 15u8, + BlockKind::WhiteBed => 0u8, + BlockKind::OrangeBed => 0u8, + BlockKind::MagentaBed => 0u8, + BlockKind::LightBlueBed => 0u8, + BlockKind::YellowBed => 0u8, + BlockKind::LimeBed => 0u8, + BlockKind::PinkBed => 0u8, + BlockKind::GrayBed => 0u8, + BlockKind::LightGrayBed => 0u8, + BlockKind::CyanBed => 0u8, + BlockKind::PurpleBed => 0u8, + BlockKind::BlueBed => 0u8, + BlockKind::BrownBed => 0u8, + BlockKind::GreenBed => 0u8, + BlockKind::RedBed => 0u8, + BlockKind::BlackBed => 0u8, + BlockKind::PoweredRail => 0u8, + BlockKind::DetectorRail => 0u8, + BlockKind::StickyPiston => 15u8, + BlockKind::Cobweb => 1u8, + BlockKind::Grass => 0u8, + BlockKind::Fern => 0u8, + BlockKind::DeadBush => 0u8, + BlockKind::Seagrass => 1u8, + BlockKind::TallSeagrass => 1u8, + BlockKind::Piston => 15u8, + BlockKind::PistonHead => 0u8, + BlockKind::WhiteWool => 15u8, + BlockKind::OrangeWool => 15u8, + BlockKind::MagentaWool => 15u8, + BlockKind::LightBlueWool => 15u8, + BlockKind::YellowWool => 15u8, + BlockKind::LimeWool => 15u8, + BlockKind::PinkWool => 15u8, + BlockKind::GrayWool => 15u8, + BlockKind::LightGrayWool => 15u8, + BlockKind::CyanWool => 15u8, + BlockKind::PurpleWool => 15u8, + BlockKind::BlueWool => 15u8, + BlockKind::BrownWool => 15u8, + BlockKind::GreenWool => 15u8, + BlockKind::RedWool => 15u8, + BlockKind::BlackWool => 15u8, + BlockKind::MovingPiston => 0u8, + BlockKind::Dandelion => 0u8, + BlockKind::Poppy => 0u8, + BlockKind::BlueOrchid => 0u8, + BlockKind::Allium => 0u8, + BlockKind::AzureBluet => 0u8, + BlockKind::RedTulip => 0u8, + BlockKind::OrangeTulip => 0u8, + BlockKind::WhiteTulip => 0u8, + BlockKind::PinkTulip => 0u8, + BlockKind::OxeyeDaisy => 0u8, + BlockKind::Cornflower => 0u8, + BlockKind::WitherRose => 0u8, + BlockKind::LilyOfTheValley => 0u8, + BlockKind::BrownMushroom => 0u8, + BlockKind::RedMushroom => 0u8, + BlockKind::GoldBlock => 15u8, + BlockKind::IronBlock => 15u8, + BlockKind::Bricks => 15u8, + BlockKind::Tnt => 15u8, + BlockKind::Bookshelf => 15u8, + BlockKind::MossyCobblestone => 15u8, + BlockKind::Obsidian => 15u8, + BlockKind::Torch => 0u8, + BlockKind::WallTorch => 0u8, + BlockKind::Fire => 0u8, + BlockKind::SoulFire => 0u8, + BlockKind::Spawner => 1u8, + BlockKind::OakStairs => 0u8, + BlockKind::Chest => 0u8, + BlockKind::RedstoneWire => 0u8, + BlockKind::DiamondOre => 15u8, + BlockKind::DeepslateDiamondOre => 15u8, + BlockKind::DiamondBlock => 15u8, + BlockKind::CraftingTable => 15u8, + BlockKind::Wheat => 0u8, + BlockKind::Farmland => 0u8, + BlockKind::Furnace => 15u8, + BlockKind::OakSign => 0u8, + BlockKind::SpruceSign => 0u8, + BlockKind::BirchSign => 0u8, + BlockKind::AcaciaSign => 0u8, + BlockKind::JungleSign => 0u8, + BlockKind::DarkOakSign => 0u8, + BlockKind::OakDoor => 0u8, + BlockKind::Ladder => 0u8, + BlockKind::Rail => 0u8, + BlockKind::CobblestoneStairs => 0u8, + BlockKind::OakWallSign => 0u8, + BlockKind::SpruceWallSign => 0u8, + BlockKind::BirchWallSign => 0u8, + BlockKind::AcaciaWallSign => 0u8, + BlockKind::JungleWallSign => 0u8, + BlockKind::DarkOakWallSign => 0u8, + BlockKind::Lever => 0u8, + BlockKind::StonePressurePlate => 0u8, + BlockKind::IronDoor => 0u8, + BlockKind::OakPressurePlate => 0u8, + BlockKind::SprucePressurePlate => 0u8, + BlockKind::BirchPressurePlate => 0u8, + BlockKind::JunglePressurePlate => 0u8, + BlockKind::AcaciaPressurePlate => 0u8, + BlockKind::DarkOakPressurePlate => 0u8, + BlockKind::RedstoneOre => 15u8, + BlockKind::DeepslateRedstoneOre => 15u8, + BlockKind::RedstoneTorch => 0u8, + BlockKind::RedstoneWallTorch => 0u8, + BlockKind::StoneButton => 0u8, + BlockKind::Snow => 0u8, + BlockKind::Ice => 1u8, + BlockKind::SnowBlock => 15u8, + BlockKind::Cactus => 0u8, + BlockKind::Clay => 15u8, + BlockKind::SugarCane => 0u8, + BlockKind::Jukebox => 15u8, + BlockKind::OakFence => 0u8, + BlockKind::Pumpkin => 15u8, + BlockKind::Netherrack => 15u8, + BlockKind::SoulSand => 15u8, + BlockKind::SoulSoil => 15u8, + BlockKind::Basalt => 15u8, + BlockKind::PolishedBasalt => 15u8, + BlockKind::SoulTorch => 0u8, + BlockKind::SoulWallTorch => 0u8, + BlockKind::Glowstone => 15u8, + BlockKind::NetherPortal => 0u8, + BlockKind::CarvedPumpkin => 15u8, + BlockKind::JackOLantern => 15u8, + BlockKind::Cake => 0u8, + BlockKind::Repeater => 0u8, + BlockKind::WhiteStainedGlass => 0u8, + BlockKind::OrangeStainedGlass => 0u8, + BlockKind::MagentaStainedGlass => 0u8, + BlockKind::LightBlueStainedGlass => 0u8, + BlockKind::YellowStainedGlass => 0u8, + BlockKind::LimeStainedGlass => 0u8, + BlockKind::PinkStainedGlass => 0u8, + BlockKind::GrayStainedGlass => 0u8, + BlockKind::LightGrayStainedGlass => 0u8, + BlockKind::CyanStainedGlass => 0u8, + BlockKind::PurpleStainedGlass => 0u8, + BlockKind::BlueStainedGlass => 0u8, + BlockKind::BrownStainedGlass => 0u8, + BlockKind::GreenStainedGlass => 0u8, + BlockKind::RedStainedGlass => 0u8, + BlockKind::BlackStainedGlass => 0u8, + BlockKind::OakTrapdoor => 0u8, + BlockKind::SpruceTrapdoor => 0u8, + BlockKind::BirchTrapdoor => 0u8, + BlockKind::JungleTrapdoor => 0u8, + BlockKind::AcaciaTrapdoor => 0u8, + BlockKind::DarkOakTrapdoor => 0u8, + BlockKind::StoneBricks => 15u8, + BlockKind::MossyStoneBricks => 15u8, + BlockKind::CrackedStoneBricks => 15u8, + BlockKind::ChiseledStoneBricks => 15u8, + BlockKind::InfestedStone => 15u8, + BlockKind::InfestedCobblestone => 15u8, + BlockKind::InfestedStoneBricks => 15u8, + BlockKind::InfestedMossyStoneBricks => 15u8, + BlockKind::InfestedCrackedStoneBricks => 15u8, + BlockKind::InfestedChiseledStoneBricks => 15u8, + BlockKind::BrownMushroomBlock => 15u8, + BlockKind::RedMushroomBlock => 15u8, + BlockKind::MushroomStem => 15u8, + BlockKind::IronBars => 0u8, + BlockKind::Chain => 0u8, + BlockKind::GlassPane => 0u8, + BlockKind::Melon => 15u8, + BlockKind::AttachedPumpkinStem => 0u8, + BlockKind::AttachedMelonStem => 0u8, + BlockKind::PumpkinStem => 0u8, + BlockKind::MelonStem => 0u8, + BlockKind::Vine => 0u8, + BlockKind::GlowLichen => 0u8, + BlockKind::OakFenceGate => 0u8, + BlockKind::BrickStairs => 0u8, + BlockKind::StoneBrickStairs => 0u8, + BlockKind::Mycelium => 15u8, + BlockKind::LilyPad => 0u8, + BlockKind::NetherBricks => 15u8, + BlockKind::NetherBrickFence => 0u8, + BlockKind::NetherBrickStairs => 0u8, + BlockKind::NetherWart => 0u8, + BlockKind::EnchantingTable => 0u8, + BlockKind::BrewingStand => 0u8, + BlockKind::Cauldron => 0u8, + BlockKind::WaterCauldron => 0u8, + BlockKind::LavaCauldron => 0u8, + BlockKind::PowderSnowCauldron => 0u8, + BlockKind::EndPortal => 0u8, + BlockKind::EndPortalFrame => 0u8, + BlockKind::EndStone => 15u8, + BlockKind::DragonEgg => 0u8, + BlockKind::RedstoneLamp => 15u8, + BlockKind::Cocoa => 0u8, + BlockKind::SandstoneStairs => 0u8, + BlockKind::EmeraldOre => 15u8, + BlockKind::DeepslateEmeraldOre => 15u8, + BlockKind::EnderChest => 0u8, + BlockKind::TripwireHook => 0u8, + BlockKind::Tripwire => 0u8, + BlockKind::EmeraldBlock => 15u8, + BlockKind::SpruceStairs => 0u8, + BlockKind::BirchStairs => 0u8, + BlockKind::JungleStairs => 0u8, + BlockKind::CommandBlock => 15u8, + BlockKind::Beacon => 1u8, + BlockKind::CobblestoneWall => 0u8, + BlockKind::MossyCobblestoneWall => 0u8, + BlockKind::FlowerPot => 0u8, + BlockKind::PottedOakSapling => 0u8, + BlockKind::PottedSpruceSapling => 0u8, + BlockKind::PottedBirchSapling => 0u8, + BlockKind::PottedJungleSapling => 0u8, + BlockKind::PottedAcaciaSapling => 0u8, + BlockKind::PottedDarkOakSapling => 0u8, + BlockKind::PottedFern => 0u8, + BlockKind::PottedDandelion => 0u8, + BlockKind::PottedPoppy => 0u8, + BlockKind::PottedBlueOrchid => 0u8, + BlockKind::PottedAllium => 0u8, + BlockKind::PottedAzureBluet => 0u8, + BlockKind::PottedRedTulip => 0u8, + BlockKind::PottedOrangeTulip => 0u8, + BlockKind::PottedWhiteTulip => 0u8, + BlockKind::PottedPinkTulip => 0u8, + BlockKind::PottedOxeyeDaisy => 0u8, + BlockKind::PottedCornflower => 0u8, + BlockKind::PottedLilyOfTheValley => 0u8, + BlockKind::PottedWitherRose => 0u8, + BlockKind::PottedRedMushroom => 0u8, + BlockKind::PottedBrownMushroom => 0u8, + BlockKind::PottedDeadBush => 0u8, + BlockKind::PottedCactus => 0u8, + BlockKind::Carrots => 0u8, + BlockKind::Potatoes => 0u8, + BlockKind::OakButton => 0u8, + BlockKind::SpruceButton => 0u8, + BlockKind::BirchButton => 0u8, + BlockKind::JungleButton => 0u8, + BlockKind::AcaciaButton => 0u8, + BlockKind::DarkOakButton => 0u8, + BlockKind::SkeletonSkull => 0u8, + BlockKind::SkeletonWallSkull => 0u8, + BlockKind::WitherSkeletonSkull => 0u8, + BlockKind::WitherSkeletonWallSkull => 0u8, + BlockKind::ZombieHead => 0u8, + BlockKind::ZombieWallHead => 0u8, + BlockKind::PlayerHead => 0u8, + BlockKind::PlayerWallHead => 0u8, + BlockKind::CreeperHead => 0u8, + BlockKind::CreeperWallHead => 0u8, + BlockKind::DragonHead => 0u8, + BlockKind::DragonWallHead => 0u8, + BlockKind::Anvil => 0u8, + BlockKind::ChippedAnvil => 0u8, + BlockKind::DamagedAnvil => 0u8, + BlockKind::TrappedChest => 0u8, + BlockKind::LightWeightedPressurePlate => 0u8, + BlockKind::HeavyWeightedPressurePlate => 0u8, + BlockKind::Comparator => 0u8, + BlockKind::DaylightDetector => 0u8, + BlockKind::RedstoneBlock => 15u8, + BlockKind::NetherQuartzOre => 15u8, + BlockKind::Hopper => 0u8, + BlockKind::QuartzBlock => 15u8, + BlockKind::ChiseledQuartzBlock => 15u8, + BlockKind::QuartzPillar => 15u8, + BlockKind::QuartzStairs => 0u8, + BlockKind::ActivatorRail => 0u8, + BlockKind::Dropper => 15u8, + BlockKind::WhiteTerracotta => 15u8, + BlockKind::OrangeTerracotta => 15u8, + BlockKind::MagentaTerracotta => 15u8, + BlockKind::LightBlueTerracotta => 15u8, + BlockKind::YellowTerracotta => 15u8, + BlockKind::LimeTerracotta => 15u8, + BlockKind::PinkTerracotta => 15u8, + BlockKind::GrayTerracotta => 15u8, + BlockKind::LightGrayTerracotta => 15u8, + BlockKind::CyanTerracotta => 15u8, + BlockKind::PurpleTerracotta => 15u8, + BlockKind::BlueTerracotta => 15u8, + BlockKind::BrownTerracotta => 15u8, + BlockKind::GreenTerracotta => 15u8, + BlockKind::RedTerracotta => 15u8, + BlockKind::BlackTerracotta => 15u8, + BlockKind::WhiteStainedGlassPane => 0u8, + BlockKind::OrangeStainedGlassPane => 0u8, + BlockKind::MagentaStainedGlassPane => 0u8, + BlockKind::LightBlueStainedGlassPane => 0u8, + BlockKind::YellowStainedGlassPane => 0u8, + BlockKind::LimeStainedGlassPane => 0u8, + BlockKind::PinkStainedGlassPane => 0u8, + BlockKind::GrayStainedGlassPane => 0u8, + BlockKind::LightGrayStainedGlassPane => 0u8, + BlockKind::CyanStainedGlassPane => 0u8, + BlockKind::PurpleStainedGlassPane => 0u8, + BlockKind::BlueStainedGlassPane => 0u8, + BlockKind::BrownStainedGlassPane => 0u8, + BlockKind::GreenStainedGlassPane => 0u8, + BlockKind::RedStainedGlassPane => 0u8, + BlockKind::BlackStainedGlassPane => 0u8, + BlockKind::AcaciaStairs => 0u8, + BlockKind::DarkOakStairs => 0u8, + BlockKind::SlimeBlock => 1u8, + BlockKind::Barrier => 0u8, + BlockKind::Light => 0u8, + BlockKind::IronTrapdoor => 0u8, + BlockKind::Prismarine => 15u8, + BlockKind::PrismarineBricks => 15u8, + BlockKind::DarkPrismarine => 15u8, + BlockKind::PrismarineStairs => 0u8, + BlockKind::PrismarineBrickStairs => 0u8, + BlockKind::DarkPrismarineStairs => 0u8, + BlockKind::PrismarineSlab => 0u8, + BlockKind::PrismarineBrickSlab => 0u8, + BlockKind::DarkPrismarineSlab => 0u8, + BlockKind::SeaLantern => 15u8, + BlockKind::HayBlock => 15u8, + BlockKind::WhiteCarpet => 0u8, + BlockKind::OrangeCarpet => 0u8, + BlockKind::MagentaCarpet => 0u8, + BlockKind::LightBlueCarpet => 0u8, + BlockKind::YellowCarpet => 0u8, + BlockKind::LimeCarpet => 0u8, + BlockKind::PinkCarpet => 0u8, + BlockKind::GrayCarpet => 0u8, + BlockKind::LightGrayCarpet => 0u8, + BlockKind::CyanCarpet => 0u8, + BlockKind::PurpleCarpet => 0u8, + BlockKind::BlueCarpet => 0u8, + BlockKind::BrownCarpet => 0u8, + BlockKind::GreenCarpet => 0u8, + BlockKind::RedCarpet => 0u8, + BlockKind::BlackCarpet => 0u8, + BlockKind::Terracotta => 15u8, + BlockKind::CoalBlock => 15u8, + BlockKind::PackedIce => 15u8, + BlockKind::Sunflower => 0u8, + BlockKind::Lilac => 0u8, + BlockKind::RoseBush => 0u8, + BlockKind::Peony => 0u8, + BlockKind::TallGrass => 0u8, + BlockKind::LargeFern => 0u8, + BlockKind::WhiteBanner => 0u8, + BlockKind::OrangeBanner => 0u8, + BlockKind::MagentaBanner => 0u8, + BlockKind::LightBlueBanner => 0u8, + BlockKind::YellowBanner => 0u8, + BlockKind::LimeBanner => 0u8, + BlockKind::PinkBanner => 0u8, + BlockKind::GrayBanner => 0u8, + BlockKind::LightGrayBanner => 0u8, + BlockKind::CyanBanner => 0u8, + BlockKind::PurpleBanner => 0u8, + BlockKind::BlueBanner => 0u8, + BlockKind::BrownBanner => 0u8, + BlockKind::GreenBanner => 0u8, + BlockKind::RedBanner => 0u8, + BlockKind::BlackBanner => 0u8, + BlockKind::WhiteWallBanner => 0u8, + BlockKind::OrangeWallBanner => 0u8, + BlockKind::MagentaWallBanner => 0u8, + BlockKind::LightBlueWallBanner => 0u8, + BlockKind::YellowWallBanner => 0u8, + BlockKind::LimeWallBanner => 0u8, + BlockKind::PinkWallBanner => 0u8, + BlockKind::GrayWallBanner => 0u8, + BlockKind::LightGrayWallBanner => 0u8, + BlockKind::CyanWallBanner => 0u8, + BlockKind::PurpleWallBanner => 0u8, + BlockKind::BlueWallBanner => 0u8, + BlockKind::BrownWallBanner => 0u8, + BlockKind::GreenWallBanner => 0u8, + BlockKind::RedWallBanner => 0u8, + BlockKind::BlackWallBanner => 0u8, + BlockKind::RedSandstone => 15u8, + BlockKind::ChiseledRedSandstone => 15u8, + BlockKind::CutRedSandstone => 15u8, + BlockKind::RedSandstoneStairs => 0u8, + BlockKind::OakSlab => 0u8, + BlockKind::SpruceSlab => 0u8, + BlockKind::BirchSlab => 0u8, + BlockKind::JungleSlab => 0u8, + BlockKind::AcaciaSlab => 0u8, + BlockKind::DarkOakSlab => 0u8, + BlockKind::StoneSlab => 0u8, + BlockKind::SmoothStoneSlab => 0u8, + BlockKind::SandstoneSlab => 0u8, + BlockKind::CutSandstoneSlab => 0u8, + BlockKind::PetrifiedOakSlab => 0u8, + BlockKind::CobblestoneSlab => 0u8, + BlockKind::BrickSlab => 0u8, + BlockKind::StoneBrickSlab => 0u8, + BlockKind::NetherBrickSlab => 0u8, + BlockKind::QuartzSlab => 0u8, + BlockKind::RedSandstoneSlab => 0u8, + BlockKind::CutRedSandstoneSlab => 0u8, + BlockKind::PurpurSlab => 0u8, + BlockKind::SmoothStone => 15u8, + BlockKind::SmoothSandstone => 15u8, + BlockKind::SmoothQuartz => 15u8, + BlockKind::SmoothRedSandstone => 15u8, + BlockKind::SpruceFenceGate => 0u8, + BlockKind::BirchFenceGate => 0u8, + BlockKind::JungleFenceGate => 0u8, + BlockKind::AcaciaFenceGate => 0u8, + BlockKind::DarkOakFenceGate => 0u8, + BlockKind::SpruceFence => 0u8, + BlockKind::BirchFence => 0u8, + BlockKind::JungleFence => 0u8, + BlockKind::AcaciaFence => 0u8, + BlockKind::DarkOakFence => 0u8, + BlockKind::SpruceDoor => 0u8, + BlockKind::BirchDoor => 0u8, + BlockKind::JungleDoor => 0u8, + BlockKind::AcaciaDoor => 0u8, + BlockKind::DarkOakDoor => 0u8, + BlockKind::EndRod => 0u8, + BlockKind::ChorusPlant => 1u8, + BlockKind::ChorusFlower => 1u8, + BlockKind::PurpurBlock => 15u8, + BlockKind::PurpurPillar => 15u8, + BlockKind::PurpurStairs => 0u8, + BlockKind::EndStoneBricks => 15u8, + BlockKind::Beetroots => 0u8, + BlockKind::DirtPath => 0u8, + BlockKind::EndGateway => 1u8, + BlockKind::RepeatingCommandBlock => 15u8, + BlockKind::ChainCommandBlock => 15u8, + BlockKind::FrostedIce => 1u8, + BlockKind::MagmaBlock => 15u8, + BlockKind::NetherWartBlock => 15u8, + BlockKind::RedNetherBricks => 15u8, + BlockKind::BoneBlock => 15u8, + BlockKind::StructureVoid => 0u8, + BlockKind::Observer => 15u8, + BlockKind::ShulkerBox => 1u8, + BlockKind::WhiteShulkerBox => 1u8, + BlockKind::OrangeShulkerBox => 1u8, + BlockKind::MagentaShulkerBox => 1u8, + BlockKind::LightBlueShulkerBox => 1u8, + BlockKind::YellowShulkerBox => 1u8, + BlockKind::LimeShulkerBox => 1u8, + BlockKind::PinkShulkerBox => 1u8, + BlockKind::GrayShulkerBox => 1u8, + BlockKind::LightGrayShulkerBox => 1u8, + BlockKind::CyanShulkerBox => 1u8, + BlockKind::PurpleShulkerBox => 1u8, + BlockKind::BlueShulkerBox => 1u8, + BlockKind::BrownShulkerBox => 1u8, + BlockKind::GreenShulkerBox => 1u8, + BlockKind::RedShulkerBox => 1u8, + BlockKind::BlackShulkerBox => 1u8, + BlockKind::WhiteGlazedTerracotta => 15u8, + BlockKind::OrangeGlazedTerracotta => 15u8, + BlockKind::MagentaGlazedTerracotta => 15u8, + BlockKind::LightBlueGlazedTerracotta => 15u8, + BlockKind::YellowGlazedTerracotta => 15u8, + BlockKind::LimeGlazedTerracotta => 15u8, + BlockKind::PinkGlazedTerracotta => 15u8, + BlockKind::GrayGlazedTerracotta => 15u8, + BlockKind::LightGrayGlazedTerracotta => 15u8, + BlockKind::CyanGlazedTerracotta => 15u8, + BlockKind::PurpleGlazedTerracotta => 15u8, + BlockKind::BlueGlazedTerracotta => 15u8, + BlockKind::BrownGlazedTerracotta => 15u8, + BlockKind::GreenGlazedTerracotta => 15u8, + BlockKind::RedGlazedTerracotta => 15u8, + BlockKind::BlackGlazedTerracotta => 15u8, + BlockKind::WhiteConcrete => 15u8, + BlockKind::OrangeConcrete => 15u8, + BlockKind::MagentaConcrete => 15u8, + BlockKind::LightBlueConcrete => 15u8, + BlockKind::YellowConcrete => 15u8, + BlockKind::LimeConcrete => 15u8, + BlockKind::PinkConcrete => 15u8, + BlockKind::GrayConcrete => 15u8, + BlockKind::LightGrayConcrete => 15u8, + BlockKind::CyanConcrete => 15u8, + BlockKind::PurpleConcrete => 15u8, + BlockKind::BlueConcrete => 15u8, + BlockKind::BrownConcrete => 15u8, + BlockKind::GreenConcrete => 15u8, + BlockKind::RedConcrete => 15u8, + BlockKind::BlackConcrete => 15u8, + BlockKind::WhiteConcretePowder => 15u8, + BlockKind::OrangeConcretePowder => 15u8, + BlockKind::MagentaConcretePowder => 15u8, + BlockKind::LightBlueConcretePowder => 15u8, + BlockKind::YellowConcretePowder => 15u8, + BlockKind::LimeConcretePowder => 15u8, + BlockKind::PinkConcretePowder => 15u8, + BlockKind::GrayConcretePowder => 15u8, + BlockKind::LightGrayConcretePowder => 15u8, + BlockKind::CyanConcretePowder => 15u8, + BlockKind::PurpleConcretePowder => 15u8, + BlockKind::BlueConcretePowder => 15u8, + BlockKind::BrownConcretePowder => 15u8, + BlockKind::GreenConcretePowder => 15u8, + BlockKind::RedConcretePowder => 15u8, + BlockKind::BlackConcretePowder => 15u8, + BlockKind::Kelp => 1u8, + BlockKind::KelpPlant => 1u8, + BlockKind::DriedKelpBlock => 15u8, + BlockKind::TurtleEgg => 0u8, + BlockKind::DeadTubeCoralBlock => 15u8, + BlockKind::DeadBrainCoralBlock => 15u8, + BlockKind::DeadBubbleCoralBlock => 15u8, + BlockKind::DeadFireCoralBlock => 15u8, + BlockKind::DeadHornCoralBlock => 15u8, + BlockKind::TubeCoralBlock => 15u8, + BlockKind::BrainCoralBlock => 15u8, + BlockKind::BubbleCoralBlock => 15u8, + BlockKind::FireCoralBlock => 15u8, + BlockKind::HornCoralBlock => 15u8, + BlockKind::DeadTubeCoral => 1u8, + BlockKind::DeadBrainCoral => 1u8, + BlockKind::DeadBubbleCoral => 1u8, + BlockKind::DeadFireCoral => 1u8, + BlockKind::DeadHornCoral => 1u8, + BlockKind::TubeCoral => 1u8, + BlockKind::BrainCoral => 1u8, + BlockKind::BubbleCoral => 1u8, + BlockKind::FireCoral => 1u8, + BlockKind::HornCoral => 1u8, + BlockKind::DeadTubeCoralFan => 1u8, + BlockKind::DeadBrainCoralFan => 1u8, + BlockKind::DeadBubbleCoralFan => 1u8, + BlockKind::DeadFireCoralFan => 1u8, + BlockKind::DeadHornCoralFan => 1u8, + BlockKind::TubeCoralFan => 1u8, + BlockKind::BrainCoralFan => 1u8, + BlockKind::BubbleCoralFan => 1u8, + BlockKind::FireCoralFan => 1u8, + BlockKind::HornCoralFan => 1u8, + BlockKind::DeadTubeCoralWallFan => 1u8, + BlockKind::DeadBrainCoralWallFan => 1u8, + BlockKind::DeadBubbleCoralWallFan => 1u8, + BlockKind::DeadFireCoralWallFan => 1u8, + BlockKind::DeadHornCoralWallFan => 1u8, + BlockKind::TubeCoralWallFan => 1u8, + BlockKind::BrainCoralWallFan => 1u8, + BlockKind::BubbleCoralWallFan => 1u8, + BlockKind::FireCoralWallFan => 1u8, + BlockKind::HornCoralWallFan => 1u8, + BlockKind::SeaPickle => 1u8, + BlockKind::BlueIce => 15u8, + BlockKind::Conduit => 1u8, + BlockKind::BambooSapling => 0u8, + BlockKind::Bamboo => 0u8, + BlockKind::PottedBamboo => 0u8, + BlockKind::VoidAir => 0u8, + BlockKind::CaveAir => 0u8, + BlockKind::BubbleColumn => 1u8, + BlockKind::PolishedGraniteStairs => 0u8, + BlockKind::SmoothRedSandstoneStairs => 0u8, + BlockKind::MossyStoneBrickStairs => 0u8, + BlockKind::PolishedDioriteStairs => 0u8, + BlockKind::MossyCobblestoneStairs => 0u8, + BlockKind::EndStoneBrickStairs => 0u8, + BlockKind::StoneStairs => 0u8, + BlockKind::SmoothSandstoneStairs => 0u8, + BlockKind::SmoothQuartzStairs => 0u8, + BlockKind::GraniteStairs => 0u8, + BlockKind::AndesiteStairs => 0u8, + BlockKind::RedNetherBrickStairs => 0u8, + BlockKind::PolishedAndesiteStairs => 0u8, + BlockKind::DioriteStairs => 0u8, + BlockKind::PolishedGraniteSlab => 0u8, + BlockKind::SmoothRedSandstoneSlab => 0u8, + BlockKind::MossyStoneBrickSlab => 0u8, + BlockKind::PolishedDioriteSlab => 0u8, + BlockKind::MossyCobblestoneSlab => 0u8, + BlockKind::EndStoneBrickSlab => 0u8, + BlockKind::SmoothSandstoneSlab => 0u8, + BlockKind::SmoothQuartzSlab => 0u8, + BlockKind::GraniteSlab => 0u8, + BlockKind::AndesiteSlab => 0u8, + BlockKind::RedNetherBrickSlab => 0u8, + BlockKind::PolishedAndesiteSlab => 0u8, + BlockKind::DioriteSlab => 0u8, + BlockKind::BrickWall => 0u8, + BlockKind::PrismarineWall => 0u8, + BlockKind::RedSandstoneWall => 0u8, + BlockKind::MossyStoneBrickWall => 0u8, + BlockKind::GraniteWall => 0u8, + BlockKind::StoneBrickWall => 0u8, + BlockKind::NetherBrickWall => 0u8, + BlockKind::AndesiteWall => 0u8, + BlockKind::RedNetherBrickWall => 0u8, + BlockKind::SandstoneWall => 0u8, + BlockKind::EndStoneBrickWall => 0u8, + BlockKind::DioriteWall => 0u8, + BlockKind::Scaffolding => 0u8, + BlockKind::Loom => 15u8, + BlockKind::Barrel => 15u8, + BlockKind::Smoker => 15u8, + BlockKind::BlastFurnace => 15u8, + BlockKind::CartographyTable => 15u8, + BlockKind::FletchingTable => 15u8, + BlockKind::Grindstone => 0u8, + BlockKind::Lectern => 0u8, + BlockKind::SmithingTable => 15u8, + BlockKind::Stonecutter => 0u8, + BlockKind::Bell => 0u8, + BlockKind::Lantern => 0u8, + BlockKind::SoulLantern => 0u8, + BlockKind::Campfire => 0u8, + BlockKind::SoulCampfire => 0u8, + BlockKind::SweetBerryBush => 0u8, + BlockKind::WarpedStem => 15u8, + BlockKind::StrippedWarpedStem => 15u8, + BlockKind::WarpedHyphae => 15u8, + BlockKind::StrippedWarpedHyphae => 15u8, + BlockKind::WarpedNylium => 15u8, + BlockKind::WarpedFungus => 0u8, + BlockKind::WarpedWartBlock => 15u8, + BlockKind::WarpedRoots => 0u8, + BlockKind::NetherSprouts => 0u8, + BlockKind::CrimsonStem => 15u8, + BlockKind::StrippedCrimsonStem => 15u8, + BlockKind::CrimsonHyphae => 15u8, + BlockKind::StrippedCrimsonHyphae => 15u8, + BlockKind::CrimsonNylium => 15u8, + BlockKind::CrimsonFungus => 0u8, + BlockKind::Shroomlight => 15u8, + BlockKind::WeepingVines => 0u8, + BlockKind::WeepingVinesPlant => 0u8, + BlockKind::TwistingVines => 0u8, + BlockKind::TwistingVinesPlant => 0u8, + BlockKind::CrimsonRoots => 0u8, + BlockKind::CrimsonPlanks => 15u8, + BlockKind::WarpedPlanks => 15u8, + BlockKind::CrimsonSlab => 0u8, + BlockKind::WarpedSlab => 0u8, + BlockKind::CrimsonPressurePlate => 0u8, + BlockKind::WarpedPressurePlate => 0u8, + BlockKind::CrimsonFence => 0u8, + BlockKind::WarpedFence => 0u8, + BlockKind::CrimsonTrapdoor => 0u8, + BlockKind::WarpedTrapdoor => 0u8, + BlockKind::CrimsonFenceGate => 0u8, + BlockKind::WarpedFenceGate => 0u8, + BlockKind::CrimsonStairs => 0u8, + BlockKind::WarpedStairs => 0u8, + BlockKind::CrimsonButton => 0u8, + BlockKind::WarpedButton => 0u8, + BlockKind::CrimsonDoor => 0u8, + BlockKind::WarpedDoor => 0u8, + BlockKind::CrimsonSign => 0u8, + BlockKind::WarpedSign => 0u8, + BlockKind::CrimsonWallSign => 0u8, + BlockKind::WarpedWallSign => 0u8, + BlockKind::StructureBlock => 15u8, + BlockKind::Jigsaw => 15u8, + BlockKind::Composter => 0u8, + BlockKind::Target => 15u8, + BlockKind::BeeNest => 15u8, + BlockKind::Beehive => 15u8, + BlockKind::HoneyBlock => 1u8, + BlockKind::HoneycombBlock => 15u8, + BlockKind::NetheriteBlock => 15u8, + BlockKind::AncientDebris => 15u8, + BlockKind::CryingObsidian => 15u8, + BlockKind::RespawnAnchor => 15u8, + BlockKind::PottedCrimsonFungus => 0u8, + BlockKind::PottedWarpedFungus => 0u8, + BlockKind::PottedCrimsonRoots => 0u8, + BlockKind::PottedWarpedRoots => 0u8, + BlockKind::Lodestone => 15u8, + BlockKind::Blackstone => 15u8, + BlockKind::BlackstoneStairs => 0u8, + BlockKind::BlackstoneWall => 0u8, + BlockKind::BlackstoneSlab => 0u8, + BlockKind::PolishedBlackstone => 15u8, + BlockKind::PolishedBlackstoneBricks => 15u8, + BlockKind::CrackedPolishedBlackstoneBricks => 15u8, + BlockKind::ChiseledPolishedBlackstone => 15u8, + BlockKind::PolishedBlackstoneBrickSlab => 0u8, + BlockKind::PolishedBlackstoneBrickStairs => 0u8, + BlockKind::PolishedBlackstoneBrickWall => 0u8, + BlockKind::GildedBlackstone => 15u8, + BlockKind::PolishedBlackstoneStairs => 0u8, + BlockKind::PolishedBlackstoneSlab => 0u8, + BlockKind::PolishedBlackstonePressurePlate => 0u8, + BlockKind::PolishedBlackstoneButton => 0u8, + BlockKind::PolishedBlackstoneWall => 0u8, + BlockKind::ChiseledNetherBricks => 15u8, + BlockKind::CrackedNetherBricks => 15u8, + BlockKind::QuartzBricks => 15u8, + BlockKind::Candle => 0u8, + BlockKind::WhiteCandle => 0u8, + BlockKind::OrangeCandle => 0u8, + BlockKind::MagentaCandle => 0u8, + BlockKind::LightBlueCandle => 0u8, + BlockKind::YellowCandle => 0u8, + BlockKind::LimeCandle => 0u8, + BlockKind::PinkCandle => 0u8, + BlockKind::GrayCandle => 0u8, + BlockKind::LightGrayCandle => 0u8, + BlockKind::CyanCandle => 0u8, + BlockKind::PurpleCandle => 0u8, + BlockKind::BlueCandle => 0u8, + BlockKind::BrownCandle => 0u8, + BlockKind::GreenCandle => 0u8, + BlockKind::RedCandle => 0u8, + BlockKind::BlackCandle => 0u8, + BlockKind::CandleCake => 0u8, + BlockKind::WhiteCandleCake => 0u8, + BlockKind::OrangeCandleCake => 0u8, + BlockKind::MagentaCandleCake => 0u8, + BlockKind::LightBlueCandleCake => 0u8, + BlockKind::YellowCandleCake => 0u8, + BlockKind::LimeCandleCake => 0u8, + BlockKind::PinkCandleCake => 0u8, + BlockKind::GrayCandleCake => 0u8, + BlockKind::LightGrayCandleCake => 0u8, + BlockKind::CyanCandleCake => 0u8, + BlockKind::PurpleCandleCake => 0u8, + BlockKind::BlueCandleCake => 0u8, + BlockKind::BrownCandleCake => 0u8, + BlockKind::GreenCandleCake => 0u8, + BlockKind::RedCandleCake => 0u8, + BlockKind::BlackCandleCake => 0u8, + BlockKind::AmethystBlock => 15u8, + BlockKind::BuddingAmethyst => 15u8, + BlockKind::AmethystCluster => 0u8, + BlockKind::LargeAmethystBud => 0u8, + BlockKind::MediumAmethystBud => 0u8, + BlockKind::SmallAmethystBud => 0u8, + BlockKind::Tuff => 15u8, + BlockKind::Calcite => 15u8, + BlockKind::TintedGlass => 15u8, + BlockKind::PowderSnow => 1u8, + BlockKind::SculkSensor => 0u8, + BlockKind::OxidizedCopper => 15u8, + BlockKind::WeatheredCopper => 15u8, + BlockKind::ExposedCopper => 15u8, + BlockKind::CopperBlock => 15u8, + BlockKind::CopperOre => 15u8, + BlockKind::DeepslateCopperOre => 15u8, + BlockKind::OxidizedCutCopper => 15u8, + BlockKind::WeatheredCutCopper => 15u8, + BlockKind::ExposedCutCopper => 15u8, + BlockKind::CutCopper => 15u8, + BlockKind::OxidizedCutCopperStairs => 0u8, + BlockKind::WeatheredCutCopperStairs => 0u8, + BlockKind::ExposedCutCopperStairs => 0u8, + BlockKind::CutCopperStairs => 0u8, + BlockKind::OxidizedCutCopperSlab => 0u8, + BlockKind::WeatheredCutCopperSlab => 0u8, + BlockKind::ExposedCutCopperSlab => 0u8, + BlockKind::CutCopperSlab => 0u8, + BlockKind::WaxedCopperBlock => 15u8, + BlockKind::WaxedWeatheredCopper => 15u8, + BlockKind::WaxedExposedCopper => 15u8, + BlockKind::WaxedOxidizedCopper => 15u8, + BlockKind::WaxedOxidizedCutCopper => 15u8, + BlockKind::WaxedWeatheredCutCopper => 15u8, + BlockKind::WaxedExposedCutCopper => 15u8, + BlockKind::WaxedCutCopper => 15u8, + BlockKind::WaxedOxidizedCutCopperStairs => 0u8, + BlockKind::WaxedWeatheredCutCopperStairs => 0u8, + BlockKind::WaxedExposedCutCopperStairs => 0u8, + BlockKind::WaxedCutCopperStairs => 0u8, + BlockKind::WaxedOxidizedCutCopperSlab => 0u8, + BlockKind::WaxedWeatheredCutCopperSlab => 0u8, + BlockKind::WaxedExposedCutCopperSlab => 0u8, + BlockKind::WaxedCutCopperSlab => 0u8, + BlockKind::LightningRod => 0u8, + BlockKind::PointedDripstone => 0u8, + BlockKind::DripstoneBlock => 15u8, + BlockKind::CaveVines => 0u8, + BlockKind::CaveVinesPlant => 0u8, + BlockKind::SporeBlossom => 0u8, + BlockKind::Azalea => 0u8, + BlockKind::FloweringAzalea => 0u8, + BlockKind::MossCarpet => 0u8, + BlockKind::MossBlock => 15u8, + BlockKind::BigDripleaf => 0u8, + BlockKind::BigDripleafStem => 0u8, + BlockKind::SmallDripleaf => 0u8, + BlockKind::HangingRoots => 0u8, + BlockKind::RootedDirt => 15u8, + BlockKind::Deepslate => 15u8, + BlockKind::CobbledDeepslate => 15u8, + BlockKind::CobbledDeepslateStairs => 0u8, + BlockKind::CobbledDeepslateSlab => 0u8, + BlockKind::CobbledDeepslateWall => 0u8, + BlockKind::PolishedDeepslate => 15u8, + BlockKind::PolishedDeepslateStairs => 0u8, + BlockKind::PolishedDeepslateSlab => 0u8, + BlockKind::PolishedDeepslateWall => 0u8, + BlockKind::DeepslateTiles => 15u8, + BlockKind::DeepslateTileStairs => 0u8, + BlockKind::DeepslateTileSlab => 0u8, + BlockKind::DeepslateTileWall => 0u8, + BlockKind::DeepslateBricks => 15u8, + BlockKind::DeepslateBrickStairs => 0u8, + BlockKind::DeepslateBrickSlab => 0u8, + BlockKind::DeepslateBrickWall => 0u8, + BlockKind::ChiseledDeepslate => 15u8, + BlockKind::CrackedDeepslateBricks => 15u8, + BlockKind::CrackedDeepslateTiles => 15u8, + BlockKind::InfestedDeepslate => 15u8, + BlockKind::SmoothBasalt => 15u8, + BlockKind::RawIronBlock => 15u8, + BlockKind::RawCopperBlock => 15u8, + BlockKind::RawGoldBlock => 15u8, + BlockKind::PottedAzaleaBush => 0u8, + BlockKind::PottedFloweringAzaleaBush => 0u8, + } + } +} +impl BlockKind { + #[doc = "Returns the `solid` property of this `BlockKind`."] + #[inline] + pub fn solid(&self) -> bool { + match self { + BlockKind::Air => false, + BlockKind::Stone => true, + BlockKind::Granite => true, + BlockKind::PolishedGranite => true, + BlockKind::Diorite => true, + BlockKind::PolishedDiorite => true, + BlockKind::Andesite => true, + BlockKind::PolishedAndesite => true, + BlockKind::GrassBlock => true, + BlockKind::Dirt => true, + BlockKind::CoarseDirt => true, BlockKind::Podzol => true, BlockKind::Cobblestone => true, BlockKind::OakPlanks => true, @@ -9311,8 +16548,11 @@ impl BlockKind { BlockKind::RedSand => true, BlockKind::Gravel => true, BlockKind::GoldOre => true, + BlockKind::DeepslateGoldOre => true, BlockKind::IronOre => true, + BlockKind::DeepslateIronOre => true, BlockKind::CoalOre => true, + BlockKind::DeepslateCoalOre => true, BlockKind::NetherGoldOre => true, BlockKind::OakLog => true, BlockKind::SpruceLog => true, @@ -9344,10 +16584,13 @@ impl BlockKind { BlockKind::JungleLeaves => true, BlockKind::AcaciaLeaves => true, BlockKind::DarkOakLeaves => true, + BlockKind::AzaleaLeaves => true, + BlockKind::FloweringAzaleaLeaves => true, BlockKind::Sponge => true, BlockKind::WetSponge => true, BlockKind::Glass => true, BlockKind::LapisOre => true, + BlockKind::DeepslateLapisOre => true, BlockKind::LapisBlock => true, BlockKind::Dispenser => true, BlockKind::Sandstone => true, @@ -9429,6 +16672,7 @@ impl BlockKind { BlockKind::Chest => true, BlockKind::RedstoneWire => false, BlockKind::DiamondOre => true, + BlockKind::DeepslateDiamondOre => true, BlockKind::DiamondBlock => true, BlockKind::CraftingTable => true, BlockKind::Wheat => false, @@ -9460,6 +16704,7 @@ impl BlockKind { BlockKind::AcaciaPressurePlate => false, BlockKind::DarkOakPressurePlate => false, BlockKind::RedstoneOre => true, + BlockKind::DeepslateRedstoneOre => true, BlockKind::RedstoneTorch => false, BlockKind::RedstoneWallTorch => false, BlockKind::StoneButton => false, @@ -9529,6 +16774,7 @@ impl BlockKind { BlockKind::PumpkinStem => false, BlockKind::MelonStem => false, BlockKind::Vine => false, + BlockKind::GlowLichen => false, BlockKind::OakFenceGate => true, BlockKind::BrickStairs => true, BlockKind::StoneBrickStairs => true, @@ -9541,6 +16787,9 @@ impl BlockKind { BlockKind::EnchantingTable => true, BlockKind::BrewingStand => true, BlockKind::Cauldron => true, + BlockKind::WaterCauldron => true, + BlockKind::LavaCauldron => true, + BlockKind::PowderSnowCauldron => true, BlockKind::EndPortal => false, BlockKind::EndPortalFrame => true, BlockKind::EndStone => true, @@ -9549,6 +16798,7 @@ impl BlockKind { BlockKind::Cocoa => true, BlockKind::SandstoneStairs => true, BlockKind::EmeraldOre => true, + BlockKind::DeepslateEmeraldOre => true, BlockKind::EnderChest => true, BlockKind::TripwireHook => false, BlockKind::Tripwire => false, @@ -9658,6 +16908,7 @@ impl BlockKind { BlockKind::DarkOakStairs => true, BlockKind::SlimeBlock => true, BlockKind::Barrier => true, + BlockKind::Light => false, BlockKind::IronTrapdoor => true, BlockKind::Prismarine => true, BlockKind::PrismarineBricks => true, @@ -9777,7 +17028,7 @@ impl BlockKind { BlockKind::PurpurStairs => true, BlockKind::EndStoneBricks => true, BlockKind::Beetroots => false, - BlockKind::GrassPath => true, + BlockKind::DirtPath => true, BlockKind::EndGateway => false, BlockKind::RepeatingCommandBlock => true, BlockKind::ChainCommandBlock => true, @@ -10042,164 +17293,216 @@ impl BlockKind { BlockKind::ChiseledNetherBricks => true, BlockKind::CrackedNetherBricks => true, BlockKind::QuartzBricks => true, + BlockKind::Candle => true, + BlockKind::WhiteCandle => true, + BlockKind::OrangeCandle => true, + BlockKind::MagentaCandle => true, + BlockKind::LightBlueCandle => true, + BlockKind::YellowCandle => true, + BlockKind::LimeCandle => true, + BlockKind::PinkCandle => true, + BlockKind::GrayCandle => true, + BlockKind::LightGrayCandle => true, + BlockKind::CyanCandle => true, + BlockKind::PurpleCandle => true, + BlockKind::BlueCandle => true, + BlockKind::BrownCandle => true, + BlockKind::GreenCandle => true, + BlockKind::RedCandle => true, + BlockKind::BlackCandle => true, + BlockKind::CandleCake => true, + BlockKind::WhiteCandleCake => true, + BlockKind::OrangeCandleCake => true, + BlockKind::MagentaCandleCake => true, + BlockKind::LightBlueCandleCake => true, + BlockKind::YellowCandleCake => true, + BlockKind::LimeCandleCake => true, + BlockKind::PinkCandleCake => true, + BlockKind::GrayCandleCake => true, + BlockKind::LightGrayCandleCake => true, + BlockKind::CyanCandleCake => true, + BlockKind::PurpleCandleCake => true, + BlockKind::BlueCandleCake => true, + BlockKind::BrownCandleCake => true, + BlockKind::GreenCandleCake => true, + BlockKind::RedCandleCake => true, + BlockKind::BlackCandleCake => true, + BlockKind::AmethystBlock => true, + BlockKind::BuddingAmethyst => true, + BlockKind::AmethystCluster => true, + BlockKind::LargeAmethystBud => true, + BlockKind::MediumAmethystBud => true, + BlockKind::SmallAmethystBud => true, + BlockKind::Tuff => true, + BlockKind::Calcite => true, + BlockKind::TintedGlass => true, + BlockKind::PowderSnow => false, + BlockKind::SculkSensor => true, + BlockKind::OxidizedCopper => true, + BlockKind::WeatheredCopper => true, + BlockKind::ExposedCopper => true, + BlockKind::CopperBlock => true, + BlockKind::CopperOre => true, + BlockKind::DeepslateCopperOre => true, + BlockKind::OxidizedCutCopper => true, + BlockKind::WeatheredCutCopper => true, + BlockKind::ExposedCutCopper => true, + BlockKind::CutCopper => true, + BlockKind::OxidizedCutCopperStairs => true, + BlockKind::WeatheredCutCopperStairs => true, + BlockKind::ExposedCutCopperStairs => true, + BlockKind::CutCopperStairs => true, + BlockKind::OxidizedCutCopperSlab => true, + BlockKind::WeatheredCutCopperSlab => true, + BlockKind::ExposedCutCopperSlab => true, + BlockKind::CutCopperSlab => true, + BlockKind::WaxedCopperBlock => true, + BlockKind::WaxedWeatheredCopper => true, + BlockKind::WaxedExposedCopper => true, + BlockKind::WaxedOxidizedCopper => true, + BlockKind::WaxedOxidizedCutCopper => true, + BlockKind::WaxedWeatheredCutCopper => true, + BlockKind::WaxedExposedCutCopper => true, + BlockKind::WaxedCutCopper => true, + BlockKind::WaxedOxidizedCutCopperStairs => true, + BlockKind::WaxedWeatheredCutCopperStairs => true, + BlockKind::WaxedExposedCutCopperStairs => true, + BlockKind::WaxedCutCopperStairs => true, + BlockKind::WaxedOxidizedCutCopperSlab => true, + BlockKind::WaxedWeatheredCutCopperSlab => true, + BlockKind::WaxedExposedCutCopperSlab => true, + BlockKind::WaxedCutCopperSlab => true, + BlockKind::LightningRod => true, + BlockKind::PointedDripstone => true, + BlockKind::DripstoneBlock => true, + BlockKind::CaveVines => false, + BlockKind::CaveVinesPlant => false, + BlockKind::SporeBlossom => false, + BlockKind::Azalea => true, + BlockKind::FloweringAzalea => true, + BlockKind::MossCarpet => true, + BlockKind::MossBlock => true, + BlockKind::BigDripleaf => true, + BlockKind::BigDripleafStem => false, + BlockKind::SmallDripleaf => false, + BlockKind::HangingRoots => false, + BlockKind::RootedDirt => true, + BlockKind::Deepslate => true, + BlockKind::CobbledDeepslate => true, + BlockKind::CobbledDeepslateStairs => true, + BlockKind::CobbledDeepslateSlab => true, + BlockKind::CobbledDeepslateWall => true, + BlockKind::PolishedDeepslate => true, + BlockKind::PolishedDeepslateStairs => true, + BlockKind::PolishedDeepslateSlab => true, + BlockKind::PolishedDeepslateWall => true, + BlockKind::DeepslateTiles => true, + BlockKind::DeepslateTileStairs => true, + BlockKind::DeepslateTileSlab => true, + BlockKind::DeepslateTileWall => true, + BlockKind::DeepslateBricks => true, + BlockKind::DeepslateBrickStairs => true, + BlockKind::DeepslateBrickSlab => true, + BlockKind::DeepslateBrickWall => true, + BlockKind::ChiseledDeepslate => true, + BlockKind::CrackedDeepslateBricks => true, + BlockKind::CrackedDeepslateTiles => true, + BlockKind::InfestedDeepslate => true, + BlockKind::SmoothBasalt => true, + BlockKind::RawIronBlock => true, + BlockKind::RawCopperBlock => true, + BlockKind::RawGoldBlock => true, + BlockKind::PottedAzaleaBush => true, + BlockKind::PottedFloweringAzaleaBush => true, } } } -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_rock: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronPickaxe, 6.0_f32), - (libcraft_items::Item::WoodenPickaxe, 2.0_f32), - (libcraft_items::Item::StonePickaxe, 4.0_f32), - (libcraft_items::Item::DiamondPickaxe, 8.0_f32), - (libcraft_items::Item::NetheritePickaxe, 9.0_f32), - (libcraft_items::Item::GoldenPickaxe, 12.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_wood: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronAxe, 6.0_f32), - (libcraft_items::Item::WoodenAxe, 2.0_f32), - (libcraft_items::Item::StoneAxe, 4.0_f32), - (libcraft_items::Item::DiamondAxe, 8.0_f32), - (libcraft_items::Item::NetheriteAxe, 9.0_f32), - (libcraft_items::Item::GoldenAxe, 12.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_plant: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronAxe, 6.0_f32), - (libcraft_items::Item::IronSword, 1.5_f32), - (libcraft_items::Item::WoodenSword, 1.5_f32), - (libcraft_items::Item::WoodenAxe, 2.0_f32), - (libcraft_items::Item::StoneSword, 1.5_f32), - (libcraft_items::Item::StoneAxe, 4.0_f32), - (libcraft_items::Item::DiamondSword, 1.5_f32), - (libcraft_items::Item::DiamondAxe, 8.0_f32), - (libcraft_items::Item::NetheriteAxe, 9.0_f32), - (libcraft_items::Item::NetheriteSword, 1.5_f32), - (libcraft_items::Item::GoldenSword, 1.5_f32), - (libcraft_items::Item::GoldenAxe, 12.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_melon: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronSword, 1.5_f32), - (libcraft_items::Item::WoodenSword, 1.5_f32), - (libcraft_items::Item::StoneSword, 1.5_f32), - (libcraft_items::Item::DiamondSword, 1.5_f32), - (libcraft_items::Item::NetheriteSword, 1.5_f32), - (libcraft_items::Item::GoldenSword, 1.5_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_leaves: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronSword, 1.5_f32), - (libcraft_items::Item::WoodenSword, 1.5_f32), - (libcraft_items::Item::StoneSword, 1.5_f32), - (libcraft_items::Item::DiamondSword, 1.5_f32), - (libcraft_items::Item::GoldenSword, 1.5_f32), - (libcraft_items::Item::NetheriteSword, 1.5_f32), - (libcraft_items::Item::Shears, 6.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_dirt: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronShovel, 6.0_f32), - (libcraft_items::Item::WoodenShovel, 2.0_f32), - (libcraft_items::Item::StoneShovel, 4.0_f32), - (libcraft_items::Item::DiamondShovel, 8.0_f32), - (libcraft_items::Item::NetheriteShovel, 9.0_f32), - (libcraft_items::Item::GoldenShovel, 12.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_web: &[(libcraft_items::Item, f32)] = &[ - (libcraft_items::Item::IronSword, 15.0_f32), - (libcraft_items::Item::WoodenSword, 15.0_f32), - (libcraft_items::Item::StoneSword, 15.0_f32), - (libcraft_items::Item::DiamondSword, 15.0_f32), - (libcraft_items::Item::GoldenSword, 15.0_f32), - (libcraft_items::Item::NetheriteSword, 15.0_f32), - (libcraft_items::Item::Shears, 15.0_f32), -]; -#[allow(dead_code, non_upper_case_globals)] -const DIG_MULTIPLIERS_wool: &[(libcraft_items::Item, f32)] = - &[(libcraft_items::Item::Shears, 4.8_f32)]; -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `dig_multipliers` property of this `BlockKind`. + #[doc = "Returns the `dig_multipliers` property of this `BlockKind`."] + #[inline] pub fn dig_multipliers(&self) -> &'static [(libcraft_items::Item, f32)] { match self { BlockKind::Air => &[], - BlockKind::Stone => DIG_MULTIPLIERS_rock, - BlockKind::Granite => DIG_MULTIPLIERS_rock, - BlockKind::PolishedGranite => DIG_MULTIPLIERS_rock, - BlockKind::Diorite => DIG_MULTIPLIERS_rock, - BlockKind::PolishedDiorite => DIG_MULTIPLIERS_rock, - BlockKind::Andesite => DIG_MULTIPLIERS_rock, - BlockKind::PolishedAndesite => DIG_MULTIPLIERS_rock, - BlockKind::GrassBlock => DIG_MULTIPLIERS_dirt, - BlockKind::Dirt => DIG_MULTIPLIERS_dirt, - BlockKind::CoarseDirt => DIG_MULTIPLIERS_plant, - BlockKind::Podzol => DIG_MULTIPLIERS_plant, - BlockKind::Cobblestone => DIG_MULTIPLIERS_rock, - BlockKind::OakPlanks => DIG_MULTIPLIERS_wood, - BlockKind::SprucePlanks => DIG_MULTIPLIERS_wood, - BlockKind::BirchPlanks => DIG_MULTIPLIERS_wood, - BlockKind::JunglePlanks => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaPlanks => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakPlanks => DIG_MULTIPLIERS_wood, - BlockKind::OakSapling => DIG_MULTIPLIERS_plant, - BlockKind::SpruceSapling => DIG_MULTIPLIERS_plant, - BlockKind::BirchSapling => DIG_MULTIPLIERS_plant, - BlockKind::JungleSapling => DIG_MULTIPLIERS_plant, - BlockKind::AcaciaSapling => DIG_MULTIPLIERS_plant, - BlockKind::DarkOakSapling => DIG_MULTIPLIERS_plant, + BlockKind::Stone => &[], + BlockKind::Granite => &[], + BlockKind::PolishedGranite => &[], + BlockKind::Diorite => &[], + BlockKind::PolishedDiorite => &[], + BlockKind::Andesite => &[], + BlockKind::PolishedAndesite => &[], + BlockKind::GrassBlock => &[], + BlockKind::Dirt => &[], + BlockKind::CoarseDirt => &[], + BlockKind::Podzol => &[], + BlockKind::Cobblestone => &[], + BlockKind::OakPlanks => &[], + BlockKind::SprucePlanks => &[], + BlockKind::BirchPlanks => &[], + BlockKind::JunglePlanks => &[], + BlockKind::AcaciaPlanks => &[], + BlockKind::DarkOakPlanks => &[], + BlockKind::OakSapling => &[], + BlockKind::SpruceSapling => &[], + BlockKind::BirchSapling => &[], + BlockKind::JungleSapling => &[], + BlockKind::AcaciaSapling => &[], + BlockKind::DarkOakSapling => &[], BlockKind::Bedrock => &[], BlockKind::Water => &[], BlockKind::Lava => &[], - BlockKind::Sand => DIG_MULTIPLIERS_dirt, - BlockKind::RedSand => DIG_MULTIPLIERS_dirt, - BlockKind::Gravel => DIG_MULTIPLIERS_dirt, - BlockKind::GoldOre => DIG_MULTIPLIERS_rock, - BlockKind::IronOre => DIG_MULTIPLIERS_rock, - BlockKind::CoalOre => DIG_MULTIPLIERS_rock, - BlockKind::NetherGoldOre => DIG_MULTIPLIERS_rock, - BlockKind::OakLog => DIG_MULTIPLIERS_wood, - BlockKind::SpruceLog => DIG_MULTIPLIERS_wood, - BlockKind::BirchLog => DIG_MULTIPLIERS_wood, - BlockKind::JungleLog => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaLog => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedSpruceLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedBirchLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedJungleLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedAcaciaLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedDarkOakLog => DIG_MULTIPLIERS_wood, - BlockKind::StrippedOakLog => DIG_MULTIPLIERS_wood, - BlockKind::OakWood => DIG_MULTIPLIERS_wood, - BlockKind::SpruceWood => DIG_MULTIPLIERS_wood, - BlockKind::BirchWood => DIG_MULTIPLIERS_wood, - BlockKind::JungleWood => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaWood => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedOakWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedSpruceWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedBirchWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedJungleWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedAcaciaWood => DIG_MULTIPLIERS_wood, - BlockKind::StrippedDarkOakWood => DIG_MULTIPLIERS_wood, - BlockKind::OakLeaves => DIG_MULTIPLIERS_plant, - BlockKind::SpruceLeaves => DIG_MULTIPLIERS_plant, - BlockKind::BirchLeaves => DIG_MULTIPLIERS_plant, - BlockKind::JungleLeaves => DIG_MULTIPLIERS_plant, - BlockKind::AcaciaLeaves => DIG_MULTIPLIERS_plant, - BlockKind::DarkOakLeaves => DIG_MULTIPLIERS_plant, + BlockKind::Sand => &[], + BlockKind::RedSand => &[], + BlockKind::Gravel => &[], + BlockKind::GoldOre => &[], + BlockKind::DeepslateGoldOre => &[], + BlockKind::IronOre => &[], + BlockKind::DeepslateIronOre => &[], + BlockKind::CoalOre => &[], + BlockKind::DeepslateCoalOre => &[], + BlockKind::NetherGoldOre => &[], + BlockKind::OakLog => &[], + BlockKind::SpruceLog => &[], + BlockKind::BirchLog => &[], + BlockKind::JungleLog => &[], + BlockKind::AcaciaLog => &[], + BlockKind::DarkOakLog => &[], + BlockKind::StrippedSpruceLog => &[], + BlockKind::StrippedBirchLog => &[], + BlockKind::StrippedJungleLog => &[], + BlockKind::StrippedAcaciaLog => &[], + BlockKind::StrippedDarkOakLog => &[], + BlockKind::StrippedOakLog => &[], + BlockKind::OakWood => &[], + BlockKind::SpruceWood => &[], + BlockKind::BirchWood => &[], + BlockKind::JungleWood => &[], + BlockKind::AcaciaWood => &[], + BlockKind::DarkOakWood => &[], + BlockKind::StrippedOakWood => &[], + BlockKind::StrippedSpruceWood => &[], + BlockKind::StrippedBirchWood => &[], + BlockKind::StrippedJungleWood => &[], + BlockKind::StrippedAcaciaWood => &[], + BlockKind::StrippedDarkOakWood => &[], + BlockKind::OakLeaves => &[], + BlockKind::SpruceLeaves => &[], + BlockKind::BirchLeaves => &[], + BlockKind::JungleLeaves => &[], + BlockKind::AcaciaLeaves => &[], + BlockKind::DarkOakLeaves => &[], + BlockKind::AzaleaLeaves => &[], + BlockKind::FloweringAzaleaLeaves => &[], BlockKind::Sponge => &[], BlockKind::WetSponge => &[], BlockKind::Glass => &[], - BlockKind::LapisOre => DIG_MULTIPLIERS_rock, - BlockKind::LapisBlock => DIG_MULTIPLIERS_rock, - BlockKind::Dispenser => DIG_MULTIPLIERS_rock, - BlockKind::Sandstone => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledSandstone => DIG_MULTIPLIERS_rock, - BlockKind::CutSandstone => DIG_MULTIPLIERS_rock, - BlockKind::NoteBlock => DIG_MULTIPLIERS_wood, + BlockKind::LapisOre => &[], + BlockKind::DeepslateLapisOre => &[], + BlockKind::LapisBlock => &[], + BlockKind::Dispenser => &[], + BlockKind::Sandstone => &[], + BlockKind::ChiseledSandstone => &[], + BlockKind::CutSandstone => &[], + BlockKind::NoteBlock => &[], BlockKind::WhiteBed => &[], BlockKind::OrangeBed => &[], BlockKind::MagentaBed => &[], @@ -10216,119 +17519,121 @@ impl BlockKind { BlockKind::GreenBed => &[], BlockKind::RedBed => &[], BlockKind::BlackBed => &[], - BlockKind::PoweredRail => DIG_MULTIPLIERS_rock, - BlockKind::DetectorRail => DIG_MULTIPLIERS_rock, + BlockKind::PoweredRail => &[], + BlockKind::DetectorRail => &[], BlockKind::StickyPiston => &[], - BlockKind::Cobweb => DIG_MULTIPLIERS_web, - BlockKind::Grass => DIG_MULTIPLIERS_plant, - BlockKind::Fern => DIG_MULTIPLIERS_plant, - BlockKind::DeadBush => DIG_MULTIPLIERS_plant, - BlockKind::Seagrass => DIG_MULTIPLIERS_plant, - BlockKind::TallSeagrass => DIG_MULTIPLIERS_plant, + BlockKind::Cobweb => &[], + BlockKind::Grass => &[], + BlockKind::Fern => &[], + BlockKind::DeadBush => &[], + BlockKind::Seagrass => &[], + BlockKind::TallSeagrass => &[], BlockKind::Piston => &[], BlockKind::PistonHead => &[], - BlockKind::WhiteWool => DIG_MULTIPLIERS_wool, - BlockKind::OrangeWool => DIG_MULTIPLIERS_wool, - BlockKind::MagentaWool => DIG_MULTIPLIERS_wool, - BlockKind::LightBlueWool => DIG_MULTIPLIERS_wool, - BlockKind::YellowWool => DIG_MULTIPLIERS_wool, - BlockKind::LimeWool => DIG_MULTIPLIERS_wool, - BlockKind::PinkWool => DIG_MULTIPLIERS_wool, - BlockKind::GrayWool => DIG_MULTIPLIERS_wool, - BlockKind::LightGrayWool => DIG_MULTIPLIERS_wool, - BlockKind::CyanWool => DIG_MULTIPLIERS_wool, - BlockKind::PurpleWool => DIG_MULTIPLIERS_wool, - BlockKind::BlueWool => DIG_MULTIPLIERS_wool, - BlockKind::BrownWool => DIG_MULTIPLIERS_wool, - BlockKind::GreenWool => DIG_MULTIPLIERS_wool, - BlockKind::RedWool => DIG_MULTIPLIERS_wool, - BlockKind::BlackWool => DIG_MULTIPLIERS_wool, + BlockKind::WhiteWool => &[], + BlockKind::OrangeWool => &[], + BlockKind::MagentaWool => &[], + BlockKind::LightBlueWool => &[], + BlockKind::YellowWool => &[], + BlockKind::LimeWool => &[], + BlockKind::PinkWool => &[], + BlockKind::GrayWool => &[], + BlockKind::LightGrayWool => &[], + BlockKind::CyanWool => &[], + BlockKind::PurpleWool => &[], + BlockKind::BlueWool => &[], + BlockKind::BrownWool => &[], + BlockKind::GreenWool => &[], + BlockKind::RedWool => &[], + BlockKind::BlackWool => &[], BlockKind::MovingPiston => &[], - BlockKind::Dandelion => DIG_MULTIPLIERS_plant, - BlockKind::Poppy => DIG_MULTIPLIERS_plant, - BlockKind::BlueOrchid => DIG_MULTIPLIERS_plant, - BlockKind::Allium => DIG_MULTIPLIERS_plant, - BlockKind::AzureBluet => DIG_MULTIPLIERS_plant, - BlockKind::RedTulip => DIG_MULTIPLIERS_plant, - BlockKind::OrangeTulip => DIG_MULTIPLIERS_plant, - BlockKind::WhiteTulip => DIG_MULTIPLIERS_plant, - BlockKind::PinkTulip => DIG_MULTIPLIERS_plant, - BlockKind::OxeyeDaisy => DIG_MULTIPLIERS_plant, - BlockKind::Cornflower => DIG_MULTIPLIERS_plant, - BlockKind::WitherRose => DIG_MULTIPLIERS_plant, - BlockKind::LilyOfTheValley => DIG_MULTIPLIERS_plant, - BlockKind::BrownMushroom => DIG_MULTIPLIERS_plant, - BlockKind::RedMushroom => DIG_MULTIPLIERS_plant, - BlockKind::GoldBlock => DIG_MULTIPLIERS_rock, - BlockKind::IronBlock => DIG_MULTIPLIERS_rock, - BlockKind::Bricks => DIG_MULTIPLIERS_rock, + BlockKind::Dandelion => &[], + BlockKind::Poppy => &[], + BlockKind::BlueOrchid => &[], + BlockKind::Allium => &[], + BlockKind::AzureBluet => &[], + BlockKind::RedTulip => &[], + BlockKind::OrangeTulip => &[], + BlockKind::WhiteTulip => &[], + BlockKind::PinkTulip => &[], + BlockKind::OxeyeDaisy => &[], + BlockKind::Cornflower => &[], + BlockKind::WitherRose => &[], + BlockKind::LilyOfTheValley => &[], + BlockKind::BrownMushroom => &[], + BlockKind::RedMushroom => &[], + BlockKind::GoldBlock => &[], + BlockKind::IronBlock => &[], + BlockKind::Bricks => &[], BlockKind::Tnt => &[], - BlockKind::Bookshelf => DIG_MULTIPLIERS_wood, - BlockKind::MossyCobblestone => DIG_MULTIPLIERS_rock, - BlockKind::Obsidian => DIG_MULTIPLIERS_rock, + BlockKind::Bookshelf => &[], + BlockKind::MossyCobblestone => &[], + BlockKind::Obsidian => &[], BlockKind::Torch => &[], BlockKind::WallTorch => &[], BlockKind::Fire => &[], BlockKind::SoulFire => &[], - BlockKind::Spawner => DIG_MULTIPLIERS_rock, - BlockKind::OakStairs => DIG_MULTIPLIERS_wood, - BlockKind::Chest => DIG_MULTIPLIERS_wood, + BlockKind::Spawner => &[], + BlockKind::OakStairs => &[], + BlockKind::Chest => &[], BlockKind::RedstoneWire => &[], - BlockKind::DiamondOre => DIG_MULTIPLIERS_rock, - BlockKind::DiamondBlock => DIG_MULTIPLIERS_rock, - BlockKind::CraftingTable => DIG_MULTIPLIERS_wood, - BlockKind::Wheat => DIG_MULTIPLIERS_plant, - BlockKind::Farmland => DIG_MULTIPLIERS_dirt, - BlockKind::Furnace => DIG_MULTIPLIERS_rock, - BlockKind::OakSign => DIG_MULTIPLIERS_wood, - BlockKind::SpruceSign => DIG_MULTIPLIERS_wood, - BlockKind::BirchSign => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaSign => DIG_MULTIPLIERS_wood, - BlockKind::JungleSign => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakSign => DIG_MULTIPLIERS_wood, - BlockKind::OakDoor => DIG_MULTIPLIERS_wood, + BlockKind::DiamondOre => &[], + BlockKind::DeepslateDiamondOre => &[], + BlockKind::DiamondBlock => &[], + BlockKind::CraftingTable => &[], + BlockKind::Wheat => &[], + BlockKind::Farmland => &[], + BlockKind::Furnace => &[], + BlockKind::OakSign => &[], + BlockKind::SpruceSign => &[], + BlockKind::BirchSign => &[], + BlockKind::AcaciaSign => &[], + BlockKind::JungleSign => &[], + BlockKind::DarkOakSign => &[], + BlockKind::OakDoor => &[], BlockKind::Ladder => &[], - BlockKind::Rail => DIG_MULTIPLIERS_rock, - BlockKind::CobblestoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::OakWallSign => DIG_MULTIPLIERS_wood, - BlockKind::SpruceWallSign => DIG_MULTIPLIERS_wood, - BlockKind::BirchWallSign => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaWallSign => DIG_MULTIPLIERS_wood, - BlockKind::JungleWallSign => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakWallSign => DIG_MULTIPLIERS_wood, + BlockKind::Rail => &[], + BlockKind::CobblestoneStairs => &[], + BlockKind::OakWallSign => &[], + BlockKind::SpruceWallSign => &[], + BlockKind::BirchWallSign => &[], + BlockKind::AcaciaWallSign => &[], + BlockKind::JungleWallSign => &[], + BlockKind::DarkOakWallSign => &[], BlockKind::Lever => &[], - BlockKind::StonePressurePlate => DIG_MULTIPLIERS_rock, - BlockKind::IronDoor => DIG_MULTIPLIERS_rock, - BlockKind::OakPressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::SprucePressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::BirchPressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::JunglePressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaPressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakPressurePlate => DIG_MULTIPLIERS_wood, - BlockKind::RedstoneOre => DIG_MULTIPLIERS_rock, + BlockKind::StonePressurePlate => &[], + BlockKind::IronDoor => &[], + BlockKind::OakPressurePlate => &[], + BlockKind::SprucePressurePlate => &[], + BlockKind::BirchPressurePlate => &[], + BlockKind::JunglePressurePlate => &[], + BlockKind::AcaciaPressurePlate => &[], + BlockKind::DarkOakPressurePlate => &[], + BlockKind::RedstoneOre => &[], + BlockKind::DeepslateRedstoneOre => &[], BlockKind::RedstoneTorch => &[], BlockKind::RedstoneWallTorch => &[], - BlockKind::StoneButton => DIG_MULTIPLIERS_rock, - BlockKind::Snow => DIG_MULTIPLIERS_dirt, - BlockKind::Ice => DIG_MULTIPLIERS_rock, - BlockKind::SnowBlock => DIG_MULTIPLIERS_dirt, - BlockKind::Cactus => DIG_MULTIPLIERS_plant, - BlockKind::Clay => DIG_MULTIPLIERS_dirt, - BlockKind::SugarCane => DIG_MULTIPLIERS_plant, - BlockKind::Jukebox => DIG_MULTIPLIERS_wood, - BlockKind::OakFence => DIG_MULTIPLIERS_wood, - BlockKind::Pumpkin => DIG_MULTIPLIERS_plant, - BlockKind::Netherrack => DIG_MULTIPLIERS_rock, - BlockKind::SoulSand => DIG_MULTIPLIERS_dirt, - BlockKind::SoulSoil => DIG_MULTIPLIERS_dirt, - BlockKind::Basalt => DIG_MULTIPLIERS_rock, - BlockKind::PolishedBasalt => DIG_MULTIPLIERS_rock, + BlockKind::StoneButton => &[], + BlockKind::Snow => &[], + BlockKind::Ice => &[], + BlockKind::SnowBlock => &[], + BlockKind::Cactus => &[], + BlockKind::Clay => &[], + BlockKind::SugarCane => &[], + BlockKind::Jukebox => &[], + BlockKind::OakFence => &[], + BlockKind::Pumpkin => &[], + BlockKind::Netherrack => &[], + BlockKind::SoulSand => &[], + BlockKind::SoulSoil => &[], + BlockKind::Basalt => &[], + BlockKind::PolishedBasalt => &[], BlockKind::SoulTorch => &[], BlockKind::SoulWallTorch => &[], BlockKind::Glowstone => &[], BlockKind::NetherPortal => &[], - BlockKind::CarvedPumpkin => DIG_MULTIPLIERS_plant, - BlockKind::JackOLantern => DIG_MULTIPLIERS_plant, + BlockKind::CarvedPumpkin => &[], + BlockKind::JackOLantern => &[], BlockKind::Cake => &[], BlockKind::Repeater => &[], BlockKind::WhiteStainedGlass => &[], @@ -10347,65 +17652,70 @@ impl BlockKind { BlockKind::GreenStainedGlass => &[], BlockKind::RedStainedGlass => &[], BlockKind::BlackStainedGlass => &[], - BlockKind::OakTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::SpruceTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::BirchTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::JungleTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::StoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::MossyStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::CrackedStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::InfestedStone => DIG_MULTIPLIERS_rock, - BlockKind::InfestedCobblestone => DIG_MULTIPLIERS_rock, - BlockKind::InfestedStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::InfestedMossyStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::InfestedCrackedStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::InfestedChiseledStoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::BrownMushroomBlock => DIG_MULTIPLIERS_wood, - BlockKind::RedMushroomBlock => DIG_MULTIPLIERS_wood, - BlockKind::MushroomStem => DIG_MULTIPLIERS_wood, - BlockKind::IronBars => DIG_MULTIPLIERS_rock, - BlockKind::Chain => DIG_MULTIPLIERS_rock, + BlockKind::OakTrapdoor => &[], + BlockKind::SpruceTrapdoor => &[], + BlockKind::BirchTrapdoor => &[], + BlockKind::JungleTrapdoor => &[], + BlockKind::AcaciaTrapdoor => &[], + BlockKind::DarkOakTrapdoor => &[], + BlockKind::StoneBricks => &[], + BlockKind::MossyStoneBricks => &[], + BlockKind::CrackedStoneBricks => &[], + BlockKind::ChiseledStoneBricks => &[], + BlockKind::InfestedStone => &[], + BlockKind::InfestedCobblestone => &[], + BlockKind::InfestedStoneBricks => &[], + BlockKind::InfestedMossyStoneBricks => &[], + BlockKind::InfestedCrackedStoneBricks => &[], + BlockKind::InfestedChiseledStoneBricks => &[], + BlockKind::BrownMushroomBlock => &[], + BlockKind::RedMushroomBlock => &[], + BlockKind::MushroomStem => &[], + BlockKind::IronBars => &[], + BlockKind::Chain => &[], BlockKind::GlassPane => &[], - BlockKind::Melon => DIG_MULTIPLIERS_plant, - BlockKind::AttachedPumpkinStem => DIG_MULTIPLIERS_plant, - BlockKind::AttachedMelonStem => DIG_MULTIPLIERS_plant, - BlockKind::PumpkinStem => DIG_MULTIPLIERS_plant, - BlockKind::MelonStem => DIG_MULTIPLIERS_plant, - BlockKind::Vine => DIG_MULTIPLIERS_plant, - BlockKind::OakFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::BrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::StoneBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::Mycelium => DIG_MULTIPLIERS_dirt, - BlockKind::LilyPad => DIG_MULTIPLIERS_plant, - BlockKind::NetherBricks => DIG_MULTIPLIERS_rock, - BlockKind::NetherBrickFence => DIG_MULTIPLIERS_rock, - BlockKind::NetherBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::NetherWart => DIG_MULTIPLIERS_plant, - BlockKind::EnchantingTable => DIG_MULTIPLIERS_rock, - BlockKind::BrewingStand => DIG_MULTIPLIERS_rock, - BlockKind::Cauldron => DIG_MULTIPLIERS_rock, + BlockKind::Melon => &[], + BlockKind::AttachedPumpkinStem => &[], + BlockKind::AttachedMelonStem => &[], + BlockKind::PumpkinStem => &[], + BlockKind::MelonStem => &[], + BlockKind::Vine => &[], + BlockKind::GlowLichen => &[], + BlockKind::OakFenceGate => &[], + BlockKind::BrickStairs => &[], + BlockKind::StoneBrickStairs => &[], + BlockKind::Mycelium => &[], + BlockKind::LilyPad => &[], + BlockKind::NetherBricks => &[], + BlockKind::NetherBrickFence => &[], + BlockKind::NetherBrickStairs => &[], + BlockKind::NetherWart => &[], + BlockKind::EnchantingTable => &[], + BlockKind::BrewingStand => &[], + BlockKind::Cauldron => &[], + BlockKind::WaterCauldron => &[], + BlockKind::LavaCauldron => &[], + BlockKind::PowderSnowCauldron => &[], BlockKind::EndPortal => &[], BlockKind::EndPortalFrame => &[], - BlockKind::EndStone => DIG_MULTIPLIERS_rock, + BlockKind::EndStone => &[], BlockKind::DragonEgg => &[], BlockKind::RedstoneLamp => &[], - BlockKind::Cocoa => DIG_MULTIPLIERS_plant, - BlockKind::SandstoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::EmeraldOre => DIG_MULTIPLIERS_rock, - BlockKind::EnderChest => DIG_MULTIPLIERS_rock, + BlockKind::Cocoa => &[], + BlockKind::SandstoneStairs => &[], + BlockKind::EmeraldOre => &[], + BlockKind::DeepslateEmeraldOre => &[], + BlockKind::EnderChest => &[], BlockKind::TripwireHook => &[], BlockKind::Tripwire => &[], - BlockKind::EmeraldBlock => DIG_MULTIPLIERS_rock, - BlockKind::SpruceStairs => DIG_MULTIPLIERS_wood, - BlockKind::BirchStairs => DIG_MULTIPLIERS_wood, - BlockKind::JungleStairs => DIG_MULTIPLIERS_wood, + BlockKind::EmeraldBlock => &[], + BlockKind::SpruceStairs => &[], + BlockKind::BirchStairs => &[], + BlockKind::JungleStairs => &[], BlockKind::CommandBlock => &[], BlockKind::Beacon => &[], - BlockKind::CobblestoneWall => DIG_MULTIPLIERS_rock, - BlockKind::MossyCobblestoneWall => DIG_MULTIPLIERS_rock, + BlockKind::CobblestoneWall => &[], + BlockKind::MossyCobblestoneWall => &[], BlockKind::FlowerPot => &[], BlockKind::PottedOakSapling => &[], BlockKind::PottedSpruceSapling => &[], @@ -10414,7 +17724,7 @@ impl BlockKind { BlockKind::PottedAcaciaSapling => &[], BlockKind::PottedDarkOakSapling => &[], BlockKind::PottedFern => &[], - BlockKind::PottedDandelion => DIG_MULTIPLIERS_plant, + BlockKind::PottedDandelion => &[], BlockKind::PottedPoppy => &[], BlockKind::PottedBlueOrchid => &[], BlockKind::PottedAllium => &[], @@ -10431,14 +17741,14 @@ impl BlockKind { BlockKind::PottedBrownMushroom => &[], BlockKind::PottedDeadBush => &[], BlockKind::PottedCactus => &[], - BlockKind::Carrots => DIG_MULTIPLIERS_plant, - BlockKind::Potatoes => DIG_MULTIPLIERS_plant, - BlockKind::OakButton => DIG_MULTIPLIERS_wood, - BlockKind::SpruceButton => DIG_MULTIPLIERS_wood, - BlockKind::BirchButton => DIG_MULTIPLIERS_wood, - BlockKind::JungleButton => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaButton => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakButton => DIG_MULTIPLIERS_wood, + BlockKind::Carrots => &[], + BlockKind::Potatoes => &[], + BlockKind::OakButton => &[], + BlockKind::SpruceButton => &[], + BlockKind::BirchButton => &[], + BlockKind::JungleButton => &[], + BlockKind::AcaciaButton => &[], + BlockKind::DarkOakButton => &[], BlockKind::SkeletonSkull => &[], BlockKind::SkeletonWallSkull => &[], BlockKind::WitherSkeletonSkull => &[], @@ -10451,39 +17761,39 @@ impl BlockKind { BlockKind::CreeperWallHead => &[], BlockKind::DragonHead => &[], BlockKind::DragonWallHead => &[], - BlockKind::Anvil => DIG_MULTIPLIERS_rock, - BlockKind::ChippedAnvil => DIG_MULTIPLIERS_rock, - BlockKind::DamagedAnvil => DIG_MULTIPLIERS_rock, - BlockKind::TrappedChest => DIG_MULTIPLIERS_wood, - BlockKind::LightWeightedPressurePlate => DIG_MULTIPLIERS_rock, - BlockKind::HeavyWeightedPressurePlate => DIG_MULTIPLIERS_rock, + BlockKind::Anvil => &[], + BlockKind::ChippedAnvil => &[], + BlockKind::DamagedAnvil => &[], + BlockKind::TrappedChest => &[], + BlockKind::LightWeightedPressurePlate => &[], + BlockKind::HeavyWeightedPressurePlate => &[], BlockKind::Comparator => &[], - BlockKind::DaylightDetector => DIG_MULTIPLIERS_wood, - BlockKind::RedstoneBlock => DIG_MULTIPLIERS_rock, - BlockKind::NetherQuartzOre => DIG_MULTIPLIERS_rock, - BlockKind::Hopper => DIG_MULTIPLIERS_rock, - BlockKind::QuartzBlock => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledQuartzBlock => DIG_MULTIPLIERS_rock, - BlockKind::QuartzPillar => DIG_MULTIPLIERS_rock, - BlockKind::QuartzStairs => DIG_MULTIPLIERS_rock, - BlockKind::ActivatorRail => DIG_MULTIPLIERS_rock, - BlockKind::Dropper => DIG_MULTIPLIERS_rock, - BlockKind::WhiteTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::OrangeTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::MagentaTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LightBlueTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::YellowTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LimeTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::PinkTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::GrayTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LightGrayTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::CyanTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::PurpleTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BlueTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BrownTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::GreenTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::RedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BlackTerracotta => DIG_MULTIPLIERS_rock, + BlockKind::DaylightDetector => &[], + BlockKind::RedstoneBlock => &[], + BlockKind::NetherQuartzOre => &[], + BlockKind::Hopper => &[], + BlockKind::QuartzBlock => &[], + BlockKind::ChiseledQuartzBlock => &[], + BlockKind::QuartzPillar => &[], + BlockKind::QuartzStairs => &[], + BlockKind::ActivatorRail => &[], + BlockKind::Dropper => &[], + BlockKind::WhiteTerracotta => &[], + BlockKind::OrangeTerracotta => &[], + BlockKind::MagentaTerracotta => &[], + BlockKind::LightBlueTerracotta => &[], + BlockKind::YellowTerracotta => &[], + BlockKind::LimeTerracotta => &[], + BlockKind::PinkTerracotta => &[], + BlockKind::GrayTerracotta => &[], + BlockKind::LightGrayTerracotta => &[], + BlockKind::CyanTerracotta => &[], + BlockKind::PurpleTerracotta => &[], + BlockKind::BlueTerracotta => &[], + BlockKind::BrownTerracotta => &[], + BlockKind::GreenTerracotta => &[], + BlockKind::RedTerracotta => &[], + BlockKind::BlackTerracotta => &[], BlockKind::WhiteStainedGlassPane => &[], BlockKind::OrangeStainedGlassPane => &[], BlockKind::MagentaStainedGlassPane => &[], @@ -10500,20 +17810,21 @@ impl BlockKind { BlockKind::GreenStainedGlassPane => &[], BlockKind::RedStainedGlassPane => &[], BlockKind::BlackStainedGlassPane => &[], - BlockKind::AcaciaStairs => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakStairs => DIG_MULTIPLIERS_wood, + BlockKind::AcaciaStairs => &[], + BlockKind::DarkOakStairs => &[], BlockKind::SlimeBlock => &[], BlockKind::Barrier => &[], - BlockKind::IronTrapdoor => DIG_MULTIPLIERS_rock, - BlockKind::Prismarine => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineBricks => DIG_MULTIPLIERS_rock, - BlockKind::DarkPrismarine => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineStairs => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::DarkPrismarineStairs => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineSlab => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::DarkPrismarineSlab => DIG_MULTIPLIERS_rock, + BlockKind::Light => &[], + BlockKind::IronTrapdoor => &[], + BlockKind::Prismarine => &[], + BlockKind::PrismarineBricks => &[], + BlockKind::DarkPrismarine => &[], + BlockKind::PrismarineStairs => &[], + BlockKind::PrismarineBrickStairs => &[], + BlockKind::DarkPrismarineStairs => &[], + BlockKind::PrismarineSlab => &[], + BlockKind::PrismarineBrickSlab => &[], + BlockKind::DarkPrismarineSlab => &[], BlockKind::SeaLantern => &[], BlockKind::HayBlock => &[], BlockKind::WhiteCarpet => &[], @@ -10532,98 +17843,98 @@ impl BlockKind { BlockKind::GreenCarpet => &[], BlockKind::RedCarpet => &[], BlockKind::BlackCarpet => &[], - BlockKind::Terracotta => DIG_MULTIPLIERS_rock, - BlockKind::CoalBlock => DIG_MULTIPLIERS_rock, - BlockKind::PackedIce => DIG_MULTIPLIERS_rock, - BlockKind::Sunflower => DIG_MULTIPLIERS_plant, - BlockKind::Lilac => DIG_MULTIPLIERS_plant, - BlockKind::RoseBush => DIG_MULTIPLIERS_plant, - BlockKind::Peony => DIG_MULTIPLIERS_rock, - BlockKind::TallGrass => DIG_MULTIPLIERS_plant, - BlockKind::LargeFern => DIG_MULTIPLIERS_plant, - BlockKind::WhiteBanner => DIG_MULTIPLIERS_wood, - BlockKind::OrangeBanner => DIG_MULTIPLIERS_wood, - BlockKind::MagentaBanner => DIG_MULTIPLIERS_wood, - BlockKind::LightBlueBanner => DIG_MULTIPLIERS_wood, - BlockKind::YellowBanner => DIG_MULTIPLIERS_wood, - BlockKind::LimeBanner => DIG_MULTIPLIERS_wood, - BlockKind::PinkBanner => DIG_MULTIPLIERS_wood, - BlockKind::GrayBanner => DIG_MULTIPLIERS_wood, - BlockKind::LightGrayBanner => DIG_MULTIPLIERS_wood, - BlockKind::CyanBanner => DIG_MULTIPLIERS_wood, - BlockKind::PurpleBanner => DIG_MULTIPLIERS_wood, - BlockKind::BlueBanner => DIG_MULTIPLIERS_wood, - BlockKind::BrownBanner => DIG_MULTIPLIERS_wood, - BlockKind::GreenBanner => DIG_MULTIPLIERS_wood, - BlockKind::RedBanner => DIG_MULTIPLIERS_wood, - BlockKind::BlackBanner => DIG_MULTIPLIERS_wood, - BlockKind::WhiteWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::OrangeWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::MagentaWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::LightBlueWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::YellowWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::LimeWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::PinkWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::GrayWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::LightGrayWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::CyanWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::PurpleWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::BlueWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::BrownWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::GreenWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::RedWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::BlackWallBanner => DIG_MULTIPLIERS_wood, - BlockKind::RedSandstone => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledRedSandstone => DIG_MULTIPLIERS_rock, - BlockKind::CutRedSandstone => DIG_MULTIPLIERS_rock, - BlockKind::RedSandstoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::OakSlab => DIG_MULTIPLIERS_rock, - BlockKind::SpruceSlab => DIG_MULTIPLIERS_rock, - BlockKind::BirchSlab => DIG_MULTIPLIERS_rock, - BlockKind::JungleSlab => DIG_MULTIPLIERS_rock, - BlockKind::AcaciaSlab => DIG_MULTIPLIERS_rock, - BlockKind::DarkOakSlab => DIG_MULTIPLIERS_rock, - BlockKind::StoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::SmoothStoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::SandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::CutSandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::PetrifiedOakSlab => DIG_MULTIPLIERS_rock, - BlockKind::CobblestoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::BrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::StoneBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::NetherBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::QuartzSlab => DIG_MULTIPLIERS_rock, - BlockKind::RedSandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::CutRedSandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::PurpurSlab => DIG_MULTIPLIERS_rock, - BlockKind::SmoothStone => DIG_MULTIPLIERS_rock, - BlockKind::SmoothSandstone => DIG_MULTIPLIERS_rock, - BlockKind::SmoothQuartz => DIG_MULTIPLIERS_rock, - BlockKind::SmoothRedSandstone => DIG_MULTIPLIERS_rock, - BlockKind::SpruceFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::BirchFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::JungleFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::SpruceFence => DIG_MULTIPLIERS_wood, - BlockKind::BirchFence => DIG_MULTIPLIERS_wood, - BlockKind::JungleFence => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaFence => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakFence => DIG_MULTIPLIERS_wood, - BlockKind::SpruceDoor => DIG_MULTIPLIERS_wood, - BlockKind::BirchDoor => DIG_MULTIPLIERS_wood, - BlockKind::JungleDoor => DIG_MULTIPLIERS_wood, - BlockKind::AcaciaDoor => DIG_MULTIPLIERS_wood, - BlockKind::DarkOakDoor => DIG_MULTIPLIERS_wood, + BlockKind::Terracotta => &[], + BlockKind::CoalBlock => &[], + BlockKind::PackedIce => &[], + BlockKind::Sunflower => &[], + BlockKind::Lilac => &[], + BlockKind::RoseBush => &[], + BlockKind::Peony => &[], + BlockKind::TallGrass => &[], + BlockKind::LargeFern => &[], + BlockKind::WhiteBanner => &[], + BlockKind::OrangeBanner => &[], + BlockKind::MagentaBanner => &[], + BlockKind::LightBlueBanner => &[], + BlockKind::YellowBanner => &[], + BlockKind::LimeBanner => &[], + BlockKind::PinkBanner => &[], + BlockKind::GrayBanner => &[], + BlockKind::LightGrayBanner => &[], + BlockKind::CyanBanner => &[], + BlockKind::PurpleBanner => &[], + BlockKind::BlueBanner => &[], + BlockKind::BrownBanner => &[], + BlockKind::GreenBanner => &[], + BlockKind::RedBanner => &[], + BlockKind::BlackBanner => &[], + BlockKind::WhiteWallBanner => &[], + BlockKind::OrangeWallBanner => &[], + BlockKind::MagentaWallBanner => &[], + BlockKind::LightBlueWallBanner => &[], + BlockKind::YellowWallBanner => &[], + BlockKind::LimeWallBanner => &[], + BlockKind::PinkWallBanner => &[], + BlockKind::GrayWallBanner => &[], + BlockKind::LightGrayWallBanner => &[], + BlockKind::CyanWallBanner => &[], + BlockKind::PurpleWallBanner => &[], + BlockKind::BlueWallBanner => &[], + BlockKind::BrownWallBanner => &[], + BlockKind::GreenWallBanner => &[], + BlockKind::RedWallBanner => &[], + BlockKind::BlackWallBanner => &[], + BlockKind::RedSandstone => &[], + BlockKind::ChiseledRedSandstone => &[], + BlockKind::CutRedSandstone => &[], + BlockKind::RedSandstoneStairs => &[], + BlockKind::OakSlab => &[], + BlockKind::SpruceSlab => &[], + BlockKind::BirchSlab => &[], + BlockKind::JungleSlab => &[], + BlockKind::AcaciaSlab => &[], + BlockKind::DarkOakSlab => &[], + BlockKind::StoneSlab => &[], + BlockKind::SmoothStoneSlab => &[], + BlockKind::SandstoneSlab => &[], + BlockKind::CutSandstoneSlab => &[], + BlockKind::PetrifiedOakSlab => &[], + BlockKind::CobblestoneSlab => &[], + BlockKind::BrickSlab => &[], + BlockKind::StoneBrickSlab => &[], + BlockKind::NetherBrickSlab => &[], + BlockKind::QuartzSlab => &[], + BlockKind::RedSandstoneSlab => &[], + BlockKind::CutRedSandstoneSlab => &[], + BlockKind::PurpurSlab => &[], + BlockKind::SmoothStone => &[], + BlockKind::SmoothSandstone => &[], + BlockKind::SmoothQuartz => &[], + BlockKind::SmoothRedSandstone => &[], + BlockKind::SpruceFenceGate => &[], + BlockKind::BirchFenceGate => &[], + BlockKind::JungleFenceGate => &[], + BlockKind::AcaciaFenceGate => &[], + BlockKind::DarkOakFenceGate => &[], + BlockKind::SpruceFence => &[], + BlockKind::BirchFence => &[], + BlockKind::JungleFence => &[], + BlockKind::AcaciaFence => &[], + BlockKind::DarkOakFence => &[], + BlockKind::SpruceDoor => &[], + BlockKind::BirchDoor => &[], + BlockKind::JungleDoor => &[], + BlockKind::AcaciaDoor => &[], + BlockKind::DarkOakDoor => &[], BlockKind::EndRod => &[], BlockKind::ChorusPlant => &[], BlockKind::ChorusFlower => &[], BlockKind::PurpurBlock => &[], BlockKind::PurpurPillar => &[], - BlockKind::PurpurStairs => DIG_MULTIPLIERS_rock, - BlockKind::EndStoneBricks => DIG_MULTIPLIERS_rock, + BlockKind::PurpurStairs => &[], + BlockKind::EndStoneBricks => &[], BlockKind::Beetroots => &[], - BlockKind::GrassPath => DIG_MULTIPLIERS_dirt, + BlockKind::DirtPath => &[], BlockKind::EndGateway => &[], BlockKind::RepeatingCommandBlock => &[], BlockKind::ChainCommandBlock => &[], @@ -10651,68 +17962,68 @@ impl BlockKind { BlockKind::GreenShulkerBox => &[], BlockKind::RedShulkerBox => &[], BlockKind::BlackShulkerBox => &[], - BlockKind::WhiteGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::OrangeGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::MagentaGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LightBlueGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::YellowGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LimeGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::PinkGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::GrayGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::LightGrayGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::CyanGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::PurpleGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BlueGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BrownGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::GreenGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::RedGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::BlackGlazedTerracotta => DIG_MULTIPLIERS_rock, - BlockKind::WhiteConcrete => DIG_MULTIPLIERS_rock, - BlockKind::OrangeConcrete => DIG_MULTIPLIERS_rock, - BlockKind::MagentaConcrete => DIG_MULTIPLIERS_rock, - BlockKind::LightBlueConcrete => DIG_MULTIPLIERS_rock, - BlockKind::YellowConcrete => DIG_MULTIPLIERS_rock, - BlockKind::LimeConcrete => DIG_MULTIPLIERS_rock, - BlockKind::PinkConcrete => DIG_MULTIPLIERS_rock, - BlockKind::GrayConcrete => DIG_MULTIPLIERS_rock, - BlockKind::LightGrayConcrete => DIG_MULTIPLIERS_rock, - BlockKind::CyanConcrete => DIG_MULTIPLIERS_rock, - BlockKind::PurpleConcrete => DIG_MULTIPLIERS_rock, - BlockKind::BlueConcrete => DIG_MULTIPLIERS_rock, - BlockKind::BrownConcrete => DIG_MULTIPLIERS_rock, - BlockKind::GreenConcrete => DIG_MULTIPLIERS_rock, - BlockKind::RedConcrete => DIG_MULTIPLIERS_rock, - BlockKind::BlackConcrete => DIG_MULTIPLIERS_rock, - BlockKind::WhiteConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::OrangeConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::MagentaConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::LightBlueConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::YellowConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::LimeConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::PinkConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::GrayConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::LightGrayConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::CyanConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::PurpleConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::BlueConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::BrownConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::GreenConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::RedConcretePowder => DIG_MULTIPLIERS_dirt, - BlockKind::BlackConcretePowder => DIG_MULTIPLIERS_dirt, + BlockKind::WhiteGlazedTerracotta => &[], + BlockKind::OrangeGlazedTerracotta => &[], + BlockKind::MagentaGlazedTerracotta => &[], + BlockKind::LightBlueGlazedTerracotta => &[], + BlockKind::YellowGlazedTerracotta => &[], + BlockKind::LimeGlazedTerracotta => &[], + BlockKind::PinkGlazedTerracotta => &[], + BlockKind::GrayGlazedTerracotta => &[], + BlockKind::LightGrayGlazedTerracotta => &[], + BlockKind::CyanGlazedTerracotta => &[], + BlockKind::PurpleGlazedTerracotta => &[], + BlockKind::BlueGlazedTerracotta => &[], + BlockKind::BrownGlazedTerracotta => &[], + BlockKind::GreenGlazedTerracotta => &[], + BlockKind::RedGlazedTerracotta => &[], + BlockKind::BlackGlazedTerracotta => &[], + BlockKind::WhiteConcrete => &[], + BlockKind::OrangeConcrete => &[], + BlockKind::MagentaConcrete => &[], + BlockKind::LightBlueConcrete => &[], + BlockKind::YellowConcrete => &[], + BlockKind::LimeConcrete => &[], + BlockKind::PinkConcrete => &[], + BlockKind::GrayConcrete => &[], + BlockKind::LightGrayConcrete => &[], + BlockKind::CyanConcrete => &[], + BlockKind::PurpleConcrete => &[], + BlockKind::BlueConcrete => &[], + BlockKind::BrownConcrete => &[], + BlockKind::GreenConcrete => &[], + BlockKind::RedConcrete => &[], + BlockKind::BlackConcrete => &[], + BlockKind::WhiteConcretePowder => &[], + BlockKind::OrangeConcretePowder => &[], + BlockKind::MagentaConcretePowder => &[], + BlockKind::LightBlueConcretePowder => &[], + BlockKind::YellowConcretePowder => &[], + BlockKind::LimeConcretePowder => &[], + BlockKind::PinkConcretePowder => &[], + BlockKind::GrayConcretePowder => &[], + BlockKind::LightGrayConcretePowder => &[], + BlockKind::CyanConcretePowder => &[], + BlockKind::PurpleConcretePowder => &[], + BlockKind::BlueConcretePowder => &[], + BlockKind::BrownConcretePowder => &[], + BlockKind::GreenConcretePowder => &[], + BlockKind::RedConcretePowder => &[], + BlockKind::BlackConcretePowder => &[], BlockKind::Kelp => &[], BlockKind::KelpPlant => &[], BlockKind::DriedKelpBlock => &[], BlockKind::TurtleEgg => &[], - BlockKind::DeadTubeCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::DeadBrainCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::DeadBubbleCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::DeadFireCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::DeadHornCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::TubeCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::BrainCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::BubbleCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::FireCoralBlock => DIG_MULTIPLIERS_rock, - BlockKind::HornCoralBlock => DIG_MULTIPLIERS_rock, + BlockKind::DeadTubeCoralBlock => &[], + BlockKind::DeadBrainCoralBlock => &[], + BlockKind::DeadBubbleCoralBlock => &[], + BlockKind::DeadFireCoralBlock => &[], + BlockKind::DeadHornCoralBlock => &[], + BlockKind::TubeCoralBlock => &[], + BlockKind::BrainCoralBlock => &[], + BlockKind::BubbleCoralBlock => &[], + BlockKind::FireCoralBlock => &[], + BlockKind::HornCoralBlock => &[], BlockKind::DeadTubeCoral => &[], BlockKind::DeadBrainCoral => &[], BlockKind::DeadBubbleCoral => &[], @@ -10745,83 +18056,83 @@ impl BlockKind { BlockKind::HornCoralWallFan => &[], BlockKind::SeaPickle => &[], BlockKind::BlueIce => &[], - BlockKind::Conduit => DIG_MULTIPLIERS_rock, + BlockKind::Conduit => &[], BlockKind::BambooSapling => &[], BlockKind::Bamboo => &[], BlockKind::PottedBamboo => &[], BlockKind::VoidAir => &[], BlockKind::CaveAir => &[], BlockKind::BubbleColumn => &[], - BlockKind::PolishedGraniteStairs => DIG_MULTIPLIERS_rock, - BlockKind::SmoothRedSandstoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::MossyStoneBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::PolishedDioriteStairs => DIG_MULTIPLIERS_rock, - BlockKind::MossyCobblestoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::EndStoneBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::StoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::SmoothSandstoneStairs => DIG_MULTIPLIERS_rock, - BlockKind::SmoothQuartzStairs => DIG_MULTIPLIERS_rock, - BlockKind::GraniteStairs => DIG_MULTIPLIERS_rock, - BlockKind::AndesiteStairs => DIG_MULTIPLIERS_rock, - BlockKind::RedNetherBrickStairs => DIG_MULTIPLIERS_rock, - BlockKind::PolishedAndesiteStairs => DIG_MULTIPLIERS_rock, - BlockKind::DioriteStairs => DIG_MULTIPLIERS_rock, - BlockKind::PolishedGraniteSlab => DIG_MULTIPLIERS_rock, - BlockKind::SmoothRedSandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::MossyStoneBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::PolishedDioriteSlab => DIG_MULTIPLIERS_rock, - BlockKind::MossyCobblestoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::EndStoneBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::SmoothSandstoneSlab => DIG_MULTIPLIERS_rock, - BlockKind::SmoothQuartzSlab => DIG_MULTIPLIERS_rock, - BlockKind::GraniteSlab => DIG_MULTIPLIERS_rock, - BlockKind::AndesiteSlab => DIG_MULTIPLIERS_rock, - BlockKind::RedNetherBrickSlab => DIG_MULTIPLIERS_rock, - BlockKind::PolishedAndesiteSlab => DIG_MULTIPLIERS_rock, - BlockKind::DioriteSlab => DIG_MULTIPLIERS_rock, - BlockKind::BrickWall => DIG_MULTIPLIERS_rock, - BlockKind::PrismarineWall => DIG_MULTIPLIERS_rock, - BlockKind::RedSandstoneWall => DIG_MULTIPLIERS_rock, - BlockKind::MossyStoneBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::GraniteWall => DIG_MULTIPLIERS_rock, - BlockKind::StoneBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::NetherBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::AndesiteWall => DIG_MULTIPLIERS_rock, - BlockKind::RedNetherBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::SandstoneWall => DIG_MULTIPLIERS_rock, - BlockKind::EndStoneBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::DioriteWall => DIG_MULTIPLIERS_rock, + BlockKind::PolishedGraniteStairs => &[], + BlockKind::SmoothRedSandstoneStairs => &[], + BlockKind::MossyStoneBrickStairs => &[], + BlockKind::PolishedDioriteStairs => &[], + BlockKind::MossyCobblestoneStairs => &[], + BlockKind::EndStoneBrickStairs => &[], + BlockKind::StoneStairs => &[], + BlockKind::SmoothSandstoneStairs => &[], + BlockKind::SmoothQuartzStairs => &[], + BlockKind::GraniteStairs => &[], + BlockKind::AndesiteStairs => &[], + BlockKind::RedNetherBrickStairs => &[], + BlockKind::PolishedAndesiteStairs => &[], + BlockKind::DioriteStairs => &[], + BlockKind::PolishedGraniteSlab => &[], + BlockKind::SmoothRedSandstoneSlab => &[], + BlockKind::MossyStoneBrickSlab => &[], + BlockKind::PolishedDioriteSlab => &[], + BlockKind::MossyCobblestoneSlab => &[], + BlockKind::EndStoneBrickSlab => &[], + BlockKind::SmoothSandstoneSlab => &[], + BlockKind::SmoothQuartzSlab => &[], + BlockKind::GraniteSlab => &[], + BlockKind::AndesiteSlab => &[], + BlockKind::RedNetherBrickSlab => &[], + BlockKind::PolishedAndesiteSlab => &[], + BlockKind::DioriteSlab => &[], + BlockKind::BrickWall => &[], + BlockKind::PrismarineWall => &[], + BlockKind::RedSandstoneWall => &[], + BlockKind::MossyStoneBrickWall => &[], + BlockKind::GraniteWall => &[], + BlockKind::StoneBrickWall => &[], + BlockKind::NetherBrickWall => &[], + BlockKind::AndesiteWall => &[], + BlockKind::RedNetherBrickWall => &[], + BlockKind::SandstoneWall => &[], + BlockKind::EndStoneBrickWall => &[], + BlockKind::DioriteWall => &[], BlockKind::Scaffolding => &[], - BlockKind::Loom => DIG_MULTIPLIERS_wood, - BlockKind::Barrel => DIG_MULTIPLIERS_wood, - BlockKind::Smoker => DIG_MULTIPLIERS_rock, - BlockKind::BlastFurnace => DIG_MULTIPLIERS_rock, - BlockKind::CartographyTable => DIG_MULTIPLIERS_wood, - BlockKind::FletchingTable => DIG_MULTIPLIERS_wood, - BlockKind::Grindstone => DIG_MULTIPLIERS_rock, - BlockKind::Lectern => DIG_MULTIPLIERS_wood, - BlockKind::SmithingTable => DIG_MULTIPLIERS_wood, - BlockKind::Stonecutter => DIG_MULTIPLIERS_rock, - BlockKind::Bell => DIG_MULTIPLIERS_rock, - BlockKind::Lantern => DIG_MULTIPLIERS_rock, - BlockKind::SoulLantern => DIG_MULTIPLIERS_rock, - BlockKind::Campfire => DIG_MULTIPLIERS_wood, - BlockKind::SoulCampfire => DIG_MULTIPLIERS_wood, + BlockKind::Loom => &[], + BlockKind::Barrel => &[], + BlockKind::Smoker => &[], + BlockKind::BlastFurnace => &[], + BlockKind::CartographyTable => &[], + BlockKind::FletchingTable => &[], + BlockKind::Grindstone => &[], + BlockKind::Lectern => &[], + BlockKind::SmithingTable => &[], + BlockKind::Stonecutter => &[], + BlockKind::Bell => &[], + BlockKind::Lantern => &[], + BlockKind::SoulLantern => &[], + BlockKind::Campfire => &[], + BlockKind::SoulCampfire => &[], BlockKind::SweetBerryBush => &[], - BlockKind::WarpedStem => DIG_MULTIPLIERS_wood, - BlockKind::StrippedWarpedStem => DIG_MULTIPLIERS_wood, - BlockKind::WarpedHyphae => DIG_MULTIPLIERS_wood, - BlockKind::StrippedWarpedHyphae => DIG_MULTIPLIERS_wood, - BlockKind::WarpedNylium => DIG_MULTIPLIERS_rock, + BlockKind::WarpedStem => &[], + BlockKind::StrippedWarpedStem => &[], + BlockKind::WarpedHyphae => &[], + BlockKind::StrippedWarpedHyphae => &[], + BlockKind::WarpedNylium => &[], BlockKind::WarpedFungus => &[], BlockKind::WarpedWartBlock => &[], BlockKind::WarpedRoots => &[], - BlockKind::NetherSprouts => DIG_MULTIPLIERS_plant, - BlockKind::CrimsonStem => DIG_MULTIPLIERS_wood, - BlockKind::StrippedCrimsonStem => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonHyphae => DIG_MULTIPLIERS_wood, - BlockKind::StrippedCrimsonHyphae => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonNylium => DIG_MULTIPLIERS_rock, + BlockKind::NetherSprouts => &[], + BlockKind::CrimsonStem => &[], + BlockKind::StrippedCrimsonStem => &[], + BlockKind::CrimsonHyphae => &[], + BlockKind::StrippedCrimsonHyphae => &[], + BlockKind::CrimsonNylium => &[], BlockKind::CrimsonFungus => &[], BlockKind::Shroomlight => &[], BlockKind::WeepingVines => &[], @@ -10829,159 +18140,263 @@ impl BlockKind { BlockKind::TwistingVines => &[], BlockKind::TwistingVinesPlant => &[], BlockKind::CrimsonRoots => &[], - BlockKind::CrimsonPlanks => DIG_MULTIPLIERS_wood, - BlockKind::WarpedPlanks => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonSlab => DIG_MULTIPLIERS_wood, - BlockKind::WarpedSlab => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonPressurePlate => DIG_MULTIPLIERS_rock, - BlockKind::WarpedPressurePlate => DIG_MULTIPLIERS_rock, - BlockKind::CrimsonFence => DIG_MULTIPLIERS_wood, - BlockKind::WarpedFence => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::WarpedTrapdoor => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::WarpedFenceGate => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonStairs => DIG_MULTIPLIERS_wood, - BlockKind::WarpedStairs => DIG_MULTIPLIERS_wood, + BlockKind::CrimsonPlanks => &[], + BlockKind::WarpedPlanks => &[], + BlockKind::CrimsonSlab => &[], + BlockKind::WarpedSlab => &[], + BlockKind::CrimsonPressurePlate => &[], + BlockKind::WarpedPressurePlate => &[], + BlockKind::CrimsonFence => &[], + BlockKind::WarpedFence => &[], + BlockKind::CrimsonTrapdoor => &[], + BlockKind::WarpedTrapdoor => &[], + BlockKind::CrimsonFenceGate => &[], + BlockKind::WarpedFenceGate => &[], + BlockKind::CrimsonStairs => &[], + BlockKind::WarpedStairs => &[], BlockKind::CrimsonButton => &[], BlockKind::WarpedButton => &[], - BlockKind::CrimsonDoor => DIG_MULTIPLIERS_wood, - BlockKind::WarpedDoor => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonSign => DIG_MULTIPLIERS_wood, - BlockKind::WarpedSign => DIG_MULTIPLIERS_wood, - BlockKind::CrimsonWallSign => DIG_MULTIPLIERS_wood, - BlockKind::WarpedWallSign => DIG_MULTIPLIERS_wood, + BlockKind::CrimsonDoor => &[], + BlockKind::WarpedDoor => &[], + BlockKind::CrimsonSign => &[], + BlockKind::WarpedSign => &[], + BlockKind::CrimsonWallSign => &[], + BlockKind::WarpedWallSign => &[], BlockKind::StructureBlock => &[], BlockKind::Jigsaw => &[], - BlockKind::Composter => DIG_MULTIPLIERS_wood, + BlockKind::Composter => &[], BlockKind::Target => &[], - BlockKind::BeeNest => DIG_MULTIPLIERS_wood, - BlockKind::Beehive => DIG_MULTIPLIERS_wood, + BlockKind::BeeNest => &[], + BlockKind::Beehive => &[], BlockKind::HoneyBlock => &[], BlockKind::HoneycombBlock => &[], - BlockKind::NetheriteBlock => DIG_MULTIPLIERS_rock, - BlockKind::AncientDebris => DIG_MULTIPLIERS_rock, - BlockKind::CryingObsidian => DIG_MULTIPLIERS_rock, - BlockKind::RespawnAnchor => DIG_MULTIPLIERS_rock, + BlockKind::NetheriteBlock => &[], + BlockKind::AncientDebris => &[], + BlockKind::CryingObsidian => &[], + BlockKind::RespawnAnchor => &[], BlockKind::PottedCrimsonFungus => &[], BlockKind::PottedWarpedFungus => &[], BlockKind::PottedCrimsonRoots => &[], BlockKind::PottedWarpedRoots => &[], - BlockKind::Lodestone => DIG_MULTIPLIERS_rock, - BlockKind::Blackstone => DIG_MULTIPLIERS_rock, - BlockKind::BlackstoneStairs => DIG_MULTIPLIERS_wood, - BlockKind::BlackstoneWall => DIG_MULTIPLIERS_rock, - BlockKind::BlackstoneSlab => DIG_MULTIPLIERS_wood, - BlockKind::PolishedBlackstone => DIG_MULTIPLIERS_rock, - BlockKind::PolishedBlackstoneBricks => DIG_MULTIPLIERS_rock, - BlockKind::CrackedPolishedBlackstoneBricks => DIG_MULTIPLIERS_rock, + BlockKind::Lodestone => &[], + BlockKind::Blackstone => &[], + BlockKind::BlackstoneStairs => &[], + BlockKind::BlackstoneWall => &[], + BlockKind::BlackstoneSlab => &[], + BlockKind::PolishedBlackstone => &[], + BlockKind::PolishedBlackstoneBricks => &[], + BlockKind::CrackedPolishedBlackstoneBricks => &[], BlockKind::ChiseledPolishedBlackstone => &[], - BlockKind::PolishedBlackstoneBrickSlab => DIG_MULTIPLIERS_wood, - BlockKind::PolishedBlackstoneBrickStairs => DIG_MULTIPLIERS_wood, - BlockKind::PolishedBlackstoneBrickWall => DIG_MULTIPLIERS_rock, - BlockKind::GildedBlackstone => DIG_MULTIPLIERS_rock, - BlockKind::PolishedBlackstoneStairs => DIG_MULTIPLIERS_wood, - BlockKind::PolishedBlackstoneSlab => DIG_MULTIPLIERS_wood, - BlockKind::PolishedBlackstonePressurePlate => DIG_MULTIPLIERS_rock, + BlockKind::PolishedBlackstoneBrickSlab => &[], + BlockKind::PolishedBlackstoneBrickStairs => &[], + BlockKind::PolishedBlackstoneBrickWall => &[], + BlockKind::GildedBlackstone => &[], + BlockKind::PolishedBlackstoneStairs => &[], + BlockKind::PolishedBlackstoneSlab => &[], + BlockKind::PolishedBlackstonePressurePlate => &[], BlockKind::PolishedBlackstoneButton => &[], - BlockKind::PolishedBlackstoneWall => DIG_MULTIPLIERS_rock, - BlockKind::ChiseledNetherBricks => DIG_MULTIPLIERS_rock, - BlockKind::CrackedNetherBricks => DIG_MULTIPLIERS_rock, - BlockKind::QuartzBricks => DIG_MULTIPLIERS_rock, + BlockKind::PolishedBlackstoneWall => &[], + BlockKind::ChiseledNetherBricks => &[], + BlockKind::CrackedNetherBricks => &[], + BlockKind::QuartzBricks => &[], + BlockKind::Candle => &[], + BlockKind::WhiteCandle => &[], + BlockKind::OrangeCandle => &[], + BlockKind::MagentaCandle => &[], + BlockKind::LightBlueCandle => &[], + BlockKind::YellowCandle => &[], + BlockKind::LimeCandle => &[], + BlockKind::PinkCandle => &[], + BlockKind::GrayCandle => &[], + BlockKind::LightGrayCandle => &[], + BlockKind::CyanCandle => &[], + BlockKind::PurpleCandle => &[], + BlockKind::BlueCandle => &[], + BlockKind::BrownCandle => &[], + BlockKind::GreenCandle => &[], + BlockKind::RedCandle => &[], + BlockKind::BlackCandle => &[], + BlockKind::CandleCake => &[], + BlockKind::WhiteCandleCake => &[], + BlockKind::OrangeCandleCake => &[], + BlockKind::MagentaCandleCake => &[], + BlockKind::LightBlueCandleCake => &[], + BlockKind::YellowCandleCake => &[], + BlockKind::LimeCandleCake => &[], + BlockKind::PinkCandleCake => &[], + BlockKind::GrayCandleCake => &[], + BlockKind::LightGrayCandleCake => &[], + BlockKind::CyanCandleCake => &[], + BlockKind::PurpleCandleCake => &[], + BlockKind::BlueCandleCake => &[], + BlockKind::BrownCandleCake => &[], + BlockKind::GreenCandleCake => &[], + BlockKind::RedCandleCake => &[], + BlockKind::BlackCandleCake => &[], + BlockKind::AmethystBlock => &[], + BlockKind::BuddingAmethyst => &[], + BlockKind::AmethystCluster => &[], + BlockKind::LargeAmethystBud => &[], + BlockKind::MediumAmethystBud => &[], + BlockKind::SmallAmethystBud => &[], + BlockKind::Tuff => &[], + BlockKind::Calcite => &[], + BlockKind::TintedGlass => &[], + BlockKind::PowderSnow => &[], + BlockKind::SculkSensor => &[], + BlockKind::OxidizedCopper => &[], + BlockKind::WeatheredCopper => &[], + BlockKind::ExposedCopper => &[], + BlockKind::CopperBlock => &[], + BlockKind::CopperOre => &[], + BlockKind::DeepslateCopperOre => &[], + BlockKind::OxidizedCutCopper => &[], + BlockKind::WeatheredCutCopper => &[], + BlockKind::ExposedCutCopper => &[], + BlockKind::CutCopper => &[], + BlockKind::OxidizedCutCopperStairs => &[], + BlockKind::WeatheredCutCopperStairs => &[], + BlockKind::ExposedCutCopperStairs => &[], + BlockKind::CutCopperStairs => &[], + BlockKind::OxidizedCutCopperSlab => &[], + BlockKind::WeatheredCutCopperSlab => &[], + BlockKind::ExposedCutCopperSlab => &[], + BlockKind::CutCopperSlab => &[], + BlockKind::WaxedCopperBlock => &[], + BlockKind::WaxedWeatheredCopper => &[], + BlockKind::WaxedExposedCopper => &[], + BlockKind::WaxedOxidizedCopper => &[], + BlockKind::WaxedOxidizedCutCopper => &[], + BlockKind::WaxedWeatheredCutCopper => &[], + BlockKind::WaxedExposedCutCopper => &[], + BlockKind::WaxedCutCopper => &[], + BlockKind::WaxedOxidizedCutCopperStairs => &[], + BlockKind::WaxedWeatheredCutCopperStairs => &[], + BlockKind::WaxedExposedCutCopperStairs => &[], + BlockKind::WaxedCutCopperStairs => &[], + BlockKind::WaxedOxidizedCutCopperSlab => &[], + BlockKind::WaxedWeatheredCutCopperSlab => &[], + BlockKind::WaxedExposedCutCopperSlab => &[], + BlockKind::WaxedCutCopperSlab => &[], + BlockKind::LightningRod => &[], + BlockKind::PointedDripstone => &[], + BlockKind::DripstoneBlock => &[], + BlockKind::CaveVines => &[], + BlockKind::CaveVinesPlant => &[], + BlockKind::SporeBlossom => &[], + BlockKind::Azalea => &[], + BlockKind::FloweringAzalea => &[], + BlockKind::MossCarpet => &[], + BlockKind::MossBlock => &[], + BlockKind::BigDripleaf => &[], + BlockKind::BigDripleafStem => &[], + BlockKind::SmallDripleaf => &[], + BlockKind::HangingRoots => &[], + BlockKind::RootedDirt => &[], + BlockKind::Deepslate => &[], + BlockKind::CobbledDeepslate => &[], + BlockKind::CobbledDeepslateStairs => &[], + BlockKind::CobbledDeepslateSlab => &[], + BlockKind::CobbledDeepslateWall => &[], + BlockKind::PolishedDeepslate => &[], + BlockKind::PolishedDeepslateStairs => &[], + BlockKind::PolishedDeepslateSlab => &[], + BlockKind::PolishedDeepslateWall => &[], + BlockKind::DeepslateTiles => &[], + BlockKind::DeepslateTileStairs => &[], + BlockKind::DeepslateTileSlab => &[], + BlockKind::DeepslateTileWall => &[], + BlockKind::DeepslateBricks => &[], + BlockKind::DeepslateBrickStairs => &[], + BlockKind::DeepslateBrickSlab => &[], + BlockKind::DeepslateBrickWall => &[], + BlockKind::ChiseledDeepslate => &[], + BlockKind::CrackedDeepslateBricks => &[], + BlockKind::CrackedDeepslateTiles => &[], + BlockKind::InfestedDeepslate => &[], + BlockKind::SmoothBasalt => &[], + BlockKind::RawIronBlock => &[], + BlockKind::RawCopperBlock => &[], + BlockKind::RawGoldBlock => &[], + BlockKind::PottedAzaleaBush => &[], + BlockKind::PottedFloweringAzaleaBush => &[], } } } -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `harvest_tools` property of this `BlockKind`. + #[doc = "Returns the `harvest_tools` property of this `BlockKind`."] + #[inline] pub fn harvest_tools(&self) -> Option<&'static [libcraft_items::Item]> { match self { BlockKind::Air => None, - BlockKind::Stone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Granite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedGranite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Diorite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedDiorite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Andesite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesite => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Stone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Granite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedGranite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Diorite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDiorite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Andesite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedAndesite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::GrassBlock => None, BlockKind::Dirt => None, BlockKind::CoarseDirt => None, BlockKind::Podzol => None, - BlockKind::Cobblestone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Cobblestone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakPlanks => None, BlockKind::SprucePlanks => None, BlockKind::BirchPlanks => None, @@ -11000,41 +18415,52 @@ impl BlockKind { BlockKind::Sand => None, BlockKind::RedSand => None, BlockKind::Gravel => None, - BlockKind::GoldOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::IronOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CoalOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherGoldOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::GoldOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateGoldOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::IronOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateIronOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CoalOre => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateCoalOre => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherGoldOre => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakLog => None, BlockKind::SpruceLog => None, BlockKind::BirchLog => None, @@ -11065,65 +18491,61 @@ impl BlockKind { BlockKind::JungleLeaves => None, BlockKind::AcaciaLeaves => None, BlockKind::DarkOakLeaves => None, + BlockKind::AzaleaLeaves => None, + BlockKind::FloweringAzaleaLeaves => None, BlockKind::Sponge => None, BlockKind::WetSponge => None, BlockKind::Glass => None, - BlockKind::LapisOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LapisBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Dispenser => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Sandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::LapisOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateLapisOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LapisBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Dispenser => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Sandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::NoteBlock => None, BlockKind::WhiteBed => None, BlockKind::OrangeBed => None, @@ -11144,17 +18566,15 @@ impl BlockKind { BlockKind::PoweredRail => None, BlockKind::DetectorRail => None, BlockKind::StickyPiston => None, - BlockKind::Cobweb => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronSword, - libcraft_items::Item::WoodenSword, - libcraft_items::Item::StoneSword, - libcraft_items::Item::DiamondSword, - libcraft_items::Item::GoldenSword, - libcraft_items::Item::Shears, - ]; - Some(TOOLS) - } + BlockKind::Cobweb => Some(&[ + libcraft_items::Item::WoodenSword, + libcraft_items::Item::StoneSword, + libcraft_items::Item::GoldenSword, + libcraft_items::Item::IronSword, + libcraft_items::Item::DiamondSword, + libcraft_items::Item::NetheriteSword, + libcraft_items::Item::Shears, + ]), BlockKind::Grass => None, BlockKind::Fern => None, BlockKind::DeadBush => None, @@ -11194,91 +18614,80 @@ impl BlockKind { BlockKind::LilyOfTheValley => None, BlockKind::BrownMushroom => None, BlockKind::RedMushroom => None, - BlockKind::GoldBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::IronBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Bricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::GoldBlock => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::IronBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Bricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Tnt => None, BlockKind::Bookshelf => None, - BlockKind::MossyCobblestone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Obsidian => { - const TOOLS: &[libcraft_items::Item] = &[libcraft_items::Item::DiamondPickaxe]; - Some(TOOLS) - } + BlockKind::MossyCobblestone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Obsidian => Some(&[ + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Torch => None, BlockKind::WallTorch => None, BlockKind::Fire => None, BlockKind::SoulFire => None, - BlockKind::Spawner => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Spawner => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakStairs => None, BlockKind::Chest => None, BlockKind::RedstoneWire => None, - BlockKind::DiamondOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DiamondBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } + BlockKind::DiamondOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateDiamondOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DiamondBlock => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::CraftingTable => None, BlockKind::Wheat => None, BlockKind::Farmland => None, - BlockKind::Furnace => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Furnace => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakSign => None, BlockKind::SpruceSign => None, BlockKind::BirchSign => None, @@ -11288,16 +18697,14 @@ impl BlockKind { BlockKind::OakDoor => None, BlockKind::Ladder => None, BlockKind::Rail => None, - BlockKind::CobblestoneStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::CobblestoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakWallSign => None, BlockKind::SpruceWallSign => None, BlockKind::BirchWallSign => None, @@ -11305,101 +18712,90 @@ impl BlockKind { BlockKind::JungleWallSign => None, BlockKind::DarkOakWallSign => None, BlockKind::Lever => None, - BlockKind::StonePressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::IronDoor => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::StonePressurePlate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::IronDoor => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::OakPressurePlate => None, BlockKind::SprucePressurePlate => None, BlockKind::BirchPressurePlate => None, BlockKind::JunglePressurePlate => None, BlockKind::AcaciaPressurePlate => None, BlockKind::DarkOakPressurePlate => None, - BlockKind::RedstoneOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } + BlockKind::RedstoneOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateRedstoneOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::RedstoneTorch => None, BlockKind::RedstoneWallTorch => None, BlockKind::StoneButton => None, - BlockKind::Snow => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronShovel, - libcraft_items::Item::WoodenShovel, - libcraft_items::Item::StoneShovel, - libcraft_items::Item::DiamondShovel, - libcraft_items::Item::GoldenShovel, - ]; - Some(TOOLS) - } + BlockKind::Snow => Some(&[ + libcraft_items::Item::WoodenShovel, + libcraft_items::Item::StoneShovel, + libcraft_items::Item::GoldenShovel, + libcraft_items::Item::IronShovel, + libcraft_items::Item::DiamondShovel, + libcraft_items::Item::NetheriteShovel, + ]), BlockKind::Ice => None, - BlockKind::SnowBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronShovel, - libcraft_items::Item::WoodenShovel, - libcraft_items::Item::StoneShovel, - libcraft_items::Item::DiamondShovel, - libcraft_items::Item::GoldenShovel, - ]; - Some(TOOLS) - } + BlockKind::SnowBlock => Some(&[ + libcraft_items::Item::WoodenShovel, + libcraft_items::Item::StoneShovel, + libcraft_items::Item::GoldenShovel, + libcraft_items::Item::IronShovel, + libcraft_items::Item::DiamondShovel, + libcraft_items::Item::NetheriteShovel, + ]), BlockKind::Cactus => None, BlockKind::Clay => None, BlockKind::SugarCane => None, BlockKind::Jukebox => None, BlockKind::OakFence => None, BlockKind::Pumpkin => None, - BlockKind::Netherrack => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Netherrack => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::SoulSand => None, BlockKind::SoulSoil => None, - BlockKind::Basalt => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBasalt => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Basalt => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBasalt => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::SoulTorch => None, BlockKind::SoulWallTorch => None, BlockKind::Glowstone => None, @@ -11430,129 +18826,63 @@ impl BlockKind { BlockKind::JungleTrapdoor => None, BlockKind::AcaciaTrapdoor => None, BlockKind::DarkOakTrapdoor => None, - BlockKind::StoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedStone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedCobblestone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedMossyStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedCrackedStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::InfestedChiseledStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::StoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyStoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CrackedStoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledStoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::InfestedStone => None, + BlockKind::InfestedCobblestone => None, + BlockKind::InfestedStoneBricks => None, + BlockKind::InfestedMossyStoneBricks => None, + BlockKind::InfestedCrackedStoneBricks => None, + BlockKind::InfestedChiseledStoneBricks => None, BlockKind::BrownMushroomBlock => None, BlockKind::RedMushroomBlock => None, BlockKind::MushroomStem => None, - BlockKind::IronBars => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Chain => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::IronBars => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Chain => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::GlassPane => None, BlockKind::Melon => None, BlockKind::AttachedPumpkinStem => None, @@ -11560,166 +18890,166 @@ impl BlockKind { BlockKind::PumpkinStem => None, BlockKind::MelonStem => None, BlockKind::Vine => None, + BlockKind::GlowLichen => None, BlockKind::OakFenceGate => None, - BlockKind::BrickStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::BrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::StoneBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Mycelium => None, BlockKind::LilyPad => None, - BlockKind::NetherBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickFence => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::NetherBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherBrickFence => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::NetherWart => None, - BlockKind::EnchantingTable => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrewingStand => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Cauldron => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::EnchantingTable => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrewingStand => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Cauldron => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaterCauldron => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LavaCauldron => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PowderSnowCauldron => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::EndPortal => None, BlockKind::EndPortalFrame => None, - BlockKind::EndStone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::EndStone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::DragonEgg => None, BlockKind::RedstoneLamp => None, BlockKind::Cocoa => None, - BlockKind::SandstoneStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EmeraldOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EnderChest => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::SandstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EmeraldOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateEmeraldOre => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EnderChest => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::TripwireHook => None, BlockKind::Tripwire => None, - BlockKind::EmeraldBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::DiamondPickaxe, - ]; - Some(TOOLS) - } + BlockKind::EmeraldBlock => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::SpruceStairs => None, BlockKind::BirchStairs => None, BlockKind::JungleStairs => None, - BlockKind::CommandBlock => None, + BlockKind::CommandBlock => Some(&[]), BlockKind::Beacon => None, - BlockKind::CobblestoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyCobblestoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::CobblestoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyCobblestoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::FlowerPot => None, BlockKind::PottedOakSapling => None, BlockKind::PottedSpruceSapling => None, @@ -11765,300 +19095,242 @@ impl BlockKind { BlockKind::CreeperWallHead => None, BlockKind::DragonHead => None, BlockKind::DragonWallHead => None, - BlockKind::Anvil => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChippedAnvil => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DamagedAnvil => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Anvil => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChippedAnvil => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DamagedAnvil => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::TrappedChest => None, - BlockKind::LightWeightedPressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::HeavyWeightedPressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::LightWeightedPressurePlate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::HeavyWeightedPressurePlate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Comparator => None, BlockKind::DaylightDetector => None, - BlockKind::RedstoneBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherQuartzOre => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Hopper => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledQuartzBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzPillar => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::RedstoneBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherQuartzOre => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Hopper => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::QuartzBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledQuartzBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::QuartzPillar => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::QuartzStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::ActivatorRail => None, - BlockKind::Dropper => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Dropper => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WhiteTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OrangeTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MagentaTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightBlueTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::YellowTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LimeTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PinkTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GrayTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightGrayTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CyanTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpleTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlueTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrownTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GreenTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::WhiteStainedGlassPane => None, BlockKind::OrangeStainedGlassPane => None, BlockKind::MagentaStainedGlassPane => None, @@ -12079,106 +19351,87 @@ impl BlockKind { BlockKind::DarkOakStairs => None, BlockKind::SlimeBlock => None, BlockKind::Barrier => None, - BlockKind::IronTrapdoor => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Prismarine => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarine => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBrickStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarineStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkPrismarineSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Light => None, + BlockKind::IronTrapdoor => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Prismarine => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DarkPrismarine => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DarkPrismarineStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DarkPrismarineSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::SeaLantern => None, BlockKind::HayBlock => None, BlockKind::WhiteCarpet => None, @@ -12197,40 +19450,27 @@ impl BlockKind { BlockKind::GreenCarpet => None, BlockKind::RedCarpet => None, BlockKind::BlackCarpet => None, - BlockKind::Terracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CoalBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Terracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CoalBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::PackedIce => None, BlockKind::Sunflower => None, BlockKind::Lilac => None, BlockKind::RoseBush => None, - BlockKind::Peony => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Peony => None, BlockKind::TallGrass => None, BlockKind::LargeFern => None, BlockKind::WhiteBanner => None, @@ -12265,276 +19505,180 @@ impl BlockKind { BlockKind::GreenWallBanner => None, BlockKind::RedWallBanner => None, BlockKind::BlackWallBanner => None, - BlockKind::RedSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledRedSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutRedSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OakSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SpruceSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BirchSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::JungleSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AcaciaSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DarkOakSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothStoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutSandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PetrifiedOakSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CobblestoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CutRedSandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothStone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothQuartz => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothRedSandstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::RedSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledRedSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutRedSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedSandstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OakSlab => None, + BlockKind::SpruceSlab => None, + BlockKind::BirchSlab => None, + BlockKind::JungleSlab => None, + BlockKind::AcaciaSlab => None, + BlockKind::DarkOakSlab => None, + BlockKind::StoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothStoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutSandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PetrifiedOakSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CobblestoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::StoneBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::QuartzSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedSandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutRedSandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpurSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothStone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothQuartz => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothRedSandstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::SpruceFenceGate => None, BlockKind::BirchFenceGate => None, BlockKind::JungleFenceGate => None, @@ -12553,94 +19697,78 @@ impl BlockKind { BlockKind::EndRod => None, BlockKind::ChorusPlant => None, BlockKind::ChorusFlower => None, - BlockKind::PurpurBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurPillar => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpurStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::PurpurBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpurPillar => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpurStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EndStoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Beetroots => None, - BlockKind::GrassPath => None, + BlockKind::DirtPath => None, BlockKind::EndGateway => None, - BlockKind::RepeatingCommandBlock => None, - BlockKind::ChainCommandBlock => None, + BlockKind::RepeatingCommandBlock => Some(&[]), + BlockKind::ChainCommandBlock => Some(&[]), BlockKind::FrostedIce => None, - BlockKind::MagmaBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::MagmaBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::NetherWartBlock => None, - BlockKind::RedNetherBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BoneBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::RedNetherBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BoneBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::StructureVoid => None, - BlockKind::Observer => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Observer => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::ShulkerBox => None, BlockKind::WhiteShulkerBox => None, BlockKind::OrangeShulkerBox => None, @@ -12658,326 +19786,262 @@ impl BlockKind { BlockKind::GreenShulkerBox => None, BlockKind::RedShulkerBox => None, BlockKind::BlackShulkerBox => None, - BlockKind::WhiteGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackGlazedTerracotta => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WhiteConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::OrangeConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MagentaConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightBlueConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::YellowConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LimeConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PinkConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GrayConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::LightGrayConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CyanConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PurpleConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlueConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrownConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GreenConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackConcrete => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::WhiteGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OrangeGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MagentaGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightBlueGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::YellowGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LimeGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PinkGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GrayGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightGrayGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CyanGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpleGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlueGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrownGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GreenGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackGlazedTerracotta => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WhiteConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OrangeConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MagentaConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightBlueConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::YellowConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LimeConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PinkConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GrayConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightGrayConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CyanConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PurpleConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlueConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrownConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GreenConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackConcrete => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::WhiteConcretePowder => None, BlockKind::OrangeConcretePowder => None, BlockKind::MagentaConcretePowder => None, @@ -12998,131 +20062,216 @@ impl BlockKind { BlockKind::KelpPlant => None, BlockKind::DriedKelpBlock => None, BlockKind::TurtleEgg => None, - BlockKind::DeadTubeCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadBrainCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadBubbleCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadFireCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadHornCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::TubeCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrainCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BubbleCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::FireCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::HornCoralBlock => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DeadTubeCoral => None, - BlockKind::DeadBrainCoral => None, - BlockKind::DeadBubbleCoral => None, - BlockKind::DeadFireCoral => None, - BlockKind::DeadHornCoral => None, + BlockKind::DeadTubeCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBrainCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBubbleCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadFireCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadHornCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::TubeCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrainCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BubbleCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::FireCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::HornCoralBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadTubeCoral => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBrainCoral => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBubbleCoral => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadFireCoral => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadHornCoral => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::TubeCoral => None, BlockKind::BrainCoral => None, BlockKind::BubbleCoral => None, BlockKind::FireCoral => None, BlockKind::HornCoral => None, - BlockKind::DeadTubeCoralFan => None, - BlockKind::DeadBrainCoralFan => None, - BlockKind::DeadBubbleCoralFan => None, - BlockKind::DeadFireCoralFan => None, - BlockKind::DeadHornCoralFan => None, + BlockKind::DeadTubeCoralFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBrainCoralFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBubbleCoralFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadFireCoralFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadHornCoralFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::TubeCoralFan => None, BlockKind::BrainCoralFan => None, BlockKind::BubbleCoralFan => None, BlockKind::FireCoralFan => None, BlockKind::HornCoralFan => None, - BlockKind::DeadTubeCoralWallFan => None, - BlockKind::DeadBrainCoralWallFan => None, - BlockKind::DeadBubbleCoralWallFan => None, - BlockKind::DeadFireCoralWallFan => None, - BlockKind::DeadHornCoralWallFan => None, + BlockKind::DeadTubeCoralWallFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBrainCoralWallFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadBubbleCoralWallFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadFireCoralWallFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeadHornCoralWallFan => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::TubeCoralWallFan => None, BlockKind::BrainCoralWallFan => None, BlockKind::BubbleCoralWallFan => None, @@ -13137,338 +20286,381 @@ impl BlockKind { BlockKind::VoidAir => None, BlockKind::CaveAir => None, BlockKind::BubbleColumn => None, - BlockKind::PolishedGraniteStairs => None, - BlockKind::SmoothRedSandstoneStairs => None, - BlockKind::MossyStoneBrickStairs => None, - BlockKind::PolishedDioriteStairs => None, - BlockKind::MossyCobblestoneStairs => None, - BlockKind::EndStoneBrickStairs => None, - BlockKind::StoneStairs => None, - BlockKind::SmoothSandstoneStairs => None, - BlockKind::SmoothQuartzStairs => None, - BlockKind::GraniteStairs => None, - BlockKind::AndesiteStairs => None, - BlockKind::RedNetherBrickStairs => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesiteStairs => None, - BlockKind::DioriteStairs => None, - BlockKind::PolishedGraniteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothRedSandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedDioriteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyCobblestoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothSandstoneSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SmoothQuartzSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GraniteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AndesiteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedNetherBrickSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedAndesiteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DioriteSlab => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PrismarineWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedSandstoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::MossyStoneBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GraniteWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::StoneBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::NetherBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::AndesiteWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::RedNetherBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SandstoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::EndStoneBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::DioriteWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::PolishedGraniteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothRedSandstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyStoneBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDioriteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyCobblestoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EndStoneBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::StoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothSandstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothQuartzStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GraniteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::AndesiteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedNetherBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedAndesiteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DioriteStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedGraniteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothRedSandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyStoneBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDioriteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyCobblestoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EndStoneBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothSandstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SmoothQuartzSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GraniteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::AndesiteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedNetherBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedAndesiteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DioriteSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PrismarineWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedSandstoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::MossyStoneBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GraniteWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::StoneBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::NetherBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::AndesiteWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RedNetherBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SandstoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::EndStoneBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DioriteWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Scaffolding => None, BlockKind::Loom => None, BlockKind::Barrel => None, - BlockKind::Smoker => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlastFurnace => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Smoker => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlastFurnace => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::CartographyTable => None, BlockKind::FletchingTable => None, - BlockKind::Grindstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Grindstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Lectern => None, BlockKind::SmithingTable => None, - BlockKind::Stonecutter => None, - BlockKind::Bell => None, - BlockKind::Lantern => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::SoulLantern => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Stonecutter => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Bell => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Lantern => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::SoulLantern => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::Campfire => None, BlockKind::SoulCampfire => None, BlockKind::SweetBerryBush => None, @@ -13476,16 +20668,14 @@ impl BlockKind { BlockKind::StrippedWarpedStem => None, BlockKind::WarpedHyphae => None, BlockKind::StrippedWarpedHyphae => None, - BlockKind::WarpedNylium => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::WarpedNylium => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::WarpedFungus => None, BlockKind::WarpedWartBlock => None, BlockKind::WarpedRoots => None, @@ -13494,16 +20684,14 @@ impl BlockKind { BlockKind::StrippedCrimsonStem => None, BlockKind::CrimsonHyphae => None, BlockKind::StrippedCrimsonHyphae => None, - BlockKind::CrimsonNylium => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::CrimsonNylium => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::CrimsonFungus => None, BlockKind::Shroomlight => None, BlockKind::WeepingVines => None, @@ -13515,26 +20703,8 @@ impl BlockKind { BlockKind::WarpedPlanks => None, BlockKind::CrimsonSlab => None, BlockKind::WarpedSlab => None, - BlockKind::CrimsonPressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::WarpedPressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::CrimsonPressurePlate => None, + BlockKind::WarpedPressurePlate => None, BlockKind::CrimsonFence => None, BlockKind::WarpedFence => None, BlockKind::CrimsonTrapdoor => None, @@ -13551,172 +20721,1593 @@ impl BlockKind { BlockKind::WarpedSign => None, BlockKind::CrimsonWallSign => None, BlockKind::WarpedWallSign => None, - BlockKind::StructureBlock => None, - BlockKind::Jigsaw => None, + BlockKind::StructureBlock => Some(&[]), + BlockKind::Jigsaw => Some(&[]), BlockKind::Composter => None, BlockKind::Target => None, BlockKind::BeeNest => None, BlockKind::Beehive => None, BlockKind::HoneyBlock => None, BlockKind::HoneycombBlock => None, - BlockKind::NetheriteBlock => { - const TOOLS: &[libcraft_items::Item] = &[libcraft_items::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::AncientDebris => { - const TOOLS: &[libcraft_items::Item] = &[libcraft_items::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::CryingObsidian => { - const TOOLS: &[libcraft_items::Item] = &[libcraft_items::Item::DiamondPickaxe]; - Some(TOOLS) - } - BlockKind::RespawnAnchor => { - const TOOLS: &[libcraft_items::Item] = &[libcraft_items::Item::DiamondPickaxe]; - Some(TOOLS) - } + BlockKind::NetheriteBlock => Some(&[ + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::AncientDebris => Some(&[ + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CryingObsidian => Some(&[ + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RespawnAnchor => Some(&[ + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::PottedCrimsonFungus => None, BlockKind::PottedWarpedFungus => None, BlockKind::PottedCrimsonRoots => None, BlockKind::PottedWarpedRoots => None, - BlockKind::Lodestone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::Blackstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackstoneStairs => None, - BlockKind::BlackstoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::BlackstoneSlab => None, - BlockKind::PolishedBlackstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBlackstoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedPolishedBlackstoneBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledPolishedBlackstone => None, - BlockKind::PolishedBlackstoneBrickSlab => None, - BlockKind::PolishedBlackstoneBrickStairs => None, - BlockKind::PolishedBlackstoneBrickWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::GildedBlackstone => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::PolishedBlackstoneStairs => None, - BlockKind::PolishedBlackstoneSlab => None, - BlockKind::PolishedBlackstonePressurePlate => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::Lodestone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Blackstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackstoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BlackstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CrackedPolishedBlackstoneBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledPolishedBlackstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::GildedBlackstone => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstoneSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedBlackstonePressurePlate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), BlockKind::PolishedBlackstoneButton => None, - BlockKind::PolishedBlackstoneWall => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::ChiseledNetherBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::CrackedNetherBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } - BlockKind::QuartzBricks => { - const TOOLS: &[libcraft_items::Item] = &[ - libcraft_items::Item::IronPickaxe, - libcraft_items::Item::WoodenPickaxe, - libcraft_items::Item::StonePickaxe, - libcraft_items::Item::DiamondPickaxe, - libcraft_items::Item::GoldenPickaxe, - ]; - Some(TOOLS) - } + BlockKind::PolishedBlackstoneWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledNetherBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CrackedNetherBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::QuartzBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Candle => None, + BlockKind::WhiteCandle => None, + BlockKind::OrangeCandle => None, + BlockKind::MagentaCandle => None, + BlockKind::LightBlueCandle => None, + BlockKind::YellowCandle => None, + BlockKind::LimeCandle => None, + BlockKind::PinkCandle => None, + BlockKind::GrayCandle => None, + BlockKind::LightGrayCandle => None, + BlockKind::CyanCandle => None, + BlockKind::PurpleCandle => None, + BlockKind::BlueCandle => None, + BlockKind::BrownCandle => None, + BlockKind::GreenCandle => None, + BlockKind::RedCandle => None, + BlockKind::BlackCandle => None, + BlockKind::CandleCake => None, + BlockKind::WhiteCandleCake => None, + BlockKind::OrangeCandleCake => None, + BlockKind::MagentaCandleCake => None, + BlockKind::LightBlueCandleCake => None, + BlockKind::YellowCandleCake => None, + BlockKind::LimeCandleCake => None, + BlockKind::PinkCandleCake => None, + BlockKind::GrayCandleCake => None, + BlockKind::LightGrayCandleCake => None, + BlockKind::CyanCandleCake => None, + BlockKind::PurpleCandleCake => None, + BlockKind::BlueCandleCake => None, + BlockKind::BrownCandleCake => None, + BlockKind::GreenCandleCake => None, + BlockKind::RedCandleCake => None, + BlockKind::BlackCandleCake => None, + BlockKind::AmethystBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::BuddingAmethyst => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::AmethystCluster => None, + BlockKind::LargeAmethystBud => None, + BlockKind::MediumAmethystBud => None, + BlockKind::SmallAmethystBud => None, + BlockKind::Tuff => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::Calcite => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::TintedGlass => None, + BlockKind::PowderSnow => None, + BlockKind::SculkSensor => None, + BlockKind::OxidizedCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WeatheredCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ExposedCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CopperBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CopperOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateCopperOre => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OxidizedCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WeatheredCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ExposedCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OxidizedCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WeatheredCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ExposedCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::OxidizedCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WeatheredCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ExposedCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedCopperBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedWeatheredCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedExposedCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedOxidizedCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedOxidizedCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedWeatheredCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedExposedCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedCutCopper => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedOxidizedCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedWeatheredCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedExposedCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedCutCopperStairs => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedOxidizedCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedWeatheredCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedExposedCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::WaxedCutCopperSlab => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::LightningRod => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PointedDripstone => None, + BlockKind::DripstoneBlock => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CaveVines => None, + BlockKind::CaveVinesPlant => None, + BlockKind::SporeBlossom => None, + BlockKind::Azalea => None, + BlockKind::FloweringAzalea => None, + BlockKind::MossCarpet => None, + BlockKind::MossBlock => None, + BlockKind::BigDripleaf => None, + BlockKind::BigDripleafStem => None, + BlockKind::SmallDripleaf => None, + BlockKind::HangingRoots => None, + BlockKind::RootedDirt => None, + BlockKind::Deepslate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CobbledDeepslate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CobbledDeepslateStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CobbledDeepslateSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CobbledDeepslateWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDeepslate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDeepslateStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDeepslateSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PolishedDeepslateWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateTiles => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateTileStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateTileSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateTileWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateBrickStairs => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateBrickSlab => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::DeepslateBrickWall => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::ChiseledDeepslate => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CrackedDeepslateBricks => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::CrackedDeepslateTiles => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::InfestedDeepslate => None, + BlockKind::SmoothBasalt => Some(&[ + libcraft_items::Item::WoodenPickaxe, + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::GoldenPickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RawIronBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RawCopperBlock => Some(&[ + libcraft_items::Item::StonePickaxe, + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::RawGoldBlock => Some(&[ + libcraft_items::Item::IronPickaxe, + libcraft_items::Item::DiamondPickaxe, + libcraft_items::Item::NetheritePickaxe, + ]), + BlockKind::PottedAzaleaBush => None, + BlockKind::PottedFloweringAzaleaBush => None, + } + } +} +impl BlockKind { + #[doc = "Returns the `drops` property of this `BlockKind`."] + #[inline] + pub fn drops(&self) -> &'static [libcraft_items::Item] { + match self { + BlockKind::Air => &[], + BlockKind::Stone => &[], + BlockKind::Granite => &[], + BlockKind::PolishedGranite => &[], + BlockKind::Diorite => &[], + BlockKind::PolishedDiorite => &[], + BlockKind::Andesite => &[], + BlockKind::PolishedAndesite => &[], + BlockKind::GrassBlock => &[], + BlockKind::Dirt => &[], + BlockKind::CoarseDirt => &[], + BlockKind::Podzol => &[], + BlockKind::Cobblestone => &[], + BlockKind::OakPlanks => &[], + BlockKind::SprucePlanks => &[], + BlockKind::BirchPlanks => &[], + BlockKind::JunglePlanks => &[], + BlockKind::AcaciaPlanks => &[], + BlockKind::DarkOakPlanks => &[], + BlockKind::OakSapling => &[], + BlockKind::SpruceSapling => &[], + BlockKind::BirchSapling => &[], + BlockKind::JungleSapling => &[], + BlockKind::AcaciaSapling => &[], + BlockKind::DarkOakSapling => &[], + BlockKind::Bedrock => &[], + BlockKind::Water => &[], + BlockKind::Lava => &[], + BlockKind::Sand => &[], + BlockKind::RedSand => &[], + BlockKind::Gravel => &[], + BlockKind::GoldOre => &[], + BlockKind::DeepslateGoldOre => &[], + BlockKind::IronOre => &[], + BlockKind::DeepslateIronOre => &[], + BlockKind::CoalOre => &[], + BlockKind::DeepslateCoalOre => &[], + BlockKind::NetherGoldOre => &[], + BlockKind::OakLog => &[], + BlockKind::SpruceLog => &[], + BlockKind::BirchLog => &[], + BlockKind::JungleLog => &[], + BlockKind::AcaciaLog => &[], + BlockKind::DarkOakLog => &[], + BlockKind::StrippedSpruceLog => &[], + BlockKind::StrippedBirchLog => &[], + BlockKind::StrippedJungleLog => &[], + BlockKind::StrippedAcaciaLog => &[], + BlockKind::StrippedDarkOakLog => &[], + BlockKind::StrippedOakLog => &[], + BlockKind::OakWood => &[], + BlockKind::SpruceWood => &[], + BlockKind::BirchWood => &[], + BlockKind::JungleWood => &[], + BlockKind::AcaciaWood => &[], + BlockKind::DarkOakWood => &[], + BlockKind::StrippedOakWood => &[], + BlockKind::StrippedSpruceWood => &[], + BlockKind::StrippedBirchWood => &[], + BlockKind::StrippedJungleWood => &[], + BlockKind::StrippedAcaciaWood => &[], + BlockKind::StrippedDarkOakWood => &[], + BlockKind::OakLeaves => &[], + BlockKind::SpruceLeaves => &[], + BlockKind::BirchLeaves => &[], + BlockKind::JungleLeaves => &[], + BlockKind::AcaciaLeaves => &[], + BlockKind::DarkOakLeaves => &[], + BlockKind::AzaleaLeaves => &[], + BlockKind::FloweringAzaleaLeaves => &[], + BlockKind::Sponge => &[], + BlockKind::WetSponge => &[], + BlockKind::Glass => &[], + BlockKind::LapisOre => &[], + BlockKind::DeepslateLapisOre => &[], + BlockKind::LapisBlock => &[], + BlockKind::Dispenser => &[], + BlockKind::Sandstone => &[], + BlockKind::ChiseledSandstone => &[], + BlockKind::CutSandstone => &[], + BlockKind::NoteBlock => &[], + BlockKind::WhiteBed => &[], + BlockKind::OrangeBed => &[], + BlockKind::MagentaBed => &[], + BlockKind::LightBlueBed => &[], + BlockKind::YellowBed => &[], + BlockKind::LimeBed => &[], + BlockKind::PinkBed => &[], + BlockKind::GrayBed => &[], + BlockKind::LightGrayBed => &[], + BlockKind::CyanBed => &[], + BlockKind::PurpleBed => &[], + BlockKind::BlueBed => &[], + BlockKind::BrownBed => &[], + BlockKind::GreenBed => &[], + BlockKind::RedBed => &[], + BlockKind::BlackBed => &[], + BlockKind::PoweredRail => &[], + BlockKind::DetectorRail => &[], + BlockKind::StickyPiston => &[], + BlockKind::Cobweb => &[], + BlockKind::Grass => &[], + BlockKind::Fern => &[], + BlockKind::DeadBush => &[], + BlockKind::Seagrass => &[], + BlockKind::TallSeagrass => &[], + BlockKind::Piston => &[], + BlockKind::PistonHead => &[], + BlockKind::WhiteWool => &[], + BlockKind::OrangeWool => &[], + BlockKind::MagentaWool => &[], + BlockKind::LightBlueWool => &[], + BlockKind::YellowWool => &[], + BlockKind::LimeWool => &[], + BlockKind::PinkWool => &[], + BlockKind::GrayWool => &[], + BlockKind::LightGrayWool => &[], + BlockKind::CyanWool => &[], + BlockKind::PurpleWool => &[], + BlockKind::BlueWool => &[], + BlockKind::BrownWool => &[], + BlockKind::GreenWool => &[], + BlockKind::RedWool => &[], + BlockKind::BlackWool => &[], + BlockKind::MovingPiston => &[], + BlockKind::Dandelion => &[], + BlockKind::Poppy => &[], + BlockKind::BlueOrchid => &[], + BlockKind::Allium => &[], + BlockKind::AzureBluet => &[], + BlockKind::RedTulip => &[], + BlockKind::OrangeTulip => &[], + BlockKind::WhiteTulip => &[], + BlockKind::PinkTulip => &[], + BlockKind::OxeyeDaisy => &[], + BlockKind::Cornflower => &[], + BlockKind::WitherRose => &[], + BlockKind::LilyOfTheValley => &[], + BlockKind::BrownMushroom => &[], + BlockKind::RedMushroom => &[], + BlockKind::GoldBlock => &[], + BlockKind::IronBlock => &[], + BlockKind::Bricks => &[], + BlockKind::Tnt => &[], + BlockKind::Bookshelf => &[], + BlockKind::MossyCobblestone => &[], + BlockKind::Obsidian => &[], + BlockKind::Torch => &[], + BlockKind::WallTorch => &[], + BlockKind::Fire => &[], + BlockKind::SoulFire => &[], + BlockKind::Spawner => &[], + BlockKind::OakStairs => &[], + BlockKind::Chest => &[], + BlockKind::RedstoneWire => &[], + BlockKind::DiamondOre => &[], + BlockKind::DeepslateDiamondOre => &[], + BlockKind::DiamondBlock => &[], + BlockKind::CraftingTable => &[], + BlockKind::Wheat => &[], + BlockKind::Farmland => &[], + BlockKind::Furnace => &[], + BlockKind::OakSign => &[], + BlockKind::SpruceSign => &[], + BlockKind::BirchSign => &[], + BlockKind::AcaciaSign => &[], + BlockKind::JungleSign => &[], + BlockKind::DarkOakSign => &[], + BlockKind::OakDoor => &[], + BlockKind::Ladder => &[], + BlockKind::Rail => &[], + BlockKind::CobblestoneStairs => &[], + BlockKind::OakWallSign => &[], + BlockKind::SpruceWallSign => &[], + BlockKind::BirchWallSign => &[], + BlockKind::AcaciaWallSign => &[], + BlockKind::JungleWallSign => &[], + BlockKind::DarkOakWallSign => &[], + BlockKind::Lever => &[], + BlockKind::StonePressurePlate => &[], + BlockKind::IronDoor => &[], + BlockKind::OakPressurePlate => &[], + BlockKind::SprucePressurePlate => &[], + BlockKind::BirchPressurePlate => &[], + BlockKind::JunglePressurePlate => &[], + BlockKind::AcaciaPressurePlate => &[], + BlockKind::DarkOakPressurePlate => &[], + BlockKind::RedstoneOre => &[], + BlockKind::DeepslateRedstoneOre => &[], + BlockKind::RedstoneTorch => &[], + BlockKind::RedstoneWallTorch => &[], + BlockKind::StoneButton => &[], + BlockKind::Snow => &[], + BlockKind::Ice => &[], + BlockKind::SnowBlock => &[], + BlockKind::Cactus => &[], + BlockKind::Clay => &[], + BlockKind::SugarCane => &[], + BlockKind::Jukebox => &[], + BlockKind::OakFence => &[], + BlockKind::Pumpkin => &[], + BlockKind::Netherrack => &[], + BlockKind::SoulSand => &[], + BlockKind::SoulSoil => &[], + BlockKind::Basalt => &[], + BlockKind::PolishedBasalt => &[], + BlockKind::SoulTorch => &[], + BlockKind::SoulWallTorch => &[], + BlockKind::Glowstone => &[], + BlockKind::NetherPortal => &[], + BlockKind::CarvedPumpkin => &[], + BlockKind::JackOLantern => &[], + BlockKind::Cake => &[], + BlockKind::Repeater => &[], + BlockKind::WhiteStainedGlass => &[], + BlockKind::OrangeStainedGlass => &[], + BlockKind::MagentaStainedGlass => &[], + BlockKind::LightBlueStainedGlass => &[], + BlockKind::YellowStainedGlass => &[], + BlockKind::LimeStainedGlass => &[], + BlockKind::PinkStainedGlass => &[], + BlockKind::GrayStainedGlass => &[], + BlockKind::LightGrayStainedGlass => &[], + BlockKind::CyanStainedGlass => &[], + BlockKind::PurpleStainedGlass => &[], + BlockKind::BlueStainedGlass => &[], + BlockKind::BrownStainedGlass => &[], + BlockKind::GreenStainedGlass => &[], + BlockKind::RedStainedGlass => &[], + BlockKind::BlackStainedGlass => &[], + BlockKind::OakTrapdoor => &[], + BlockKind::SpruceTrapdoor => &[], + BlockKind::BirchTrapdoor => &[], + BlockKind::JungleTrapdoor => &[], + BlockKind::AcaciaTrapdoor => &[], + BlockKind::DarkOakTrapdoor => &[], + BlockKind::StoneBricks => &[], + BlockKind::MossyStoneBricks => &[], + BlockKind::CrackedStoneBricks => &[], + BlockKind::ChiseledStoneBricks => &[], + BlockKind::InfestedStone => &[], + BlockKind::InfestedCobblestone => &[], + BlockKind::InfestedStoneBricks => &[], + BlockKind::InfestedMossyStoneBricks => &[], + BlockKind::InfestedCrackedStoneBricks => &[], + BlockKind::InfestedChiseledStoneBricks => &[], + BlockKind::BrownMushroomBlock => &[], + BlockKind::RedMushroomBlock => &[], + BlockKind::MushroomStem => &[], + BlockKind::IronBars => &[], + BlockKind::Chain => &[], + BlockKind::GlassPane => &[], + BlockKind::Melon => &[], + BlockKind::AttachedPumpkinStem => &[], + BlockKind::AttachedMelonStem => &[], + BlockKind::PumpkinStem => &[], + BlockKind::MelonStem => &[], + BlockKind::Vine => &[], + BlockKind::GlowLichen => &[], + BlockKind::OakFenceGate => &[], + BlockKind::BrickStairs => &[], + BlockKind::StoneBrickStairs => &[], + BlockKind::Mycelium => &[], + BlockKind::LilyPad => &[], + BlockKind::NetherBricks => &[], + BlockKind::NetherBrickFence => &[], + BlockKind::NetherBrickStairs => &[], + BlockKind::NetherWart => &[], + BlockKind::EnchantingTable => &[], + BlockKind::BrewingStand => &[], + BlockKind::Cauldron => &[], + BlockKind::WaterCauldron => &[], + BlockKind::LavaCauldron => &[], + BlockKind::PowderSnowCauldron => &[], + BlockKind::EndPortal => &[], + BlockKind::EndPortalFrame => &[], + BlockKind::EndStone => &[], + BlockKind::DragonEgg => &[], + BlockKind::RedstoneLamp => &[], + BlockKind::Cocoa => &[], + BlockKind::SandstoneStairs => &[], + BlockKind::EmeraldOre => &[], + BlockKind::DeepslateEmeraldOre => &[], + BlockKind::EnderChest => &[], + BlockKind::TripwireHook => &[], + BlockKind::Tripwire => &[], + BlockKind::EmeraldBlock => &[], + BlockKind::SpruceStairs => &[], + BlockKind::BirchStairs => &[], + BlockKind::JungleStairs => &[], + BlockKind::CommandBlock => &[], + BlockKind::Beacon => &[], + BlockKind::CobblestoneWall => &[], + BlockKind::MossyCobblestoneWall => &[], + BlockKind::FlowerPot => &[], + BlockKind::PottedOakSapling => &[], + BlockKind::PottedSpruceSapling => &[], + BlockKind::PottedBirchSapling => &[], + BlockKind::PottedJungleSapling => &[], + BlockKind::PottedAcaciaSapling => &[], + BlockKind::PottedDarkOakSapling => &[], + BlockKind::PottedFern => &[], + BlockKind::PottedDandelion => &[], + BlockKind::PottedPoppy => &[], + BlockKind::PottedBlueOrchid => &[], + BlockKind::PottedAllium => &[], + BlockKind::PottedAzureBluet => &[], + BlockKind::PottedRedTulip => &[], + BlockKind::PottedOrangeTulip => &[], + BlockKind::PottedWhiteTulip => &[], + BlockKind::PottedPinkTulip => &[], + BlockKind::PottedOxeyeDaisy => &[], + BlockKind::PottedCornflower => &[], + BlockKind::PottedLilyOfTheValley => &[], + BlockKind::PottedWitherRose => &[], + BlockKind::PottedRedMushroom => &[], + BlockKind::PottedBrownMushroom => &[], + BlockKind::PottedDeadBush => &[], + BlockKind::PottedCactus => &[], + BlockKind::Carrots => &[], + BlockKind::Potatoes => &[], + BlockKind::OakButton => &[], + BlockKind::SpruceButton => &[], + BlockKind::BirchButton => &[], + BlockKind::JungleButton => &[], + BlockKind::AcaciaButton => &[], + BlockKind::DarkOakButton => &[], + BlockKind::SkeletonSkull => &[], + BlockKind::SkeletonWallSkull => &[], + BlockKind::WitherSkeletonSkull => &[], + BlockKind::WitherSkeletonWallSkull => &[], + BlockKind::ZombieHead => &[], + BlockKind::ZombieWallHead => &[], + BlockKind::PlayerHead => &[], + BlockKind::PlayerWallHead => &[], + BlockKind::CreeperHead => &[], + BlockKind::CreeperWallHead => &[], + BlockKind::DragonHead => &[], + BlockKind::DragonWallHead => &[], + BlockKind::Anvil => &[], + BlockKind::ChippedAnvil => &[], + BlockKind::DamagedAnvil => &[], + BlockKind::TrappedChest => &[], + BlockKind::LightWeightedPressurePlate => &[], + BlockKind::HeavyWeightedPressurePlate => &[], + BlockKind::Comparator => &[], + BlockKind::DaylightDetector => &[], + BlockKind::RedstoneBlock => &[], + BlockKind::NetherQuartzOre => &[], + BlockKind::Hopper => &[], + BlockKind::QuartzBlock => &[], + BlockKind::ChiseledQuartzBlock => &[], + BlockKind::QuartzPillar => &[], + BlockKind::QuartzStairs => &[], + BlockKind::ActivatorRail => &[], + BlockKind::Dropper => &[], + BlockKind::WhiteTerracotta => &[], + BlockKind::OrangeTerracotta => &[], + BlockKind::MagentaTerracotta => &[], + BlockKind::LightBlueTerracotta => &[], + BlockKind::YellowTerracotta => &[], + BlockKind::LimeTerracotta => &[], + BlockKind::PinkTerracotta => &[], + BlockKind::GrayTerracotta => &[], + BlockKind::LightGrayTerracotta => &[], + BlockKind::CyanTerracotta => &[], + BlockKind::PurpleTerracotta => &[], + BlockKind::BlueTerracotta => &[], + BlockKind::BrownTerracotta => &[], + BlockKind::GreenTerracotta => &[], + BlockKind::RedTerracotta => &[], + BlockKind::BlackTerracotta => &[], + BlockKind::WhiteStainedGlassPane => &[], + BlockKind::OrangeStainedGlassPane => &[], + BlockKind::MagentaStainedGlassPane => &[], + BlockKind::LightBlueStainedGlassPane => &[], + BlockKind::YellowStainedGlassPane => &[], + BlockKind::LimeStainedGlassPane => &[], + BlockKind::PinkStainedGlassPane => &[], + BlockKind::GrayStainedGlassPane => &[], + BlockKind::LightGrayStainedGlassPane => &[], + BlockKind::CyanStainedGlassPane => &[], + BlockKind::PurpleStainedGlassPane => &[], + BlockKind::BlueStainedGlassPane => &[], + BlockKind::BrownStainedGlassPane => &[], + BlockKind::GreenStainedGlassPane => &[], + BlockKind::RedStainedGlassPane => &[], + BlockKind::BlackStainedGlassPane => &[], + BlockKind::AcaciaStairs => &[], + BlockKind::DarkOakStairs => &[], + BlockKind::SlimeBlock => &[], + BlockKind::Barrier => &[], + BlockKind::Light => &[], + BlockKind::IronTrapdoor => &[], + BlockKind::Prismarine => &[], + BlockKind::PrismarineBricks => &[], + BlockKind::DarkPrismarine => &[], + BlockKind::PrismarineStairs => &[], + BlockKind::PrismarineBrickStairs => &[], + BlockKind::DarkPrismarineStairs => &[], + BlockKind::PrismarineSlab => &[], + BlockKind::PrismarineBrickSlab => &[], + BlockKind::DarkPrismarineSlab => &[], + BlockKind::SeaLantern => &[], + BlockKind::HayBlock => &[], + BlockKind::WhiteCarpet => &[], + BlockKind::OrangeCarpet => &[], + BlockKind::MagentaCarpet => &[], + BlockKind::LightBlueCarpet => &[], + BlockKind::YellowCarpet => &[], + BlockKind::LimeCarpet => &[], + BlockKind::PinkCarpet => &[], + BlockKind::GrayCarpet => &[], + BlockKind::LightGrayCarpet => &[], + BlockKind::CyanCarpet => &[], + BlockKind::PurpleCarpet => &[], + BlockKind::BlueCarpet => &[], + BlockKind::BrownCarpet => &[], + BlockKind::GreenCarpet => &[], + BlockKind::RedCarpet => &[], + BlockKind::BlackCarpet => &[], + BlockKind::Terracotta => &[], + BlockKind::CoalBlock => &[], + BlockKind::PackedIce => &[], + BlockKind::Sunflower => &[], + BlockKind::Lilac => &[], + BlockKind::RoseBush => &[], + BlockKind::Peony => &[], + BlockKind::TallGrass => &[], + BlockKind::LargeFern => &[], + BlockKind::WhiteBanner => &[], + BlockKind::OrangeBanner => &[], + BlockKind::MagentaBanner => &[], + BlockKind::LightBlueBanner => &[], + BlockKind::YellowBanner => &[], + BlockKind::LimeBanner => &[], + BlockKind::PinkBanner => &[], + BlockKind::GrayBanner => &[], + BlockKind::LightGrayBanner => &[], + BlockKind::CyanBanner => &[], + BlockKind::PurpleBanner => &[], + BlockKind::BlueBanner => &[], + BlockKind::BrownBanner => &[], + BlockKind::GreenBanner => &[], + BlockKind::RedBanner => &[], + BlockKind::BlackBanner => &[], + BlockKind::WhiteWallBanner => &[], + BlockKind::OrangeWallBanner => &[], + BlockKind::MagentaWallBanner => &[], + BlockKind::LightBlueWallBanner => &[], + BlockKind::YellowWallBanner => &[], + BlockKind::LimeWallBanner => &[], + BlockKind::PinkWallBanner => &[], + BlockKind::GrayWallBanner => &[], + BlockKind::LightGrayWallBanner => &[], + BlockKind::CyanWallBanner => &[], + BlockKind::PurpleWallBanner => &[], + BlockKind::BlueWallBanner => &[], + BlockKind::BrownWallBanner => &[], + BlockKind::GreenWallBanner => &[], + BlockKind::RedWallBanner => &[], + BlockKind::BlackWallBanner => &[], + BlockKind::RedSandstone => &[], + BlockKind::ChiseledRedSandstone => &[], + BlockKind::CutRedSandstone => &[], + BlockKind::RedSandstoneStairs => &[], + BlockKind::OakSlab => &[], + BlockKind::SpruceSlab => &[], + BlockKind::BirchSlab => &[], + BlockKind::JungleSlab => &[], + BlockKind::AcaciaSlab => &[], + BlockKind::DarkOakSlab => &[], + BlockKind::StoneSlab => &[], + BlockKind::SmoothStoneSlab => &[], + BlockKind::SandstoneSlab => &[], + BlockKind::CutSandstoneSlab => &[], + BlockKind::PetrifiedOakSlab => &[], + BlockKind::CobblestoneSlab => &[], + BlockKind::BrickSlab => &[], + BlockKind::StoneBrickSlab => &[], + BlockKind::NetherBrickSlab => &[], + BlockKind::QuartzSlab => &[], + BlockKind::RedSandstoneSlab => &[], + BlockKind::CutRedSandstoneSlab => &[], + BlockKind::PurpurSlab => &[], + BlockKind::SmoothStone => &[], + BlockKind::SmoothSandstone => &[], + BlockKind::SmoothQuartz => &[], + BlockKind::SmoothRedSandstone => &[], + BlockKind::SpruceFenceGate => &[], + BlockKind::BirchFenceGate => &[], + BlockKind::JungleFenceGate => &[], + BlockKind::AcaciaFenceGate => &[], + BlockKind::DarkOakFenceGate => &[], + BlockKind::SpruceFence => &[], + BlockKind::BirchFence => &[], + BlockKind::JungleFence => &[], + BlockKind::AcaciaFence => &[], + BlockKind::DarkOakFence => &[], + BlockKind::SpruceDoor => &[], + BlockKind::BirchDoor => &[], + BlockKind::JungleDoor => &[], + BlockKind::AcaciaDoor => &[], + BlockKind::DarkOakDoor => &[], + BlockKind::EndRod => &[], + BlockKind::ChorusPlant => &[], + BlockKind::ChorusFlower => &[], + BlockKind::PurpurBlock => &[], + BlockKind::PurpurPillar => &[], + BlockKind::PurpurStairs => &[], + BlockKind::EndStoneBricks => &[], + BlockKind::Beetroots => &[], + BlockKind::DirtPath => &[], + BlockKind::EndGateway => &[], + BlockKind::RepeatingCommandBlock => &[], + BlockKind::ChainCommandBlock => &[], + BlockKind::FrostedIce => &[], + BlockKind::MagmaBlock => &[], + BlockKind::NetherWartBlock => &[], + BlockKind::RedNetherBricks => &[], + BlockKind::BoneBlock => &[], + BlockKind::StructureVoid => &[], + BlockKind::Observer => &[], + BlockKind::ShulkerBox => &[], + BlockKind::WhiteShulkerBox => &[], + BlockKind::OrangeShulkerBox => &[], + BlockKind::MagentaShulkerBox => &[], + BlockKind::LightBlueShulkerBox => &[], + BlockKind::YellowShulkerBox => &[], + BlockKind::LimeShulkerBox => &[], + BlockKind::PinkShulkerBox => &[], + BlockKind::GrayShulkerBox => &[], + BlockKind::LightGrayShulkerBox => &[], + BlockKind::CyanShulkerBox => &[], + BlockKind::PurpleShulkerBox => &[], + BlockKind::BlueShulkerBox => &[], + BlockKind::BrownShulkerBox => &[], + BlockKind::GreenShulkerBox => &[], + BlockKind::RedShulkerBox => &[], + BlockKind::BlackShulkerBox => &[], + BlockKind::WhiteGlazedTerracotta => &[], + BlockKind::OrangeGlazedTerracotta => &[], + BlockKind::MagentaGlazedTerracotta => &[], + BlockKind::LightBlueGlazedTerracotta => &[], + BlockKind::YellowGlazedTerracotta => &[], + BlockKind::LimeGlazedTerracotta => &[], + BlockKind::PinkGlazedTerracotta => &[], + BlockKind::GrayGlazedTerracotta => &[], + BlockKind::LightGrayGlazedTerracotta => &[], + BlockKind::CyanGlazedTerracotta => &[], + BlockKind::PurpleGlazedTerracotta => &[], + BlockKind::BlueGlazedTerracotta => &[], + BlockKind::BrownGlazedTerracotta => &[], + BlockKind::GreenGlazedTerracotta => &[], + BlockKind::RedGlazedTerracotta => &[], + BlockKind::BlackGlazedTerracotta => &[], + BlockKind::WhiteConcrete => &[], + BlockKind::OrangeConcrete => &[], + BlockKind::MagentaConcrete => &[], + BlockKind::LightBlueConcrete => &[], + BlockKind::YellowConcrete => &[], + BlockKind::LimeConcrete => &[], + BlockKind::PinkConcrete => &[], + BlockKind::GrayConcrete => &[], + BlockKind::LightGrayConcrete => &[], + BlockKind::CyanConcrete => &[], + BlockKind::PurpleConcrete => &[], + BlockKind::BlueConcrete => &[], + BlockKind::BrownConcrete => &[], + BlockKind::GreenConcrete => &[], + BlockKind::RedConcrete => &[], + BlockKind::BlackConcrete => &[], + BlockKind::WhiteConcretePowder => &[], + BlockKind::OrangeConcretePowder => &[], + BlockKind::MagentaConcretePowder => &[], + BlockKind::LightBlueConcretePowder => &[], + BlockKind::YellowConcretePowder => &[], + BlockKind::LimeConcretePowder => &[], + BlockKind::PinkConcretePowder => &[], + BlockKind::GrayConcretePowder => &[], + BlockKind::LightGrayConcretePowder => &[], + BlockKind::CyanConcretePowder => &[], + BlockKind::PurpleConcretePowder => &[], + BlockKind::BlueConcretePowder => &[], + BlockKind::BrownConcretePowder => &[], + BlockKind::GreenConcretePowder => &[], + BlockKind::RedConcretePowder => &[], + BlockKind::BlackConcretePowder => &[], + BlockKind::Kelp => &[], + BlockKind::KelpPlant => &[], + BlockKind::DriedKelpBlock => &[], + BlockKind::TurtleEgg => &[], + BlockKind::DeadTubeCoralBlock => &[], + BlockKind::DeadBrainCoralBlock => &[], + BlockKind::DeadBubbleCoralBlock => &[], + BlockKind::DeadFireCoralBlock => &[], + BlockKind::DeadHornCoralBlock => &[], + BlockKind::TubeCoralBlock => &[], + BlockKind::BrainCoralBlock => &[], + BlockKind::BubbleCoralBlock => &[], + BlockKind::FireCoralBlock => &[], + BlockKind::HornCoralBlock => &[], + BlockKind::DeadTubeCoral => &[], + BlockKind::DeadBrainCoral => &[], + BlockKind::DeadBubbleCoral => &[], + BlockKind::DeadFireCoral => &[], + BlockKind::DeadHornCoral => &[], + BlockKind::TubeCoral => &[], + BlockKind::BrainCoral => &[], + BlockKind::BubbleCoral => &[], + BlockKind::FireCoral => &[], + BlockKind::HornCoral => &[], + BlockKind::DeadTubeCoralFan => &[], + BlockKind::DeadBrainCoralFan => &[], + BlockKind::DeadBubbleCoralFan => &[], + BlockKind::DeadFireCoralFan => &[], + BlockKind::DeadHornCoralFan => &[], + BlockKind::TubeCoralFan => &[], + BlockKind::BrainCoralFan => &[], + BlockKind::BubbleCoralFan => &[], + BlockKind::FireCoralFan => &[], + BlockKind::HornCoralFan => &[], + BlockKind::DeadTubeCoralWallFan => &[], + BlockKind::DeadBrainCoralWallFan => &[], + BlockKind::DeadBubbleCoralWallFan => &[], + BlockKind::DeadFireCoralWallFan => &[], + BlockKind::DeadHornCoralWallFan => &[], + BlockKind::TubeCoralWallFan => &[], + BlockKind::BrainCoralWallFan => &[], + BlockKind::BubbleCoralWallFan => &[], + BlockKind::FireCoralWallFan => &[], + BlockKind::HornCoralWallFan => &[], + BlockKind::SeaPickle => &[], + BlockKind::BlueIce => &[], + BlockKind::Conduit => &[], + BlockKind::BambooSapling => &[], + BlockKind::Bamboo => &[], + BlockKind::PottedBamboo => &[], + BlockKind::VoidAir => &[], + BlockKind::CaveAir => &[], + BlockKind::BubbleColumn => &[], + BlockKind::PolishedGraniteStairs => &[], + BlockKind::SmoothRedSandstoneStairs => &[], + BlockKind::MossyStoneBrickStairs => &[], + BlockKind::PolishedDioriteStairs => &[], + BlockKind::MossyCobblestoneStairs => &[], + BlockKind::EndStoneBrickStairs => &[], + BlockKind::StoneStairs => &[], + BlockKind::SmoothSandstoneStairs => &[], + BlockKind::SmoothQuartzStairs => &[], + BlockKind::GraniteStairs => &[], + BlockKind::AndesiteStairs => &[], + BlockKind::RedNetherBrickStairs => &[], + BlockKind::PolishedAndesiteStairs => &[], + BlockKind::DioriteStairs => &[], + BlockKind::PolishedGraniteSlab => &[], + BlockKind::SmoothRedSandstoneSlab => &[], + BlockKind::MossyStoneBrickSlab => &[], + BlockKind::PolishedDioriteSlab => &[], + BlockKind::MossyCobblestoneSlab => &[], + BlockKind::EndStoneBrickSlab => &[], + BlockKind::SmoothSandstoneSlab => &[], + BlockKind::SmoothQuartzSlab => &[], + BlockKind::GraniteSlab => &[], + BlockKind::AndesiteSlab => &[], + BlockKind::RedNetherBrickSlab => &[], + BlockKind::PolishedAndesiteSlab => &[], + BlockKind::DioriteSlab => &[], + BlockKind::BrickWall => &[], + BlockKind::PrismarineWall => &[], + BlockKind::RedSandstoneWall => &[], + BlockKind::MossyStoneBrickWall => &[], + BlockKind::GraniteWall => &[], + BlockKind::StoneBrickWall => &[], + BlockKind::NetherBrickWall => &[], + BlockKind::AndesiteWall => &[], + BlockKind::RedNetherBrickWall => &[], + BlockKind::SandstoneWall => &[], + BlockKind::EndStoneBrickWall => &[], + BlockKind::DioriteWall => &[], + BlockKind::Scaffolding => &[], + BlockKind::Loom => &[], + BlockKind::Barrel => &[], + BlockKind::Smoker => &[], + BlockKind::BlastFurnace => &[], + BlockKind::CartographyTable => &[], + BlockKind::FletchingTable => &[], + BlockKind::Grindstone => &[], + BlockKind::Lectern => &[], + BlockKind::SmithingTable => &[], + BlockKind::Stonecutter => &[], + BlockKind::Bell => &[], + BlockKind::Lantern => &[], + BlockKind::SoulLantern => &[], + BlockKind::Campfire => &[], + BlockKind::SoulCampfire => &[], + BlockKind::SweetBerryBush => &[], + BlockKind::WarpedStem => &[], + BlockKind::StrippedWarpedStem => &[], + BlockKind::WarpedHyphae => &[], + BlockKind::StrippedWarpedHyphae => &[], + BlockKind::WarpedNylium => &[], + BlockKind::WarpedFungus => &[], + BlockKind::WarpedWartBlock => &[], + BlockKind::WarpedRoots => &[], + BlockKind::NetherSprouts => &[], + BlockKind::CrimsonStem => &[], + BlockKind::StrippedCrimsonStem => &[], + BlockKind::CrimsonHyphae => &[], + BlockKind::StrippedCrimsonHyphae => &[], + BlockKind::CrimsonNylium => &[], + BlockKind::CrimsonFungus => &[], + BlockKind::Shroomlight => &[], + BlockKind::WeepingVines => &[], + BlockKind::WeepingVinesPlant => &[], + BlockKind::TwistingVines => &[], + BlockKind::TwistingVinesPlant => &[], + BlockKind::CrimsonRoots => &[], + BlockKind::CrimsonPlanks => &[], + BlockKind::WarpedPlanks => &[], + BlockKind::CrimsonSlab => &[], + BlockKind::WarpedSlab => &[], + BlockKind::CrimsonPressurePlate => &[], + BlockKind::WarpedPressurePlate => &[], + BlockKind::CrimsonFence => &[], + BlockKind::WarpedFence => &[], + BlockKind::CrimsonTrapdoor => &[], + BlockKind::WarpedTrapdoor => &[], + BlockKind::CrimsonFenceGate => &[], + BlockKind::WarpedFenceGate => &[], + BlockKind::CrimsonStairs => &[], + BlockKind::WarpedStairs => &[], + BlockKind::CrimsonButton => &[], + BlockKind::WarpedButton => &[], + BlockKind::CrimsonDoor => &[], + BlockKind::WarpedDoor => &[], + BlockKind::CrimsonSign => &[], + BlockKind::WarpedSign => &[], + BlockKind::CrimsonWallSign => &[], + BlockKind::WarpedWallSign => &[], + BlockKind::StructureBlock => &[], + BlockKind::Jigsaw => &[], + BlockKind::Composter => &[], + BlockKind::Target => &[], + BlockKind::BeeNest => &[], + BlockKind::Beehive => &[], + BlockKind::HoneyBlock => &[], + BlockKind::HoneycombBlock => &[], + BlockKind::NetheriteBlock => &[], + BlockKind::AncientDebris => &[], + BlockKind::CryingObsidian => &[], + BlockKind::RespawnAnchor => &[], + BlockKind::PottedCrimsonFungus => &[], + BlockKind::PottedWarpedFungus => &[], + BlockKind::PottedCrimsonRoots => &[], + BlockKind::PottedWarpedRoots => &[], + BlockKind::Lodestone => &[], + BlockKind::Blackstone => &[], + BlockKind::BlackstoneStairs => &[], + BlockKind::BlackstoneWall => &[], + BlockKind::BlackstoneSlab => &[], + BlockKind::PolishedBlackstone => &[], + BlockKind::PolishedBlackstoneBricks => &[], + BlockKind::CrackedPolishedBlackstoneBricks => &[], + BlockKind::ChiseledPolishedBlackstone => &[], + BlockKind::PolishedBlackstoneBrickSlab => &[], + BlockKind::PolishedBlackstoneBrickStairs => &[], + BlockKind::PolishedBlackstoneBrickWall => &[], + BlockKind::GildedBlackstone => &[], + BlockKind::PolishedBlackstoneStairs => &[], + BlockKind::PolishedBlackstoneSlab => &[], + BlockKind::PolishedBlackstonePressurePlate => &[], + BlockKind::PolishedBlackstoneButton => &[], + BlockKind::PolishedBlackstoneWall => &[], + BlockKind::ChiseledNetherBricks => &[], + BlockKind::CrackedNetherBricks => &[], + BlockKind::QuartzBricks => &[], + BlockKind::Candle => &[], + BlockKind::WhiteCandle => &[], + BlockKind::OrangeCandle => &[], + BlockKind::MagentaCandle => &[], + BlockKind::LightBlueCandle => &[], + BlockKind::YellowCandle => &[], + BlockKind::LimeCandle => &[], + BlockKind::PinkCandle => &[], + BlockKind::GrayCandle => &[], + BlockKind::LightGrayCandle => &[], + BlockKind::CyanCandle => &[], + BlockKind::PurpleCandle => &[], + BlockKind::BlueCandle => &[], + BlockKind::BrownCandle => &[], + BlockKind::GreenCandle => &[], + BlockKind::RedCandle => &[], + BlockKind::BlackCandle => &[], + BlockKind::CandleCake => &[], + BlockKind::WhiteCandleCake => &[], + BlockKind::OrangeCandleCake => &[], + BlockKind::MagentaCandleCake => &[], + BlockKind::LightBlueCandleCake => &[], + BlockKind::YellowCandleCake => &[], + BlockKind::LimeCandleCake => &[], + BlockKind::PinkCandleCake => &[], + BlockKind::GrayCandleCake => &[], + BlockKind::LightGrayCandleCake => &[], + BlockKind::CyanCandleCake => &[], + BlockKind::PurpleCandleCake => &[], + BlockKind::BlueCandleCake => &[], + BlockKind::BrownCandleCake => &[], + BlockKind::GreenCandleCake => &[], + BlockKind::RedCandleCake => &[], + BlockKind::BlackCandleCake => &[], + BlockKind::AmethystBlock => &[], + BlockKind::BuddingAmethyst => &[], + BlockKind::AmethystCluster => &[], + BlockKind::LargeAmethystBud => &[], + BlockKind::MediumAmethystBud => &[], + BlockKind::SmallAmethystBud => &[], + BlockKind::Tuff => &[], + BlockKind::Calcite => &[], + BlockKind::TintedGlass => &[], + BlockKind::PowderSnow => &[], + BlockKind::SculkSensor => &[], + BlockKind::OxidizedCopper => &[], + BlockKind::WeatheredCopper => &[], + BlockKind::ExposedCopper => &[], + BlockKind::CopperBlock => &[], + BlockKind::CopperOre => &[], + BlockKind::DeepslateCopperOre => &[], + BlockKind::OxidizedCutCopper => &[], + BlockKind::WeatheredCutCopper => &[], + BlockKind::ExposedCutCopper => &[], + BlockKind::CutCopper => &[], + BlockKind::OxidizedCutCopperStairs => &[], + BlockKind::WeatheredCutCopperStairs => &[], + BlockKind::ExposedCutCopperStairs => &[], + BlockKind::CutCopperStairs => &[], + BlockKind::OxidizedCutCopperSlab => &[], + BlockKind::WeatheredCutCopperSlab => &[], + BlockKind::ExposedCutCopperSlab => &[], + BlockKind::CutCopperSlab => &[], + BlockKind::WaxedCopperBlock => &[], + BlockKind::WaxedWeatheredCopper => &[], + BlockKind::WaxedExposedCopper => &[], + BlockKind::WaxedOxidizedCopper => &[], + BlockKind::WaxedOxidizedCutCopper => &[], + BlockKind::WaxedWeatheredCutCopper => &[], + BlockKind::WaxedExposedCutCopper => &[], + BlockKind::WaxedCutCopper => &[], + BlockKind::WaxedOxidizedCutCopperStairs => &[], + BlockKind::WaxedWeatheredCutCopperStairs => &[], + BlockKind::WaxedExposedCutCopperStairs => &[], + BlockKind::WaxedCutCopperStairs => &[], + BlockKind::WaxedOxidizedCutCopperSlab => &[], + BlockKind::WaxedWeatheredCutCopperSlab => &[], + BlockKind::WaxedExposedCutCopperSlab => &[], + BlockKind::WaxedCutCopperSlab => &[], + BlockKind::LightningRod => &[], + BlockKind::PointedDripstone => &[], + BlockKind::DripstoneBlock => &[], + BlockKind::CaveVines => &[], + BlockKind::CaveVinesPlant => &[], + BlockKind::SporeBlossom => &[], + BlockKind::Azalea => &[], + BlockKind::FloweringAzalea => &[], + BlockKind::MossCarpet => &[], + BlockKind::MossBlock => &[], + BlockKind::BigDripleaf => &[], + BlockKind::BigDripleafStem => &[], + BlockKind::SmallDripleaf => &[], + BlockKind::HangingRoots => &[], + BlockKind::RootedDirt => &[], + BlockKind::Deepslate => &[], + BlockKind::CobbledDeepslate => &[], + BlockKind::CobbledDeepslateStairs => &[], + BlockKind::CobbledDeepslateSlab => &[], + BlockKind::CobbledDeepslateWall => &[], + BlockKind::PolishedDeepslate => &[], + BlockKind::PolishedDeepslateStairs => &[], + BlockKind::PolishedDeepslateSlab => &[], + BlockKind::PolishedDeepslateWall => &[], + BlockKind::DeepslateTiles => &[], + BlockKind::DeepslateTileStairs => &[], + BlockKind::DeepslateTileSlab => &[], + BlockKind::DeepslateTileWall => &[], + BlockKind::DeepslateBricks => &[], + BlockKind::DeepslateBrickStairs => &[], + BlockKind::DeepslateBrickSlab => &[], + BlockKind::DeepslateBrickWall => &[], + BlockKind::ChiseledDeepslate => &[], + BlockKind::CrackedDeepslateBricks => &[], + BlockKind::CrackedDeepslateTiles => &[], + BlockKind::InfestedDeepslate => &[], + BlockKind::SmoothBasalt => &[], + BlockKind::RawIronBlock => &[], + BlockKind::RawCopperBlock => &[], + BlockKind::RawGoldBlock => &[], + BlockKind::PottedAzaleaBush => &[], + BlockKind::PottedFloweringAzaleaBush => &[], } } } diff --git a/libcraft/blocks/src/block_data.rs b/libcraft/blocks/src/block_data.rs index 10d3fe618..62f92f99e 100644 --- a/libcraft/blocks/src/block_data.rs +++ b/libcraft/blocks/src/block_data.rs @@ -1,8 +1,15 @@ +//! Provides access to block properties. +//! +//! Some `BlockData` structs, such as [`Waterlogged`], are general to multiple blocks. +//! Others are specific to one type of block. +//! +//! This API is inspired by [Bukkit's BlockData API](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/BlockData.html). + use crate::data::{RawBlockStateProperties, ValidProperties}; use libcraft_core::block::{ AttachedFace, Axis, BambooLeaves, BedPart, BellAttachment, BlockFace, BlockHalf, ChestType, - ComparatorMode, Instrument, Orientation, PistonType, RailShape, SlabType, StairShape, - StructureBlockMode, WallConnection, + ComparatorMode, DoorHinge, Instrument, Orientation, PistonType, RailShape, SlabType, + StairShape, StructureBlockMode, WallConnection, }; use libcraft_macros::BlockData; @@ -20,7 +27,7 @@ pub trait BlockData { fn apply(&self, raw: &mut RawBlockStateProperties); } -/// Generalized BlockData structs +// Generalized BlockData structs /// A block that has an "age" property that /// represents crop growth. @@ -262,6 +269,7 @@ pub struct Door { facing: BlockFace, open: bool, powered: bool, + hinge: DoorHinge, valid_properties: &'static ValidProperties, } diff --git a/libcraft/blocks/src/data.rs b/libcraft/blocks/src/data.rs index 27e51d73d..38c83ce9f 100644 --- a/libcraft/blocks/src/data.rs +++ b/libcraft/blocks/src/data.rs @@ -1,6 +1,10 @@ -use std::{collections::HashMap, str::FromStr}; +use std::{ + collections::{BTreeMap, HashMap}, + str::FromStr, +}; use crate::BlockKind; +use bincode::{Decode, Encode}; use libcraft_core::block::{ AttachedFace, Axis, BambooLeaves, BedPart, BellAttachment, BlockFace, BlockHalf, ChestType, ComparatorMode, DoorHinge, Instrument, Orientation, PistonType, RailShape, RedstoneConnection, @@ -9,7 +13,7 @@ use libcraft_core::block::{ use serde::{Deserialize, Serialize}; /// Defines all possible data associated with a block state. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, Hash)] pub struct RawBlockState { /// Block state ID pub id: u16, @@ -17,9 +21,10 @@ pub struct RawBlockState { /// Whether this is the default state for this block kind pub default: bool, pub properties: RawBlockStateProperties, + pub untyped_properties: Vec<(String, String)>, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, Hash)] pub struct RawBlockStateProperties { pub facing: Option, pub bamboo_leaves: Option, @@ -215,7 +220,7 @@ impl BlockReportEntry { #[derive(Debug, Serialize, Deserialize)] pub struct BlockReportState { #[serde(default)] - pub properties: HashMap, + pub properties: BTreeMap, pub id: u16, #[serde(default)] pub default: bool, @@ -311,17 +316,22 @@ impl BlockReportState { wall_up: self.property("up"), wall_west: self.property("west"), }, + untyped_properties: self + .properties + .iter() + .map(|(k, v)| (k.into(), v.into())) + .collect(), } } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, Hash)] pub struct RawBlockProperties { pub kind: BlockKind, pub valid_properties: ValidProperties, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, Hash)] pub struct ValidProperties { pub facing: Vec, pub bamboo_leaves: Vec, diff --git a/libcraft/blocks/src/lib.rs b/libcraft/blocks/src/lib.rs index 39fcb6c2b..76267b179 100644 --- a/libcraft/blocks/src/lib.rs +++ b/libcraft/blocks/src/lib.rs @@ -1,10 +1,15 @@ mod block; -mod block_data; +pub mod block_data; pub mod data; +mod metadata; mod registry; mod simplified_block; +mod utils; pub use block::BlockKind; -pub use block_data::*; +pub use block_data::BlockData; +pub use metadata::{PlacementType, SupportType}; pub use registry::BlockState; pub use simplified_block::SimplifiedBlockKind; + +pub const HIGHEST_ID: u16 = 20341; diff --git a/feather/blocks/src/categories.rs b/libcraft/blocks/src/metadata.rs similarity index 90% rename from feather/blocks/src/categories.rs rename to libcraft/blocks/src/metadata.rs index 16920fddf..6998e30cb 100644 --- a/feather/blocks/src/categories.rs +++ b/libcraft/blocks/src/metadata.rs @@ -1,5 +1,4 @@ -use crate::{BlockId, BlockKind}; -use libcraft_blocks::SimplifiedBlockKind; +use crate::{block_data::Lightable, BlockKind, BlockState, SimplifiedBlockKind}; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum PlacementType { @@ -32,30 +31,7 @@ pub enum SupportType { VineLike, } -impl BlockId { - #[inline] - pub fn is_solid(self) -> bool { - self.kind().solid() - } - - #[inline] - pub fn is_opaque(self) -> bool { - !self.kind().transparent() - } - - #[inline] - pub fn is_air(self) -> bool { - self.simplified_kind() == SimplifiedBlockKind::Air - } - - #[inline] - pub fn is_fluid(self) -> bool { - matches!( - self.simplified_kind(), - SimplifiedBlockKind::Water | SimplifiedBlockKind::Lava - ) - } - +impl BlockState { #[inline] pub fn is_replaceable(self) -> bool { matches!( @@ -84,7 +60,7 @@ impl BlockId { | BlockKind::SeaLantern | BlockKind::Conduit => 15, BlockKind::RedstoneLamp => { - if self.lit().unwrap() { + if self.data_as::().unwrap().lit() { 15 } else { 0 @@ -206,9 +182,4 @@ impl BlockId { _ => None, } } - - #[inline] - pub fn is_full_block(self) -> bool { - self.kind().solid() - } } diff --git a/libcraft/blocks/src/registry.rs b/libcraft/blocks/src/registry.rs index 106e57c74..d570ae4da 100644 --- a/libcraft/blocks/src/registry.rs +++ b/libcraft/blocks/src/registry.rs @@ -1,11 +1,14 @@ use crate::data::{RawBlockProperties, RawBlockState, RawBlockStateProperties, ValidProperties}; -use crate::{BlockData, BlockKind}; +use crate::{BlockData, BlockKind, SimplifiedBlockKind}; use ahash::AHashMap; use bytemuck::{Pod, Zeroable}; use once_cell::sync::Lazy; -use serde::{Deserialize, Serialize}; +use serde::{de, Deserialize, Serialize}; +use smartstring::{LazyCompact, SmartString}; +use std::collections::BTreeMap; +use std::fmt::Debug; use std::io::Cursor; /// A block state. @@ -17,15 +20,28 @@ use std::io::Cursor; /// * _Data_, or properties, represented by structs implementing the [`BlockData`](crate::BlockData) /// trait. For example, a chest has a "type" property in its block data /// that determines whether the chest is single or double. -#[derive( - Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, Zeroable, Pod, -)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Zeroable, Pod, Default)] #[repr(transparent)] pub struct BlockState { id: u16, } impl BlockState { + /// Gets the default block state for the given block kind. + pub fn new(kind: BlockKind) -> Self { + REGISTRY.default_state(kind) + } + + /// Gets the kind of this block. + pub fn kind(self) -> BlockKind { + self.raw().kind + } + + /// Gets the `SimplifiedKind` of this block. + pub fn simplified_kind(self) -> SimplifiedBlockKind { + self.kind().simplified_kind() + } + /// Gets this block as a struct implementing the [`BlockData`](crate::BlockData) /// interface. /// @@ -45,11 +61,18 @@ impl BlockState { pub fn set_data(&mut self, data: T) { let mut raw = self.raw().properties.clone(); data.apply(&mut raw); - if let Some(new_block) = Self::from_raw(&raw) { + if let Some(new_block) = Self::from_raw(&raw, self.kind()) { *self = new_block; } } + /// Returns a new block state with the given property values applied. + pub fn with_data(self, data: T) -> Self { + let mut copy = self; + copy.set_data(data); + copy + } + /// Returns whether this is the default block state for /// the block kind. pub fn is_default(self) -> bool { @@ -77,6 +100,37 @@ impl BlockState { REGISTRY.raw_state(self.id).is_some() } + /// Gets the stable namespaced ID of the block kind. + /// + /// Combined with `property_values`, this method can be used + /// for the persistent serialization of block states. + pub fn namespaced_id(&self) -> &str { + self.kind().namespaced_id() + } + + /// Returns an iterator over (key, value) pairs representing + /// the properties of this block. + /// + /// This method can be used to serialize block states. + pub fn property_values(&self) -> impl Iterator + '_ { + self.raw() + .untyped_properties + .iter() + .map(|(k, v)| (k.as_str(), v.as_str())) + } + + /// Creates a `BlockState` from its namespaced ID and property values. + /// + /// This method can be used to deserialize block states. + pub fn from_namespaced_id_and_property_values<'a>( + namespaced_id: &str, + property_values: impl IntoIterator, + ) -> Option { + REGISTRY + .id_for_untyped_repr(namespaced_id, property_values) + .map(|id| Self { id }) + } + pub fn get_valid_properties(&self) -> &'static ValidProperties { REGISTRY.valid_properties.get(&self.raw().kind).unwrap() } @@ -87,31 +141,89 @@ impl BlockState { } /// Creates a block state from its raw properties. - pub(crate) fn from_raw(raw: &RawBlockStateProperties) -> Option { - let id = REGISTRY.id_for_state(raw)?; + pub(crate) fn from_raw(raw: &RawBlockStateProperties, kind: BlockKind) -> Option { + let id = REGISTRY.id_for_state(raw, kind)?; Some(Self { id }) } } +#[derive(Serialize, Deserialize)] +struct SerializedBlockState<'a> { + kind: &'a str, + properties: BTreeMap<&'a str, &'a str>, +} + +impl Serialize for BlockState { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + SerializedBlockState { + kind: self.namespaced_id(), + properties: self.property_values().collect(), + } + .serialize(serializer) + } +} + +impl<'de> Deserialize<'de> for BlockState { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let serialized = SerializedBlockState::deserialize(deserializer)?; + BlockState::from_namespaced_id_and_property_values(serialized.kind, serialized.properties) + .ok_or_else(|| de::Error::custom("invalid block state")) + } +} + +impl Debug for BlockState { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let mut s = f.debug_struct("BlockState"); + s.field("kind", &self.kind()); + for (property, value) in self.property_values() { + s.field(property, &value); + } + s.finish() + } +} + static REGISTRY: Lazy = Lazy::new(BlockRegistry::new); +type SmartStr = SmartString; +type PropertyValues = Vec<(SmartStr, SmartStr)>; + struct BlockRegistry { states: Vec, - id_mapping: AHashMap, + id_mapping: AHashMap<(BlockKind, RawBlockStateProperties), u16>, valid_properties: AHashMap, + default_states: AHashMap, + default_property_values: AHashMap, + by_untyped_repr: AHashMap<(SmartStr, PropertyValues), u16>, +} + +fn set_defualt_property_values(values: &mut PropertyValues, default: &PropertyValues) { + for (key, value) in default { + if !values.iter().any(|(k, _)| k == key) { + values.push((key.clone(), value.clone())); + } + } + values.sort_unstable(); } impl BlockRegistry { fn new() -> Self { - const STATE_DATA: &[u8] = include_bytes!("../assets/raw_block_states.bc.gz"); - let state_reader = flate2::bufread::GzDecoder::new(Cursor::new(STATE_DATA)); + static STATE_DATA: &[u8] = include_bytes!("../../assets/raw_block_states.bc.gz"); + let mut state_reader = flate2::bufread::GzDecoder::new(Cursor::new(STATE_DATA)); let states: Vec = - bincode::deserialize_from(state_reader).expect("malformed block state data"); + bincode::decode_from_std_read(&mut state_reader, bincode::config::standard()) + .expect("malformed block state data"); - const PROPERTY_DATA: &[u8] = include_bytes!("../assets/raw_block_properties.bc.gz"); - let property_reader = flate2::bufread::GzDecoder::new(Cursor::new(PROPERTY_DATA)); + static PROPERTY_DATA: &[u8] = include_bytes!("../../assets/raw_block_properties.bc.gz"); + let mut property_reader = flate2::bufread::GzDecoder::new(Cursor::new(PROPERTY_DATA)); let properties: Vec = - bincode::deserialize_from(property_reader).expect("malformed block properties"); + bincode::decode_from_std_read(&mut property_reader, bincode::config::standard()) + .expect("malformed block properties"); // Ensure that indexes match IDs. #[cfg(debug_assertions)] @@ -123,7 +235,7 @@ impl BlockRegistry { let id_mapping = states .iter() - .map(|state| (state.properties.clone(), state.id)) + .map(|state| ((state.kind, state.properties.clone()), state.id)) .collect(); let valid_properties = properties @@ -131,10 +243,46 @@ impl BlockRegistry { .map(|properties| (properties.kind, properties.valid_properties.clone())) .collect(); + let default_states = states + .iter() + .filter(|s| s.default) + .map(|s| (s.kind, BlockState { id: s.id })) + .collect(); + + let by_untyped_repr: AHashMap<(SmartStr, PropertyValues), u16> = states + .iter() + .map(|s| { + let mut props: PropertyValues = s + .untyped_properties + .iter() + .map(|(a, b)| (a.into(), b.into())) + .collect(); + props.sort_unstable(); + ((s.kind.namespaced_id().into(), props), s.id) + }) + .collect(); + + let default_property_values = states + .iter() + .filter(|s| s.default) + .map(|s| { + ( + s.kind, + s.untyped_properties + .iter() + .map(|(a, b)| (a.into(), b.into())) + .collect(), + ) + }) + .collect(); + Self { states, id_mapping, valid_properties, + default_states, + by_untyped_repr, + default_property_values, } } @@ -142,8 +290,29 @@ impl BlockRegistry { self.states.get(id as usize) } - fn id_for_state(&self, state: &RawBlockStateProperties) -> Option { - self.id_mapping.get(state).copied() + fn id_for_state(&self, state: &RawBlockStateProperties, kind: BlockKind) -> Option { + self.id_mapping.get(&(kind, state.clone())).copied() + } + + fn default_state(&self, kind: BlockKind) -> BlockState { + self.default_states[&kind] + } + + fn id_for_untyped_repr<'a>( + &self, + namespaced_id: impl Into, + property_values: impl IntoIterator, + ) -> Option { + let namespaced_id = namespaced_id.into(); + let kind = BlockKind::from_namespaced_id(&namespaced_id)?; + let mut property_values: PropertyValues = property_values + .into_iter() + .map(|(k, v)| (k.into(), v.into())) + .collect::>(); + set_defualt_property_values(&mut property_values, &self.default_property_values[&kind]); + self.by_untyped_repr + .get(&(namespaced_id, property_values)) + .copied() } } diff --git a/libcraft/blocks/src/simplified_block.rs b/libcraft/blocks/src/simplified_block.rs index 2ad8b9c8d..8ce738b7e 100644 --- a/libcraft/blocks/src/simplified_block.rs +++ b/libcraft/blocks/src/simplified_block.rs @@ -2,364 +2,938 @@ use crate::BlockKind; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum SimplifiedBlockKind { + ActivatorRail, Air, - Planks, - Sapling, - Log, - Leaves, - Bed, - Wool, - Flower, - WoodenPressurePlate, - StainedGlass, - WoodenTrapdoor, - WoodenButton, + AmethystBlock, + AmethystCluster, + AncientDebris, + Andesite, + AndesiteWall, Anvil, - GlazedTeracotta, - Teracotta, - StainedGlassPane, - Carpet, - WallBanner, + AttachedMelonStem, + AttachedPumpkinStem, + Azalea, + Bamboo, Banner, - Slab, - Stairs, - FenceGate, - Fence, - WoodenDoor, - ShulkerBox, + Barrel, + Barrier, + Basalt, + Beacon, + Bed, + Bedrock, + BeeNest, + Beehive, + Beetroots, + Bell, + BigDripleaf, + BigDripleafStem, + BlackCandle, + BlackCandleCake, + Blackstone, + BlackstoneWall, + BlastFurnace, + BlueCandle, + BlueCandleCake, + BlueIce, + BoneBlock, + Bookshelf, + BrewingStand, + BrickWall, + Bricks, + BrownCandle, + BrownCandleCake, + BrownMushroomBlock, + BubbleColumn, + BuddingAmethyst, + Cactus, + Cake, + Calcite, + Campfire, + Candle, + CandleCake, + Carpet, + Carrots, + CartographyTable, + CarvedPumpkin, + Cauldron, + CaveVines, + CaveVinesPlant, + Chain, + ChainCommandBlock, + Chest, + ChiseledDeepslate, + ChiseledNetherBricks, + ChiseledPolishedBlackstone, + ChiseledQuartzBlock, + ChiseledRedSandstone, + ChiseledSandstone, + ChiseledStoneBricks, + ChorusFlower, + ChorusPlant, + Clay, + CoalBlock, + CoalOre, + CoarseDirt, + CobbledDeepslate, + CobbledDeepslateWall, + Cobblestone, + CobblestoneWall, + Cobweb, + Cocoa, + CommandBlock, + Comparator, + Composter, Concrete, ConcretePowder, + Conduit, + CopperBlock, + CopperOre, Coral, CoralBlock, CoralFan, CoralWallFan, - Mushroom, - WallSign, - Sign, - Stone, - Granite, - PolishedGranite, + Cornflower, + CrackedDeepslateBricks, + CrackedDeepslateTiles, + CrackedNetherBricks, + CrackedPolishedBlackstoneBricks, + CrackedStoneBricks, + CraftingTable, + CreeperHead, + CreeperWallHead, + CrimsonButton, + CrimsonDoor, + CrimsonFungus, + CrimsonHyphae, + CrimsonNylium, + CrimsonPressurePlate, + CrimsonRoots, + CrimsonStem, + CrimsonTrapdoor, + CryingObsidian, + CutCopper, + CutRedSandstone, + CutSandstone, + CyanCandle, + CyanCandleCake, + DarkPrismarine, + DaylightDetector, + DeadBush, + Deepslate, + DeepslateBrickWall, + DeepslateBricks, + DeepslateCoalOre, + DeepslateCopperOre, + DeepslateDiamondOre, + DeepslateEmeraldOre, + DeepslateGoldOre, + DeepslateIronOre, + DeepslateLapisOre, + DeepslateRedstoneOre, + DeepslateTileWall, + DeepslateTiles, + DetectorRail, + DiamondBlock, + DiamondOre, Diorite, - PolishedDiorite, - Andesite, - PolishedAndesite, - GrassBlock, + DioriteWall, Dirt, - CoarseDirt, - Podzol, - Cobblestone, - Bedrock, - Water, - Lava, - Sand, - RedSand, - Gravel, - GoldOre, - IronOre, - CoalOre, - NetherGoldOre, - Sponge, - WetSponge, - Glass, - LapisOre, - LapisBlock, + DirtPath, Dispenser, - Sandstone, - ChiseledSandstone, - CutSandstone, - NoteBlock, - PoweredRail, - DetectorRail, - StickyPiston, - Cobweb, - Grass, + DragonEgg, + DragonHead, + DragonWallHead, + DriedKelpBlock, + DripstoneBlock, + Dropper, + EmeraldBlock, + EmeraldOre, + EnchantingTable, + EndGateway, + EndPortal, + EndPortalFrame, + EndRod, + EndStone, + EndStoneBrickWall, + EndStoneBricks, + EnderChest, + ExposedCopper, + ExposedCutCopper, + Farmland, + Fence, + FenceGate, Fern, - DeadBush, - Seagrass, - TallSeagrass, - Piston, - PistonHead, - MovingPiston, - Cornflower, - WitherRose, - LilyOfTheValley, - GoldBlock, - IronBlock, - Bricks, - Tnt, - Bookshelf, - MossyCobblestone, - Obsidian, - Torch, - WallTorch, Fire, - SoulFire, - Spawner, - Chest, - RedstoneWire, - DiamondOre, - DiamondBlock, - CraftingTable, - Wheat, - Farmland, + FletchingTable, + Flower, + FlowerPot, + FloweringAzalea, + FrostedIce, Furnace, - Ladder, - Rail, - Lever, - StonePressurePlate, - IronDoor, - RedstoneOre, - RedstoneTorch, - RedstoneWallTorch, - StoneButton, - Snow, - Ice, - SnowBlock, - Cactus, - Clay, - SugarCane, - Jukebox, - Pumpkin, - Netherrack, - SoulSand, - SoulSoil, - Basalt, - PolishedBasalt, - SoulTorch, - SoulWallTorch, + GildedBlackstone, + Glass, + GlassPane, + GlazedTeracotta, + GlowLichen, Glowstone, - NetherPortal, - CarvedPumpkin, - JackOLantern, - Cake, - Repeater, - StoneBricks, - MossyStoneBricks, - CrackedStoneBricks, - ChiseledStoneBricks, - InfestedStone, + GoldBlock, + GoldOre, + Granite, + GraniteWall, + Grass, + GrassBlock, + Gravel, + GrayCandle, + GrayCandleCake, + GreenCandle, + GreenCandleCake, + Grindstone, + HangingRoots, + HayBlock, + HeavyWeightedPressurePlate, + HoneyBlock, + HoneycombBlock, + Hopper, + Ice, + InfestedChiseledStoneBricks, InfestedCobblestone, - InfestedStoneBricks, - InfestedMossyStoneBricks, InfestedCrackedStoneBricks, - InfestedChiseledStoneBricks, - BrownMushroomBlock, - RedMushroomBlock, - MushroomStem, + InfestedDeepslate, + InfestedMossyStoneBricks, + InfestedStone, + InfestedStoneBricks, IronBars, - Chain, - GlassPane, + IronBlock, + IronDoor, + IronOre, + IronTrapdoor, + JackOLantern, + Jigsaw, + Jukebox, + Kelp, + KelpPlant, + Ladder, + Lantern, + LapisBlock, + LapisOre, + LargeAmethystBud, + LargeFern, + Lava, + LavaCauldron, + Leaves, + Lectern, + Lever, + Light, + LightBlueCandle, + LightBlueCandleCake, + LightGrayCandle, + LightGrayCandleCake, + LightWeightedPressurePlate, + LightningRod, + Lilac, + LilyOfTheValley, + LilyPad, + LimeCandle, + LimeCandleCake, + Lodestone, + Log, + Loom, + MagentaCandle, + MagentaCandleCake, + MagmaBlock, + MediumAmethystBud, Melon, - AttachedPumpkinStem, - AttachedMelonStem, - PumpkinStem, MelonStem, - Vine, + MossBlock, + MossyCobblestone, + MossyCobblestoneWall, + MossyStoneBrickWall, + MossyStoneBricks, + MovingPiston, + Mushroom, + MushroomStem, Mycelium, - LilyPad, + NetherBrickWall, NetherBricks, + NetherGoldOre, + NetherPortal, + NetherQuartzOre, + NetherSprouts, NetherWart, - EnchantingTable, - BrewingStand, - Cauldron, - EndPortal, - EndPortalFrame, - EndStone, - DragonEgg, - RedstoneLamp, - Cocoa, - EmeraldOre, - EnderChest, - TripwireHook, - Tripwire, - EmeraldBlock, - CommandBlock, - Beacon, - CobblestoneWall, - MossyCobblestoneWall, - FlowerPot, - PottedFern, - PottedDandelion, - PottedPoppy, + NetherWartBlock, + NetheriteBlock, + Netherrack, + NoteBlock, + Observer, + Obsidian, + OrangeCandle, + OrangeCandleCake, + OxidizedCopper, + OxidizedCutCopper, + PackedIce, + Peony, + PinkCandle, + PinkCandleCake, + Piston, + PistonHead, + Planks, + PlayerHead, + PlayerWallHead, + Podzol, + PointedDripstone, + PolishedAndesite, + PolishedBasalt, + PolishedBlackstone, + PolishedBlackstoneBrickWall, + PolishedBlackstoneBricks, + PolishedBlackstoneButton, + PolishedBlackstonePressurePlate, + PolishedBlackstoneWall, + PolishedDeepslate, + PolishedDeepslateWall, + PolishedDiorite, + PolishedGranite, + Potatoes, PottedAllium, + PottedAzaleaBush, + PottedBamboo, + PottedCactus, PottedCornflower, + PottedCrimsonFungus, + PottedCrimsonRoots, + PottedDandelion, + PottedDeadBush, + PottedFern, + PottedFloweringAzaleaBush, PottedLilyOfTheValley, + PottedPoppy, + PottedWarpedFungus, + PottedWarpedRoots, PottedWitherRose, - PottedDeadBush, - PottedCactus, - Carrots, - Potatoes, - SkeletonSkull, - SkeletonWallSkull, - WitherSkeletonSkull, - WitherSkeletonWallSkull, - ZombieHead, - ZombieWallHead, - PlayerHead, - PlayerWallHead, - CreeperHead, - CreeperWallHead, - DragonHead, - DragonWallHead, - TrappedChest, - LightWeightedPressurePlate, - HeavyWeightedPressurePlate, - Comparator, - DaylightDetector, - RedstoneBlock, - NetherQuartzOre, - Hopper, - QuartzBlock, - ChiseledQuartzBlock, - QuartzPillar, - ActivatorRail, - Dropper, - SlimeBlock, - Barrier, - IronTrapdoor, + PowderSnow, + PowderSnowCauldron, + PoweredRail, Prismarine, PrismarineBricks, - DarkPrismarine, - SeaLantern, - HayBlock, - CoalBlock, - PackedIce, - Sunflower, - Lilac, - RoseBush, - Peony, - TallGrass, - LargeFern, - RedSandstone, - ChiseledRedSandstone, - CutRedSandstone, - SmoothStone, - SmoothSandstone, - SmoothQuartz, - SmoothRedSandstone, - EndRod, - ChorusPlant, - ChorusFlower, + PrismarineWall, + Pumpkin, + PumpkinStem, + PurpleCandle, + PurpleCandleCake, PurpurBlock, PurpurPillar, - EndStoneBricks, - Beetroots, - GrassPath, - EndGateway, - RepeatingCommandBlock, - ChainCommandBlock, - FrostedIce, - MagmaBlock, - NetherWartBlock, + QuartzBlock, + QuartzBricks, + QuartzPillar, + Rail, + RawCopperBlock, + RawGoldBlock, + RawIronBlock, + RedCandle, + RedCandleCake, + RedMushroomBlock, + RedNetherBrickWall, RedNetherBricks, - BoneBlock, - StructureVoid, - Observer, - Kelp, - KelpPlant, - DriedKelpBlock, - TurtleEgg, - SeaPickle, - BlueIce, - Conduit, - Bamboo, - PottedBamboo, - BubbleColumn, - BrickWall, - PrismarineWall, + RedSand, + RedSandstone, RedSandstoneWall, - MossyStoneBrickWall, - GraniteWall, - StoneBrickWall, - NetherBrickWall, - AndesiteWall, - RedNetherBrickWall, + RedstoneBlock, + RedstoneLamp, + RedstoneOre, + RedstoneTorch, + RedstoneWallTorch, + RedstoneWire, + Repeater, + RepeatingCommandBlock, + RespawnAnchor, + RootedDirt, + RoseBush, + Sand, + Sandstone, SandstoneWall, - EndStoneBrickWall, - DioriteWall, + Sapling, Scaffolding, - Loom, - Barrel, - Smoker, - BlastFurnace, - CartographyTable, - FletchingTable, - Grindstone, - Lectern, + SculkSensor, + SeaLantern, + SeaPickle, + Seagrass, + Shroomlight, + ShulkerBox, + Sign, + SkeletonSkull, + SkeletonWallSkull, + Slab, + SlimeBlock, + SmallAmethystBud, + SmallDripleaf, SmithingTable, - Stonecutter, - Bell, - Lantern, - SoulLantern, - Campfire, + Smoker, + SmoothBasalt, + SmoothQuartz, + SmoothRedSandstone, + SmoothSandstone, + SmoothStone, + Snow, + SnowBlock, SoulCampfire, - SweetBerryBush, - WarpedStem, + SoulFire, + SoulLantern, + SoulSand, + SoulSoil, + SoulTorch, + SoulWallTorch, + Spawner, + Sponge, + SporeBlossom, + StainedGlass, + StainedGlassPane, + Stairs, + StickyPiston, + Stone, + StoneBrickWall, + StoneBricks, + StoneButton, + StonePressurePlate, + Stonecutter, + StrippedCrimsonHyphae, + StrippedCrimsonStem, + StrippedWarpedHyphae, StrippedWarpedStem, + StructureBlock, + StructureVoid, + SugarCane, + Sunflower, + SweetBerryBush, + TallGrass, + TallSeagrass, + Target, + Teracotta, + TintedGlass, + Tnt, + Torch, + TrappedChest, + Tripwire, + TripwireHook, + Tuff, + TurtleEgg, + TwistingVines, + TwistingVinesPlant, + Vine, + WallBanner, + WallSign, + WallTorch, + WarpedButton, + WarpedDoor, + WarpedFungus, WarpedHyphae, - StrippedWarpedHyphae, WarpedNylium, - WarpedFungus, - WarpedWartBlock, + WarpedPressurePlate, WarpedRoots, - NetherSprouts, - CrimsonStem, - StrippedCrimsonStem, - CrimsonHyphae, - StrippedCrimsonHyphae, - CrimsonNylium, - CrimsonFungus, - Shroomlight, + WarpedStem, + WarpedTrapdoor, + WarpedWartBlock, + Water, + WaterCauldron, + WaxedCopperBlock, + WaxedCutCopper, + WaxedExposedCopper, + WaxedExposedCutCopper, + WaxedOxidizedCopper, + WaxedOxidizedCutCopper, + WaxedWeatheredCopper, + WaxedWeatheredCutCopper, + WeatheredCopper, + WeatheredCutCopper, WeepingVines, WeepingVinesPlant, - TwistingVines, - TwistingVinesPlant, - CrimsonRoots, - CrimsonPressurePlate, - WarpedPressurePlate, - CrimsonTrapdoor, - WarpedTrapdoor, - CrimsonButton, - WarpedButton, - CrimsonDoor, - WarpedDoor, - StructureBlock, - Jigsaw, - Composter, - Target, - BeeNest, - Beehive, - HoneyBlock, - HoneycombBlock, - NetheriteBlock, - AncientDebris, - CryingObsidian, - RespawnAnchor, - PottedCrimsonFungus, - PottedWarpedFungus, - PottedCrimsonRoots, - PottedWarpedRoots, - Lodestone, - Blackstone, - BlackstoneWall, - PolishedBlackstone, - PolishedBlackstoneBricks, - CrackedPolishedBlackstoneBricks, - ChiseledPolishedBlackstone, - PolishedBlackstoneBrickWall, - GildedBlackstone, - PolishedBlackstonePressurePlate, - PolishedBlackstoneButton, - PolishedBlackstoneWall, - ChiseledNetherBricks, - CrackedNetherBricks, - QuartzBricks, + WetSponge, + Wheat, + WhiteCandle, + WhiteCandleCake, + WitherRose, + WitherSkeletonSkull, + WitherSkeletonWallSkull, + WoodenButton, + WoodenDoor, + WoodenPressurePlate, + WoodenTrapdoor, + Wool, + YellowCandle, + YellowCandleCake, + ZombieHead, + ZombieWallHead, +} +impl SimplifiedBlockKind { + #[inline] + pub fn values() -> &'static [SimplifiedBlockKind] { + use SimplifiedBlockKind::*; + &[ + ActivatorRail, + Air, + AmethystBlock, + AmethystCluster, + AncientDebris, + Andesite, + AndesiteWall, + Anvil, + AttachedMelonStem, + AttachedPumpkinStem, + Azalea, + Bamboo, + Banner, + Barrel, + Barrier, + Basalt, + Beacon, + Bed, + Bedrock, + BeeNest, + Beehive, + Beetroots, + Bell, + BigDripleaf, + BigDripleafStem, + BlackCandle, + BlackCandleCake, + Blackstone, + BlackstoneWall, + BlastFurnace, + BlueCandle, + BlueCandleCake, + BlueIce, + BoneBlock, + Bookshelf, + BrewingStand, + BrickWall, + Bricks, + BrownCandle, + BrownCandleCake, + BrownMushroomBlock, + BubbleColumn, + BuddingAmethyst, + Cactus, + Cake, + Calcite, + Campfire, + Candle, + CandleCake, + Carpet, + Carrots, + CartographyTable, + CarvedPumpkin, + Cauldron, + CaveVines, + CaveVinesPlant, + Chain, + ChainCommandBlock, + Chest, + ChiseledDeepslate, + ChiseledNetherBricks, + ChiseledPolishedBlackstone, + ChiseledQuartzBlock, + ChiseledRedSandstone, + ChiseledSandstone, + ChiseledStoneBricks, + ChorusFlower, + ChorusPlant, + Clay, + CoalBlock, + CoalOre, + CoarseDirt, + CobbledDeepslate, + CobbledDeepslateWall, + Cobblestone, + CobblestoneWall, + Cobweb, + Cocoa, + CommandBlock, + Comparator, + Composter, + Concrete, + ConcretePowder, + Conduit, + CopperBlock, + CopperOre, + Coral, + CoralBlock, + CoralFan, + CoralWallFan, + Cornflower, + CrackedDeepslateBricks, + CrackedDeepslateTiles, + CrackedNetherBricks, + CrackedPolishedBlackstoneBricks, + CrackedStoneBricks, + CraftingTable, + CreeperHead, + CreeperWallHead, + CrimsonButton, + CrimsonDoor, + CrimsonFungus, + CrimsonHyphae, + CrimsonNylium, + CrimsonPressurePlate, + CrimsonRoots, + CrimsonStem, + CrimsonTrapdoor, + CryingObsidian, + CutCopper, + CutRedSandstone, + CutSandstone, + CyanCandle, + CyanCandleCake, + DarkPrismarine, + DaylightDetector, + DeadBush, + Deepslate, + DeepslateBrickWall, + DeepslateBricks, + DeepslateCoalOre, + DeepslateCopperOre, + DeepslateDiamondOre, + DeepslateEmeraldOre, + DeepslateGoldOre, + DeepslateIronOre, + DeepslateLapisOre, + DeepslateRedstoneOre, + DeepslateTileWall, + DeepslateTiles, + DetectorRail, + DiamondBlock, + DiamondOre, + Diorite, + DioriteWall, + Dirt, + DirtPath, + Dispenser, + DragonEgg, + DragonHead, + DragonWallHead, + DriedKelpBlock, + DripstoneBlock, + Dropper, + EmeraldBlock, + EmeraldOre, + EnchantingTable, + EndGateway, + EndPortal, + EndPortalFrame, + EndRod, + EndStone, + EndStoneBrickWall, + EndStoneBricks, + EnderChest, + ExposedCopper, + ExposedCutCopper, + Farmland, + Fence, + FenceGate, + Fern, + Fire, + FletchingTable, + Flower, + FlowerPot, + FloweringAzalea, + FrostedIce, + Furnace, + GildedBlackstone, + Glass, + GlassPane, + GlazedTeracotta, + GlowLichen, + Glowstone, + GoldBlock, + GoldOre, + Granite, + GraniteWall, + Grass, + GrassBlock, + Gravel, + GrayCandle, + GrayCandleCake, + GreenCandle, + GreenCandleCake, + Grindstone, + HangingRoots, + HayBlock, + HeavyWeightedPressurePlate, + HoneyBlock, + HoneycombBlock, + Hopper, + Ice, + InfestedChiseledStoneBricks, + InfestedCobblestone, + InfestedCrackedStoneBricks, + InfestedDeepslate, + InfestedMossyStoneBricks, + InfestedStone, + InfestedStoneBricks, + IronBars, + IronBlock, + IronDoor, + IronOre, + IronTrapdoor, + JackOLantern, + Jigsaw, + Jukebox, + Kelp, + KelpPlant, + Ladder, + Lantern, + LapisBlock, + LapisOre, + LargeAmethystBud, + LargeFern, + Lava, + LavaCauldron, + Leaves, + Lectern, + Lever, + Light, + LightBlueCandle, + LightBlueCandleCake, + LightGrayCandle, + LightGrayCandleCake, + LightWeightedPressurePlate, + LightningRod, + Lilac, + LilyOfTheValley, + LilyPad, + LimeCandle, + LimeCandleCake, + Lodestone, + Log, + Loom, + MagentaCandle, + MagentaCandleCake, + MagmaBlock, + MediumAmethystBud, + Melon, + MelonStem, + MossBlock, + MossyCobblestone, + MossyCobblestoneWall, + MossyStoneBrickWall, + MossyStoneBricks, + MovingPiston, + Mushroom, + MushroomStem, + Mycelium, + NetherBrickWall, + NetherBricks, + NetherGoldOre, + NetherPortal, + NetherQuartzOre, + NetherSprouts, + NetherWart, + NetherWartBlock, + NetheriteBlock, + Netherrack, + NoteBlock, + Observer, + Obsidian, + OrangeCandle, + OrangeCandleCake, + OxidizedCopper, + OxidizedCutCopper, + PackedIce, + Peony, + PinkCandle, + PinkCandleCake, + Piston, + PistonHead, + Planks, + PlayerHead, + PlayerWallHead, + Podzol, + PointedDripstone, + PolishedAndesite, + PolishedBasalt, + PolishedBlackstone, + PolishedBlackstoneBrickWall, + PolishedBlackstoneBricks, + PolishedBlackstoneButton, + PolishedBlackstonePressurePlate, + PolishedBlackstoneWall, + PolishedDeepslate, + PolishedDeepslateWall, + PolishedDiorite, + PolishedGranite, + Potatoes, + PottedAllium, + PottedAzaleaBush, + PottedBamboo, + PottedCactus, + PottedCornflower, + PottedCrimsonFungus, + PottedCrimsonRoots, + PottedDandelion, + PottedDeadBush, + PottedFern, + PottedFloweringAzaleaBush, + PottedLilyOfTheValley, + PottedPoppy, + PottedWarpedFungus, + PottedWarpedRoots, + PottedWitherRose, + PowderSnow, + PowderSnowCauldron, + PoweredRail, + Prismarine, + PrismarineBricks, + PrismarineWall, + Pumpkin, + PumpkinStem, + PurpleCandle, + PurpleCandleCake, + PurpurBlock, + PurpurPillar, + QuartzBlock, + QuartzBricks, + QuartzPillar, + Rail, + RawCopperBlock, + RawGoldBlock, + RawIronBlock, + RedCandle, + RedCandleCake, + RedMushroomBlock, + RedNetherBrickWall, + RedNetherBricks, + RedSand, + RedSandstone, + RedSandstoneWall, + RedstoneBlock, + RedstoneLamp, + RedstoneOre, + RedstoneTorch, + RedstoneWallTorch, + RedstoneWire, + Repeater, + RepeatingCommandBlock, + RespawnAnchor, + RootedDirt, + RoseBush, + Sand, + Sandstone, + SandstoneWall, + Sapling, + Scaffolding, + SculkSensor, + SeaLantern, + SeaPickle, + Seagrass, + Shroomlight, + ShulkerBox, + Sign, + SkeletonSkull, + SkeletonWallSkull, + Slab, + SlimeBlock, + SmallAmethystBud, + SmallDripleaf, + SmithingTable, + Smoker, + SmoothBasalt, + SmoothQuartz, + SmoothRedSandstone, + SmoothSandstone, + SmoothStone, + Snow, + SnowBlock, + SoulCampfire, + SoulFire, + SoulLantern, + SoulSand, + SoulSoil, + SoulTorch, + SoulWallTorch, + Spawner, + Sponge, + SporeBlossom, + StainedGlass, + StainedGlassPane, + Stairs, + StickyPiston, + Stone, + StoneBrickWall, + StoneBricks, + StoneButton, + StonePressurePlate, + Stonecutter, + StrippedCrimsonHyphae, + StrippedCrimsonStem, + StrippedWarpedHyphae, + StrippedWarpedStem, + StructureBlock, + StructureVoid, + SugarCane, + Sunflower, + SweetBerryBush, + TallGrass, + TallSeagrass, + Target, + Teracotta, + TintedGlass, + Tnt, + Torch, + TrappedChest, + Tripwire, + TripwireHook, + Tuff, + TurtleEgg, + TwistingVines, + TwistingVinesPlant, + Vine, + WallBanner, + WallSign, + WallTorch, + WarpedButton, + WarpedDoor, + WarpedFungus, + WarpedHyphae, + WarpedNylium, + WarpedPressurePlate, + WarpedRoots, + WarpedStem, + WarpedTrapdoor, + WarpedWartBlock, + Water, + WaterCauldron, + WaxedCopperBlock, + WaxedCutCopper, + WaxedExposedCopper, + WaxedExposedCutCopper, + WaxedOxidizedCopper, + WaxedOxidizedCutCopper, + WaxedWeatheredCopper, + WaxedWeatheredCutCopper, + WeatheredCopper, + WeatheredCutCopper, + WeepingVines, + WeepingVinesPlant, + WetSponge, + Wheat, + WhiteCandle, + WhiteCandleCake, + WitherRose, + WitherSkeletonSkull, + WitherSkeletonWallSkull, + WoodenButton, + WoodenDoor, + WoodenPressurePlate, + WoodenTrapdoor, + Wool, + YellowCandle, + YellowCandleCake, + ZombieHead, + ZombieWallHead, + ] + } } - -#[allow(warnings)] -#[allow(clippy::all)] impl BlockKind { - /// Returns the `simplified_kind` property of this `BlockKind`. + #[doc = "Returns the `simplified_kind` property of this `BlockKind`."] + #[inline] pub fn simplified_kind(&self) -> SimplifiedBlockKind { match self { BlockKind::Air => SimplifiedBlockKind::Air, @@ -394,8 +968,11 @@ impl BlockKind { BlockKind::RedSand => SimplifiedBlockKind::RedSand, BlockKind::Gravel => SimplifiedBlockKind::Gravel, BlockKind::GoldOre => SimplifiedBlockKind::GoldOre, + BlockKind::DeepslateGoldOre => SimplifiedBlockKind::DeepslateGoldOre, BlockKind::IronOre => SimplifiedBlockKind::IronOre, + BlockKind::DeepslateIronOre => SimplifiedBlockKind::DeepslateIronOre, BlockKind::CoalOre => SimplifiedBlockKind::CoalOre, + BlockKind::DeepslateCoalOre => SimplifiedBlockKind::DeepslateCoalOre, BlockKind::NetherGoldOre => SimplifiedBlockKind::NetherGoldOre, BlockKind::OakLog => SimplifiedBlockKind::Log, BlockKind::SpruceLog => SimplifiedBlockKind::Log, @@ -427,10 +1004,13 @@ impl BlockKind { BlockKind::JungleLeaves => SimplifiedBlockKind::Leaves, BlockKind::AcaciaLeaves => SimplifiedBlockKind::Leaves, BlockKind::DarkOakLeaves => SimplifiedBlockKind::Leaves, + BlockKind::AzaleaLeaves => SimplifiedBlockKind::Leaves, + BlockKind::FloweringAzaleaLeaves => SimplifiedBlockKind::Leaves, BlockKind::Sponge => SimplifiedBlockKind::Sponge, BlockKind::WetSponge => SimplifiedBlockKind::WetSponge, BlockKind::Glass => SimplifiedBlockKind::Glass, BlockKind::LapisOre => SimplifiedBlockKind::LapisOre, + BlockKind::DeepslateLapisOre => SimplifiedBlockKind::DeepslateLapisOre, BlockKind::LapisBlock => SimplifiedBlockKind::LapisBlock, BlockKind::Dispenser => SimplifiedBlockKind::Dispenser, BlockKind::Sandstone => SimplifiedBlockKind::Sandstone, @@ -512,6 +1092,7 @@ impl BlockKind { BlockKind::Chest => SimplifiedBlockKind::Chest, BlockKind::RedstoneWire => SimplifiedBlockKind::RedstoneWire, BlockKind::DiamondOre => SimplifiedBlockKind::DiamondOre, + BlockKind::DeepslateDiamondOre => SimplifiedBlockKind::DeepslateDiamondOre, BlockKind::DiamondBlock => SimplifiedBlockKind::DiamondBlock, BlockKind::CraftingTable => SimplifiedBlockKind::CraftingTable, BlockKind::Wheat => SimplifiedBlockKind::Wheat, @@ -543,6 +1124,7 @@ impl BlockKind { BlockKind::AcaciaPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, BlockKind::DarkOakPressurePlate => SimplifiedBlockKind::WoodenPressurePlate, BlockKind::RedstoneOre => SimplifiedBlockKind::RedstoneOre, + BlockKind::DeepslateRedstoneOre => SimplifiedBlockKind::DeepslateRedstoneOre, BlockKind::RedstoneTorch => SimplifiedBlockKind::RedstoneTorch, BlockKind::RedstoneWallTorch => SimplifiedBlockKind::RedstoneWallTorch, BlockKind::StoneButton => SimplifiedBlockKind::StoneButton, @@ -616,6 +1198,7 @@ impl BlockKind { BlockKind::PumpkinStem => SimplifiedBlockKind::PumpkinStem, BlockKind::MelonStem => SimplifiedBlockKind::MelonStem, BlockKind::Vine => SimplifiedBlockKind::Vine, + BlockKind::GlowLichen => SimplifiedBlockKind::GlowLichen, BlockKind::OakFenceGate => SimplifiedBlockKind::FenceGate, BlockKind::BrickStairs => SimplifiedBlockKind::Stairs, BlockKind::StoneBrickStairs => SimplifiedBlockKind::Stairs, @@ -628,6 +1211,9 @@ impl BlockKind { BlockKind::EnchantingTable => SimplifiedBlockKind::EnchantingTable, BlockKind::BrewingStand => SimplifiedBlockKind::BrewingStand, BlockKind::Cauldron => SimplifiedBlockKind::Cauldron, + BlockKind::WaterCauldron => SimplifiedBlockKind::WaterCauldron, + BlockKind::LavaCauldron => SimplifiedBlockKind::LavaCauldron, + BlockKind::PowderSnowCauldron => SimplifiedBlockKind::PowderSnowCauldron, BlockKind::EndPortal => SimplifiedBlockKind::EndPortal, BlockKind::EndPortalFrame => SimplifiedBlockKind::EndPortalFrame, BlockKind::EndStone => SimplifiedBlockKind::EndStone, @@ -636,6 +1222,7 @@ impl BlockKind { BlockKind::Cocoa => SimplifiedBlockKind::Cocoa, BlockKind::SandstoneStairs => SimplifiedBlockKind::Stairs, BlockKind::EmeraldOre => SimplifiedBlockKind::EmeraldOre, + BlockKind::DeepslateEmeraldOre => SimplifiedBlockKind::DeepslateEmeraldOre, BlockKind::EnderChest => SimplifiedBlockKind::EnderChest, BlockKind::TripwireHook => SimplifiedBlockKind::TripwireHook, BlockKind::Tripwire => SimplifiedBlockKind::Tripwire, @@ -749,6 +1336,7 @@ impl BlockKind { BlockKind::DarkOakStairs => SimplifiedBlockKind::Stairs, BlockKind::SlimeBlock => SimplifiedBlockKind::SlimeBlock, BlockKind::Barrier => SimplifiedBlockKind::Barrier, + BlockKind::Light => SimplifiedBlockKind::Light, BlockKind::IronTrapdoor => SimplifiedBlockKind::IronTrapdoor, BlockKind::Prismarine => SimplifiedBlockKind::Prismarine, BlockKind::PrismarineBricks => SimplifiedBlockKind::PrismarineBricks, @@ -868,7 +1456,7 @@ impl BlockKind { BlockKind::PurpurStairs => SimplifiedBlockKind::Stairs, BlockKind::EndStoneBricks => SimplifiedBlockKind::EndStoneBricks, BlockKind::Beetroots => SimplifiedBlockKind::Beetroots, - BlockKind::GrassPath => SimplifiedBlockKind::GrassPath, + BlockKind::DirtPath => SimplifiedBlockKind::DirtPath, BlockKind::EndGateway => SimplifiedBlockKind::EndGateway, BlockKind::RepeatingCommandBlock => SimplifiedBlockKind::RepeatingCommandBlock, BlockKind::ChainCommandBlock => SimplifiedBlockKind::ChainCommandBlock, @@ -1141,6 +1729,127 @@ impl BlockKind { BlockKind::ChiseledNetherBricks => SimplifiedBlockKind::ChiseledNetherBricks, BlockKind::CrackedNetherBricks => SimplifiedBlockKind::CrackedNetherBricks, BlockKind::QuartzBricks => SimplifiedBlockKind::QuartzBricks, + BlockKind::Candle => SimplifiedBlockKind::Candle, + BlockKind::WhiteCandle => SimplifiedBlockKind::WhiteCandle, + BlockKind::OrangeCandle => SimplifiedBlockKind::OrangeCandle, + BlockKind::MagentaCandle => SimplifiedBlockKind::MagentaCandle, + BlockKind::LightBlueCandle => SimplifiedBlockKind::LightBlueCandle, + BlockKind::YellowCandle => SimplifiedBlockKind::YellowCandle, + BlockKind::LimeCandle => SimplifiedBlockKind::LimeCandle, + BlockKind::PinkCandle => SimplifiedBlockKind::PinkCandle, + BlockKind::GrayCandle => SimplifiedBlockKind::GrayCandle, + BlockKind::LightGrayCandle => SimplifiedBlockKind::LightGrayCandle, + BlockKind::CyanCandle => SimplifiedBlockKind::CyanCandle, + BlockKind::PurpleCandle => SimplifiedBlockKind::PurpleCandle, + BlockKind::BlueCandle => SimplifiedBlockKind::BlueCandle, + BlockKind::BrownCandle => SimplifiedBlockKind::BrownCandle, + BlockKind::GreenCandle => SimplifiedBlockKind::GreenCandle, + BlockKind::RedCandle => SimplifiedBlockKind::RedCandle, + BlockKind::BlackCandle => SimplifiedBlockKind::BlackCandle, + BlockKind::CandleCake => SimplifiedBlockKind::CandleCake, + BlockKind::WhiteCandleCake => SimplifiedBlockKind::WhiteCandleCake, + BlockKind::OrangeCandleCake => SimplifiedBlockKind::OrangeCandleCake, + BlockKind::MagentaCandleCake => SimplifiedBlockKind::MagentaCandleCake, + BlockKind::LightBlueCandleCake => SimplifiedBlockKind::LightBlueCandleCake, + BlockKind::YellowCandleCake => SimplifiedBlockKind::YellowCandleCake, + BlockKind::LimeCandleCake => SimplifiedBlockKind::LimeCandleCake, + BlockKind::PinkCandleCake => SimplifiedBlockKind::PinkCandleCake, + BlockKind::GrayCandleCake => SimplifiedBlockKind::GrayCandleCake, + BlockKind::LightGrayCandleCake => SimplifiedBlockKind::LightGrayCandleCake, + BlockKind::CyanCandleCake => SimplifiedBlockKind::CyanCandleCake, + BlockKind::PurpleCandleCake => SimplifiedBlockKind::PurpleCandleCake, + BlockKind::BlueCandleCake => SimplifiedBlockKind::BlueCandleCake, + BlockKind::BrownCandleCake => SimplifiedBlockKind::BrownCandleCake, + BlockKind::GreenCandleCake => SimplifiedBlockKind::GreenCandleCake, + BlockKind::RedCandleCake => SimplifiedBlockKind::RedCandleCake, + BlockKind::BlackCandleCake => SimplifiedBlockKind::BlackCandleCake, + BlockKind::AmethystBlock => SimplifiedBlockKind::AmethystBlock, + BlockKind::BuddingAmethyst => SimplifiedBlockKind::BuddingAmethyst, + BlockKind::AmethystCluster => SimplifiedBlockKind::AmethystCluster, + BlockKind::LargeAmethystBud => SimplifiedBlockKind::LargeAmethystBud, + BlockKind::MediumAmethystBud => SimplifiedBlockKind::MediumAmethystBud, + BlockKind::SmallAmethystBud => SimplifiedBlockKind::SmallAmethystBud, + BlockKind::Tuff => SimplifiedBlockKind::Tuff, + BlockKind::Calcite => SimplifiedBlockKind::Calcite, + BlockKind::TintedGlass => SimplifiedBlockKind::TintedGlass, + BlockKind::PowderSnow => SimplifiedBlockKind::PowderSnow, + BlockKind::SculkSensor => SimplifiedBlockKind::SculkSensor, + BlockKind::OxidizedCopper => SimplifiedBlockKind::OxidizedCopper, + BlockKind::WeatheredCopper => SimplifiedBlockKind::WeatheredCopper, + BlockKind::ExposedCopper => SimplifiedBlockKind::ExposedCopper, + BlockKind::CopperBlock => SimplifiedBlockKind::CopperBlock, + BlockKind::CopperOre => SimplifiedBlockKind::CopperOre, + BlockKind::DeepslateCopperOre => SimplifiedBlockKind::DeepslateCopperOre, + BlockKind::OxidizedCutCopper => SimplifiedBlockKind::OxidizedCutCopper, + BlockKind::WeatheredCutCopper => SimplifiedBlockKind::WeatheredCutCopper, + BlockKind::ExposedCutCopper => SimplifiedBlockKind::ExposedCutCopper, + BlockKind::CutCopper => SimplifiedBlockKind::CutCopper, + BlockKind::OxidizedCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::WeatheredCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::ExposedCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::CutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::OxidizedCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::WeatheredCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::ExposedCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::CutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::WaxedCopperBlock => SimplifiedBlockKind::WaxedCopperBlock, + BlockKind::WaxedWeatheredCopper => SimplifiedBlockKind::WaxedWeatheredCopper, + BlockKind::WaxedExposedCopper => SimplifiedBlockKind::WaxedExposedCopper, + BlockKind::WaxedOxidizedCopper => SimplifiedBlockKind::WaxedOxidizedCopper, + BlockKind::WaxedOxidizedCutCopper => SimplifiedBlockKind::WaxedOxidizedCutCopper, + BlockKind::WaxedWeatheredCutCopper => SimplifiedBlockKind::WaxedWeatheredCutCopper, + BlockKind::WaxedExposedCutCopper => SimplifiedBlockKind::WaxedExposedCutCopper, + BlockKind::WaxedCutCopper => SimplifiedBlockKind::WaxedCutCopper, + BlockKind::WaxedOxidizedCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::WaxedWeatheredCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::WaxedExposedCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::WaxedCutCopperStairs => SimplifiedBlockKind::Stairs, + BlockKind::WaxedOxidizedCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::WaxedWeatheredCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::WaxedExposedCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::WaxedCutCopperSlab => SimplifiedBlockKind::Slab, + BlockKind::LightningRod => SimplifiedBlockKind::LightningRod, + BlockKind::PointedDripstone => SimplifiedBlockKind::PointedDripstone, + BlockKind::DripstoneBlock => SimplifiedBlockKind::DripstoneBlock, + BlockKind::CaveVines => SimplifiedBlockKind::CaveVines, + BlockKind::CaveVinesPlant => SimplifiedBlockKind::CaveVinesPlant, + BlockKind::SporeBlossom => SimplifiedBlockKind::SporeBlossom, + BlockKind::Azalea => SimplifiedBlockKind::Azalea, + BlockKind::FloweringAzalea => SimplifiedBlockKind::FloweringAzalea, + BlockKind::MossCarpet => SimplifiedBlockKind::Carpet, + BlockKind::MossBlock => SimplifiedBlockKind::MossBlock, + BlockKind::BigDripleaf => SimplifiedBlockKind::BigDripleaf, + BlockKind::BigDripleafStem => SimplifiedBlockKind::BigDripleafStem, + BlockKind::SmallDripleaf => SimplifiedBlockKind::SmallDripleaf, + BlockKind::HangingRoots => SimplifiedBlockKind::HangingRoots, + BlockKind::RootedDirt => SimplifiedBlockKind::RootedDirt, + BlockKind::Deepslate => SimplifiedBlockKind::Deepslate, + BlockKind::CobbledDeepslate => SimplifiedBlockKind::CobbledDeepslate, + BlockKind::CobbledDeepslateStairs => SimplifiedBlockKind::Stairs, + BlockKind::CobbledDeepslateSlab => SimplifiedBlockKind::Slab, + BlockKind::CobbledDeepslateWall => SimplifiedBlockKind::CobbledDeepslateWall, + BlockKind::PolishedDeepslate => SimplifiedBlockKind::PolishedDeepslate, + BlockKind::PolishedDeepslateStairs => SimplifiedBlockKind::Stairs, + BlockKind::PolishedDeepslateSlab => SimplifiedBlockKind::Slab, + BlockKind::PolishedDeepslateWall => SimplifiedBlockKind::PolishedDeepslateWall, + BlockKind::DeepslateTiles => SimplifiedBlockKind::DeepslateTiles, + BlockKind::DeepslateTileStairs => SimplifiedBlockKind::Stairs, + BlockKind::DeepslateTileSlab => SimplifiedBlockKind::Slab, + BlockKind::DeepslateTileWall => SimplifiedBlockKind::DeepslateTileWall, + BlockKind::DeepslateBricks => SimplifiedBlockKind::DeepslateBricks, + BlockKind::DeepslateBrickStairs => SimplifiedBlockKind::Stairs, + BlockKind::DeepslateBrickSlab => SimplifiedBlockKind::Slab, + BlockKind::DeepslateBrickWall => SimplifiedBlockKind::DeepslateBrickWall, + BlockKind::ChiseledDeepslate => SimplifiedBlockKind::ChiseledDeepslate, + BlockKind::CrackedDeepslateBricks => SimplifiedBlockKind::CrackedDeepslateBricks, + BlockKind::CrackedDeepslateTiles => SimplifiedBlockKind::CrackedDeepslateTiles, + BlockKind::InfestedDeepslate => SimplifiedBlockKind::InfestedDeepslate, + BlockKind::SmoothBasalt => SimplifiedBlockKind::SmoothBasalt, + BlockKind::RawIronBlock => SimplifiedBlockKind::RawIronBlock, + BlockKind::RawCopperBlock => SimplifiedBlockKind::RawCopperBlock, + BlockKind::RawGoldBlock => SimplifiedBlockKind::RawGoldBlock, + BlockKind::PottedAzaleaBush => SimplifiedBlockKind::PottedAzaleaBush, + BlockKind::PottedFloweringAzaleaBush => SimplifiedBlockKind::PottedFloweringAzaleaBush, } } } diff --git a/libcraft/blocks/src/utils.rs b/libcraft/blocks/src/utils.rs new file mode 100644 index 000000000..7c5a856e4 --- /dev/null +++ b/libcraft/blocks/src/utils.rs @@ -0,0 +1,18 @@ +use crate::BlockKind; + +impl BlockKind { + pub fn is_air(self) -> bool { + matches!( + self, + BlockKind::Air | BlockKind::VoidAir | BlockKind::CaveAir + ) + } + + pub fn opaque(self) -> bool { + !self.transparent() + } + + pub fn fluid(self) -> bool { + matches!(self, BlockKind::Water | BlockKind::Lava) + } +} diff --git a/libcraft/blocks/tests/blocks.rs b/libcraft/blocks/tests/blocks.rs index b9ff9108f..98e5fcea3 100644 --- a/libcraft/blocks/tests/blocks.rs +++ b/libcraft/blocks/tests/blocks.rs @@ -1,12 +1,12 @@ use std::time::Instant; -use libcraft_blocks::{Ageable, BlockState}; +use libcraft_blocks::{block_data::Ageable, BlockKind, BlockState}; #[test] fn update_block_data() { let start = Instant::now(); - let mut block = BlockState::from_id(1485).unwrap(); + let mut block = BlockState::from_id(1528).unwrap(); let mut fire = block.data_as::().unwrap(); assert_eq!(fire.age(), 1); fire.set_age(3); @@ -18,7 +18,7 @@ fn update_block_data() { #[test] fn set_only_valid_values() { - let mut block = BlockState::from_id(1485).unwrap(); + let mut block = BlockState::from_id(1528).unwrap(); let mut fire = block.data_as::().unwrap(); assert_eq!(fire.age(), 1); fire.set_age(20); @@ -32,7 +32,7 @@ fn set_only_valid_values() { #[test] fn block_data_valid_properties() { - let block = BlockState::from_id(1485).unwrap(); + let block = BlockState::from_id(1528).unwrap(); let fire = block.data_as::().unwrap(); assert_eq!( fire.valid_age(), @@ -42,7 +42,7 @@ fn block_data_valid_properties() { #[test] fn block_state_valid_properties() { - let block = BlockState::from_id(1485).unwrap(); + let block = BlockState::from_id(1528).unwrap(); assert_eq!( block.get_valid_properties().age, @@ -51,3 +51,17 @@ fn block_state_valid_properties() { assert_eq!(block.get_valid_properties().up, vec![true, false]); assert_eq!(block.get_valid_properties().waterlogged, Vec::new()) } + +#[test] +fn default_state() { + let block = BlockState::new(BlockKind::PointedDripstone); + assert_eq!(block.id(), 18_549); + dbg!(block); +} + +#[test] +fn stairs() { + let block = + BlockState::new(BlockKind::from_namespaced_id("minecraft:nether_brick_stairs").unwrap()); + assert_eq!(block.kind(), BlockKind::NetherBrickStairs); +} diff --git a/libcraft/chunk/Cargo.toml b/libcraft/chunk/Cargo.toml new file mode 100644 index 000000000..6c545db3b --- /dev/null +++ b/libcraft/chunk/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "libcraft-chunk" +version = "0.1.0" +edition = "2021" + +[dependencies] +derive_more = "0.99" +bincode = "2.0.0-rc.1" +flate2 = "1" +libcraft-blocks = { path = "../blocks" } +libcraft-core = { path = "../core" } +itertools = "0.10" +once_cell = "1" +serde = { version = "1", features = [ "derive" ] } diff --git a/libcraft/chunk/src/biome.rs b/libcraft/chunk/src/biome.rs new file mode 100644 index 000000000..3f100cce4 --- /dev/null +++ b/libcraft/chunk/src/biome.rs @@ -0,0 +1,301 @@ +use itertools::Itertools; +use std::sync::atomic::Ordering; +use std::{collections::HashMap, io::Cursor}; + +use bincode::{Decode, Encode}; +use libcraft_blocks::BlockKind; +use serde::{Deserialize, Serialize}; + +use crate::paletted_container::BIOMES_COUNT; +use libcraft_core::EntityKind; + +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + derive_more::Deref, + Serialize, + Deserialize, + Encode, + Decode, +)] +pub struct BiomeId(usize); + +impl From for BiomeId { + fn from(id: usize) -> Self { + BiomeId(id) + } +} + +impl Default for BiomeId { + fn default() -> Self { + 0.into() + } +} + +#[derive(Default, Serialize, Deserialize, Encode, Decode)] +pub struct BiomeList(Vec<(String, BiomeGeneratorInfo)>); + +impl BiomeList { + /// Returns the default set of biomes used in vanilla. + pub fn vanilla() -> Self { + static DATA: &[u8] = include_bytes!("../../assets/vanilla_biomes.bc.gz"); + + let mut decoder = flate2::read::GzDecoder::new(Cursor::new(DATA)); + bincode::decode_from_std_read(&mut decoder, bincode::config::standard()) + .expect("malformed vanilla biomes data") + } + + pub fn insert(&mut self, biome: String, info: BiomeGeneratorInfo) { + BIOMES_COUNT.fetch_add(1, Ordering::Relaxed); + self.0.push((biome, info)); + } + + pub fn get_by_id(&self, id: &BiomeId) -> Option<(&String, &BiomeGeneratorInfo)> { + self.0.get(id.0).map(|(a, b)| (a, b)) + } + + pub fn get_id(&self, identifier: &str) -> Option { + self.0 + .iter() + .position(|(name, _)| name == identifier) + .map(BiomeId) + } + + pub fn iter(&self) -> impl Iterator + '_ { + self.0.iter().map(|(a, b)| (a, b)) + } +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeGeneratorInfo { + pub carvers: HashMap>, + pub features: Vec>, + pub spawners: BiomeSpawners, + #[serde(with = "spawn_costs")] + pub spawn_costs: HashMap, + #[serde(flatten)] + pub info: BiomeInfo, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeInfo { + pub effects: BiomeEffects, + pub precipitation: String, + pub temperature: f32, + pub downfall: f32, + pub temperature_modifier: Option, + pub category: BiomeCategory, + pub particle: Option, +} + +pub mod spawn_costs { + use serde::de::Error; + use serde::ser::SerializeMap; + use serde::{Deserializer, Serializer}; + + use super::*; + + pub fn serialize( + value: &HashMap, + serializer: S, + ) -> Result + where + S: Serializer, + { + let mut map = serializer.serialize_map(Some(value.len()))?; + for (key, value) in value.iter() { + map.serialize_entry(key.namespaced_id(), value)?; + } + map.end() + } + + pub fn deserialize<'de, D>( + deserializer: D, + ) -> Result, D::Error> + where + D: Deserializer<'de>, + { + let mut map = HashMap::new(); + for (key, value) in HashMap::::deserialize(deserializer)? { + map.insert( + EntityKind::from_namespaced_id(&key).ok_or_else(|| { + D::Error::custom(format_args!( + "unknown field `{}`, expected one of {}", + key, + EntityKind::values() + .iter() + .map(|kind| format!("`{}`", kind.namespaced_id())) + .join(", ") + )) + })?, + value, + ); + } + Ok(map) + } +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeSpawnCost { + energy_budget: f32, + charge: f32, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeParticle { + pub probability: f32, + pub options: BiomeParticleOptions, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeParticleOptions { + #[serde(rename = "type")] + pub particle_type: String, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +#[serde(rename_all = "snake_case")] +pub enum BiomeTemperatureModifier { + Frozen, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +#[serde(rename_all = "snake_case")] +pub enum BiomeGrassColorModifier { + Swamp, + DarkForest, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +#[serde(rename_all = "snake_case")] +pub enum BiomeCategory { + Ocean, + Plains, + Desert, + Forest, + ExtremeHills, + Taiga, + Swamp, + River, + Nether, + TheEnd, + Icy, + Mushroom, + Beach, + Jungle, + Mesa, + Savanna, + Mountain, + Underground, + None, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeEffects { + pub mood_sound: Option, + pub music: Option, + pub ambient_sound: Option, + pub additions_sound: Option, + pub grass_color_modifier: Option, + pub sky_color: BiomeColor, + pub foliage_color: Option, + pub grass_color: Option, + pub fog_color: BiomeColor, + pub water_color: BiomeColor, + pub water_fog_color: BiomeColor, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeAdditionsSound { + pub sound: String, + pub tick_chance: f64, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeMusic { + pub sound: String, + pub min_delay: i32, + pub max_delay: i32, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub replace_current_music: bool, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +#[serde(from = "i32", into = "i32")] +pub struct BiomeColor { + pub r: u8, + pub g: u8, + pub b: u8, +} + +impl From for BiomeColor { + #[allow(clippy::identity_op)] + #[allow(clippy::erasing_op)] + fn from(i: i32) -> Self { + let r = ((i >> (8 * 2)) & 0xFF) as u8; + let g = ((i >> (8 * 1)) & 0xFF) as u8; + let b = ((i >> (8 * 0)) & 0xFF) as u8; + BiomeColor { r, g, b } + } +} + +impl From for i32 { + fn from(color: BiomeColor) -> Self { + let mut i = 0i32; + i += color.r as i32; + i <<= 8; + i += color.g as i32; + i <<= 8; + i += color.b as i32; + i + } +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeMoodSound { + pub sound: String, + pub tick_delay: i32, + pub block_search_extent: i32, + pub offset: f32, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +pub struct BiomeSpawners { + pub monster: Vec, + pub creature: Vec, + pub ambient: Vec, + #[serde(default)] + pub axolotls: Vec, + pub underground_water_creature: Vec, + pub water_creature: Vec, + pub water_ambient: Vec, + pub misc: Vec, +} + +#[derive(Serialize, Deserialize, Debug, Clone, Encode, Decode)] +#[serde(rename_all = "camelCase")] +pub struct BiomeSpawner { + #[serde(rename = "type")] + pub entity_type: String, + pub weight: usize, + pub min_count: usize, + pub max_count: usize, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn vanilla_biomes_load() { + let biomes = BiomeList::vanilla(); + assert!(!biomes.0.is_empty()); + assert!(biomes.get_id("minecraft:plains").is_some()); + } +} diff --git a/feather/base/src/chunk/heightmap.rs b/libcraft/chunk/src/heightmap.rs similarity index 68% rename from feather/base/src/chunk/heightmap.rs rename to libcraft/chunk/src/heightmap.rs index 14c954233..5e3e4cc6b 100644 --- a/feather/base/src/chunk/heightmap.rs +++ b/libcraft/chunk/src/heightmap.rs @@ -1,8 +1,8 @@ +use std::convert::TryInto; use std::marker::PhantomData; -use blocks::{BlockId, SimplifiedBlockKind}; - -use crate::{CHUNK_HEIGHT, CHUNK_WIDTH}; +use libcraft_blocks::{BlockState, SimplifiedBlockKind}; +use libcraft_core::{WorldHeight, CHUNK_WIDTH}; use super::PackedArray; @@ -11,25 +11,17 @@ use super::PackedArray; pub struct HeightmapStore { pub motion_blocking: Heightmap, pub motion_blocking_no_leaves: Heightmap, - pub light_blocking: Heightmap, pub ocean_floor: Heightmap, pub world_surface: Heightmap, } -impl Default for HeightmapStore { - fn default() -> Self { - Self::new() - } -} - impl HeightmapStore { - pub fn new() -> Self { + pub fn new(height: WorldHeight) -> Self { Self { - motion_blocking: Heightmap::new(), - motion_blocking_no_leaves: Heightmap::new(), - light_blocking: Heightmap::new(), - ocean_floor: Heightmap::new(), - world_surface: Heightmap::new(), + motion_blocking: Heightmap::new(height), + motion_blocking_no_leaves: Heightmap::new(height), + ocean_floor: Heightmap::new(height), + world_surface: Heightmap::new(height), } } @@ -38,26 +30,23 @@ impl HeightmapStore { x: usize, y: usize, z: usize, - old_block: BlockId, - new_block: BlockId, - get_block: impl Fn(usize, usize, usize) -> BlockId, + old_block: BlockState, + new_block: BlockState, + get_block: impl Fn(usize, usize, usize) -> BlockState, ) { self.motion_blocking .update(x, y, z, old_block, new_block, &get_block); self.motion_blocking_no_leaves .update(x, y, z, old_block, new_block, &get_block); - self.light_blocking - .update(x, y, z, old_block, new_block, &get_block); self.ocean_floor .update(x, y, z, old_block, new_block, &get_block); self.world_surface .update(x, y, z, old_block, new_block, &get_block); } - pub fn recalculate(&mut self, get_block: impl Fn(usize, usize, usize) -> BlockId) { + pub fn recalculate(&mut self, get_block: impl Fn(usize, usize, usize) -> BlockState) { self.motion_blocking.recalculate(&get_block); self.motion_blocking_no_leaves.recalculate(&get_block); - self.light_blocking.recalculate(&get_block); self.ocean_floor.recalculate(&get_block); self.world_surface.recalculate(&get_block); } @@ -67,30 +56,30 @@ impl HeightmapStore { pub trait HeightmapFunction { /// Returns whether a block should be considered /// "solid" during the heightmap computation. - fn is_solid(block: BlockId) -> bool; + fn is_solid(block: BlockState) -> bool; } #[derive(Debug, Clone)] pub struct LightBlocking; impl HeightmapFunction for LightBlocking { - fn is_solid(block: BlockId) -> bool { - block.is_opaque() + fn is_solid(block: BlockState) -> bool { + block.kind().opaque() } } #[derive(Debug, Clone)] pub struct MotionBlocking; impl HeightmapFunction for MotionBlocking { - fn is_solid(block: BlockId) -> bool { - block.is_solid() || block.is_fluid() + fn is_solid(block: BlockState) -> bool { + block.kind().solid() || block.kind().fluid() } } #[derive(Debug, Clone)] pub struct MotionBlockingNoLeaves; impl HeightmapFunction for MotionBlockingNoLeaves { - fn is_solid(block: BlockId) -> bool { - (block.is_solid() || block.is_fluid()) + fn is_solid(block: BlockState) -> bool { + (block.kind().solid() || block.kind().fluid()) && block.simplified_kind() != SimplifiedBlockKind::Leaves } } @@ -98,41 +87,39 @@ impl HeightmapFunction for MotionBlockingNoLeaves { #[derive(Debug, Clone)] pub struct OceanFloor; impl HeightmapFunction for OceanFloor { - fn is_solid(block: BlockId) -> bool { - block.is_solid() + fn is_solid(block: BlockState) -> bool { + block.kind().solid() } } #[derive(Debug, Clone)] pub struct WorldSurface; impl HeightmapFunction for WorldSurface { - fn is_solid(block: BlockId) -> bool { - !block.is_air() + fn is_solid(block: BlockState) -> bool { + !block.kind().is_air() } } #[derive(Debug, Clone)] pub struct Heightmap { heights: PackedArray, + height: WorldHeight, _marker: PhantomData, } -impl Default for Heightmap -where - F: HeightmapFunction, -{ - fn default() -> Self { - Self::new() - } -} - impl Heightmap where F: HeightmapFunction, { - pub fn new() -> Self { + pub fn new(height: WorldHeight) -> Self { Self { - heights: PackedArray::new(256, 9), + heights: PackedArray::new( + (CHUNK_WIDTH * CHUNK_WIDTH) as usize, + ((*height as f64 + 1.0).log2().ceil() as usize) + .try_into() + .unwrap(), + ), + height, _marker: PhantomData, } } @@ -165,9 +152,9 @@ where x: usize, y: usize, z: usize, - old_block: BlockId, - new_block: BlockId, - get_block: impl Fn(usize, usize, usize) -> BlockId, + old_block: BlockState, + new_block: BlockState, + get_block: impl Fn(usize, usize, usize) -> BlockState, ) { if F::is_solid(old_block) && self.height(x, z) == Some(y) { // This was old the highest block @@ -187,10 +174,10 @@ where } /// Recalculates this entire heightmap. - pub fn recalculate(&mut self, get_block: impl Fn(usize, usize, usize) -> BlockId) { + pub fn recalculate(&mut self, get_block: impl Fn(usize, usize, usize) -> BlockState) { for x in 0..CHUNK_WIDTH { for z in 0..CHUNK_WIDTH { - for y in (0..CHUNK_HEIGHT).rev() { + for y in (0..*self.height).rev() { if F::is_solid(get_block(x, y, z)) { self.set_height(x, z, y + 1); break; @@ -199,4 +186,12 @@ where } } } + + pub fn from_u64_vec(vec: Vec, height: WorldHeight) -> Heightmap { + Heightmap { + heights: PackedArray::from_u64_vec(vec, CHUNK_WIDTH * CHUNK_WIDTH), + height, + _marker: PhantomData, + } + } } diff --git a/libcraft/chunk/src/lib.rs b/libcraft/chunk/src/lib.rs new file mode 100644 index 000000000..08bd3d4cc --- /dev/null +++ b/libcraft/chunk/src/lib.rs @@ -0,0 +1,628 @@ +//! Implements an efficient chunk data structure for storing blocks. + +use once_cell::sync::Lazy; +use std::usize; + +pub use heightmap::{Heightmap, HeightmapFunction, HeightmapStore}; +pub use light::LightStore; +pub use packed_array::PackedArray; + +use biome::BiomeId; +use libcraft_blocks::{BlockState, HIGHEST_ID}; +use libcraft_core::{ChunkPosition, Sections}; +use paletted_container::PalettedContainer; + +pub const BIOME_SAMPLE_RATE: usize = 4; +/// The width in blocks of a chunk column. +pub const CHUNK_WIDTH: usize = 16; + +/// The height in blocks of a chunk section. +pub const SECTION_HEIGHT: usize = 16; + +/// The width in blocks of a chunk section. +pub const SECTION_WIDTH: usize = CHUNK_WIDTH; + +/// The volume in blocks of a chunk section. +pub const SECTION_VOLUME: usize = SECTION_HEIGHT * SECTION_WIDTH * SECTION_WIDTH; + +pub const BIOMES_PER_CHUNK_SECTION: usize = (CHUNK_WIDTH / BIOME_SAMPLE_RATE) + * (CHUNK_WIDTH / BIOME_SAMPLE_RATE) + * (SECTION_HEIGHT / BIOME_SAMPLE_RATE); + +pub mod biome; +mod heightmap; +mod light; +mod packed_array; +pub mod paletted_container; + +/// A 16 x height x 16 chunk of blocks plus associated +/// light, biome, and heightmap data. +#[derive(Debug, Clone)] +pub struct Chunk { + sections: Vec, + heightmaps: HeightmapStore, + position: ChunkPosition, + min_y_section: i32, +} + +impl Chunk { + /// Creates a new empty chunk with the specified + /// position. + pub fn new(position: ChunkPosition, sections: Sections, min_y: i32) -> Self { + Self { + sections: vec![ChunkSection::default(); *sections + 2], + position, + heightmaps: HeightmapStore::new(sections.into()), + min_y_section: min_y / 16, + } + } + + /// Gets the position of this chunk. + pub fn position(&self) -> ChunkPosition { + self.position + } + + /// Sets the position of this chunk. + pub fn set_position(&mut self, pos: ChunkPosition) { + self.position = pos; + } + + /// Gets the block at the given position within this chunk. + /// + /// Returns `None` if the coordinates are out of bounds. + pub fn block_at(&self, x: usize, y: usize, z: usize) -> Option { + self.section_for_y(y)?.block_at(x, y % SECTION_HEIGHT, z) + } + + /// Sets the block at the given position within this chunk. + /// + /// Returns `None` if the coordinates are out of bounds. + pub fn set_block_at( + &mut self, + x: usize, + y: usize, + z: usize, + block: BlockState, + update_heightmaps: bool, + ) -> Option<()> { + if update_heightmaps { + let old_block = self.block_at(x, y, z)?; + let result = self + .section_for_y_mut(y)? + .set_block_at(x, y % SECTION_HEIGHT, z, block); + self.heightmaps + .update(x, y, z, old_block, block, Self::block_at_fn(&self.sections)); + result + } else { + self.section_for_y_mut(y)? + .set_block_at(x, y % SECTION_HEIGHT, z, block) + } + } + + /// Gets the biome at the given position within this chunk. + /// + /// Returns `None` if the coordinates are out of bounds. + pub fn biome_at(&self, x: usize, y: usize, z: usize) -> Option { + self.section_for_y(y)?.biome_at( + x / BIOME_SAMPLE_RATE, + (y / BIOME_SAMPLE_RATE) % SECTION_HEIGHT, + z / BIOME_SAMPLE_RATE, + ) + } + + /// Sets the biome at the given position within this chunk. + /// + /// Returns `None` if the coordinates are out of bounds. + pub fn set_biome_at(&mut self, x: usize, y: usize, z: usize, biome: BiomeId) -> Option<()> { + self.section_for_y_mut(y)?.set_biome_at( + x / BIOME_SAMPLE_RATE, + (y / BIOME_SAMPLE_RATE) % SECTION_HEIGHT, + z / BIOME_SAMPLE_RATE, + biome, + ) + } + + /// Fills the given chunk section with `block`. + pub fn fill_section(&mut self, section: usize, block: BlockState) -> bool { + let section = match self.sections.get_mut(section) { + Some(section) => section, + None => return false, + }; + + section.fill(block); + + true + } + + /// Recalculates heightmaps for this chunk. + pub fn recalculate_heightmaps(&mut self) { + self.heightmaps + .recalculate(Self::block_at_fn(&self.sections)) + } + + fn block_at_fn(sections: &[ChunkSection]) -> impl Fn(usize, usize, usize) -> BlockState + '_ { + move |x, y, z| { + sections[(y / SECTION_HEIGHT) + 1] + .block_at(x, y % SECTION_HEIGHT, z) + .unwrap() + } + } + + pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { + self.section_for_y(y)? + .block_light_at(x, y % SECTION_HEIGHT, z) + } + + pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { + self.section_for_y(y)? + .sky_light_at(x, y % SECTION_HEIGHT, z) + } + + pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + self.section_for_y_mut(y)? + .set_block_light_at(x, y, z, light) + } + + pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + self.section_for_y_mut(y)?.set_sky_light_at(x, y, z, light) + } + + fn section_for_y(&self, y: usize) -> Option<&ChunkSection> { + self.sections.get((y / SECTION_HEIGHT) + 1) + } + + fn section_for_y_mut(&mut self, y: usize) -> Option<&mut ChunkSection> { + self.sections.get_mut((y / SECTION_HEIGHT) + 1) + } + + /// Gets the [`HeightmapStore`] for this chunk. + pub fn heightmaps(&self) -> &HeightmapStore { + &self.heightmaps + } + + /// Mutably gets the [`HeightmapStore`] for this chunk. + pub fn heightmaps_mut(&mut self) -> &mut HeightmapStore { + &mut self.heightmaps + } + + /// Gets the chunk section at index `y`. + pub fn section(&self, y: isize) -> Option<&ChunkSection> { + self.sections.get((y + 1) as usize) + } + + /// Mutably gets the chunk section at index `y`. + pub fn section_mut(&mut self, y: isize) -> Option<&mut ChunkSection> { + self.sections.get_mut((y + 1) as usize) + } + + /// Sets the section at index `y`. + pub fn set_section_at(&mut self, y: isize, section: ChunkSection) { + self.sections[(y + 1) as usize] = section; + } + + /// Gets the sections of this chunk. + pub fn sections(&self) -> &[ChunkSection] { + &self.sections + } + + /// Gets the sections of this chunk. + pub fn sections_mut(&mut self) -> &mut [ChunkSection] { + &mut self.sections + } + + pub fn min_y_section(&self) -> i32 { + self.min_y_section + } + + pub fn min_y(&self) -> i32 { + self.min_y_section * SECTION_HEIGHT as i32 + } +} + +/// A 16x16x16 chunk of blocks. +#[derive(Debug, Clone)] +pub struct ChunkSection { + blocks: PalettedContainer, + biomes: PalettedContainer, + air_block_count: u32, + light: LightStore, +} + +impl Default for ChunkSection { + fn default() -> Self { + Self::new( + PalettedContainer::new(), + PalettedContainer::new(), + SECTION_VOLUME as u32, + LightStore::new(), + ) + } +} + +impl ChunkSection { + /// Creates new `ChunkSection` from its + /// raw parts. + pub fn new( + blocks: PalettedContainer, + biomes: PalettedContainer, + air_block_count: u32, + light: LightStore, + ) -> Self { + Self { + blocks, + biomes, + air_block_count, + light, + } + } + + /// Determines whether this chunk is empty (contains only air). + pub fn is_empty(&self) -> bool { + self.non_air_blocks() == 0 + } + + /// Returns the number of air blocks in this chunk section. + pub fn air_blocks(&self) -> u32 { + self.air_block_count + } + + /// Returns the number of non-air blocks in this chunk section. + pub fn non_air_blocks(&self) -> u32 { + SECTION_VOLUME as u32 - self.air_blocks() + } + + /// Gets the block at the given coordinates within this + /// chunk section. + pub fn block_at(&self, x: usize, y: usize, z: usize) -> Option { + self.blocks.get_block_at(x, y, z) + } + + /// Sets the block at the given coordinates within + /// this chunk section. + /// + /// Returns `None` if the coordinates were out of bounds. + pub fn set_block_at(&mut self, x: usize, y: usize, z: usize, block: BlockState) -> Option<()> { + self.update_air_block_count(x, y, z, block); + self.blocks.set_block_at(x, y, z, block) + } + + /// Gets the biome at the given coordinates within this + /// chunk section. + pub fn biome_at(&self, x: usize, y: usize, z: usize) -> Option { + self.biomes.biome_at(x, y, z) + } + + /// Sets the biome at the given coordinates within + /// this chunk section. + /// + /// Returns `None` if the coordinates were out of bounds. + pub fn set_biome_at(&mut self, x: usize, y: usize, z: usize, biome: BiomeId) -> Option<()> { + self.biomes.set_biome_at(x, y, z, biome) + } + + /// Fills this chunk section with the given block. + /// + /// Does not currently update heightmaps. + pub fn fill(&mut self, block: BlockState) { + self.blocks.fill(block); + + if block.kind().is_air() { + self.air_block_count = SECTION_VOLUME as u32; + } else { + self.air_block_count = 0; + } + } + + pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { + self.light.block_light_at(x, y, z) + } + + pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { + self.light.sky_light_at(x, y, z) + } + + pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + self.light.set_block_light_at(x, y, z, light) + } + + pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + self.light.set_sky_light_at(x, y, z, light) + } + + pub fn light(&self) -> &LightStore { + &self.light + } + + pub fn light_mut(&mut self) -> &mut LightStore { + &mut self.light + } + + pub fn blocks(&self) -> &PalettedContainer { + &self.blocks + } + + pub fn blocks_mut(&mut self) -> &mut PalettedContainer { + &mut self.blocks + } + + pub fn biomes(&self) -> &PalettedContainer { + &self.biomes + } + + pub fn biomes_mut(&mut self) -> &mut PalettedContainer { + &mut self.biomes + } + + pub fn count_air_blocks(blocks: &PalettedContainer) -> u32 { + match blocks { + PalettedContainer::SingleValue(value) if value.kind().is_air() => blocks.len() as u32, + PalettedContainer::SingleValue(_) => 0, + PalettedContainer::MultipleValues { data, palette } => { + let air_blocks_in_palette = palette + .iter() + .enumerate() + .filter_map(|(i, value)| if value.kind().is_air() { Some(i) } else { None }) + .map(|i| i as u32) + .collect::>(); + data.iter() + .filter(|block| air_blocks_in_palette.contains(&(*block as u32))) + .count() as u32 + } + PalettedContainer::GlobalPalette { data } => { + static AIR_BLOCKS: Lazy> = Lazy::new(|| { + (0..HIGHEST_ID) + .filter(|index| BlockState::from_id(*index as u16).unwrap().kind().is_air()) + .map(|i| i as u32) + .collect::>() + }); + data.iter() + .filter(|block| AIR_BLOCKS.contains(&(*block as u32))) + .count() as u32 + } + } + } + + fn update_air_block_count(&mut self, x: usize, y: usize, z: usize, new: BlockState) { + let old = self.block_at(x, y, z).unwrap(); + if old.kind().is_air() && !new.kind().is_air() { + self.air_block_count -= 1; + } else if !old.kind().is_air() && new.kind().is_air() { + self.air_block_count += 1; + } + } + + fn block_index(x: usize, y: usize, z: usize) -> Option { + if x >= SECTION_WIDTH || y >= SECTION_WIDTH || z >= SECTION_WIDTH { + None + } else { + Some((y << 8) | (z << 4) | x) + } + } + + fn biome_index(x: usize, y: usize, z: usize) -> Option { + if x >= SECTION_WIDTH / BIOME_SAMPLE_RATE + || y >= SECTION_WIDTH / BIOME_SAMPLE_RATE + || z >= SECTION_WIDTH / BIOME_SAMPLE_RATE + { + None + } else { + Some((y << 4) | (z << 2) | x) + } + } +} +/* +#[cfg(test)] +mod tests { + use super::*; + use std::convert::TryInto; + + #[test] + fn chunk_new() { + let pos = ChunkPosition::new(0, 0); + let chunk = Chunk::new(pos, Sections(16), 0); + + // Confirm that chunk is empty + for x in 0..16 { + assert_eq!( + chunk.section(x).unwrap().blocks, + PalettedContainer::default() + ); + assert_eq!( + chunk.section(x).unwrap().biomes, + PalettedContainer::default() + ); + } + + assert_eq!(chunk.position(), pos); + } + + #[test] + fn set_block_simple() { + let pos = ChunkPosition::new(0, 0); + let mut chunk = Chunk::new(pos, Sections(16), 0); + + chunk.set_block_at(0, 0, 0, BlockState::andesite(), true); + assert_eq!(chunk.block_at(0, 0, 0).unwrap(), BlockState::andesite()); + assert!(chunk.section(0).is_some()); + } + + #[test] + fn fill_chunk() { + let pos = ChunkPosition::new(0, 0); + let mut chunk = Chunk::new(pos, Sections(16), 0); + + let block = BlockState::stone(); + + for x in 0..SECTION_WIDTH { + for y in 0..16 * SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + chunk.set_block_at(x, y, z, block, true).unwrap(); + assert_eq!(chunk.block_at(x, y, z), Some(block)); + } + } + } + + // Check again, just to be sure + for x in 0..SECTION_WIDTH { + for y in 0..16 * SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + assert_eq!(chunk.block_at(x, y, z), Some(block)); + } + } + } + } + + #[test] + fn spray_chunk() { + // This test fills each section of the chunk + // with the blocks with IDs corresponding + // to 0-4095 in order, testing that + // resizing, etc. works correctly. + + let pos = ChunkPosition::new(0, 0); + let mut chunk = Chunk::new(pos, Sections(16), 0); + + for section in 0..16 { + let mut counter = 0; + for x in 0..SECTION_WIDTH { + for y in 0..SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + let block = BlockState::from_vanilla_id(counter).unwrap(); + chunk.set_block_at(x, (section * SECTION_HEIGHT) + y, z, block, true); + assert_eq!( + chunk.block_at(x, (section * SECTION_HEIGHT) + y, z), + Some(block) + ); + counter += 1; + } + } + } + } + + // Go through again to be sure + for section in 0..16 { + assert!(chunk.section(section).is_some()); + let mut counter = 0; + for x in 0..SECTION_WIDTH { + for y in 0..SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + let block = BlockState::from_vanilla_id(counter).unwrap(); + assert_eq!( + chunk.block_at(x, (section as usize * SECTION_HEIGHT) + y, z), + Some(block) + ); + assert!(chunk.section(section).is_some()); + counter += 1; + } + } + } + } + + // Now, empty the chunk and ensure + // that the sections become empty. + for x in 0..SECTION_WIDTH { + for y in 0..16 * SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + chunk.set_block_at(x, y, z, BlockState::air(), false); + } + } + } + } + + #[test] + fn section_from_data_and_palette() { + let pos = ChunkPosition::new(0, 0); + let mut chunk = Chunk::new(pos, Sections(16), 0); + + let mut palette = PalettedContainer::new(); + let stone_index = palette.index_or_insert(BlockState::stone()); + + let mut data = PackedArray::new(16 * SECTION_WIDTH * SECTION_WIDTH, 5.try_into().unwrap()); + for i in 0..4096 { + data.set(i, stone_index as u64); + } + palette.set_data(data); + + let section = + ChunkSection::new(palette, PalettedContainer::default(), 0, LightStore::new()); + chunk.set_section_at(0, section); + + for x in 0..SECTION_WIDTH { + for y in 0..16 { + for z in 0..SECTION_WIDTH { + assert_eq!(chunk.block_at(x, y, z).unwrap(), BlockState::stone()); + } + } + } + } + + #[test] + fn test_palette_insertion_in_middle() { + let mut chunk = ChunkSection::default(); + + chunk + .set_block_at(0, 0, 0, BlockState::cobblestone()) + .unwrap(); + chunk.set_block_at(0, 1, 0, BlockState::stone()).unwrap(); + + assert_eq!(chunk.block_at(0, 0, 0).unwrap(), BlockState::cobblestone()); + assert_eq!(chunk.block_at(0, 1, 0).unwrap(), BlockState::stone()); + } + + #[test] + fn test_biomes() { + let mut chunk = Chunk::new(ChunkPosition::default(), Sections(16), 0); + + for x in (0..SECTION_WIDTH).step_by(BIOME_SAMPLE_RATE) { + for z in (0..SECTION_WIDTH).step_by(BIOME_SAMPLE_RATE) { + assert_eq!(chunk.biome_at(x, 0, z), Some(0.into())); + chunk.set_biome_at(x, 0, z, 1.into()); + assert_eq!(chunk.biome_at(x, 0, z), Some(1.into())); + } + } + } + + #[test] + fn test_light() { + let mut chunk = Chunk::new(ChunkPosition::default(), Sections(16), 0); + + chunk + .set_block_at(0, 0, 0, BlockState::stone(), true) + .unwrap(); + + for x in 0..SECTION_WIDTH { + for y in 0..SECTION_HEIGHT { + for z in 0..SECTION_WIDTH { + chunk.set_block_light_at(x, y, z, 10); + chunk.set_sky_light_at(x, y, z, 8); + assert_eq!(chunk.block_light_at(x, y, z), Some(10)); + assert_eq!(chunk.sky_light_at(x, y, z), Some(8)); + } + } + } + } + + #[test] + fn heightmaps() { + let mut chunk = Chunk::new(ChunkPosition::new(0, 0), Sections(16), 0); + + chunk.set_block_at(0, 10, 0, BlockState::stone(), true); + assert_eq!(chunk.heightmaps.motion_blocking.height(0, 0), Some(10)); + } + + #[test] + fn fill_chunk_section() { + let mut section = ChunkSection::default(); + section.set_block_at(0, 0, 0, BlockState::stone()); + section.fill(BlockState::acacia_wood()); + + for x in 0..CHUNK_WIDTH { + for y in 0..SECTION_HEIGHT { + for z in 0..CHUNK_WIDTH { + assert_eq!(section.block_at(x, y, z), Some(BlockState::acacia_wood())); + } + } + } + } +} + */ diff --git a/libcraft/chunk/src/light.rs b/libcraft/chunk/src/light.rs new file mode 100644 index 000000000..3e89d0505 --- /dev/null +++ b/libcraft/chunk/src/light.rs @@ -0,0 +1,103 @@ +use crate::ChunkSection; +use std::convert::TryInto; + +use super::{PackedArray, SECTION_VOLUME}; + +/// Contains light data for a chunk section. +#[derive(Debug, Clone)] +pub struct LightStore { + /// Could be None in some dimensions (see [has_skylight](crate::common::world::DimensionTypeInfo.has_skylight)) + /// or when you get this packet from deserialization of the LightData packet + sky_light: Option, + /// Could be None when you get this packet from deserialization of the LightData packet + block_light: Option, +} + +impl Default for LightStore { + fn default() -> Self { + Self::new() + } +} + +impl LightStore { + /// Creates a `LightStore` with sky light set to 15. + pub fn new() -> Self { + let mut this = LightStore { + sky_light: Some(PackedArray::new(SECTION_VOLUME, 4.try_into().unwrap())), + block_light: Some(PackedArray::new(SECTION_VOLUME, 4.try_into().unwrap())), + }; + fill_with_default_light(this.sky_light.as_mut().unwrap()); + fill_with_default_light(this.block_light.as_mut().unwrap()); + this + } + /// Creates a `LightStore` with all light set to 0. + pub fn empty() -> Self { + LightStore { + block_light: Some(PackedArray::new(SECTION_VOLUME, 4.try_into().unwrap())), + sky_light: Some(PackedArray::new(SECTION_VOLUME, 4.try_into().unwrap())), + } + } + + /// Creates a `LightStore` from packed arrays. + pub fn from_packed_arrays( + sky_light: Option, + block_light: Option, + ) -> Option { + if (sky_light.is_some() + && (sky_light.as_ref().unwrap().len() != SECTION_VOLUME + || sky_light.as_ref().unwrap().bits_per_value() != 4.try_into().unwrap())) + || (block_light.is_some() + && (block_light.as_ref().unwrap().len() != SECTION_VOLUME + || block_light.as_ref().unwrap().bits_per_value() != 4.try_into().unwrap())) + { + None + } else { + Some(Self { + block_light, + sky_light, + }) + } + } + + pub fn sky_light_at(&self, x: usize, y: usize, z: usize) -> Option { + let index = ChunkSection::block_index(x, y, z)?; + self.sky_light.as_ref()?.get(index).map(|x| x as u8) + } + + pub fn block_light_at(&self, x: usize, y: usize, z: usize) -> Option { + let index = ChunkSection::block_index(x, y, z)?; + self.block_light.as_ref()?.get(index).map(|x| x as u8) + } + + pub fn set_sky_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + let index = ChunkSection::block_index(x, y, z)?; + self.sky_light.as_mut()?.set(index, light.min(15) as u64); + Some(()) + } + + pub fn set_block_light_at(&mut self, x: usize, y: usize, z: usize, light: u8) -> Option<()> { + let index = ChunkSection::block_index(x, y, z)?; + self.block_light.as_mut()?.set(index, light.min(15) as u64); + Some(()) + } + + pub fn sky_light(&self) -> Option<&PackedArray> { + self.sky_light.as_ref() + } + + pub fn block_light(&self) -> Option<&PackedArray> { + self.block_light.as_ref() + } + + pub fn sky_light_mut(&mut self) -> Option<&mut PackedArray> { + self.sky_light.as_mut() + } + + pub fn block_light_mut(&mut self) -> Option<&mut PackedArray> { + self.block_light.as_mut() + } +} + +fn fill_with_default_light(arr: &mut PackedArray) { + arr.fill(15); +} diff --git a/feather/base/src/chunk/packed_array.rs b/libcraft/chunk/src/packed_array.rs similarity index 70% rename from feather/base/src/chunk/packed_array.rs rename to libcraft/chunk/src/packed_array.rs index f1d3eae8c..44b4ab962 100644 --- a/feather/base/src/chunk/packed_array.rs +++ b/libcraft/chunk/src/packed_array.rs @@ -1,9 +1,13 @@ +use std::convert::TryInto; +use std::mem::ManuallyDrop; +use std::num::NonZeroUsize; + /// A packed array of integers where each integer consumes -/// `n` bits. Used to store block data in chunks. -#[derive(Debug, Clone)] +/// `bits_per_value` bits. Used to store block data in chunks. +#[derive(Debug, Clone, PartialEq)] pub struct PackedArray { length: usize, - bits_per_value: usize, + bits_per_value: NonZeroUsize, bits: Vec, } @@ -14,7 +18,7 @@ impl PackedArray { /// /// # Panics /// Panics if `bits_per_value > 64`. - pub fn new(length: usize, bits_per_value: usize) -> Self { + pub fn new(length: usize, bits_per_value: NonZeroUsize) -> Self { let mut this = Self { length, bits_per_value, @@ -29,7 +33,10 @@ impl PackedArray { /// Creates a `PackedArray` from raw `u64` data /// and a length. pub fn from_u64_vec(bits: Vec, length: usize) -> Self { - let bits_per_value = bits.len() * 64 / length; + assert!(!bits.is_empty()); + let bits_per_value = (bits.len() * u64::BITS as usize / length) + .try_into() + .unwrap(); Self { length, bits_per_value, @@ -37,6 +44,19 @@ impl PackedArray { } } + /// Creates a `PackedArray` from raw `i64` data + /// and a length. + pub fn from_i64_vec(bits: Vec, length: usize) -> Self { + // SAFETY: i64 and u64 have the same memory layout + let mut bits = ManuallyDrop::new(bits); + Self::from_u64_vec( + unsafe { + Vec::from_raw_parts(bits.as_mut_ptr() as *mut u64, bits.len(), bits.capacity()) + }, + length, + ) + } + /// Gets the value at the given index. #[inline] pub fn get(&self, index: usize) -> Option { @@ -56,7 +76,7 @@ impl PackedArray { /// Panics if `index >= self.length()` or `value > self.max_value()`. #[inline] pub fn set(&mut self, index: usize, value: u64) { - assert!( + debug_assert!( index < self.len(), "index out of bounds: index is {}; length is {}", index, @@ -64,7 +84,7 @@ impl PackedArray { ); let mask = self.mask(); - assert!(value <= mask); + debug_assert!(value <= mask); let (u64_index, bit_index) = self.indexes(index); @@ -81,7 +101,7 @@ impl PackedArray { assert!(value <= self.max_value()); let mut x = 0; for i in 0..self.values_per_u64() { - x |= value << (i * self.bits_per_value); + x |= value << (i * self.bits_per_value.get()); } self.bits.fill(x); @@ -90,7 +110,7 @@ impl PackedArray { /// Returns an iterator over values in this array. pub fn iter(&self) -> impl Iterator + '_ { let values_per_u64 = self.values_per_u64(); - let bits_per_value = self.bits_per_value() as u64; + let bits_per_value = self.bits_per_value().get() as u64; let mask = self.mask(); let length = self.len(); @@ -103,13 +123,14 @@ impl PackedArray { } /// Resizes this packed array to a new bits per value. - pub fn resized(&mut self, new_bits_per_value: usize) -> PackedArray { + #[must_use = "method returns a new array and does not mutate the original value"] + pub fn resized(&self, new_bits_per_value: NonZeroUsize) -> PackedArray { Self::from_iter(self.iter(), new_bits_per_value) } /// Collects an iterator into a `PackedArray`. - pub fn from_iter(iter: impl IntoIterator, bits_per_value: usize) -> Self { - assert!(bits_per_value <= 64); + pub fn from_iter(iter: impl IntoIterator, bits_per_value: NonZeroUsize) -> Self { + assert!(bits_per_value.get() <= 64); let iter = iter.into_iter(); let mut bits = Vec::with_capacity(iter.size_hint().0); @@ -118,11 +139,11 @@ impl PackedArray { let mut length = 0; for value in iter { - debug_assert!(value < 1 << bits_per_value); + debug_assert!(value < 1 << bits_per_value.get()); current_u64 |= value << current_offset; - current_offset += bits_per_value; - if current_offset > 64 - bits_per_value { + current_offset += bits_per_value.get(); + if current_offset > 64 - bits_per_value.get() { bits.push(current_u64); current_offset = 0; current_u64 = 0; @@ -162,11 +183,12 @@ impl PackedArray { /// Returns the number of bits used to represent each value. #[inline] - pub fn bits_per_value(&self) -> usize { + pub fn bits_per_value(&self) -> NonZeroUsize { self.bits_per_value } - pub fn set_bits_per_value(&mut self, new_value: usize) { + /// Sets the number of bits used to represent each value. + pub fn set_bits_per_value(&mut self, new_value: NonZeroUsize) { self.bits_per_value = new_value; } @@ -175,12 +197,13 @@ impl PackedArray { &self.bits } + /// Gets the raw mutable `u64` data. pub fn as_u64_mut_vec(&mut self) -> &mut Vec { &mut self.bits } fn mask(&self) -> u64 { - (1 << self.bits_per_value) - 1 + (1 << self.bits_per_value.get()) - 1 } fn needed_u64s(&self) -> usize { @@ -188,29 +211,28 @@ impl PackedArray { } fn values_per_u64(&self) -> usize { - 64 / self.bits_per_value + 64 / self.bits_per_value.get() } fn indexes(&self, index: usize) -> (usize, usize) { - let u64_index = index / self.values_per_u64(); - let bit_index = (index % self.values_per_u64()) * self.bits_per_value; - - (u64_index, bit_index) + let vales_per_u64 = self.values_per_u64(); + let u64_index = index / vales_per_u64; + let index = index % vales_per_u64; + (u64_index, index * self.bits_per_value.get()) } } #[cfg(test)] mod tests { use super::*; - use rand::{Rng, SeedableRng}; - use rand_pcg::Pcg64Mcg; + use std::convert::TryInto; #[test] fn smoke() { let length = 100; - let mut array = PackedArray::new(length, 10); + let mut array = PackedArray::new(length, 10.try_into().unwrap()); assert_eq!(array.len(), length); - assert_eq!(array.bits_per_value(), 10); + assert_eq!(array.bits_per_value().get(), 10); assert_eq!(array.bits.len(), 17); for i in 0..length { @@ -222,7 +244,7 @@ mod tests { #[test] fn out_of_bounds() { - let array = PackedArray::new(97, 10); + let array = PackedArray::new(97, 10.try_into().unwrap()); assert_eq!(array.bits.len(), 17); assert_eq!(array.get(96), Some(0)); assert_eq!(array.get(97), None); @@ -230,12 +252,11 @@ mod tests { #[test] fn iter() { - let mut array = PackedArray::new(10_000, 10); - let mut rng = Pcg64Mcg::seed_from_u64(10); + let mut array = PackedArray::new(10_000, 10.try_into().unwrap()); let mut oracle = Vec::new(); for i in 0..array.len() { - let value = rng.gen_range(0..1024); + let value = i as u64; oracle.push(value); array.set(i, value); assert_eq!(array.get(i), Some(value)); @@ -252,15 +273,13 @@ mod tests { #[test] fn resize() { - let mut rng = Pcg64Mcg::seed_from_u64(11); - let length = 1024; - let mut array = PackedArray::new(length, 1); + let mut array = PackedArray::new(length, 1.try_into().unwrap()); let mut oracle = Vec::new(); for new_bits_per_value in 2..=16 { for i in 0..array.len() { - let value = rng.gen_range(0..array.max_value() + 1); + let value = i as u64; array.set(i, value); oracle.push(value); } @@ -269,7 +288,7 @@ mod tests { assert_eq!(array.get(i), Some(oracle_value)); } - array = array.resized(new_bits_per_value); + array = array.resized(new_bits_per_value.try_into().unwrap()); for (i, &oracle_value) in oracle.iter().enumerate() { assert_eq!(array.get(i), Some(oracle_value)); @@ -281,7 +300,7 @@ mod tests { #[test] fn fill() { - let mut array = PackedArray::new(1024, 10); + let mut array = PackedArray::new(1024, 10.try_into().unwrap()); array.fill(102); assert!(array.iter().all(|x| x == 102)); @@ -292,7 +311,7 @@ mod tests { #[test] #[should_panic] fn fill_too_large() { - let mut array = PackedArray::new(100, 10); + let mut array = PackedArray::new(100, 10.try_into().unwrap()); array.fill(1024); // 1024 == 2^10 } } diff --git a/libcraft/chunk/src/paletted_container.rs b/libcraft/chunk/src/paletted_container.rs new file mode 100644 index 000000000..ca42d0171 --- /dev/null +++ b/libcraft/chunk/src/paletted_container.rs @@ -0,0 +1,351 @@ +use std::convert::TryInto; +use std::fmt::Debug; +use std::num::NonZeroUsize; +use std::sync::atomic::{AtomicUsize, Ordering}; + +use libcraft_blocks::{BlockState, HIGHEST_ID}; + +use crate::biome::BiomeId; +use crate::{ChunkSection, PackedArray, BIOMES_PER_CHUNK_SECTION, SECTION_VOLUME}; + +/// Stores blocks or biomes of a chunk section. +/// N = 4 for blocks, 2 for biomes +#[derive(Debug, Clone, PartialEq)] +pub enum PalettedContainer +where + T: Paletteable, +{ + SingleValue(T), + MultipleValues { data: PackedArray, palette: Vec }, + GlobalPalette { data: PackedArray }, +} + +impl PalettedContainer +where + T: Paletteable, +{ + /// Creates a new empty `BlockStore`. + pub fn new() -> Self { + Self::SingleValue(T::default()) + } + + /// Gets the palette. None if using global or single-value palette + pub fn palette(&self) -> Option<&Vec> { + match self { + PalettedContainer::MultipleValues { palette, .. } => Some(palette), + _ => None, + } + } + + /// Gets a mutable reference to the palette. None if using global or single-value palette + pub fn palette_mut(&mut self) -> Option<&mut Vec> { + match self { + PalettedContainer::MultipleValues { palette, .. } => Some(palette), + _ => None, + } + } + + /// Gets the inner representation of this container's data. + /// None if using single-value palette + pub fn data(&self) -> Option<&PackedArray> { + match self { + PalettedContainer::MultipleValues { data, .. } + | PalettedContainer::GlobalPalette { data } => Some(data), + _ => None, + } + } + + /// Gets a mutable reference to the inner representation of this container's data. + /// None if using single-value palette + pub fn data_mut(&mut self) -> Option<&mut PackedArray> { + match self { + PalettedContainer::MultipleValues { data, .. } + | PalettedContainer::GlobalPalette { data } => Some(data), + _ => None, + } + } + + /// Sets the inner representation of this container's data. + /// Returns false if the container is single-value, true otherwise + pub fn set_data(&mut self, new_data: PackedArray) -> bool { + match self { + PalettedContainer::MultipleValues { data, .. } + | PalettedContainer::GlobalPalette { data } => { + *data = new_data; + true + } + _ => false, + } + } + + /// Gets the entry at this index + pub fn get(&self, index: usize) -> Option { + match self { + PalettedContainer::SingleValue(item) => Some(*item), + PalettedContainer::MultipleValues { data, palette } => { + let palette_index = data.get(index)?; + Some( + palette + .get(palette_index as usize) + .copied() + .unwrap_or_else(|| { + panic!( + "palette does not contain entry {} (see: {:?})", + palette_index, palette + ) + }), + ) + } + PalettedContainer::GlobalPalette { data } => { + let palette_index = data.get(index)? as u32; + T::from_default_palette(palette_index) + } + } + } + + /// Sets the entry at this index + pub fn set(&mut self, index: usize, item: T) { + let palette_index = self.index_or_insert(item); + match self { + PalettedContainer::SingleValue(value) if *value == item => {} + PalettedContainer::SingleValue(_) => unreachable!(), + PalettedContainer::MultipleValues { data, .. } => data.set(index, palette_index as u64), + PalettedContainer::GlobalPalette { data } => { + data.set(index, item.default_palette_index() as u64) + } + } + } + + /// Inserts a value into this container's palette. + pub fn index_or_insert(&mut self, item: T) -> u32 { + if let Some(index) = self.get_palette_index(item) { + index + } else { + self.resize_if_needed(); + match self { + PalettedContainer::SingleValue(_) => unreachable!(), + PalettedContainer::MultipleValues { palette, .. } => { + assert!(!palette.contains(&item)); + palette.push(item); + palette.len() as u32 - 1 + } + PalettedContainer::GlobalPalette { .. } => item.default_palette_index(), + } + } + } + + /// Fills this storage with the item + pub fn fill(&mut self, item: T) { + *self = PalettedContainer::SingleValue(item) + } + + /// How many values does this container store + #[allow(clippy::len_without_is_empty)] + pub fn len(&self) -> usize { + T::ENTRIES_PER_CHUNK_SECTION + } + + pub fn global_palette_bits_per_value() -> NonZeroUsize { + Self::palette_bits_per_value(T::length()) + } + + pub fn palette_bits_per_value(palette_len: usize) -> NonZeroUsize { + ((palette_len as f64).log2().ceil() as usize) + .max(T::MIN_BITS_PER_ENTRY.get()) + .try_into() + .unwrap() + } + + fn get_palette_index(&mut self, item: T) -> Option { + match self { + PalettedContainer::SingleValue(value) if *value == item => Some(0), + PalettedContainer::SingleValue(_) => None, + PalettedContainer::MultipleValues { palette, .. } => palette + .iter() + .position(|value| *value == item) + .map(|i| i as u32), + PalettedContainer::GlobalPalette { .. } => Some(item.default_palette_index()), + } + } + + fn resize_if_needed(&mut self) { + let len = self.len(); + match self { + PalettedContainer::SingleValue(value) => { + *self = PalettedContainer::MultipleValues { + data: PackedArray::new(len, T::MIN_BITS_PER_ENTRY), + palette: vec![*value], + } + } + PalettedContainer::MultipleValues { data, palette } => { + if palette.len() >= data.max_value() as usize { + // Resize to either the global palette or a new section palette size. + let new_size = (data.bits_per_value().get() + 1).try_into().unwrap(); + if new_size <= T::MAX_BITS_PER_ENTRY { + *data = data.resized(new_size); + } else { + *self = Self::GlobalPalette { + data: { + let mut data = data.resized(Self::global_palette_bits_per_value()); + // Update items to use global IDs instead of palette indices + Self::map_to_global_palette(len, palette, &mut data); + data + }, + } + } + } + } + PalettedContainer::GlobalPalette { .. } => {} + } + } + + pub fn map_to_global_palette(len: usize, palette: &[T], data: &mut PackedArray) { + for i in 0..len { + let palette_index = data.get(i).unwrap() as usize; + let item = palette.get(palette_index).copied().unwrap(); + data.set(i, item.default_palette_index() as u64); + } + } + + pub fn map_from_global_palette(len: usize, palette: &[T], data: &mut PackedArray) { + for i in 0..len { + let palette_index = data.get(i).unwrap(); + let item = T::from_default_palette(palette_index as u32).unwrap(); + data.set(i, palette.iter().position(|it| *it == item).unwrap() as u64); + } + } +} + +impl PalettedContainer { + /// Gets the block at this position + pub fn get_block_at(&self, x: usize, y: usize, z: usize) -> Option { + let index = ChunkSection::block_index(x, y, z)?; + + self.get(index) + } + + /// Sets the block at this position + pub fn set_block_at(&mut self, x: usize, y: usize, z: usize, block: BlockState) -> Option<()> { + let index = ChunkSection::block_index(x, y, z)?; + self.set(index, block); + Some(()) + } +} + +impl PalettedContainer { + /// Gets the biome at this position + pub fn biome_at(&self, x: usize, y: usize, z: usize) -> Option { + let index = ChunkSection::biome_index(x, y, z)?; + self.get(index) + } + + /// Sets the biome at this position + pub fn set_biome_at(&mut self, x: usize, y: usize, z: usize, biome: BiomeId) -> Option<()> { + let index = ChunkSection::biome_index(x, y, z)?; + self.set(index, biome); + Some(()) + } +} + +impl Default for PalettedContainer +where + T: Paletteable, +{ + fn default() -> Self { + Self::new() + } +} + +pub trait Paletteable: Default + Copy + PartialEq + Debug { + const MIN_BITS_PER_ENTRY: NonZeroUsize; + // FIXME replace with .unwrap() when it's const stable + // SAFETY: non-zero * 2 = non-zero + const MAX_BITS_PER_ENTRY: NonZeroUsize = + unsafe { NonZeroUsize::new_unchecked(Self::MIN_BITS_PER_ENTRY.get() * 2) }; + const ENTRIES_PER_CHUNK_SECTION: usize; + + fn from_default_palette(index: u32) -> Option; + fn default_palette_index(&self) -> u32; + fn length() -> usize; +} + +impl Paletteable for BlockState { + // SAFETY: 4 is non-zero + const MIN_BITS_PER_ENTRY: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(4) }; + const ENTRIES_PER_CHUNK_SECTION: usize = SECTION_VOLUME; + + fn from_default_palette(index: u32) -> Option { + Self::from_id(index as u16) + } + + fn default_palette_index(&self) -> u32 { + self.id() as u32 + } + + fn length() -> usize { + HIGHEST_ID.into() + } +} + +pub static BIOMES_COUNT: AtomicUsize = AtomicUsize::new(0); + +impl Paletteable for BiomeId { + // SAFETY: 2 is non-zero + const MIN_BITS_PER_ENTRY: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(2) }; + const ENTRIES_PER_CHUNK_SECTION: usize = BIOMES_PER_CHUNK_SECTION; + + fn from_default_palette(index: u32) -> Option { + Some(Self::from(index as usize)) + } + + fn default_palette_index(&self) -> u32 { + **self as u32 + } + + fn length() -> usize { + BIOMES_COUNT.load(Ordering::Relaxed) + } +} + +/* +#[cfg(test)] +mod tests { + use libcraft_blocks::BlockState; + + use crate::chunk::paletted_container::PalettedContainer; + + #[test] + fn test() { + let mut container = PalettedContainer::::new(); + assert_eq!(container, PalettedContainer::default()); + container + .set_block_at(10, 10, 5, BlockState::stone()) + .unwrap(); + assert_eq!( + container.palette().unwrap(), + &vec![BlockState::default(), BlockState::stone()] + ); + assert_eq!( + container.get_block_at(10, 10, 5).unwrap(), + BlockState::stone() + ); + for id in 0..256 { + container + .set_block_at( + id / 16, + 0, + id % 16, + BlockState::from_vanilla_id(id as u16).unwrap(), + ) + .unwrap(); + } + assert!(matches!(container, PalettedContainer::GlobalPalette { .. })); + for id in 0..256 { + assert_eq!( + container.get_block_at(id / 16, 0, id % 16).unwrap(), + BlockState::from_vanilla_id(id as u16).unwrap() + ); + } + } +} +*/ diff --git a/libcraft/core/Cargo.toml b/libcraft/core/Cargo.toml index e4897a0b8..6b471e5db 100644 --- a/libcraft/core/Cargo.toml +++ b/libcraft/core/Cargo.toml @@ -2,13 +2,16 @@ name = "libcraft-core" version = "0.1.0" authors = ["caelunshun "] -edition = "2018" +edition = "2021" [dependencies] +bincode = "2.0.0-rc.1" bytemuck = { version = "1", features = ["derive"] } +derive_more = "0.99" num-derive = "0.3" num-traits = "0.2" serde = { version = "1", features = ["derive"] } -strum = "0.21" -strum_macros = "0.21" -vek = "0.14" \ No newline at end of file +strum = "0.24" +strum_macros = "0.24" +thiserror = "1" +vek = "0.15" diff --git a/libcraft/core/src/biome.rs b/libcraft/core/src/biome.rs deleted file mode 100644 index 2b81c3bc5..000000000 --- a/libcraft/core/src/biome.rs +++ /dev/null @@ -1,783 +0,0 @@ -// This file is @generated. Please do not edit. - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum Biome { - Ocean, - Plains, - Desert, - Mountains, - Forest, - Taiga, - Swamp, - River, - NetherWastes, - TheEnd, - FrozenOcean, - FrozenRiver, - SnowyTundra, - SnowyMountains, - MushroomFields, - MushroomFieldShore, - Beach, - DesertHills, - WoodedHills, - TaigaHills, - MountainEdge, - Jungle, - JungleHills, - JungleEdge, - DeepOcean, - StoneShore, - SnowyBeach, - BirchForest, - BirchForestHills, - DarkForest, - SnowyTaiga, - SnowyTaigaHills, - GiantTreeTaiga, - GiantTreeTaigaHills, - WoodedMountains, - Savanna, - SavannaPlateau, - Badlands, - WoodedBadlandsPlateau, - BadlandsPlateau, - SmallEndIslands, - EndMidlands, - EndHighlands, - EndBarrens, - WarmOcean, - LukewarmOcean, - ColdOcean, - DeepWarmOcean, - DeepLukewarmOcean, - DeepColdOcean, - DeepFrozenOcean, - TheVoid, - SunflowerPlains, - DesertLakes, - GravellyMountains, - FlowerForest, - TaigaMountains, - SwampHills, - IceSpikes, - ModifiedJungle, - ModifiedJungleEdge, - TallBirchForest, - TallBirchHills, - DarkForestHills, - SnowyTaigaMountains, - GiantSpruceTaiga, - GiantSpruceTaigaHills, - ModifiedGravellyMountains, - ShatteredSavanna, - ShatteredSavannaPlateau, - ErodedBadlands, - ModifiedWoodedBadlandsPlateau, - ModifiedBadlandsPlateau, - BambooJungle, - BambooJungleHills, - SoulSandValley, - CrimsonForest, - WarpedForest, - BasaltDeltas, -} - -#[allow(warnings)] -#[allow(clippy::all)] -impl Biome { - /// Returns the `id` property of this `Biome`. - pub fn id(&self) -> u32 { - match self { - Biome::Ocean => 0, - Biome::Plains => 1, - Biome::Desert => 2, - Biome::Mountains => 3, - Biome::Forest => 4, - Biome::Taiga => 5, - Biome::Swamp => 6, - Biome::River => 7, - Biome::NetherWastes => 8, - Biome::TheEnd => 9, - Biome::FrozenOcean => 10, - Biome::FrozenRiver => 11, - Biome::SnowyTundra => 12, - Biome::SnowyMountains => 13, - Biome::MushroomFields => 14, - Biome::MushroomFieldShore => 15, - Biome::Beach => 16, - Biome::DesertHills => 17, - Biome::WoodedHills => 18, - Biome::TaigaHills => 19, - Biome::MountainEdge => 20, - Biome::Jungle => 21, - Biome::JungleHills => 22, - Biome::JungleEdge => 23, - Biome::DeepOcean => 24, - Biome::StoneShore => 25, - Biome::SnowyBeach => 26, - Biome::BirchForest => 27, - Biome::BirchForestHills => 28, - Biome::DarkForest => 29, - Biome::SnowyTaiga => 30, - Biome::SnowyTaigaHills => 31, - Biome::GiantTreeTaiga => 32, - Biome::GiantTreeTaigaHills => 33, - Biome::WoodedMountains => 34, - Biome::Savanna => 35, - Biome::SavannaPlateau => 36, - Biome::Badlands => 37, - Biome::WoodedBadlandsPlateau => 38, - Biome::BadlandsPlateau => 39, - Biome::SmallEndIslands => 40, - Biome::EndMidlands => 41, - Biome::EndHighlands => 42, - Biome::EndBarrens => 43, - Biome::WarmOcean => 44, - Biome::LukewarmOcean => 45, - Biome::ColdOcean => 46, - Biome::DeepWarmOcean => 47, - Biome::DeepLukewarmOcean => 48, - Biome::DeepColdOcean => 49, - Biome::DeepFrozenOcean => 50, - Biome::TheVoid => 127, - Biome::SunflowerPlains => 129, - Biome::DesertLakes => 130, - Biome::GravellyMountains => 131, - Biome::FlowerForest => 132, - Biome::TaigaMountains => 133, - Biome::SwampHills => 134, - Biome::IceSpikes => 140, - Biome::ModifiedJungle => 149, - Biome::ModifiedJungleEdge => 151, - Biome::TallBirchForest => 155, - Biome::TallBirchHills => 156, - Biome::DarkForestHills => 157, - Biome::SnowyTaigaMountains => 158, - Biome::GiantSpruceTaiga => 160, - Biome::GiantSpruceTaigaHills => 161, - Biome::ModifiedGravellyMountains => 162, - Biome::ShatteredSavanna => 163, - Biome::ShatteredSavannaPlateau => 164, - Biome::ErodedBadlands => 165, - Biome::ModifiedWoodedBadlandsPlateau => 166, - Biome::ModifiedBadlandsPlateau => 167, - Biome::BambooJungle => 168, - Biome::BambooJungleHills => 169, - Biome::SoulSandValley => 170, - Biome::CrimsonForest => 171, - Biome::WarpedForest => 172, - Biome::BasaltDeltas => 173, - } - } - - /// Gets a `Biome` by its `id`. - pub fn from_id(id: u32) -> Option { - match id { - 0 => Some(Biome::Ocean), - 1 => Some(Biome::Plains), - 2 => Some(Biome::Desert), - 3 => Some(Biome::Mountains), - 4 => Some(Biome::Forest), - 5 => Some(Biome::Taiga), - 6 => Some(Biome::Swamp), - 7 => Some(Biome::River), - 8 => Some(Biome::NetherWastes), - 9 => Some(Biome::TheEnd), - 10 => Some(Biome::FrozenOcean), - 11 => Some(Biome::FrozenRiver), - 12 => Some(Biome::SnowyTundra), - 13 => Some(Biome::SnowyMountains), - 14 => Some(Biome::MushroomFields), - 15 => Some(Biome::MushroomFieldShore), - 16 => Some(Biome::Beach), - 17 => Some(Biome::DesertHills), - 18 => Some(Biome::WoodedHills), - 19 => Some(Biome::TaigaHills), - 20 => Some(Biome::MountainEdge), - 21 => Some(Biome::Jungle), - 22 => Some(Biome::JungleHills), - 23 => Some(Biome::JungleEdge), - 24 => Some(Biome::DeepOcean), - 25 => Some(Biome::StoneShore), - 26 => Some(Biome::SnowyBeach), - 27 => Some(Biome::BirchForest), - 28 => Some(Biome::BirchForestHills), - 29 => Some(Biome::DarkForest), - 30 => Some(Biome::SnowyTaiga), - 31 => Some(Biome::SnowyTaigaHills), - 32 => Some(Biome::GiantTreeTaiga), - 33 => Some(Biome::GiantTreeTaigaHills), - 34 => Some(Biome::WoodedMountains), - 35 => Some(Biome::Savanna), - 36 => Some(Biome::SavannaPlateau), - 37 => Some(Biome::Badlands), - 38 => Some(Biome::WoodedBadlandsPlateau), - 39 => Some(Biome::BadlandsPlateau), - 40 => Some(Biome::SmallEndIslands), - 41 => Some(Biome::EndMidlands), - 42 => Some(Biome::EndHighlands), - 43 => Some(Biome::EndBarrens), - 44 => Some(Biome::WarmOcean), - 45 => Some(Biome::LukewarmOcean), - 46 => Some(Biome::ColdOcean), - 47 => Some(Biome::DeepWarmOcean), - 48 => Some(Biome::DeepLukewarmOcean), - 49 => Some(Biome::DeepColdOcean), - 50 => Some(Biome::DeepFrozenOcean), - 127 => Some(Biome::TheVoid), - 129 => Some(Biome::SunflowerPlains), - 130 => Some(Biome::DesertLakes), - 131 => Some(Biome::GravellyMountains), - 132 => Some(Biome::FlowerForest), - 133 => Some(Biome::TaigaMountains), - 134 => Some(Biome::SwampHills), - 140 => Some(Biome::IceSpikes), - 149 => Some(Biome::ModifiedJungle), - 151 => Some(Biome::ModifiedJungleEdge), - 155 => Some(Biome::TallBirchForest), - 156 => Some(Biome::TallBirchHills), - 157 => Some(Biome::DarkForestHills), - 158 => Some(Biome::SnowyTaigaMountains), - 160 => Some(Biome::GiantSpruceTaiga), - 161 => Some(Biome::GiantSpruceTaigaHills), - 162 => Some(Biome::ModifiedGravellyMountains), - 163 => Some(Biome::ShatteredSavanna), - 164 => Some(Biome::ShatteredSavannaPlateau), - 165 => Some(Biome::ErodedBadlands), - 166 => Some(Biome::ModifiedWoodedBadlandsPlateau), - 167 => Some(Biome::ModifiedBadlandsPlateau), - 168 => Some(Biome::BambooJungle), - 169 => Some(Biome::BambooJungleHills), - 170 => Some(Biome::SoulSandValley), - 171 => Some(Biome::CrimsonForest), - 172 => Some(Biome::WarpedForest), - 173 => Some(Biome::BasaltDeltas), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Biome { - /// Returns the `name` property of this `Biome`. - pub fn name(&self) -> &'static str { - match self { - Biome::Ocean => "ocean", - Biome::Plains => "plains", - Biome::Desert => "desert", - Biome::Mountains => "mountains", - Biome::Forest => "forest", - Biome::Taiga => "taiga", - Biome::Swamp => "swamp", - Biome::River => "river", - Biome::NetherWastes => "nether_wastes", - Biome::TheEnd => "the_end", - Biome::FrozenOcean => "frozen_ocean", - Biome::FrozenRiver => "frozen_river", - Biome::SnowyTundra => "snowy_tundra", - Biome::SnowyMountains => "snowy_mountains", - Biome::MushroomFields => "mushroom_fields", - Biome::MushroomFieldShore => "mushroom_field_shore", - Biome::Beach => "beach", - Biome::DesertHills => "desert_hills", - Biome::WoodedHills => "wooded_hills", - Biome::TaigaHills => "taiga_hills", - Biome::MountainEdge => "mountain_edge", - Biome::Jungle => "jungle", - Biome::JungleHills => "jungle_hills", - Biome::JungleEdge => "jungle_edge", - Biome::DeepOcean => "deep_ocean", - Biome::StoneShore => "stone_shore", - Biome::SnowyBeach => "snowy_beach", - Biome::BirchForest => "birch_forest", - Biome::BirchForestHills => "birch_forest_hills", - Biome::DarkForest => "dark_forest", - Biome::SnowyTaiga => "snowy_taiga", - Biome::SnowyTaigaHills => "snowy_taiga_hills", - Biome::GiantTreeTaiga => "giant_tree_taiga", - Biome::GiantTreeTaigaHills => "giant_tree_taiga_hills", - Biome::WoodedMountains => "wooded_mountains", - Biome::Savanna => "savanna", - Biome::SavannaPlateau => "savanna_plateau", - Biome::Badlands => "badlands", - Biome::WoodedBadlandsPlateau => "wooded_badlands_plateau", - Biome::BadlandsPlateau => "badlands_plateau", - Biome::SmallEndIslands => "small_end_islands", - Biome::EndMidlands => "end_midlands", - Biome::EndHighlands => "end_highlands", - Biome::EndBarrens => "end_barrens", - Biome::WarmOcean => "warm_ocean", - Biome::LukewarmOcean => "lukewarm_ocean", - Biome::ColdOcean => "cold_ocean", - Biome::DeepWarmOcean => "deep_warm_ocean", - Biome::DeepLukewarmOcean => "deep_lukewarm_ocean", - Biome::DeepColdOcean => "deep_cold_ocean", - Biome::DeepFrozenOcean => "deep_frozen_ocean", - Biome::TheVoid => "the_void", - Biome::SunflowerPlains => "sunflower_plains", - Biome::DesertLakes => "desert_lakes", - Biome::GravellyMountains => "gravelly_mountains", - Biome::FlowerForest => "flower_forest", - Biome::TaigaMountains => "taiga_mountains", - Biome::SwampHills => "swamp_hills", - Biome::IceSpikes => "ice_spikes", - Biome::ModifiedJungle => "modified_jungle", - Biome::ModifiedJungleEdge => "modified_jungle_edge", - Biome::TallBirchForest => "tall_birch_forest", - Biome::TallBirchHills => "tall_birch_hills", - Biome::DarkForestHills => "dark_forest_hills", - Biome::SnowyTaigaMountains => "snowy_taiga_mountains", - Biome::GiantSpruceTaiga => "giant_spruce_taiga", - Biome::GiantSpruceTaigaHills => "giant_spruce_taiga_hills", - Biome::ModifiedGravellyMountains => "modified_gravelly_mountains", - Biome::ShatteredSavanna => "shattered_savanna", - Biome::ShatteredSavannaPlateau => "shattered_savanna_plateau", - Biome::ErodedBadlands => "eroded_badlands", - Biome::ModifiedWoodedBadlandsPlateau => "modified_wooded_badlands_plateau", - Biome::ModifiedBadlandsPlateau => "modified_badlands_plateau", - Biome::BambooJungle => "bamboo_jungle", - Biome::BambooJungleHills => "bamboo_jungle_hills", - Biome::SoulSandValley => "soul_sand_valley", - Biome::CrimsonForest => "crimson_forest", - Biome::WarpedForest => "warped_forest", - Biome::BasaltDeltas => "basalt_deltas", - } - } - - /// Gets a `Biome` by its `name`. - pub fn from_name(name: &str) -> Option { - match name { - "ocean" => Some(Biome::Ocean), - "plains" => Some(Biome::Plains), - "desert" => Some(Biome::Desert), - "mountains" => Some(Biome::Mountains), - "forest" => Some(Biome::Forest), - "taiga" => Some(Biome::Taiga), - "swamp" => Some(Biome::Swamp), - "river" => Some(Biome::River), - "nether_wastes" => Some(Biome::NetherWastes), - "the_end" => Some(Biome::TheEnd), - "frozen_ocean" => Some(Biome::FrozenOcean), - "frozen_river" => Some(Biome::FrozenRiver), - "snowy_tundra" => Some(Biome::SnowyTundra), - "snowy_mountains" => Some(Biome::SnowyMountains), - "mushroom_fields" => Some(Biome::MushroomFields), - "mushroom_field_shore" => Some(Biome::MushroomFieldShore), - "beach" => Some(Biome::Beach), - "desert_hills" => Some(Biome::DesertHills), - "wooded_hills" => Some(Biome::WoodedHills), - "taiga_hills" => Some(Biome::TaigaHills), - "mountain_edge" => Some(Biome::MountainEdge), - "jungle" => Some(Biome::Jungle), - "jungle_hills" => Some(Biome::JungleHills), - "jungle_edge" => Some(Biome::JungleEdge), - "deep_ocean" => Some(Biome::DeepOcean), - "stone_shore" => Some(Biome::StoneShore), - "snowy_beach" => Some(Biome::SnowyBeach), - "birch_forest" => Some(Biome::BirchForest), - "birch_forest_hills" => Some(Biome::BirchForestHills), - "dark_forest" => Some(Biome::DarkForest), - "snowy_taiga" => Some(Biome::SnowyTaiga), - "snowy_taiga_hills" => Some(Biome::SnowyTaigaHills), - "giant_tree_taiga" => Some(Biome::GiantTreeTaiga), - "giant_tree_taiga_hills" => Some(Biome::GiantTreeTaigaHills), - "wooded_mountains" => Some(Biome::WoodedMountains), - "savanna" => Some(Biome::Savanna), - "savanna_plateau" => Some(Biome::SavannaPlateau), - "badlands" => Some(Biome::Badlands), - "wooded_badlands_plateau" => Some(Biome::WoodedBadlandsPlateau), - "badlands_plateau" => Some(Biome::BadlandsPlateau), - "small_end_islands" => Some(Biome::SmallEndIslands), - "end_midlands" => Some(Biome::EndMidlands), - "end_highlands" => Some(Biome::EndHighlands), - "end_barrens" => Some(Biome::EndBarrens), - "warm_ocean" => Some(Biome::WarmOcean), - "lukewarm_ocean" => Some(Biome::LukewarmOcean), - "cold_ocean" => Some(Biome::ColdOcean), - "deep_warm_ocean" => Some(Biome::DeepWarmOcean), - "deep_lukewarm_ocean" => Some(Biome::DeepLukewarmOcean), - "deep_cold_ocean" => Some(Biome::DeepColdOcean), - "deep_frozen_ocean" => Some(Biome::DeepFrozenOcean), - "the_void" => Some(Biome::TheVoid), - "sunflower_plains" => Some(Biome::SunflowerPlains), - "desert_lakes" => Some(Biome::DesertLakes), - "gravelly_mountains" => Some(Biome::GravellyMountains), - "flower_forest" => Some(Biome::FlowerForest), - "taiga_mountains" => Some(Biome::TaigaMountains), - "swamp_hills" => Some(Biome::SwampHills), - "ice_spikes" => Some(Biome::IceSpikes), - "modified_jungle" => Some(Biome::ModifiedJungle), - "modified_jungle_edge" => Some(Biome::ModifiedJungleEdge), - "tall_birch_forest" => Some(Biome::TallBirchForest), - "tall_birch_hills" => Some(Biome::TallBirchHills), - "dark_forest_hills" => Some(Biome::DarkForestHills), - "snowy_taiga_mountains" => Some(Biome::SnowyTaigaMountains), - "giant_spruce_taiga" => Some(Biome::GiantSpruceTaiga), - "giant_spruce_taiga_hills" => Some(Biome::GiantSpruceTaigaHills), - "modified_gravelly_mountains" => Some(Biome::ModifiedGravellyMountains), - "shattered_savanna" => Some(Biome::ShatteredSavanna), - "shattered_savanna_plateau" => Some(Biome::ShatteredSavannaPlateau), - "eroded_badlands" => Some(Biome::ErodedBadlands), - "modified_wooded_badlands_plateau" => Some(Biome::ModifiedWoodedBadlandsPlateau), - "modified_badlands_plateau" => Some(Biome::ModifiedBadlandsPlateau), - "bamboo_jungle" => Some(Biome::BambooJungle), - "bamboo_jungle_hills" => Some(Biome::BambooJungleHills), - "soul_sand_valley" => Some(Biome::SoulSandValley), - "crimson_forest" => Some(Biome::CrimsonForest), - "warped_forest" => Some(Biome::WarpedForest), - "basalt_deltas" => Some(Biome::BasaltDeltas), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Biome { - /// Returns the `display_name` property of this `Biome`. - pub fn display_name(&self) -> &'static str { - match self { - Biome::Ocean => "Ocean", - Biome::Plains => "Plains", - Biome::Desert => "Desert", - Biome::Mountains => "Mountains", - Biome::Forest => "Forest", - Biome::Taiga => "Taiga", - Biome::Swamp => "Swamp", - Biome::River => "River", - Biome::NetherWastes => "Nether Wastes", - Biome::TheEnd => "The End", - Biome::FrozenOcean => "Frozen Ocean", - Biome::FrozenRiver => "Frozen River", - Biome::SnowyTundra => "Snowy Tundra", - Biome::SnowyMountains => "Snowy Mountains", - Biome::MushroomFields => "Mushroom Fields", - Biome::MushroomFieldShore => "Mushroom Fields Shore", - Biome::Beach => "Beach", - Biome::DesertHills => "Desert Hills", - Biome::WoodedHills => "Wooded Hills", - Biome::TaigaHills => "Taiga Hills", - Biome::MountainEdge => "Mountain Edge", - Biome::Jungle => "Jungle", - Biome::JungleHills => "Jungle Hills", - Biome::JungleEdge => "Jungle Edge", - Biome::DeepOcean => "Deep Ocean", - Biome::StoneShore => "Stone Shore", - Biome::SnowyBeach => "Snowy Beach", - Biome::BirchForest => "Birch Forest", - Biome::BirchForestHills => "Birch Forest Hills", - Biome::DarkForest => "Dark Forest", - Biome::SnowyTaiga => "Snowy Taiga", - Biome::SnowyTaigaHills => "Snowy Taiga Hills", - Biome::GiantTreeTaiga => "Giant Tree Taiga", - Biome::GiantTreeTaigaHills => "Giant Tree Taiga Hills", - Biome::WoodedMountains => "Wooded Mountains", - Biome::Savanna => "Savanna", - Biome::SavannaPlateau => "Savanna Plateau", - Biome::Badlands => "Badlands", - Biome::WoodedBadlandsPlateau => "Wooded Badlands Plateau", - Biome::BadlandsPlateau => "Badlands Plateau", - Biome::SmallEndIslands => "Small End Islands", - Biome::EndMidlands => "End Midlands", - Biome::EndHighlands => "End Highlands", - Biome::EndBarrens => "End Barrens", - Biome::WarmOcean => "Warm Ocean", - Biome::LukewarmOcean => "Lukewarm Ocean", - Biome::ColdOcean => "Cold Ocean", - Biome::DeepWarmOcean => "Deep Warm Ocean", - Biome::DeepLukewarmOcean => "Deep Lukewarm Ocean", - Biome::DeepColdOcean => "Deep Cold Ocean", - Biome::DeepFrozenOcean => "Deep Frozen Ocean", - Biome::TheVoid => "the_void", - Biome::SunflowerPlains => "Sunflower Plains", - Biome::DesertLakes => "Desert Lakes", - Biome::GravellyMountains => "Gravelly Mountains", - Biome::FlowerForest => "Flower Forest", - Biome::TaigaMountains => "Taiga Mountains", - Biome::SwampHills => "Swamp Hills", - Biome::IceSpikes => "Ice Spikes", - Biome::ModifiedJungle => "Modified Jungle", - Biome::ModifiedJungleEdge => "Modified Jungle Edge", - Biome::TallBirchForest => "Tall Birch Forest", - Biome::TallBirchHills => "Tall Birch Hills", - Biome::DarkForestHills => "Dark Forest Hills", - Biome::SnowyTaigaMountains => "Snowy Taiga Mountains", - Biome::GiantSpruceTaiga => "Giant Spruce Taiga", - Biome::GiantSpruceTaigaHills => "Giant Spruce Taiga Hills", - Biome::ModifiedGravellyMountains => "Gravelly Mountains+", - Biome::ShatteredSavanna => "Shattered Savanna", - Biome::ShatteredSavannaPlateau => "Shattered Savanna Plateau", - Biome::ErodedBadlands => "Eroded Badlands", - Biome::ModifiedWoodedBadlandsPlateau => "Modified Wooded Badlands Plateau", - Biome::ModifiedBadlandsPlateau => "Modified Badlands Plateau", - Biome::BambooJungle => "Bamboo Jungle", - Biome::BambooJungleHills => "Bamboo Jungle Hills", - Biome::SoulSandValley => "Soul Sand Valley", - Biome::CrimsonForest => "Crimson Forest", - Biome::WarpedForest => "Warped Forest", - Biome::BasaltDeltas => "Basalt Deltas", - } - } - - /// Gets a `Biome` by its `display_name`. - pub fn from_display_name(display_name: &str) -> Option { - match display_name { - "Ocean" => Some(Biome::Ocean), - "Plains" => Some(Biome::Plains), - "Desert" => Some(Biome::Desert), - "Mountains" => Some(Biome::Mountains), - "Forest" => Some(Biome::Forest), - "Taiga" => Some(Biome::Taiga), - "Swamp" => Some(Biome::Swamp), - "River" => Some(Biome::River), - "Nether Wastes" => Some(Biome::NetherWastes), - "The End" => Some(Biome::TheEnd), - "Frozen Ocean" => Some(Biome::FrozenOcean), - "Frozen River" => Some(Biome::FrozenRiver), - "Snowy Tundra" => Some(Biome::SnowyTundra), - "Snowy Mountains" => Some(Biome::SnowyMountains), - "Mushroom Fields" => Some(Biome::MushroomFields), - "Mushroom Fields Shore" => Some(Biome::MushroomFieldShore), - "Beach" => Some(Biome::Beach), - "Desert Hills" => Some(Biome::DesertHills), - "Wooded Hills" => Some(Biome::WoodedHills), - "Taiga Hills" => Some(Biome::TaigaHills), - "Mountain Edge" => Some(Biome::MountainEdge), - "Jungle" => Some(Biome::Jungle), - "Jungle Hills" => Some(Biome::JungleHills), - "Jungle Edge" => Some(Biome::JungleEdge), - "Deep Ocean" => Some(Biome::DeepOcean), - "Stone Shore" => Some(Biome::StoneShore), - "Snowy Beach" => Some(Biome::SnowyBeach), - "Birch Forest" => Some(Biome::BirchForest), - "Birch Forest Hills" => Some(Biome::BirchForestHills), - "Dark Forest" => Some(Biome::DarkForest), - "Snowy Taiga" => Some(Biome::SnowyTaiga), - "Snowy Taiga Hills" => Some(Biome::SnowyTaigaHills), - "Giant Tree Taiga" => Some(Biome::GiantTreeTaiga), - "Giant Tree Taiga Hills" => Some(Biome::GiantTreeTaigaHills), - "Wooded Mountains" => Some(Biome::WoodedMountains), - "Savanna" => Some(Biome::Savanna), - "Savanna Plateau" => Some(Biome::SavannaPlateau), - "Badlands" => Some(Biome::Badlands), - "Wooded Badlands Plateau" => Some(Biome::WoodedBadlandsPlateau), - "Badlands Plateau" => Some(Biome::BadlandsPlateau), - "Small End Islands" => Some(Biome::SmallEndIslands), - "End Midlands" => Some(Biome::EndMidlands), - "End Highlands" => Some(Biome::EndHighlands), - "End Barrens" => Some(Biome::EndBarrens), - "Warm Ocean" => Some(Biome::WarmOcean), - "Lukewarm Ocean" => Some(Biome::LukewarmOcean), - "Cold Ocean" => Some(Biome::ColdOcean), - "Deep Warm Ocean" => Some(Biome::DeepWarmOcean), - "Deep Lukewarm Ocean" => Some(Biome::DeepLukewarmOcean), - "Deep Cold Ocean" => Some(Biome::DeepColdOcean), - "Deep Frozen Ocean" => Some(Biome::DeepFrozenOcean), - "the_void" => Some(Biome::TheVoid), - "Sunflower Plains" => Some(Biome::SunflowerPlains), - "Desert Lakes" => Some(Biome::DesertLakes), - "Gravelly Mountains" => Some(Biome::GravellyMountains), - "Flower Forest" => Some(Biome::FlowerForest), - "Taiga Mountains" => Some(Biome::TaigaMountains), - "Swamp Hills" => Some(Biome::SwampHills), - "Ice Spikes" => Some(Biome::IceSpikes), - "Modified Jungle" => Some(Biome::ModifiedJungle), - "Modified Jungle Edge" => Some(Biome::ModifiedJungleEdge), - "Tall Birch Forest" => Some(Biome::TallBirchForest), - "Tall Birch Hills" => Some(Biome::TallBirchHills), - "Dark Forest Hills" => Some(Biome::DarkForestHills), - "Snowy Taiga Mountains" => Some(Biome::SnowyTaigaMountains), - "Giant Spruce Taiga" => Some(Biome::GiantSpruceTaiga), - "Giant Spruce Taiga Hills" => Some(Biome::GiantSpruceTaigaHills), - "Gravelly Mountains+" => Some(Biome::ModifiedGravellyMountains), - "Shattered Savanna" => Some(Biome::ShatteredSavanna), - "Shattered Savanna Plateau" => Some(Biome::ShatteredSavannaPlateau), - "Eroded Badlands" => Some(Biome::ErodedBadlands), - "Modified Wooded Badlands Plateau" => Some(Biome::ModifiedWoodedBadlandsPlateau), - "Modified Badlands Plateau" => Some(Biome::ModifiedBadlandsPlateau), - "Bamboo Jungle" => Some(Biome::BambooJungle), - "Bamboo Jungle Hills" => Some(Biome::BambooJungleHills), - "Soul Sand Valley" => Some(Biome::SoulSandValley), - "Crimson Forest" => Some(Biome::CrimsonForest), - "Warped Forest" => Some(Biome::WarpedForest), - "Basalt Deltas" => Some(Biome::BasaltDeltas), - _ => None, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Biome { - /// Returns the `rainfall` property of this `Biome`. - pub fn rainfall(&self) -> f32 { - match self { - Biome::Ocean => 0.5 as f32, - Biome::Plains => 0.4 as f32, - Biome::Desert => 0 as f32, - Biome::Mountains => 0.3 as f32, - Biome::Forest => 0.8 as f32, - Biome::Taiga => 0.8 as f32, - Biome::Swamp => 0.9 as f32, - Biome::River => 0.5 as f32, - Biome::NetherWastes => 0 as f32, - Biome::TheEnd => 0.5 as f32, - Biome::FrozenOcean => 0.5 as f32, - Biome::FrozenRiver => 0.5 as f32, - Biome::SnowyTundra => 0.5 as f32, - Biome::SnowyMountains => 0.5 as f32, - Biome::MushroomFields => 1 as f32, - Biome::MushroomFieldShore => 1 as f32, - Biome::Beach => 0.4 as f32, - Biome::DesertHills => 0 as f32, - Biome::WoodedHills => 0.8 as f32, - Biome::TaigaHills => 0.8 as f32, - Biome::MountainEdge => 0.3 as f32, - Biome::Jungle => 0.9 as f32, - Biome::JungleHills => 0.9 as f32, - Biome::JungleEdge => 0.8 as f32, - Biome::DeepOcean => 0.5 as f32, - Biome::StoneShore => 0.3 as f32, - Biome::SnowyBeach => 0.3 as f32, - Biome::BirchForest => 0.6 as f32, - Biome::BirchForestHills => 0.6 as f32, - Biome::DarkForest => 0.8 as f32, - Biome::SnowyTaiga => 0.4 as f32, - Biome::SnowyTaigaHills => 0.4 as f32, - Biome::GiantTreeTaiga => 0.8 as f32, - Biome::GiantTreeTaigaHills => 0.8 as f32, - Biome::WoodedMountains => 0.3 as f32, - Biome::Savanna => 0 as f32, - Biome::SavannaPlateau => 0 as f32, - Biome::Badlands => 0 as f32, - Biome::WoodedBadlandsPlateau => 0 as f32, - Biome::BadlandsPlateau => 0 as f32, - Biome::SmallEndIslands => 0.5 as f32, - Biome::EndMidlands => 0.5 as f32, - Biome::EndHighlands => 0.5 as f32, - Biome::EndBarrens => 0.5 as f32, - Biome::WarmOcean => 0.5 as f32, - Biome::LukewarmOcean => 0.5 as f32, - Biome::ColdOcean => 0.5 as f32, - Biome::DeepWarmOcean => 0.5 as f32, - Biome::DeepLukewarmOcean => 0.5 as f32, - Biome::DeepColdOcean => 0.5 as f32, - Biome::DeepFrozenOcean => 0.5 as f32, - Biome::TheVoid => 0.5 as f32, - Biome::SunflowerPlains => 0.4 as f32, - Biome::DesertLakes => 0 as f32, - Biome::GravellyMountains => 0.3 as f32, - Biome::FlowerForest => 0.8 as f32, - Biome::TaigaMountains => 0.8 as f32, - Biome::SwampHills => 0.9 as f32, - Biome::IceSpikes => 0.5 as f32, - Biome::ModifiedJungle => 0.9 as f32, - Biome::ModifiedJungleEdge => 0.8 as f32, - Biome::TallBirchForest => 0.6 as f32, - Biome::TallBirchHills => 0.6 as f32, - Biome::DarkForestHills => 0.8 as f32, - Biome::SnowyTaigaMountains => 0.4 as f32, - Biome::GiantSpruceTaiga => 0.8 as f32, - Biome::GiantSpruceTaigaHills => 0.8 as f32, - Biome::ModifiedGravellyMountains => 0.3 as f32, - Biome::ShatteredSavanna => 0 as f32, - Biome::ShatteredSavannaPlateau => 0 as f32, - Biome::ErodedBadlands => 0 as f32, - Biome::ModifiedWoodedBadlandsPlateau => 0 as f32, - Biome::ModifiedBadlandsPlateau => 0 as f32, - Biome::BambooJungle => 0.9 as f32, - Biome::BambooJungleHills => 0.9 as f32, - Biome::SoulSandValley => 0 as f32, - Biome::CrimsonForest => 0 as f32, - Biome::WarpedForest => 0 as f32, - Biome::BasaltDeltas => 0 as f32, - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Biome { - /// Returns the `temperature` property of this `Biome`. - pub fn temperature(&self) -> f32 { - match self { - Biome::Ocean => 0.5 as f32, - Biome::Plains => 0.8 as f32, - Biome::Desert => 2 as f32, - Biome::Mountains => 0.2 as f32, - Biome::Forest => 0.7 as f32, - Biome::Taiga => 0.25 as f32, - Biome::Swamp => 0.8 as f32, - Biome::River => 0.5 as f32, - Biome::NetherWastes => 2 as f32, - Biome::TheEnd => 0.5 as f32, - Biome::FrozenOcean => 0 as f32, - Biome::FrozenRiver => 0 as f32, - Biome::SnowyTundra => 0 as f32, - Biome::SnowyMountains => 0 as f32, - Biome::MushroomFields => 0.9 as f32, - Biome::MushroomFieldShore => 0.9 as f32, - Biome::Beach => 0.8 as f32, - Biome::DesertHills => 2 as f32, - Biome::WoodedHills => 0.7 as f32, - Biome::TaigaHills => 0.25 as f32, - Biome::MountainEdge => 0.2 as f32, - Biome::Jungle => 0.95 as f32, - Biome::JungleHills => 0.95 as f32, - Biome::JungleEdge => 0.95 as f32, - Biome::DeepOcean => 0.5 as f32, - Biome::StoneShore => 0.2 as f32, - Biome::SnowyBeach => 0.05 as f32, - Biome::BirchForest => 0.6 as f32, - Biome::BirchForestHills => 0.6 as f32, - Biome::DarkForest => 0.7 as f32, - Biome::SnowyTaiga => -0.5 as f32, - Biome::SnowyTaigaHills => -0.5 as f32, - Biome::GiantTreeTaiga => 0.3 as f32, - Biome::GiantTreeTaigaHills => 0.3 as f32, - Biome::WoodedMountains => 0.2 as f32, - Biome::Savanna => 1.2 as f32, - Biome::SavannaPlateau => 1 as f32, - Biome::Badlands => 2 as f32, - Biome::WoodedBadlandsPlateau => 2 as f32, - Biome::BadlandsPlateau => 2 as f32, - Biome::SmallEndIslands => 0.5 as f32, - Biome::EndMidlands => 0.5 as f32, - Biome::EndHighlands => 0.5 as f32, - Biome::EndBarrens => 0.5 as f32, - Biome::WarmOcean => 0.5 as f32, - Biome::LukewarmOcean => 0.5 as f32, - Biome::ColdOcean => 0.5 as f32, - Biome::DeepWarmOcean => 0.5 as f32, - Biome::DeepLukewarmOcean => 0.5 as f32, - Biome::DeepColdOcean => 0.5 as f32, - Biome::DeepFrozenOcean => 0.5 as f32, - Biome::TheVoid => 0.5 as f32, - Biome::SunflowerPlains => 0.8 as f32, - Biome::DesertLakes => 2 as f32, - Biome::GravellyMountains => 0.2 as f32, - Biome::FlowerForest => 0.7 as f32, - Biome::TaigaMountains => 0.25 as f32, - Biome::SwampHills => 0.8 as f32, - Biome::IceSpikes => 0 as f32, - Biome::ModifiedJungle => 0.95 as f32, - Biome::ModifiedJungleEdge => 0.95 as f32, - Biome::TallBirchForest => 0.6 as f32, - Biome::TallBirchHills => 0.6 as f32, - Biome::DarkForestHills => 0.7 as f32, - Biome::SnowyTaigaMountains => -0.5 as f32, - Biome::GiantSpruceTaiga => 0.25 as f32, - Biome::GiantSpruceTaigaHills => 0.25 as f32, - Biome::ModifiedGravellyMountains => 0.2 as f32, - Biome::ShatteredSavanna => 1.1 as f32, - Biome::ShatteredSavannaPlateau => 1 as f32, - Biome::ErodedBadlands => 2 as f32, - Biome::ModifiedWoodedBadlandsPlateau => 2 as f32, - Biome::ModifiedBadlandsPlateau => 2 as f32, - Biome::BambooJungle => 0.95 as f32, - Biome::BambooJungleHills => 0.95 as f32, - Biome::SoulSandValley => 2 as f32, - Biome::CrimsonForest => 2 as f32, - Biome::WarpedForest => 2 as f32, - Biome::BasaltDeltas => 2 as f32, - } - } -} diff --git a/libcraft/core/src/block.rs b/libcraft/core/src/block.rs index 8051da9fb..55bdc4b72 100644 --- a/libcraft/core/src/block.rs +++ b/libcraft/core/src/block.rs @@ -2,34 +2,40 @@ //! See the `libcraft-blocks` crate //! for actual block definitions. +use bincode::{Decode, Encode}; use serde::{Deserialize, Serialize}; use strum_macros::EnumString; /// Direction a block is facing in. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] #[repr(u8)] + pub enum BlockFace { + Bottom, + Top, + North, South, - SouthSouthwest, - Southwest, - WestSouthwest, West, - WestNorthwest, - Northwest, - NorthNorthwest, - North, - NorthNortheast, - Northeast, - EastNortheast, East, - EastSoutheast, - Southeast, - SouthSoutheast, +} + +impl BlockFace { + pub fn axis(self) -> Axis { + match self { + BlockFace::East | BlockFace::West => Axis::X, + BlockFace::Top | BlockFace::Bottom => Axis::Y, + BlockFace::North | BlockFace::South => Axis::Z, + } + } } /// Size of bamboo leaves. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum BambooLeaves { None, @@ -38,7 +44,9 @@ pub enum BambooLeaves { } /// Part of a bed. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum BedPart { Foot, @@ -46,7 +54,9 @@ pub enum BedPart { } /// How a bell is attached. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum BellAttachment { Ceiling, @@ -57,7 +67,9 @@ pub enum BellAttachment { /// An axis. Used for bone blocks, /// portal blocks, chains, etc. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum Axis { X, @@ -66,7 +78,9 @@ pub enum Axis { } /// Block face a button or grindstone is attached to. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum AttachedFace { Ceiling, @@ -75,7 +89,9 @@ pub enum AttachedFace { } /// Type of a chest. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum ChestType { Single, @@ -86,7 +102,9 @@ pub enum ChestType { } /// Which half of a door or flower block is. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum BlockHalf { Lower, @@ -94,7 +112,9 @@ pub enum BlockHalf { } /// Which half of stairs. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum StairHalf { Bottom, @@ -102,7 +122,9 @@ pub enum StairHalf { } /// To which side a door's hinge is. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum DoorHinge { Left, @@ -110,7 +132,9 @@ pub enum DoorHinge { } /// Orientation of a jigsaw block. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum Orientation { DownEast, @@ -128,7 +152,9 @@ pub enum Orientation { } /// A note block instrument. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum Instrument { Banjo, @@ -150,7 +176,9 @@ pub enum Instrument { } /// Type of a slab block. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum SlabType { Bottom, @@ -159,7 +187,9 @@ pub enum SlabType { } /// Type of a moving piston or piston head. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum PistonType { Normal, @@ -167,7 +197,9 @@ pub enum PistonType { } /// Shape of a rail block. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum RailShape { EastWest, @@ -183,7 +215,9 @@ pub enum RailShape { } /// Mode of a redstone comparator. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum ComparatorMode { Compare, @@ -191,7 +225,9 @@ pub enum ComparatorMode { } /// How a redstone dust connects to a given side. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum RedstoneConnection { None, @@ -200,7 +236,9 @@ pub enum RedstoneConnection { } /// Shape of a stairs block. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum StairShape { InnerLeft, @@ -211,7 +249,9 @@ pub enum StairShape { } /// Mode of a structure block. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum StructureBlockMode { Corner, @@ -221,7 +261,9 @@ pub enum StructureBlockMode { } /// How a wall connects to a given direction. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Encode, Decode, EnumString, +)] #[strum(serialize_all = "snake_case")] pub enum WallConnection { None, diff --git a/libcraft/core/src/consts.rs b/libcraft/core/src/consts.rs index e3ee4c9a6..261ba6c3d 100644 --- a/libcraft/core/src/consts.rs +++ b/libcraft/core/src/consts.rs @@ -1,4 +1,24 @@ -/// Width, in blocks, of a chunk. +use std::{ops::RangeInclusive, time::Duration}; + +/// Number of updates (ticks) to do per second. +pub const TPS: u32 = 20; +/// The number of milliseconds per tick. +pub const TICK_MILLIS: u32 = 1000 / TPS; +/// The duration of a tick. +pub const TICK_DURATION: Duration = Duration::from_millis(TICK_MILLIS as u64); + +/// Default port for Minecraft servers. +pub const DEFAULT_PORT: u16 = 25565; + +/// The protocol version number +pub const PROTOCOL_VERSION: i32 = 757; +/// Vanilla server URL +pub const SERVER_DOWNLOAD_URL: &str = + "https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar"; +/// Minecraft version of this server in format x.y.z (1.16.5, 1.18.1) +pub const VERSION_STRING: &str = "1.18.1"; +/// World save versions compatible with this version of the server +pub const ANVIL_VERSION_RANGE: RangeInclusive = 2865..=2975; + pub const CHUNK_WIDTH: usize = 16; -/// Height, in blocks, of a chunk. -pub const CHUNK_HEIGHT: usize = 256; +pub const CHUNK_SECTION_HEIGHT: usize = 16; diff --git a/libcraft/core/src/dimension.rs b/libcraft/core/src/dimension.rs deleted file mode 100644 index 4b9a4d035..000000000 --- a/libcraft/core/src/dimension.rs +++ /dev/null @@ -1,70 +0,0 @@ -use serde::{Deserialize, Serialize}; -use std::convert::TryFrom; - -#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] -#[serde(try_from = "String", into = "&'static str")] -pub enum Dimension { - Overworld, - TheNether, - TheEnd, -} - -impl Dimension { - pub fn id(&self) -> i32 { - match self { - Self::Overworld => 0, - Self::TheNether => -1, - Self::TheEnd => 1, - } - } - - pub fn from_id(id: i32) -> Option { - match id { - 0 => Some(Self::Overworld), - -1 => Some(Self::TheNether), - 1 => Some(Self::TheEnd), - _ => None, - } - } - - pub fn namespaced_id(&self) -> &'static str { - match self { - Self::Overworld => "minecraft:overworld", - Self::TheNether => "minecraft:the_nether", - Self::TheEnd => "minecraft:the_end", - } - } - - pub fn from_namespaced_id(id: &str) -> Option { - match id { - "minecraft:overworld" => Some(Self::Overworld), - "minecraft:the_nether" => Some(Self::TheNether), - "minecraft:the_end" => Some(Self::TheEnd), - _ => None, - } - } -} - -impl TryFrom for Dimension { - type Error = &'static str; - - fn try_from(namespaced_value: String) -> Result { - if let Some(val) = Self::from_namespaced_id(namespaced_value.as_str()) { - Ok(val) - } else { - Err("Unknown dimension namespaced_id.") - } - } -} - -impl From for &'static str { - fn from(value: Dimension) -> Self { - value.namespaced_id() - } -} - -impl From for i32 { - fn from(value: Dimension) -> Self { - value.id() - } -} diff --git a/libcraft/core/src/entity.rs b/libcraft/core/src/entity.rs index 0f16ee4ce..d0a7af8c3 100644 --- a/libcraft/core/src/entity.rs +++ b/libcraft/core/src/entity.rs @@ -1,10 +1,24 @@ // This file is @generated. Please do not edit. - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + serde :: Serialize, + serde :: Deserialize, + bincode :: Encode, + bincode :: Decode, +)] +#[serde(try_from = "String", into = "&'static str")] pub enum EntityKind { AreaEffectCloud, ArmorStand, Arrow, + Axolotl, Bat, Bee, Blaze, @@ -33,6 +47,9 @@ pub enum EntityKind { Fox, Ghast, Giant, + GlowItemFrame, + GlowSquid, + Goat, Guardian, Hoglin, Horse, @@ -47,6 +64,7 @@ pub enum EntityKind { Llama, LlamaSpit, MagmaCube, + Marker, Minecart, ChestMinecart, CommandBlockMinecart, @@ -111,480 +129,619 @@ pub enum EntityKind { Player, FishingBobber, } - -#[allow(warnings)] -#[allow(clippy::all)] impl EntityKind { - /// Returns the `id` property of this `EntityKind`. + #[inline] + pub fn values() -> &'static [EntityKind] { + use EntityKind::*; + &[ + AreaEffectCloud, + ArmorStand, + Arrow, + Axolotl, + Bat, + Bee, + Blaze, + Boat, + Cat, + CaveSpider, + Chicken, + Cod, + Cow, + Creeper, + Dolphin, + Donkey, + DragonFireball, + Drowned, + ElderGuardian, + EndCrystal, + EnderDragon, + Enderman, + Endermite, + Evoker, + EvokerFangs, + ExperienceOrb, + EyeOfEnder, + FallingBlock, + FireworkRocket, + Fox, + Ghast, + Giant, + GlowItemFrame, + GlowSquid, + Goat, + Guardian, + Hoglin, + Horse, + Husk, + Illusioner, + IronGolem, + Item, + ItemFrame, + Fireball, + LeashKnot, + LightningBolt, + Llama, + LlamaSpit, + MagmaCube, + Marker, + Minecart, + ChestMinecart, + CommandBlockMinecart, + FurnaceMinecart, + HopperMinecart, + SpawnerMinecart, + TntMinecart, + Mule, + Mooshroom, + Ocelot, + Painting, + Panda, + Parrot, + Phantom, + Pig, + Piglin, + PiglinBrute, + Pillager, + PolarBear, + Tnt, + Pufferfish, + Rabbit, + Ravager, + Salmon, + Sheep, + Shulker, + ShulkerBullet, + Silverfish, + Skeleton, + SkeletonHorse, + Slime, + SmallFireball, + SnowGolem, + Snowball, + SpectralArrow, + Spider, + Squid, + Stray, + Strider, + Egg, + EnderPearl, + ExperienceBottle, + Potion, + Trident, + TraderLlama, + TropicalFish, + Turtle, + Vex, + Villager, + Vindicator, + WanderingTrader, + Witch, + Wither, + WitherSkeleton, + WitherSkull, + Wolf, + Zoglin, + Zombie, + ZombieHorse, + ZombieVillager, + ZombifiedPiglin, + Player, + FishingBobber, + ] + } +} +impl EntityKind { + #[doc = "Returns the `id` property of this `EntityKind`."] + #[inline] pub fn id(&self) -> u32 { match self { - EntityKind::AreaEffectCloud => 0, - EntityKind::ArmorStand => 1, - EntityKind::Arrow => 2, - EntityKind::Bat => 3, - EntityKind::Bee => 4, - EntityKind::Blaze => 5, - EntityKind::Boat => 6, - EntityKind::Cat => 7, - EntityKind::CaveSpider => 8, - EntityKind::Chicken => 9, - EntityKind::Cod => 10, - EntityKind::Cow => 11, - EntityKind::Creeper => 12, - EntityKind::Dolphin => 13, - EntityKind::Donkey => 14, - EntityKind::DragonFireball => 15, - EntityKind::Drowned => 16, - EntityKind::ElderGuardian => 17, - EntityKind::EndCrystal => 18, - EntityKind::EnderDragon => 19, - EntityKind::Enderman => 20, - EntityKind::Endermite => 21, - EntityKind::Evoker => 22, - EntityKind::EvokerFangs => 23, - EntityKind::ExperienceOrb => 24, - EntityKind::EyeOfEnder => 25, - EntityKind::FallingBlock => 26, - EntityKind::FireworkRocket => 27, - EntityKind::Fox => 28, - EntityKind::Ghast => 29, - EntityKind::Giant => 30, - EntityKind::Guardian => 31, - EntityKind::Hoglin => 32, - EntityKind::Horse => 33, - EntityKind::Husk => 34, - EntityKind::Illusioner => 35, - EntityKind::IronGolem => 36, - EntityKind::Item => 37, - EntityKind::ItemFrame => 38, - EntityKind::Fireball => 39, - EntityKind::LeashKnot => 40, - EntityKind::LightningBolt => 41, - EntityKind::Llama => 42, - EntityKind::LlamaSpit => 43, - EntityKind::MagmaCube => 44, - EntityKind::Minecart => 45, - EntityKind::ChestMinecart => 46, - EntityKind::CommandBlockMinecart => 47, - EntityKind::FurnaceMinecart => 48, - EntityKind::HopperMinecart => 49, - EntityKind::SpawnerMinecart => 50, - EntityKind::TntMinecart => 51, - EntityKind::Mule => 52, - EntityKind::Mooshroom => 53, - EntityKind::Ocelot => 54, - EntityKind::Painting => 55, - EntityKind::Panda => 56, - EntityKind::Parrot => 57, - EntityKind::Phantom => 58, - EntityKind::Pig => 59, - EntityKind::Piglin => 60, - EntityKind::PiglinBrute => 61, - EntityKind::Pillager => 62, - EntityKind::PolarBear => 63, - EntityKind::Tnt => 64, - EntityKind::Pufferfish => 65, - EntityKind::Rabbit => 66, - EntityKind::Ravager => 67, - EntityKind::Salmon => 68, - EntityKind::Sheep => 69, - EntityKind::Shulker => 70, - EntityKind::ShulkerBullet => 71, - EntityKind::Silverfish => 72, - EntityKind::Skeleton => 73, - EntityKind::SkeletonHorse => 74, - EntityKind::Slime => 75, - EntityKind::SmallFireball => 76, - EntityKind::SnowGolem => 77, - EntityKind::Snowball => 78, - EntityKind::SpectralArrow => 79, - EntityKind::Spider => 80, - EntityKind::Squid => 81, - EntityKind::Stray => 82, - EntityKind::Strider => 83, - EntityKind::Egg => 84, - EntityKind::EnderPearl => 85, - EntityKind::ExperienceBottle => 86, - EntityKind::Potion => 87, - EntityKind::Trident => 88, - EntityKind::TraderLlama => 89, - EntityKind::TropicalFish => 90, - EntityKind::Turtle => 91, - EntityKind::Vex => 92, - EntityKind::Villager => 93, - EntityKind::Vindicator => 94, - EntityKind::WanderingTrader => 95, - EntityKind::Witch => 96, - EntityKind::Wither => 97, - EntityKind::WitherSkeleton => 98, - EntityKind::WitherSkull => 99, - EntityKind::Wolf => 100, - EntityKind::Zoglin => 101, - EntityKind::Zombie => 102, - EntityKind::ZombieHorse => 103, - EntityKind::ZombieVillager => 104, - EntityKind::ZombifiedPiglin => 105, - EntityKind::Player => 106, - EntityKind::FishingBobber => 107, + EntityKind::AreaEffectCloud => 0u32, + EntityKind::ArmorStand => 1u32, + EntityKind::Arrow => 2u32, + EntityKind::Axolotl => 3u32, + EntityKind::Bat => 4u32, + EntityKind::Bee => 5u32, + EntityKind::Blaze => 6u32, + EntityKind::Boat => 7u32, + EntityKind::Cat => 8u32, + EntityKind::CaveSpider => 9u32, + EntityKind::Chicken => 10u32, + EntityKind::Cod => 11u32, + EntityKind::Cow => 12u32, + EntityKind::Creeper => 13u32, + EntityKind::Dolphin => 14u32, + EntityKind::Donkey => 15u32, + EntityKind::DragonFireball => 16u32, + EntityKind::Drowned => 17u32, + EntityKind::ElderGuardian => 18u32, + EntityKind::EndCrystal => 19u32, + EntityKind::EnderDragon => 20u32, + EntityKind::Enderman => 21u32, + EntityKind::Endermite => 22u32, + EntityKind::Evoker => 23u32, + EntityKind::EvokerFangs => 24u32, + EntityKind::ExperienceOrb => 25u32, + EntityKind::EyeOfEnder => 26u32, + EntityKind::FallingBlock => 27u32, + EntityKind::FireworkRocket => 28u32, + EntityKind::Fox => 29u32, + EntityKind::Ghast => 30u32, + EntityKind::Giant => 31u32, + EntityKind::GlowItemFrame => 32u32, + EntityKind::GlowSquid => 33u32, + EntityKind::Goat => 34u32, + EntityKind::Guardian => 35u32, + EntityKind::Hoglin => 36u32, + EntityKind::Horse => 37u32, + EntityKind::Husk => 38u32, + EntityKind::Illusioner => 39u32, + EntityKind::IronGolem => 40u32, + EntityKind::Item => 41u32, + EntityKind::ItemFrame => 42u32, + EntityKind::Fireball => 43u32, + EntityKind::LeashKnot => 44u32, + EntityKind::LightningBolt => 45u32, + EntityKind::Llama => 46u32, + EntityKind::LlamaSpit => 47u32, + EntityKind::MagmaCube => 48u32, + EntityKind::Marker => 49u32, + EntityKind::Minecart => 50u32, + EntityKind::ChestMinecart => 51u32, + EntityKind::CommandBlockMinecart => 52u32, + EntityKind::FurnaceMinecart => 53u32, + EntityKind::HopperMinecart => 54u32, + EntityKind::SpawnerMinecart => 55u32, + EntityKind::TntMinecart => 56u32, + EntityKind::Mule => 57u32, + EntityKind::Mooshroom => 58u32, + EntityKind::Ocelot => 59u32, + EntityKind::Painting => 60u32, + EntityKind::Panda => 61u32, + EntityKind::Parrot => 62u32, + EntityKind::Phantom => 63u32, + EntityKind::Pig => 64u32, + EntityKind::Piglin => 65u32, + EntityKind::PiglinBrute => 66u32, + EntityKind::Pillager => 67u32, + EntityKind::PolarBear => 68u32, + EntityKind::Tnt => 69u32, + EntityKind::Pufferfish => 70u32, + EntityKind::Rabbit => 71u32, + EntityKind::Ravager => 72u32, + EntityKind::Salmon => 73u32, + EntityKind::Sheep => 74u32, + EntityKind::Shulker => 75u32, + EntityKind::ShulkerBullet => 76u32, + EntityKind::Silverfish => 77u32, + EntityKind::Skeleton => 78u32, + EntityKind::SkeletonHorse => 79u32, + EntityKind::Slime => 80u32, + EntityKind::SmallFireball => 81u32, + EntityKind::SnowGolem => 82u32, + EntityKind::Snowball => 83u32, + EntityKind::SpectralArrow => 84u32, + EntityKind::Spider => 85u32, + EntityKind::Squid => 86u32, + EntityKind::Stray => 87u32, + EntityKind::Strider => 88u32, + EntityKind::Egg => 89u32, + EntityKind::EnderPearl => 90u32, + EntityKind::ExperienceBottle => 91u32, + EntityKind::Potion => 92u32, + EntityKind::Trident => 93u32, + EntityKind::TraderLlama => 94u32, + EntityKind::TropicalFish => 95u32, + EntityKind::Turtle => 96u32, + EntityKind::Vex => 97u32, + EntityKind::Villager => 98u32, + EntityKind::Vindicator => 99u32, + EntityKind::WanderingTrader => 100u32, + EntityKind::Witch => 101u32, + EntityKind::Wither => 102u32, + EntityKind::WitherSkeleton => 103u32, + EntityKind::WitherSkull => 104u32, + EntityKind::Wolf => 105u32, + EntityKind::Zoglin => 106u32, + EntityKind::Zombie => 107u32, + EntityKind::ZombieHorse => 108u32, + EntityKind::ZombieVillager => 109u32, + EntityKind::ZombifiedPiglin => 110u32, + EntityKind::Player => 111u32, + EntityKind::FishingBobber => 112u32, } } - - /// Gets a `EntityKind` by its `id`. + #[doc = "Gets a `EntityKind` by its `id`."] + #[inline] pub fn from_id(id: u32) -> Option { match id { - 0 => Some(EntityKind::AreaEffectCloud), - 1 => Some(EntityKind::ArmorStand), - 2 => Some(EntityKind::Arrow), - 3 => Some(EntityKind::Bat), - 4 => Some(EntityKind::Bee), - 5 => Some(EntityKind::Blaze), - 6 => Some(EntityKind::Boat), - 7 => Some(EntityKind::Cat), - 8 => Some(EntityKind::CaveSpider), - 9 => Some(EntityKind::Chicken), - 10 => Some(EntityKind::Cod), - 11 => Some(EntityKind::Cow), - 12 => Some(EntityKind::Creeper), - 13 => Some(EntityKind::Dolphin), - 14 => Some(EntityKind::Donkey), - 15 => Some(EntityKind::DragonFireball), - 16 => Some(EntityKind::Drowned), - 17 => Some(EntityKind::ElderGuardian), - 18 => Some(EntityKind::EndCrystal), - 19 => Some(EntityKind::EnderDragon), - 20 => Some(EntityKind::Enderman), - 21 => Some(EntityKind::Endermite), - 22 => Some(EntityKind::Evoker), - 23 => Some(EntityKind::EvokerFangs), - 24 => Some(EntityKind::ExperienceOrb), - 25 => Some(EntityKind::EyeOfEnder), - 26 => Some(EntityKind::FallingBlock), - 27 => Some(EntityKind::FireworkRocket), - 28 => Some(EntityKind::Fox), - 29 => Some(EntityKind::Ghast), - 30 => Some(EntityKind::Giant), - 31 => Some(EntityKind::Guardian), - 32 => Some(EntityKind::Hoglin), - 33 => Some(EntityKind::Horse), - 34 => Some(EntityKind::Husk), - 35 => Some(EntityKind::Illusioner), - 36 => Some(EntityKind::IronGolem), - 37 => Some(EntityKind::Item), - 38 => Some(EntityKind::ItemFrame), - 39 => Some(EntityKind::Fireball), - 40 => Some(EntityKind::LeashKnot), - 41 => Some(EntityKind::LightningBolt), - 42 => Some(EntityKind::Llama), - 43 => Some(EntityKind::LlamaSpit), - 44 => Some(EntityKind::MagmaCube), - 45 => Some(EntityKind::Minecart), - 46 => Some(EntityKind::ChestMinecart), - 47 => Some(EntityKind::CommandBlockMinecart), - 48 => Some(EntityKind::FurnaceMinecart), - 49 => Some(EntityKind::HopperMinecart), - 50 => Some(EntityKind::SpawnerMinecart), - 51 => Some(EntityKind::TntMinecart), - 52 => Some(EntityKind::Mule), - 53 => Some(EntityKind::Mooshroom), - 54 => Some(EntityKind::Ocelot), - 55 => Some(EntityKind::Painting), - 56 => Some(EntityKind::Panda), - 57 => Some(EntityKind::Parrot), - 58 => Some(EntityKind::Phantom), - 59 => Some(EntityKind::Pig), - 60 => Some(EntityKind::Piglin), - 61 => Some(EntityKind::PiglinBrute), - 62 => Some(EntityKind::Pillager), - 63 => Some(EntityKind::PolarBear), - 64 => Some(EntityKind::Tnt), - 65 => Some(EntityKind::Pufferfish), - 66 => Some(EntityKind::Rabbit), - 67 => Some(EntityKind::Ravager), - 68 => Some(EntityKind::Salmon), - 69 => Some(EntityKind::Sheep), - 70 => Some(EntityKind::Shulker), - 71 => Some(EntityKind::ShulkerBullet), - 72 => Some(EntityKind::Silverfish), - 73 => Some(EntityKind::Skeleton), - 74 => Some(EntityKind::SkeletonHorse), - 75 => Some(EntityKind::Slime), - 76 => Some(EntityKind::SmallFireball), - 77 => Some(EntityKind::SnowGolem), - 78 => Some(EntityKind::Snowball), - 79 => Some(EntityKind::SpectralArrow), - 80 => Some(EntityKind::Spider), - 81 => Some(EntityKind::Squid), - 82 => Some(EntityKind::Stray), - 83 => Some(EntityKind::Strider), - 84 => Some(EntityKind::Egg), - 85 => Some(EntityKind::EnderPearl), - 86 => Some(EntityKind::ExperienceBottle), - 87 => Some(EntityKind::Potion), - 88 => Some(EntityKind::Trident), - 89 => Some(EntityKind::TraderLlama), - 90 => Some(EntityKind::TropicalFish), - 91 => Some(EntityKind::Turtle), - 92 => Some(EntityKind::Vex), - 93 => Some(EntityKind::Villager), - 94 => Some(EntityKind::Vindicator), - 95 => Some(EntityKind::WanderingTrader), - 96 => Some(EntityKind::Witch), - 97 => Some(EntityKind::Wither), - 98 => Some(EntityKind::WitherSkeleton), - 99 => Some(EntityKind::WitherSkull), - 100 => Some(EntityKind::Wolf), - 101 => Some(EntityKind::Zoglin), - 102 => Some(EntityKind::Zombie), - 103 => Some(EntityKind::ZombieHorse), - 104 => Some(EntityKind::ZombieVillager), - 105 => Some(EntityKind::ZombifiedPiglin), - 106 => Some(EntityKind::Player), - 107 => Some(EntityKind::FishingBobber), + 0u32 => Some(EntityKind::AreaEffectCloud), + 1u32 => Some(EntityKind::ArmorStand), + 2u32 => Some(EntityKind::Arrow), + 3u32 => Some(EntityKind::Axolotl), + 4u32 => Some(EntityKind::Bat), + 5u32 => Some(EntityKind::Bee), + 6u32 => Some(EntityKind::Blaze), + 7u32 => Some(EntityKind::Boat), + 8u32 => Some(EntityKind::Cat), + 9u32 => Some(EntityKind::CaveSpider), + 10u32 => Some(EntityKind::Chicken), + 11u32 => Some(EntityKind::Cod), + 12u32 => Some(EntityKind::Cow), + 13u32 => Some(EntityKind::Creeper), + 14u32 => Some(EntityKind::Dolphin), + 15u32 => Some(EntityKind::Donkey), + 16u32 => Some(EntityKind::DragonFireball), + 17u32 => Some(EntityKind::Drowned), + 18u32 => Some(EntityKind::ElderGuardian), + 19u32 => Some(EntityKind::EndCrystal), + 20u32 => Some(EntityKind::EnderDragon), + 21u32 => Some(EntityKind::Enderman), + 22u32 => Some(EntityKind::Endermite), + 23u32 => Some(EntityKind::Evoker), + 24u32 => Some(EntityKind::EvokerFangs), + 25u32 => Some(EntityKind::ExperienceOrb), + 26u32 => Some(EntityKind::EyeOfEnder), + 27u32 => Some(EntityKind::FallingBlock), + 28u32 => Some(EntityKind::FireworkRocket), + 29u32 => Some(EntityKind::Fox), + 30u32 => Some(EntityKind::Ghast), + 31u32 => Some(EntityKind::Giant), + 32u32 => Some(EntityKind::GlowItemFrame), + 33u32 => Some(EntityKind::GlowSquid), + 34u32 => Some(EntityKind::Goat), + 35u32 => Some(EntityKind::Guardian), + 36u32 => Some(EntityKind::Hoglin), + 37u32 => Some(EntityKind::Horse), + 38u32 => Some(EntityKind::Husk), + 39u32 => Some(EntityKind::Illusioner), + 40u32 => Some(EntityKind::IronGolem), + 41u32 => Some(EntityKind::Item), + 42u32 => Some(EntityKind::ItemFrame), + 43u32 => Some(EntityKind::Fireball), + 44u32 => Some(EntityKind::LeashKnot), + 45u32 => Some(EntityKind::LightningBolt), + 46u32 => Some(EntityKind::Llama), + 47u32 => Some(EntityKind::LlamaSpit), + 48u32 => Some(EntityKind::MagmaCube), + 49u32 => Some(EntityKind::Marker), + 50u32 => Some(EntityKind::Minecart), + 51u32 => Some(EntityKind::ChestMinecart), + 52u32 => Some(EntityKind::CommandBlockMinecart), + 53u32 => Some(EntityKind::FurnaceMinecart), + 54u32 => Some(EntityKind::HopperMinecart), + 55u32 => Some(EntityKind::SpawnerMinecart), + 56u32 => Some(EntityKind::TntMinecart), + 57u32 => Some(EntityKind::Mule), + 58u32 => Some(EntityKind::Mooshroom), + 59u32 => Some(EntityKind::Ocelot), + 60u32 => Some(EntityKind::Painting), + 61u32 => Some(EntityKind::Panda), + 62u32 => Some(EntityKind::Parrot), + 63u32 => Some(EntityKind::Phantom), + 64u32 => Some(EntityKind::Pig), + 65u32 => Some(EntityKind::Piglin), + 66u32 => Some(EntityKind::PiglinBrute), + 67u32 => Some(EntityKind::Pillager), + 68u32 => Some(EntityKind::PolarBear), + 69u32 => Some(EntityKind::Tnt), + 70u32 => Some(EntityKind::Pufferfish), + 71u32 => Some(EntityKind::Rabbit), + 72u32 => Some(EntityKind::Ravager), + 73u32 => Some(EntityKind::Salmon), + 74u32 => Some(EntityKind::Sheep), + 75u32 => Some(EntityKind::Shulker), + 76u32 => Some(EntityKind::ShulkerBullet), + 77u32 => Some(EntityKind::Silverfish), + 78u32 => Some(EntityKind::Skeleton), + 79u32 => Some(EntityKind::SkeletonHorse), + 80u32 => Some(EntityKind::Slime), + 81u32 => Some(EntityKind::SmallFireball), + 82u32 => Some(EntityKind::SnowGolem), + 83u32 => Some(EntityKind::Snowball), + 84u32 => Some(EntityKind::SpectralArrow), + 85u32 => Some(EntityKind::Spider), + 86u32 => Some(EntityKind::Squid), + 87u32 => Some(EntityKind::Stray), + 88u32 => Some(EntityKind::Strider), + 89u32 => Some(EntityKind::Egg), + 90u32 => Some(EntityKind::EnderPearl), + 91u32 => Some(EntityKind::ExperienceBottle), + 92u32 => Some(EntityKind::Potion), + 93u32 => Some(EntityKind::Trident), + 94u32 => Some(EntityKind::TraderLlama), + 95u32 => Some(EntityKind::TropicalFish), + 96u32 => Some(EntityKind::Turtle), + 97u32 => Some(EntityKind::Vex), + 98u32 => Some(EntityKind::Villager), + 99u32 => Some(EntityKind::Vindicator), + 100u32 => Some(EntityKind::WanderingTrader), + 101u32 => Some(EntityKind::Witch), + 102u32 => Some(EntityKind::Wither), + 103u32 => Some(EntityKind::WitherSkeleton), + 104u32 => Some(EntityKind::WitherSkull), + 105u32 => Some(EntityKind::Wolf), + 106u32 => Some(EntityKind::Zoglin), + 107u32 => Some(EntityKind::Zombie), + 108u32 => Some(EntityKind::ZombieHorse), + 109u32 => Some(EntityKind::ZombieVillager), + 110u32 => Some(EntityKind::ZombifiedPiglin), + 111u32 => Some(EntityKind::Player), + 112u32 => Some(EntityKind::FishingBobber), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl EntityKind { - /// Returns the `internal_id` property of this `EntityKind`. - pub fn internal_id(&self) -> u32 { + #[doc = "Returns the `width` property of this `EntityKind`."] + #[inline] + pub fn width(&self) -> f32 { match self { - EntityKind::AreaEffectCloud => 0, - EntityKind::ArmorStand => 1, - EntityKind::Arrow => 2, - EntityKind::Bat => 3, - EntityKind::Bee => 4, - EntityKind::Blaze => 5, - EntityKind::Boat => 6, - EntityKind::Cat => 7, - EntityKind::CaveSpider => 8, - EntityKind::Chicken => 9, - EntityKind::Cod => 10, - EntityKind::Cow => 11, - EntityKind::Creeper => 12, - EntityKind::Dolphin => 13, - EntityKind::Donkey => 14, - EntityKind::DragonFireball => 15, - EntityKind::Drowned => 16, - EntityKind::ElderGuardian => 17, - EntityKind::EndCrystal => 18, - EntityKind::EnderDragon => 19, - EntityKind::Enderman => 20, - EntityKind::Endermite => 21, - EntityKind::Evoker => 22, - EntityKind::EvokerFangs => 23, - EntityKind::ExperienceOrb => 24, - EntityKind::EyeOfEnder => 25, - EntityKind::FallingBlock => 26, - EntityKind::FireworkRocket => 27, - EntityKind::Fox => 28, - EntityKind::Ghast => 29, - EntityKind::Giant => 30, - EntityKind::Guardian => 31, - EntityKind::Hoglin => 32, - EntityKind::Horse => 33, - EntityKind::Husk => 34, - EntityKind::Illusioner => 35, - EntityKind::IronGolem => 36, - EntityKind::Item => 37, - EntityKind::ItemFrame => 38, - EntityKind::Fireball => 39, - EntityKind::LeashKnot => 40, - EntityKind::LightningBolt => 41, - EntityKind::Llama => 42, - EntityKind::LlamaSpit => 43, - EntityKind::MagmaCube => 44, - EntityKind::Minecart => 45, - EntityKind::ChestMinecart => 46, - EntityKind::CommandBlockMinecart => 47, - EntityKind::FurnaceMinecart => 48, - EntityKind::HopperMinecart => 49, - EntityKind::SpawnerMinecart => 50, - EntityKind::TntMinecart => 51, - EntityKind::Mule => 52, - EntityKind::Mooshroom => 53, - EntityKind::Ocelot => 54, - EntityKind::Painting => 55, - EntityKind::Panda => 56, - EntityKind::Parrot => 57, - EntityKind::Phantom => 58, - EntityKind::Pig => 59, - EntityKind::Piglin => 60, - EntityKind::PiglinBrute => 61, - EntityKind::Pillager => 62, - EntityKind::PolarBear => 63, - EntityKind::Tnt => 64, - EntityKind::Pufferfish => 65, - EntityKind::Rabbit => 66, - EntityKind::Ravager => 67, - EntityKind::Salmon => 68, - EntityKind::Sheep => 69, - EntityKind::Shulker => 70, - EntityKind::ShulkerBullet => 71, - EntityKind::Silverfish => 72, - EntityKind::Skeleton => 73, - EntityKind::SkeletonHorse => 74, - EntityKind::Slime => 75, - EntityKind::SmallFireball => 76, - EntityKind::SnowGolem => 77, - EntityKind::Snowball => 78, - EntityKind::SpectralArrow => 79, - EntityKind::Spider => 80, - EntityKind::Squid => 81, - EntityKind::Stray => 82, - EntityKind::Strider => 83, - EntityKind::Egg => 84, - EntityKind::EnderPearl => 85, - EntityKind::ExperienceBottle => 86, - EntityKind::Potion => 87, - EntityKind::Trident => 88, - EntityKind::TraderLlama => 89, - EntityKind::TropicalFish => 90, - EntityKind::Turtle => 91, - EntityKind::Vex => 92, - EntityKind::Villager => 93, - EntityKind::Vindicator => 94, - EntityKind::WanderingTrader => 95, - EntityKind::Witch => 96, - EntityKind::Wither => 97, - EntityKind::WitherSkeleton => 98, - EntityKind::WitherSkull => 99, - EntityKind::Wolf => 100, - EntityKind::Zoglin => 101, - EntityKind::Zombie => 102, - EntityKind::ZombieHorse => 103, - EntityKind::ZombieVillager => 104, - EntityKind::ZombifiedPiglin => 105, - EntityKind::Player => 106, - EntityKind::FishingBobber => 107, + EntityKind::AreaEffectCloud => 6f32, + EntityKind::ArmorStand => 0.5f32, + EntityKind::Arrow => 0.5f32, + EntityKind::Axolotl => 0.75f32, + EntityKind::Bat => 0.5f32, + EntityKind::Bee => 0.7f32, + EntityKind::Blaze => 0.6f32, + EntityKind::Boat => 1.375f32, + EntityKind::Cat => 0.6f32, + EntityKind::CaveSpider => 0.7f32, + EntityKind::Chicken => 0.4f32, + EntityKind::Cod => 0.5f32, + EntityKind::Cow => 0.9f32, + EntityKind::Creeper => 0.6f32, + EntityKind::Dolphin => 0.9f32, + EntityKind::Donkey => 1.39648f32, + EntityKind::DragonFireball => 1f32, + EntityKind::Drowned => 0.6f32, + EntityKind::ElderGuardian => 1.9975f32, + EntityKind::EndCrystal => 2f32, + EntityKind::EnderDragon => 16f32, + EntityKind::Enderman => 0.6f32, + EntityKind::Endermite => 0.4f32, + EntityKind::Evoker => 0.6f32, + EntityKind::EvokerFangs => 0.5f32, + EntityKind::ExperienceOrb => 0.5f32, + EntityKind::EyeOfEnder => 0.25f32, + EntityKind::FallingBlock => 0.98f32, + EntityKind::FireworkRocket => 0.25f32, + EntityKind::Fox => 0.6f32, + EntityKind::Ghast => 4f32, + EntityKind::Giant => 3.6f32, + EntityKind::GlowItemFrame => 0.5f32, + EntityKind::GlowSquid => 0.8f32, + EntityKind::Goat => 0.9f32, + EntityKind::Guardian => 0.85f32, + EntityKind::Hoglin => 1.39648f32, + EntityKind::Horse => 1.39648f32, + EntityKind::Husk => 0.6f32, + EntityKind::Illusioner => 0.6f32, + EntityKind::IronGolem => 1.4f32, + EntityKind::Item => 0.25f32, + EntityKind::ItemFrame => 0.5f32, + EntityKind::Fireball => 1f32, + EntityKind::LeashKnot => 0.375f32, + EntityKind::LightningBolt => 0f32, + EntityKind::Llama => 0.9f32, + EntityKind::LlamaSpit => 0.25f32, + EntityKind::MagmaCube => 2.04f32, + EntityKind::Marker => 0f32, + EntityKind::Minecart => 0.98f32, + EntityKind::ChestMinecart => 0.98f32, + EntityKind::CommandBlockMinecart => 0.98f32, + EntityKind::FurnaceMinecart => 0.98f32, + EntityKind::HopperMinecart => 0.98f32, + EntityKind::SpawnerMinecart => 0.98f32, + EntityKind::TntMinecart => 0.98f32, + EntityKind::Mule => 1.39648f32, + EntityKind::Mooshroom => 0.9f32, + EntityKind::Ocelot => 0.6f32, + EntityKind::Painting => 0.5f32, + EntityKind::Panda => 1.3f32, + EntityKind::Parrot => 0.5f32, + EntityKind::Phantom => 0.9f32, + EntityKind::Pig => 0.9f32, + EntityKind::Piglin => 0.6f32, + EntityKind::PiglinBrute => 0.6f32, + EntityKind::Pillager => 0.6f32, + EntityKind::PolarBear => 1.4f32, + EntityKind::Tnt => 0.98f32, + EntityKind::Pufferfish => 0.7f32, + EntityKind::Rabbit => 0.4f32, + EntityKind::Ravager => 1.95f32, + EntityKind::Salmon => 0.7f32, + EntityKind::Sheep => 0.9f32, + EntityKind::Shulker => 1f32, + EntityKind::ShulkerBullet => 0.3125f32, + EntityKind::Silverfish => 0.4f32, + EntityKind::Skeleton => 0.6f32, + EntityKind::SkeletonHorse => 1.39648f32, + EntityKind::Slime => 2.04f32, + EntityKind::SmallFireball => 0.3125f32, + EntityKind::SnowGolem => 0.7f32, + EntityKind::Snowball => 0.25f32, + EntityKind::SpectralArrow => 0.5f32, + EntityKind::Spider => 1.4f32, + EntityKind::Squid => 0.8f32, + EntityKind::Stray => 0.6f32, + EntityKind::Strider => 0.9f32, + EntityKind::Egg => 0.25f32, + EntityKind::EnderPearl => 0.25f32, + EntityKind::ExperienceBottle => 0.25f32, + EntityKind::Potion => 0.25f32, + EntityKind::Trident => 0.5f32, + EntityKind::TraderLlama => 0.9f32, + EntityKind::TropicalFish => 0.5f32, + EntityKind::Turtle => 1.2f32, + EntityKind::Vex => 0.4f32, + EntityKind::Villager => 0.6f32, + EntityKind::Vindicator => 0.6f32, + EntityKind::WanderingTrader => 0.6f32, + EntityKind::Witch => 0.6f32, + EntityKind::Wither => 0.9f32, + EntityKind::WitherSkeleton => 0.7f32, + EntityKind::WitherSkull => 0.3125f32, + EntityKind::Wolf => 0.6f32, + EntityKind::Zoglin => 1.39648f32, + EntityKind::Zombie => 0.6f32, + EntityKind::ZombieHorse => 1.39648f32, + EntityKind::ZombieVillager => 0.6f32, + EntityKind::ZombifiedPiglin => 0.6f32, + EntityKind::Player => 0.6f32, + EntityKind::FishingBobber => 0.25f32, } } - - /// Gets a `EntityKind` by its `internal_id`. - pub fn from_internal_id(internal_id: u32) -> Option { - match internal_id { - 0 => Some(EntityKind::AreaEffectCloud), - 1 => Some(EntityKind::ArmorStand), - 2 => Some(EntityKind::Arrow), - 3 => Some(EntityKind::Bat), - 4 => Some(EntityKind::Bee), - 5 => Some(EntityKind::Blaze), - 6 => Some(EntityKind::Boat), - 7 => Some(EntityKind::Cat), - 8 => Some(EntityKind::CaveSpider), - 9 => Some(EntityKind::Chicken), - 10 => Some(EntityKind::Cod), - 11 => Some(EntityKind::Cow), - 12 => Some(EntityKind::Creeper), - 13 => Some(EntityKind::Dolphin), - 14 => Some(EntityKind::Donkey), - 15 => Some(EntityKind::DragonFireball), - 16 => Some(EntityKind::Drowned), - 17 => Some(EntityKind::ElderGuardian), - 18 => Some(EntityKind::EndCrystal), - 19 => Some(EntityKind::EnderDragon), - 20 => Some(EntityKind::Enderman), - 21 => Some(EntityKind::Endermite), - 22 => Some(EntityKind::Evoker), - 23 => Some(EntityKind::EvokerFangs), - 24 => Some(EntityKind::ExperienceOrb), - 25 => Some(EntityKind::EyeOfEnder), - 26 => Some(EntityKind::FallingBlock), - 27 => Some(EntityKind::FireworkRocket), - 28 => Some(EntityKind::Fox), - 29 => Some(EntityKind::Ghast), - 30 => Some(EntityKind::Giant), - 31 => Some(EntityKind::Guardian), - 32 => Some(EntityKind::Hoglin), - 33 => Some(EntityKind::Horse), - 34 => Some(EntityKind::Husk), - 35 => Some(EntityKind::Illusioner), - 36 => Some(EntityKind::IronGolem), - 37 => Some(EntityKind::Item), - 38 => Some(EntityKind::ItemFrame), - 39 => Some(EntityKind::Fireball), - 40 => Some(EntityKind::LeashKnot), - 41 => Some(EntityKind::LightningBolt), - 42 => Some(EntityKind::Llama), - 43 => Some(EntityKind::LlamaSpit), - 44 => Some(EntityKind::MagmaCube), - 45 => Some(EntityKind::Minecart), - 46 => Some(EntityKind::ChestMinecart), - 47 => Some(EntityKind::CommandBlockMinecart), - 48 => Some(EntityKind::FurnaceMinecart), - 49 => Some(EntityKind::HopperMinecart), - 50 => Some(EntityKind::SpawnerMinecart), - 51 => Some(EntityKind::TntMinecart), - 52 => Some(EntityKind::Mule), - 53 => Some(EntityKind::Mooshroom), - 54 => Some(EntityKind::Ocelot), - 55 => Some(EntityKind::Painting), - 56 => Some(EntityKind::Panda), - 57 => Some(EntityKind::Parrot), - 58 => Some(EntityKind::Phantom), - 59 => Some(EntityKind::Pig), - 60 => Some(EntityKind::Piglin), - 61 => Some(EntityKind::PiglinBrute), - 62 => Some(EntityKind::Pillager), - 63 => Some(EntityKind::PolarBear), - 64 => Some(EntityKind::Tnt), - 65 => Some(EntityKind::Pufferfish), - 66 => Some(EntityKind::Rabbit), - 67 => Some(EntityKind::Ravager), - 68 => Some(EntityKind::Salmon), - 69 => Some(EntityKind::Sheep), - 70 => Some(EntityKind::Shulker), - 71 => Some(EntityKind::ShulkerBullet), - 72 => Some(EntityKind::Silverfish), - 73 => Some(EntityKind::Skeleton), - 74 => Some(EntityKind::SkeletonHorse), - 75 => Some(EntityKind::Slime), - 76 => Some(EntityKind::SmallFireball), - 77 => Some(EntityKind::SnowGolem), - 78 => Some(EntityKind::Snowball), - 79 => Some(EntityKind::SpectralArrow), - 80 => Some(EntityKind::Spider), - 81 => Some(EntityKind::Squid), - 82 => Some(EntityKind::Stray), - 83 => Some(EntityKind::Strider), - 84 => Some(EntityKind::Egg), - 85 => Some(EntityKind::EnderPearl), - 86 => Some(EntityKind::ExperienceBottle), - 87 => Some(EntityKind::Potion), - 88 => Some(EntityKind::Trident), - 89 => Some(EntityKind::TraderLlama), - 90 => Some(EntityKind::TropicalFish), - 91 => Some(EntityKind::Turtle), - 92 => Some(EntityKind::Vex), - 93 => Some(EntityKind::Villager), - 94 => Some(EntityKind::Vindicator), - 95 => Some(EntityKind::WanderingTrader), - 96 => Some(EntityKind::Witch), - 97 => Some(EntityKind::Wither), - 98 => Some(EntityKind::WitherSkeleton), - 99 => Some(EntityKind::WitherSkull), - 100 => Some(EntityKind::Wolf), - 101 => Some(EntityKind::Zoglin), - 102 => Some(EntityKind::Zombie), - 103 => Some(EntityKind::ZombieHorse), - 104 => Some(EntityKind::ZombieVillager), - 105 => Some(EntityKind::ZombifiedPiglin), - 106 => Some(EntityKind::Player), - 107 => Some(EntityKind::FishingBobber), - _ => None, +} +impl EntityKind { + #[doc = "Returns the `height` property of this `EntityKind`."] + #[inline] + pub fn height(&self) -> f32 { + match self { + EntityKind::AreaEffectCloud => 0.5f32, + EntityKind::ArmorStand => 1.975f32, + EntityKind::Arrow => 0.5f32, + EntityKind::Axolotl => 0.42f32, + EntityKind::Bat => 0.9f32, + EntityKind::Bee => 0.6f32, + EntityKind::Blaze => 1.8f32, + EntityKind::Boat => 0.5625f32, + EntityKind::Cat => 0.7f32, + EntityKind::CaveSpider => 0.5f32, + EntityKind::Chicken => 0.7f32, + EntityKind::Cod => 0.3f32, + EntityKind::Cow => 1.4f32, + EntityKind::Creeper => 1.7f32, + EntityKind::Dolphin => 0.6f32, + EntityKind::Donkey => 1.5f32, + EntityKind::DragonFireball => 1f32, + EntityKind::Drowned => 1.95f32, + EntityKind::ElderGuardian => 1.9975f32, + EntityKind::EndCrystal => 2f32, + EntityKind::EnderDragon => 8f32, + EntityKind::Enderman => 2.9f32, + EntityKind::Endermite => 0.3f32, + EntityKind::Evoker => 1.95f32, + EntityKind::EvokerFangs => 0.8f32, + EntityKind::ExperienceOrb => 0.5f32, + EntityKind::EyeOfEnder => 0.25f32, + EntityKind::FallingBlock => 0.98f32, + EntityKind::FireworkRocket => 0.25f32, + EntityKind::Fox => 0.7f32, + EntityKind::Ghast => 4f32, + EntityKind::Giant => 12f32, + EntityKind::GlowItemFrame => 0.5f32, + EntityKind::GlowSquid => 0.8f32, + EntityKind::Goat => 1.3f32, + EntityKind::Guardian => 0.85f32, + EntityKind::Hoglin => 1.4f32, + EntityKind::Horse => 1.6f32, + EntityKind::Husk => 1.95f32, + EntityKind::Illusioner => 1.95f32, + EntityKind::IronGolem => 2.7f32, + EntityKind::Item => 0.25f32, + EntityKind::ItemFrame => 0.5f32, + EntityKind::Fireball => 1f32, + EntityKind::LeashKnot => 0.5f32, + EntityKind::LightningBolt => 0f32, + EntityKind::Llama => 1.87f32, + EntityKind::LlamaSpit => 0.25f32, + EntityKind::MagmaCube => 2.04f32, + EntityKind::Marker => 0f32, + EntityKind::Minecart => 0.7f32, + EntityKind::ChestMinecart => 0.7f32, + EntityKind::CommandBlockMinecart => 0.7f32, + EntityKind::FurnaceMinecart => 0.7f32, + EntityKind::HopperMinecart => 0.7f32, + EntityKind::SpawnerMinecart => 0.7f32, + EntityKind::TntMinecart => 0.7f32, + EntityKind::Mule => 1.6f32, + EntityKind::Mooshroom => 1.4f32, + EntityKind::Ocelot => 0.7f32, + EntityKind::Painting => 0.5f32, + EntityKind::Panda => 1.25f32, + EntityKind::Parrot => 0.9f32, + EntityKind::Phantom => 0.5f32, + EntityKind::Pig => 0.9f32, + EntityKind::Piglin => 1.95f32, + EntityKind::PiglinBrute => 1.95f32, + EntityKind::Pillager => 1.95f32, + EntityKind::PolarBear => 1.4f32, + EntityKind::Tnt => 0.98f32, + EntityKind::Pufferfish => 0.7f32, + EntityKind::Rabbit => 0.5f32, + EntityKind::Ravager => 2.2f32, + EntityKind::Salmon => 0.4f32, + EntityKind::Sheep => 1.3f32, + EntityKind::Shulker => 1f32, + EntityKind::ShulkerBullet => 0.3125f32, + EntityKind::Silverfish => 0.3f32, + EntityKind::Skeleton => 1.99f32, + EntityKind::SkeletonHorse => 1.6f32, + EntityKind::Slime => 2.04f32, + EntityKind::SmallFireball => 0.3125f32, + EntityKind::SnowGolem => 1.9f32, + EntityKind::Snowball => 0.25f32, + EntityKind::SpectralArrow => 0.5f32, + EntityKind::Spider => 0.9f32, + EntityKind::Squid => 0.8f32, + EntityKind::Stray => 1.99f32, + EntityKind::Strider => 1.7f32, + EntityKind::Egg => 0.25f32, + EntityKind::EnderPearl => 0.25f32, + EntityKind::ExperienceBottle => 0.25f32, + EntityKind::Potion => 0.25f32, + EntityKind::Trident => 0.5f32, + EntityKind::TraderLlama => 1.87f32, + EntityKind::TropicalFish => 0.4f32, + EntityKind::Turtle => 0.4f32, + EntityKind::Vex => 0.8f32, + EntityKind::Villager => 1.95f32, + EntityKind::Vindicator => 1.95f32, + EntityKind::WanderingTrader => 1.95f32, + EntityKind::Witch => 1.95f32, + EntityKind::Wither => 3.5f32, + EntityKind::WitherSkeleton => 2.4f32, + EntityKind::WitherSkull => 0.3125f32, + EntityKind::Wolf => 0.85f32, + EntityKind::Zoglin => 1.4f32, + EntityKind::Zombie => 1.95f32, + EntityKind::ZombieHorse => 1.6f32, + EntityKind::ZombieVillager => 1.95f32, + EntityKind::ZombifiedPiglin => 1.95f32, + EntityKind::Player => 1.8f32, + EntityKind::FishingBobber => 0.25f32, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl EntityKind { - /// Returns the `name` property of this `EntityKind`. + #[doc = "Returns the `name` property of this `EntityKind`."] + #[inline] pub fn name(&self) -> &'static str { match self { EntityKind::AreaEffectCloud => "area_effect_cloud", EntityKind::ArmorStand => "armor_stand", EntityKind::Arrow => "arrow", + EntityKind::Axolotl => "axolotl", EntityKind::Bat => "bat", EntityKind::Bee => "bee", EntityKind::Blaze => "blaze", @@ -613,6 +770,9 @@ impl EntityKind { EntityKind::Fox => "fox", EntityKind::Ghast => "ghast", EntityKind::Giant => "giant", + EntityKind::GlowItemFrame => "glow_item_frame", + EntityKind::GlowSquid => "glow_squid", + EntityKind::Goat => "goat", EntityKind::Guardian => "guardian", EntityKind::Hoglin => "hoglin", EntityKind::Horse => "horse", @@ -627,6 +787,7 @@ impl EntityKind { EntityKind::Llama => "llama", EntityKind::LlamaSpit => "llama_spit", EntityKind::MagmaCube => "magma_cube", + EntityKind::Marker => "marker", EntityKind::Minecart => "minecart", EntityKind::ChestMinecart => "chest_minecart", EntityKind::CommandBlockMinecart => "command_block_minecart", @@ -692,13 +853,14 @@ impl EntityKind { EntityKind::FishingBobber => "fishing_bobber", } } - - /// Gets a `EntityKind` by its `name`. + #[doc = "Gets a `EntityKind` by its `name`."] + #[inline] pub fn from_name(name: &str) -> Option { match name { "area_effect_cloud" => Some(EntityKind::AreaEffectCloud), "armor_stand" => Some(EntityKind::ArmorStand), "arrow" => Some(EntityKind::Arrow), + "axolotl" => Some(EntityKind::Axolotl), "bat" => Some(EntityKind::Bat), "bee" => Some(EntityKind::Bee), "blaze" => Some(EntityKind::Blaze), @@ -727,6 +889,9 @@ impl EntityKind { "fox" => Some(EntityKind::Fox), "ghast" => Some(EntityKind::Ghast), "giant" => Some(EntityKind::Giant), + "glow_item_frame" => Some(EntityKind::GlowItemFrame), + "glow_squid" => Some(EntityKind::GlowSquid), + "goat" => Some(EntityKind::Goat), "guardian" => Some(EntityKind::Guardian), "hoglin" => Some(EntityKind::Hoglin), "horse" => Some(EntityKind::Horse), @@ -741,6 +906,7 @@ impl EntityKind { "llama" => Some(EntityKind::Llama), "llama_spit" => Some(EntityKind::LlamaSpit), "magma_cube" => Some(EntityKind::MagmaCube), + "marker" => Some(EntityKind::Marker), "minecart" => Some(EntityKind::Minecart), "chest_minecart" => Some(EntityKind::ChestMinecart), "command_block_minecart" => Some(EntityKind::CommandBlockMinecart), @@ -808,676 +974,271 @@ impl EntityKind { } } } -#[allow(warnings)] -#[allow(clippy::all)] impl EntityKind { - /// Returns the `display_name` property of this `EntityKind`. - pub fn display_name(&self) -> &'static str { + #[doc = "Returns the `namespaced_id` property of this `EntityKind`."] + #[inline] + pub fn namespaced_id(&self) -> &'static str { match self { - EntityKind::AreaEffectCloud => "Area Effect Cloud", - EntityKind::ArmorStand => "Armor Stand", - EntityKind::Arrow => "Arrow", - EntityKind::Bat => "Bat", - EntityKind::Bee => "Bee", - EntityKind::Blaze => "Blaze", - EntityKind::Boat => "Boat", - EntityKind::Cat => "Cat", - EntityKind::CaveSpider => "Cave Spider", - EntityKind::Chicken => "Chicken", - EntityKind::Cod => "Cod", - EntityKind::Cow => "Cow", - EntityKind::Creeper => "Creeper", - EntityKind::Dolphin => "Dolphin", - EntityKind::Donkey => "Donkey", - EntityKind::DragonFireball => "Dragon Fireball", - EntityKind::Drowned => "Drowned", - EntityKind::ElderGuardian => "Elder Guardian", - EntityKind::EndCrystal => "End Crystal", - EntityKind::EnderDragon => "Ender Dragon", - EntityKind::Enderman => "Enderman", - EntityKind::Endermite => "Endermite", - EntityKind::Evoker => "Evoker", - EntityKind::EvokerFangs => "Evoker Fangs", - EntityKind::ExperienceOrb => "Experience Orb", - EntityKind::EyeOfEnder => "Eye of Ender", - EntityKind::FallingBlock => "Falling Block", - EntityKind::FireworkRocket => "Firework Rocket", - EntityKind::Fox => "Fox", - EntityKind::Ghast => "Ghast", - EntityKind::Giant => "Giant", - EntityKind::Guardian => "Guardian", - EntityKind::Hoglin => "Hoglin", - EntityKind::Horse => "Horse", - EntityKind::Husk => "Husk", - EntityKind::Illusioner => "Illusioner", - EntityKind::IronGolem => "Iron Golem", - EntityKind::Item => "Item", - EntityKind::ItemFrame => "Item Frame", - EntityKind::Fireball => "Fireball", - EntityKind::LeashKnot => "Leash Knot", - EntityKind::LightningBolt => "Lightning Bolt", - EntityKind::Llama => "Llama", - EntityKind::LlamaSpit => "Llama Spit", - EntityKind::MagmaCube => "Magma Cube", - EntityKind::Minecart => "Minecart", - EntityKind::ChestMinecart => "Minecart with Chest", - EntityKind::CommandBlockMinecart => "Minecart with Command Block", - EntityKind::FurnaceMinecart => "Minecart with Furnace", - EntityKind::HopperMinecart => "Minecart with Hopper", - EntityKind::SpawnerMinecart => "Minecart with Spawner", - EntityKind::TntMinecart => "Minecart with TNT", - EntityKind::Mule => "Mule", - EntityKind::Mooshroom => "Mooshroom", - EntityKind::Ocelot => "Ocelot", - EntityKind::Painting => "Painting", - EntityKind::Panda => "Panda", - EntityKind::Parrot => "Parrot", - EntityKind::Phantom => "Phantom", - EntityKind::Pig => "Pig", - EntityKind::Piglin => "Piglin", - EntityKind::PiglinBrute => "Piglin Brute", - EntityKind::Pillager => "Pillager", - EntityKind::PolarBear => "Polar Bear", - EntityKind::Tnt => "Primed TNT", - EntityKind::Pufferfish => "Pufferfish", - EntityKind::Rabbit => "Rabbit", - EntityKind::Ravager => "Ravager", - EntityKind::Salmon => "Salmon", - EntityKind::Sheep => "Sheep", - EntityKind::Shulker => "Shulker", - EntityKind::ShulkerBullet => "Shulker Bullet", - EntityKind::Silverfish => "Silverfish", - EntityKind::Skeleton => "Skeleton", - EntityKind::SkeletonHorse => "Skeleton Horse", - EntityKind::Slime => "Slime", - EntityKind::SmallFireball => "Small Fireball", - EntityKind::SnowGolem => "Snow Golem", - EntityKind::Snowball => "Snowball", - EntityKind::SpectralArrow => "Spectral Arrow", - EntityKind::Spider => "Spider", - EntityKind::Squid => "Squid", - EntityKind::Stray => "Stray", - EntityKind::Strider => "Strider", - EntityKind::Egg => "Thrown Egg", - EntityKind::EnderPearl => "Thrown Ender Pearl", - EntityKind::ExperienceBottle => "Thrown Bottle o' Enchanting", - EntityKind::Potion => "Potion", - EntityKind::Trident => "Trident", - EntityKind::TraderLlama => "Trader Llama", - EntityKind::TropicalFish => "Tropical Fish", - EntityKind::Turtle => "Turtle", - EntityKind::Vex => "Vex", - EntityKind::Villager => "Villager", - EntityKind::Vindicator => "Vindicator", - EntityKind::WanderingTrader => "Wandering Trader", - EntityKind::Witch => "Witch", - EntityKind::Wither => "Wither", - EntityKind::WitherSkeleton => "Wither Skeleton", - EntityKind::WitherSkull => "Wither Skull", - EntityKind::Wolf => "Wolf", - EntityKind::Zoglin => "Zoglin", - EntityKind::Zombie => "Zombie", - EntityKind::ZombieHorse => "Zombie Horse", - EntityKind::ZombieVillager => "Zombie Villager", - EntityKind::ZombifiedPiglin => "Zombified Piglin", - EntityKind::Player => "Player", - EntityKind::FishingBobber => "Fishing Bobber", + EntityKind::AreaEffectCloud => "minecraft:area_effect_cloud", + EntityKind::ArmorStand => "minecraft:armor_stand", + EntityKind::Arrow => "minecraft:arrow", + EntityKind::Axolotl => "minecraft:axolotl", + EntityKind::Bat => "minecraft:bat", + EntityKind::Bee => "minecraft:bee", + EntityKind::Blaze => "minecraft:blaze", + EntityKind::Boat => "minecraft:boat", + EntityKind::Cat => "minecraft:cat", + EntityKind::CaveSpider => "minecraft:cave_spider", + EntityKind::Chicken => "minecraft:chicken", + EntityKind::Cod => "minecraft:cod", + EntityKind::Cow => "minecraft:cow", + EntityKind::Creeper => "minecraft:creeper", + EntityKind::Dolphin => "minecraft:dolphin", + EntityKind::Donkey => "minecraft:donkey", + EntityKind::DragonFireball => "minecraft:dragon_fireball", + EntityKind::Drowned => "minecraft:drowned", + EntityKind::ElderGuardian => "minecraft:elder_guardian", + EntityKind::EndCrystal => "minecraft:end_crystal", + EntityKind::EnderDragon => "minecraft:ender_dragon", + EntityKind::Enderman => "minecraft:enderman", + EntityKind::Endermite => "minecraft:endermite", + EntityKind::Evoker => "minecraft:evoker", + EntityKind::EvokerFangs => "minecraft:evoker_fangs", + EntityKind::ExperienceOrb => "minecraft:experience_orb", + EntityKind::EyeOfEnder => "minecraft:eye_of_ender", + EntityKind::FallingBlock => "minecraft:falling_block", + EntityKind::FireworkRocket => "minecraft:firework_rocket", + EntityKind::Fox => "minecraft:fox", + EntityKind::Ghast => "minecraft:ghast", + EntityKind::Giant => "minecraft:giant", + EntityKind::GlowItemFrame => "minecraft:glow_item_frame", + EntityKind::GlowSquid => "minecraft:glow_squid", + EntityKind::Goat => "minecraft:goat", + EntityKind::Guardian => "minecraft:guardian", + EntityKind::Hoglin => "minecraft:hoglin", + EntityKind::Horse => "minecraft:horse", + EntityKind::Husk => "minecraft:husk", + EntityKind::Illusioner => "minecraft:illusioner", + EntityKind::IronGolem => "minecraft:iron_golem", + EntityKind::Item => "minecraft:item", + EntityKind::ItemFrame => "minecraft:item_frame", + EntityKind::Fireball => "minecraft:fireball", + EntityKind::LeashKnot => "minecraft:leash_knot", + EntityKind::LightningBolt => "minecraft:lightning_bolt", + EntityKind::Llama => "minecraft:llama", + EntityKind::LlamaSpit => "minecraft:llama_spit", + EntityKind::MagmaCube => "minecraft:magma_cube", + EntityKind::Marker => "minecraft:marker", + EntityKind::Minecart => "minecraft:minecart", + EntityKind::ChestMinecart => "minecraft:chest_minecart", + EntityKind::CommandBlockMinecart => "minecraft:command_block_minecart", + EntityKind::FurnaceMinecart => "minecraft:furnace_minecart", + EntityKind::HopperMinecart => "minecraft:hopper_minecart", + EntityKind::SpawnerMinecart => "minecraft:spawner_minecart", + EntityKind::TntMinecart => "minecraft:tnt_minecart", + EntityKind::Mule => "minecraft:mule", + EntityKind::Mooshroom => "minecraft:mooshroom", + EntityKind::Ocelot => "minecraft:ocelot", + EntityKind::Painting => "minecraft:painting", + EntityKind::Panda => "minecraft:panda", + EntityKind::Parrot => "minecraft:parrot", + EntityKind::Phantom => "minecraft:phantom", + EntityKind::Pig => "minecraft:pig", + EntityKind::Piglin => "minecraft:piglin", + EntityKind::PiglinBrute => "minecraft:piglin_brute", + EntityKind::Pillager => "minecraft:pillager", + EntityKind::PolarBear => "minecraft:polar_bear", + EntityKind::Tnt => "minecraft:tnt", + EntityKind::Pufferfish => "minecraft:pufferfish", + EntityKind::Rabbit => "minecraft:rabbit", + EntityKind::Ravager => "minecraft:ravager", + EntityKind::Salmon => "minecraft:salmon", + EntityKind::Sheep => "minecraft:sheep", + EntityKind::Shulker => "minecraft:shulker", + EntityKind::ShulkerBullet => "minecraft:shulker_bullet", + EntityKind::Silverfish => "minecraft:silverfish", + EntityKind::Skeleton => "minecraft:skeleton", + EntityKind::SkeletonHorse => "minecraft:skeleton_horse", + EntityKind::Slime => "minecraft:slime", + EntityKind::SmallFireball => "minecraft:small_fireball", + EntityKind::SnowGolem => "minecraft:snow_golem", + EntityKind::Snowball => "minecraft:snowball", + EntityKind::SpectralArrow => "minecraft:spectral_arrow", + EntityKind::Spider => "minecraft:spider", + EntityKind::Squid => "minecraft:squid", + EntityKind::Stray => "minecraft:stray", + EntityKind::Strider => "minecraft:strider", + EntityKind::Egg => "minecraft:egg", + EntityKind::EnderPearl => "minecraft:ender_pearl", + EntityKind::ExperienceBottle => "minecraft:experience_bottle", + EntityKind::Potion => "minecraft:potion", + EntityKind::Trident => "minecraft:trident", + EntityKind::TraderLlama => "minecraft:trader_llama", + EntityKind::TropicalFish => "minecraft:tropical_fish", + EntityKind::Turtle => "minecraft:turtle", + EntityKind::Vex => "minecraft:vex", + EntityKind::Villager => "minecraft:villager", + EntityKind::Vindicator => "minecraft:vindicator", + EntityKind::WanderingTrader => "minecraft:wandering_trader", + EntityKind::Witch => "minecraft:witch", + EntityKind::Wither => "minecraft:wither", + EntityKind::WitherSkeleton => "minecraft:wither_skeleton", + EntityKind::WitherSkull => "minecraft:wither_skull", + EntityKind::Wolf => "minecraft:wolf", + EntityKind::Zoglin => "minecraft:zoglin", + EntityKind::Zombie => "minecraft:zombie", + EntityKind::ZombieHorse => "minecraft:zombie_horse", + EntityKind::ZombieVillager => "minecraft:zombie_villager", + EntityKind::ZombifiedPiglin => "minecraft:zombified_piglin", + EntityKind::Player => "minecraft:player", + EntityKind::FishingBobber => "minecraft:fishing_bobber", } } - - /// Gets a `EntityKind` by its `display_name`. - pub fn from_display_name(display_name: &str) -> Option { - match display_name { - "Area Effect Cloud" => Some(EntityKind::AreaEffectCloud), - "Armor Stand" => Some(EntityKind::ArmorStand), - "Arrow" => Some(EntityKind::Arrow), - "Bat" => Some(EntityKind::Bat), - "Bee" => Some(EntityKind::Bee), - "Blaze" => Some(EntityKind::Blaze), - "Boat" => Some(EntityKind::Boat), - "Cat" => Some(EntityKind::Cat), - "Cave Spider" => Some(EntityKind::CaveSpider), - "Chicken" => Some(EntityKind::Chicken), - "Cod" => Some(EntityKind::Cod), - "Cow" => Some(EntityKind::Cow), - "Creeper" => Some(EntityKind::Creeper), - "Dolphin" => Some(EntityKind::Dolphin), - "Donkey" => Some(EntityKind::Donkey), - "Dragon Fireball" => Some(EntityKind::DragonFireball), - "Drowned" => Some(EntityKind::Drowned), - "Elder Guardian" => Some(EntityKind::ElderGuardian), - "End Crystal" => Some(EntityKind::EndCrystal), - "Ender Dragon" => Some(EntityKind::EnderDragon), - "Enderman" => Some(EntityKind::Enderman), - "Endermite" => Some(EntityKind::Endermite), - "Evoker" => Some(EntityKind::Evoker), - "Evoker Fangs" => Some(EntityKind::EvokerFangs), - "Experience Orb" => Some(EntityKind::ExperienceOrb), - "Eye of Ender" => Some(EntityKind::EyeOfEnder), - "Falling Block" => Some(EntityKind::FallingBlock), - "Firework Rocket" => Some(EntityKind::FireworkRocket), - "Fox" => Some(EntityKind::Fox), - "Ghast" => Some(EntityKind::Ghast), - "Giant" => Some(EntityKind::Giant), - "Guardian" => Some(EntityKind::Guardian), - "Hoglin" => Some(EntityKind::Hoglin), - "Horse" => Some(EntityKind::Horse), - "Husk" => Some(EntityKind::Husk), - "Illusioner" => Some(EntityKind::Illusioner), - "Iron Golem" => Some(EntityKind::IronGolem), - "Item" => Some(EntityKind::Item), - "Item Frame" => Some(EntityKind::ItemFrame), - "Fireball" => Some(EntityKind::Fireball), - "Leash Knot" => Some(EntityKind::LeashKnot), - "Lightning Bolt" => Some(EntityKind::LightningBolt), - "Llama" => Some(EntityKind::Llama), - "Llama Spit" => Some(EntityKind::LlamaSpit), - "Magma Cube" => Some(EntityKind::MagmaCube), - "Minecart" => Some(EntityKind::Minecart), - "Minecart with Chest" => Some(EntityKind::ChestMinecart), - "Minecart with Command Block" => Some(EntityKind::CommandBlockMinecart), - "Minecart with Furnace" => Some(EntityKind::FurnaceMinecart), - "Minecart with Hopper" => Some(EntityKind::HopperMinecart), - "Minecart with Spawner" => Some(EntityKind::SpawnerMinecart), - "Minecart with TNT" => Some(EntityKind::TntMinecart), - "Mule" => Some(EntityKind::Mule), - "Mooshroom" => Some(EntityKind::Mooshroom), - "Ocelot" => Some(EntityKind::Ocelot), - "Painting" => Some(EntityKind::Painting), - "Panda" => Some(EntityKind::Panda), - "Parrot" => Some(EntityKind::Parrot), - "Phantom" => Some(EntityKind::Phantom), - "Pig" => Some(EntityKind::Pig), - "Piglin" => Some(EntityKind::Piglin), - "Piglin Brute" => Some(EntityKind::PiglinBrute), - "Pillager" => Some(EntityKind::Pillager), - "Polar Bear" => Some(EntityKind::PolarBear), - "Primed TNT" => Some(EntityKind::Tnt), - "Pufferfish" => Some(EntityKind::Pufferfish), - "Rabbit" => Some(EntityKind::Rabbit), - "Ravager" => Some(EntityKind::Ravager), - "Salmon" => Some(EntityKind::Salmon), - "Sheep" => Some(EntityKind::Sheep), - "Shulker" => Some(EntityKind::Shulker), - "Shulker Bullet" => Some(EntityKind::ShulkerBullet), - "Silverfish" => Some(EntityKind::Silverfish), - "Skeleton" => Some(EntityKind::Skeleton), - "Skeleton Horse" => Some(EntityKind::SkeletonHorse), - "Slime" => Some(EntityKind::Slime), - "Small Fireball" => Some(EntityKind::SmallFireball), - "Snow Golem" => Some(EntityKind::SnowGolem), - "Snowball" => Some(EntityKind::Snowball), - "Spectral Arrow" => Some(EntityKind::SpectralArrow), - "Spider" => Some(EntityKind::Spider), - "Squid" => Some(EntityKind::Squid), - "Stray" => Some(EntityKind::Stray), - "Strider" => Some(EntityKind::Strider), - "Thrown Egg" => Some(EntityKind::Egg), - "Thrown Ender Pearl" => Some(EntityKind::EnderPearl), - "Thrown Bottle o' Enchanting" => Some(EntityKind::ExperienceBottle), - "Potion" => Some(EntityKind::Potion), - "Trident" => Some(EntityKind::Trident), - "Trader Llama" => Some(EntityKind::TraderLlama), - "Tropical Fish" => Some(EntityKind::TropicalFish), - "Turtle" => Some(EntityKind::Turtle), - "Vex" => Some(EntityKind::Vex), - "Villager" => Some(EntityKind::Villager), - "Vindicator" => Some(EntityKind::Vindicator), - "Wandering Trader" => Some(EntityKind::WanderingTrader), - "Witch" => Some(EntityKind::Witch), - "Wither" => Some(EntityKind::Wither), - "Wither Skeleton" => Some(EntityKind::WitherSkeleton), - "Wither Skull" => Some(EntityKind::WitherSkull), - "Wolf" => Some(EntityKind::Wolf), - "Zoglin" => Some(EntityKind::Zoglin), - "Zombie" => Some(EntityKind::Zombie), - "Zombie Horse" => Some(EntityKind::ZombieHorse), - "Zombie Villager" => Some(EntityKind::ZombieVillager), - "Zombified Piglin" => Some(EntityKind::ZombifiedPiglin), - "Player" => Some(EntityKind::Player), - "Fishing Bobber" => Some(EntityKind::FishingBobber), + #[doc = "Gets a `EntityKind` by its `namespaced_id`."] + #[inline] + pub fn from_namespaced_id(namespaced_id: &str) -> Option { + match namespaced_id { + "minecraft:area_effect_cloud" => Some(EntityKind::AreaEffectCloud), + "minecraft:armor_stand" => Some(EntityKind::ArmorStand), + "minecraft:arrow" => Some(EntityKind::Arrow), + "minecraft:axolotl" => Some(EntityKind::Axolotl), + "minecraft:bat" => Some(EntityKind::Bat), + "minecraft:bee" => Some(EntityKind::Bee), + "minecraft:blaze" => Some(EntityKind::Blaze), + "minecraft:boat" => Some(EntityKind::Boat), + "minecraft:cat" => Some(EntityKind::Cat), + "minecraft:cave_spider" => Some(EntityKind::CaveSpider), + "minecraft:chicken" => Some(EntityKind::Chicken), + "minecraft:cod" => Some(EntityKind::Cod), + "minecraft:cow" => Some(EntityKind::Cow), + "minecraft:creeper" => Some(EntityKind::Creeper), + "minecraft:dolphin" => Some(EntityKind::Dolphin), + "minecraft:donkey" => Some(EntityKind::Donkey), + "minecraft:dragon_fireball" => Some(EntityKind::DragonFireball), + "minecraft:drowned" => Some(EntityKind::Drowned), + "minecraft:elder_guardian" => Some(EntityKind::ElderGuardian), + "minecraft:end_crystal" => Some(EntityKind::EndCrystal), + "minecraft:ender_dragon" => Some(EntityKind::EnderDragon), + "minecraft:enderman" => Some(EntityKind::Enderman), + "minecraft:endermite" => Some(EntityKind::Endermite), + "minecraft:evoker" => Some(EntityKind::Evoker), + "minecraft:evoker_fangs" => Some(EntityKind::EvokerFangs), + "minecraft:experience_orb" => Some(EntityKind::ExperienceOrb), + "minecraft:eye_of_ender" => Some(EntityKind::EyeOfEnder), + "minecraft:falling_block" => Some(EntityKind::FallingBlock), + "minecraft:firework_rocket" => Some(EntityKind::FireworkRocket), + "minecraft:fox" => Some(EntityKind::Fox), + "minecraft:ghast" => Some(EntityKind::Ghast), + "minecraft:giant" => Some(EntityKind::Giant), + "minecraft:glow_item_frame" => Some(EntityKind::GlowItemFrame), + "minecraft:glow_squid" => Some(EntityKind::GlowSquid), + "minecraft:goat" => Some(EntityKind::Goat), + "minecraft:guardian" => Some(EntityKind::Guardian), + "minecraft:hoglin" => Some(EntityKind::Hoglin), + "minecraft:horse" => Some(EntityKind::Horse), + "minecraft:husk" => Some(EntityKind::Husk), + "minecraft:illusioner" => Some(EntityKind::Illusioner), + "minecraft:iron_golem" => Some(EntityKind::IronGolem), + "minecraft:item" => Some(EntityKind::Item), + "minecraft:item_frame" => Some(EntityKind::ItemFrame), + "minecraft:fireball" => Some(EntityKind::Fireball), + "minecraft:leash_knot" => Some(EntityKind::LeashKnot), + "minecraft:lightning_bolt" => Some(EntityKind::LightningBolt), + "minecraft:llama" => Some(EntityKind::Llama), + "minecraft:llama_spit" => Some(EntityKind::LlamaSpit), + "minecraft:magma_cube" => Some(EntityKind::MagmaCube), + "minecraft:marker" => Some(EntityKind::Marker), + "minecraft:minecart" => Some(EntityKind::Minecart), + "minecraft:chest_minecart" => Some(EntityKind::ChestMinecart), + "minecraft:command_block_minecart" => Some(EntityKind::CommandBlockMinecart), + "minecraft:furnace_minecart" => Some(EntityKind::FurnaceMinecart), + "minecraft:hopper_minecart" => Some(EntityKind::HopperMinecart), + "minecraft:spawner_minecart" => Some(EntityKind::SpawnerMinecart), + "minecraft:tnt_minecart" => Some(EntityKind::TntMinecart), + "minecraft:mule" => Some(EntityKind::Mule), + "minecraft:mooshroom" => Some(EntityKind::Mooshroom), + "minecraft:ocelot" => Some(EntityKind::Ocelot), + "minecraft:painting" => Some(EntityKind::Painting), + "minecraft:panda" => Some(EntityKind::Panda), + "minecraft:parrot" => Some(EntityKind::Parrot), + "minecraft:phantom" => Some(EntityKind::Phantom), + "minecraft:pig" => Some(EntityKind::Pig), + "minecraft:piglin" => Some(EntityKind::Piglin), + "minecraft:piglin_brute" => Some(EntityKind::PiglinBrute), + "minecraft:pillager" => Some(EntityKind::Pillager), + "minecraft:polar_bear" => Some(EntityKind::PolarBear), + "minecraft:tnt" => Some(EntityKind::Tnt), + "minecraft:pufferfish" => Some(EntityKind::Pufferfish), + "minecraft:rabbit" => Some(EntityKind::Rabbit), + "minecraft:ravager" => Some(EntityKind::Ravager), + "minecraft:salmon" => Some(EntityKind::Salmon), + "minecraft:sheep" => Some(EntityKind::Sheep), + "minecraft:shulker" => Some(EntityKind::Shulker), + "minecraft:shulker_bullet" => Some(EntityKind::ShulkerBullet), + "minecraft:silverfish" => Some(EntityKind::Silverfish), + "minecraft:skeleton" => Some(EntityKind::Skeleton), + "minecraft:skeleton_horse" => Some(EntityKind::SkeletonHorse), + "minecraft:slime" => Some(EntityKind::Slime), + "minecraft:small_fireball" => Some(EntityKind::SmallFireball), + "minecraft:snow_golem" => Some(EntityKind::SnowGolem), + "minecraft:snowball" => Some(EntityKind::Snowball), + "minecraft:spectral_arrow" => Some(EntityKind::SpectralArrow), + "minecraft:spider" => Some(EntityKind::Spider), + "minecraft:squid" => Some(EntityKind::Squid), + "minecraft:stray" => Some(EntityKind::Stray), + "minecraft:strider" => Some(EntityKind::Strider), + "minecraft:egg" => Some(EntityKind::Egg), + "minecraft:ender_pearl" => Some(EntityKind::EnderPearl), + "minecraft:experience_bottle" => Some(EntityKind::ExperienceBottle), + "minecraft:potion" => Some(EntityKind::Potion), + "minecraft:trident" => Some(EntityKind::Trident), + "minecraft:trader_llama" => Some(EntityKind::TraderLlama), + "minecraft:tropical_fish" => Some(EntityKind::TropicalFish), + "minecraft:turtle" => Some(EntityKind::Turtle), + "minecraft:vex" => Some(EntityKind::Vex), + "minecraft:villager" => Some(EntityKind::Villager), + "minecraft:vindicator" => Some(EntityKind::Vindicator), + "minecraft:wandering_trader" => Some(EntityKind::WanderingTrader), + "minecraft:witch" => Some(EntityKind::Witch), + "minecraft:wither" => Some(EntityKind::Wither), + "minecraft:wither_skeleton" => Some(EntityKind::WitherSkeleton), + "minecraft:wither_skull" => Some(EntityKind::WitherSkull), + "minecraft:wolf" => Some(EntityKind::Wolf), + "minecraft:zoglin" => Some(EntityKind::Zoglin), + "minecraft:zombie" => Some(EntityKind::Zombie), + "minecraft:zombie_horse" => Some(EntityKind::ZombieHorse), + "minecraft:zombie_villager" => Some(EntityKind::ZombieVillager), + "minecraft:zombified_piglin" => Some(EntityKind::ZombifiedPiglin), + "minecraft:player" => Some(EntityKind::Player), + "minecraft:fishing_bobber" => Some(EntityKind::FishingBobber), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] -impl EntityKind { - /// Returns the `bounding_box` property of this `EntityKind`. - pub fn bounding_box(&self) -> vek::Aabb { - match self { - EntityKind::AreaEffectCloud => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(6 as f64, 0.5 as f64, 6 as f64), - }, - EntityKind::ArmorStand => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 1.975 as f64, 0.5 as f64), - }, - EntityKind::Arrow => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::Bat => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.9 as f64, 0.5 as f64), - }, - EntityKind::Bee => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 0.6 as f64, 0.7 as f64), - }, - EntityKind::Blaze => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.8 as f64, 0.6 as f64), - }, - EntityKind::Boat => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.375 as f64, 0.5625 as f64, 1.375 as f64), - }, - EntityKind::Cat => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 0.7 as f64, 0.6 as f64), - }, - EntityKind::CaveSpider => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 0.5 as f64, 0.7 as f64), - }, - EntityKind::Chicken => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.4 as f64, 0.7 as f64, 0.4 as f64), - }, - EntityKind::Cod => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.3 as f64, 0.5 as f64), - }, - EntityKind::Cow => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.4 as f64, 0.9 as f64), - }, - EntityKind::Creeper => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.7 as f64, 0.6 as f64), - }, - EntityKind::Dolphin => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 0.6 as f64, 0.9 as f64), - }, - EntityKind::Donkey => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.5 as f64, 1.39648 as f64), - }, - EntityKind::DragonFireball => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1 as f64, 1 as f64, 1 as f64), - }, - EntityKind::Drowned => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::ElderGuardian => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.9975 as f64, 1.9975 as f64, 1.9975 as f64), - }, - EntityKind::EndCrystal => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(2 as f64, 2 as f64, 2 as f64), - }, - EntityKind::EnderDragon => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(16 as f64, 8 as f64, 16 as f64), - }, - EntityKind::Enderman => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 2.9 as f64, 0.6 as f64), - }, - EntityKind::Endermite => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.4 as f64, 0.3 as f64, 0.4 as f64), - }, - EntityKind::Evoker => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::EvokerFangs => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.8 as f64, 0.5 as f64), - }, - EntityKind::ExperienceOrb => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::EyeOfEnder => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::FallingBlock => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.98 as f64, 0.98 as f64), - }, - EntityKind::FireworkRocket => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::Fox => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 0.7 as f64, 0.6 as f64), - }, - EntityKind::Ghast => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(4 as f64, 4 as f64, 4 as f64), - }, - EntityKind::Giant => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(3.6 as f64, 12 as f64, 3.6 as f64), - }, - EntityKind::Guardian => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.85 as f64, 0.85 as f64, 0.85 as f64), - }, - EntityKind::Hoglin => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.4 as f64, 1.39648 as f64), - }, - EntityKind::Horse => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.6 as f64, 1.39648 as f64), - }, - EntityKind::Husk => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Illusioner => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::IronGolem => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.4 as f64, 2.7 as f64, 1.4 as f64), - }, - EntityKind::Item => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::ItemFrame => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::Fireball => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1 as f64, 1 as f64, 1 as f64), - }, - EntityKind::LeashKnot => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::LightningBolt => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0 as f64, 0 as f64, 0 as f64), - }, - EntityKind::Llama => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.87 as f64, 0.9 as f64), - }, - EntityKind::LlamaSpit => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::MagmaCube => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(2.04 as f64, 2.04 as f64, 2.04 as f64), - }, - EntityKind::Minecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::ChestMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::CommandBlockMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::FurnaceMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::HopperMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::SpawnerMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::TntMinecart => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.7 as f64, 0.98 as f64), - }, - EntityKind::Mule => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.6 as f64, 1.39648 as f64), - }, - EntityKind::Mooshroom => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.4 as f64, 0.9 as f64), - }, - EntityKind::Ocelot => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 0.7 as f64, 0.6 as f64), - }, - EntityKind::Painting => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::Panda => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.3 as f64, 1.25 as f64, 1.3 as f64), - }, - EntityKind::Parrot => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.9 as f64, 0.5 as f64), - }, - EntityKind::Phantom => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 0.5 as f64, 0.9 as f64), - }, - EntityKind::Pig => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 0.9 as f64, 0.9 as f64), - }, - EntityKind::Piglin => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::PiglinBrute => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Pillager => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::PolarBear => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.4 as f64, 1.4 as f64, 1.4 as f64), - }, - EntityKind::Tnt => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.98 as f64, 0.98 as f64, 0.98 as f64), - }, - EntityKind::Pufferfish => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 0.7 as f64, 0.7 as f64), - }, - EntityKind::Rabbit => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.4 as f64, 0.5 as f64, 0.4 as f64), - }, - EntityKind::Ravager => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.95 as f64, 2.2 as f64, 1.95 as f64), - }, - EntityKind::Salmon => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 0.4 as f64, 0.7 as f64), - }, - EntityKind::Sheep => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.3 as f64, 0.9 as f64), - }, - EntityKind::Shulker => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1 as f64, 1 as f64, 1 as f64), - }, - EntityKind::ShulkerBullet => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.3125 as f64, 0.3125 as f64, 0.3125 as f64), - }, - EntityKind::Silverfish => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.4 as f64, 0.3 as f64, 0.4 as f64), - }, - EntityKind::Skeleton => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.99 as f64, 0.6 as f64), - }, - EntityKind::SkeletonHorse => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.6 as f64, 1.39648 as f64), - }, - EntityKind::Slime => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(2.04 as f64, 2.04 as f64, 2.04 as f64), - }, - EntityKind::SmallFireball => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.3125 as f64, 0.3125 as f64, 0.3125 as f64), - }, - EntityKind::SnowGolem => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 1.9 as f64, 0.7 as f64), - }, - EntityKind::Snowball => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::SpectralArrow => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::Spider => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.4 as f64, 0.9 as f64, 1.4 as f64), - }, - EntityKind::Squid => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.8 as f64, 0.8 as f64, 0.8 as f64), - }, - EntityKind::Stray => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.99 as f64, 0.6 as f64), - }, - EntityKind::Strider => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.7 as f64, 0.9 as f64), - }, - EntityKind::Egg => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::EnderPearl => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::ExperienceBottle => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::Potion => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, - EntityKind::Trident => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.5 as f64, 0.5 as f64), - }, - EntityKind::TraderLlama => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 1.87 as f64, 0.9 as f64), - }, - EntityKind::TropicalFish => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.5 as f64, 0.4 as f64, 0.5 as f64), - }, - EntityKind::Turtle => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.2 as f64, 0.4 as f64, 1.2 as f64), - }, - EntityKind::Vex => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.4 as f64, 0.8 as f64, 0.4 as f64), - }, - EntityKind::Villager => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Vindicator => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::WanderingTrader => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Witch => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Wither => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.9 as f64, 3.5 as f64, 0.9 as f64), - }, - EntityKind::WitherSkeleton => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.7 as f64, 2.4 as f64, 0.7 as f64), - }, - EntityKind::WitherSkull => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.3125 as f64, 0.3125 as f64, 0.3125 as f64), - }, - EntityKind::Wolf => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 0.85 as f64, 0.6 as f64), - }, - EntityKind::Zoglin => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.4 as f64, 1.39648 as f64), - }, - EntityKind::Zombie => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::ZombieHorse => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(1.39648 as f64, 1.6 as f64, 1.39648 as f64), - }, - EntityKind::ZombieVillager => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::ZombifiedPiglin => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.95 as f64, 0.6 as f64), - }, - EntityKind::Player => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.6 as f64, 1.8 as f64, 0.6 as f64), - }, - EntityKind::FishingBobber => vek::Aabb { - min: vek::Vec3::zero(), - max: vek::Vec3::new(0.25 as f64, 0.25 as f64, 0.25 as f64), - }, +use std::convert::TryFrom; +use std::str::FromStr; +impl TryFrom for EntityKind { + type Error = &'static str; + fn try_from(value: String) -> Result { + if let Some(kind) = EntityKind::from_name(value.as_str()) { + Ok(kind) + } else { + Err("Unknown entity kind") + } + } +} +impl From for &'static str { + fn from(i: EntityKind) -> Self { + i.name() + } +} +impl FromStr for EntityKind { + type Err = &'static str; + fn from_str(s: &str) -> Result { + if let Some(kind) = EntityKind::from_name(s) { + Ok(kind) + } else { + Err("Unknown entity kind") } } } diff --git a/libcraft/core/src/lib.rs b/libcraft/core/src/lib.rs index cd3d042c1..567c4812f 100644 --- a/libcraft/core/src/lib.rs +++ b/libcraft/core/src/lib.rs @@ -1,9 +1,7 @@ //! Foundational types and constants for Minecraft. -mod biome; pub mod block; -mod consts; -mod dimension; +pub mod consts; mod entity; mod gamemode; mod gamerules; @@ -11,15 +9,96 @@ mod interaction; mod player; mod positions; -pub use biome::Biome; +use std::fmt::Formatter; + +pub use block::BlockFace; pub use consts::*; -pub use dimension::Dimension; pub use entity::EntityKind; pub use gamemode::Gamemode; pub use gamerules::GameRules; pub use interaction::InteractionType; pub use player::Hand; pub use positions::{ - vec3, Aabb, BlockFace, BlockPosition, ChunkPosition, Mat4f, Position, Vec2d, Vec2f, Vec2i, - Vec3d, Vec3f, Vec3i, Vec4d, Vec4f, Vec4i, + vec3, Aabb, BlockPosition, ChunkPosition, Mat4f, Position, RegionPosition, ValidBlockPosition, + Vec2d, Vec2f, Vec2i, Vec3d, Vec3f, Vec3i, Vec4d, Vec4f, Vec4i, REGION_SIZE, +}; + +use num_derive::{FromPrimitive, ToPrimitive}; +use serde::{ + de::{Error, Visitor}, + Deserialize, Deserializer, Serialize, }; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, FromPrimitive, ToPrimitive)] +pub enum Direction { + North, + South, + East, + West, +} + +/// A profile property, which stores metadata +/// for some player's account. This is usually +/// used to store skin data. +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct ProfileProperty { + pub name: String, + pub value: String, + pub signature: String, +} + +#[derive(Clone, Copy, PartialEq, Eq, Debug, derive_more::Deref)] +pub struct WorldHeight(pub usize); + +#[derive(Clone, Copy, PartialEq, Eq, Debug, derive_more::Deref)] +pub struct Sections(pub usize); + +impl From for WorldHeight { + fn from(sections: Sections) -> Self { + WorldHeight(sections.0 * CHUNK_SECTION_HEIGHT) + } +} + +impl From for Sections { + fn from(sections: WorldHeight) -> Self { + Sections(sections.0 / CHUNK_SECTION_HEIGHT) + } +} + +pub fn deserialize_bool<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + struct BoolI8Visitor; + + impl Visitor<'_> for BoolI8Visitor { + type Value = bool; + + fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { + formatter.write_str("a bool") + } + + fn visit_bool(self, v: bool) -> Result + where + E: Error, + { + Ok(v) + } + + fn visit_i8(self, v: i8) -> Result + where + E: Error, + { + Ok(v != 0) + } + + fn visit_u8(self, v: u8) -> Result + where + E: Error, + { + Ok(v != 0) + } + } + + deserializer.deserialize_any(BoolI8Visitor) +} diff --git a/libcraft/core/src/particle.rs b/libcraft/core/src/particle.rs index ea6dc8196..e7002e009 100644 --- a/libcraft/core/src/particle.rs +++ b/libcraft/core/src/particle.rs @@ -5,7 +5,7 @@ pub enum Particle { AmbientEntityEffect, AngryVillager, Barrier, - Block(BlockId), + Block(BlockState), Bubble, Cloud, Crit, @@ -30,7 +30,7 @@ pub enum Particle { EntityEffect, ExplosionEmitter, Explosion, - FallingDust(BlockId), + FallingDust(BlockState), Firework, Fishing, Flame, diff --git a/libcraft/core/src/positions.rs b/libcraft/core/src/positions.rs index 81606b6f6..fb6cf3fc8 100644 --- a/libcraft/core/src/positions.rs +++ b/libcraft/core/src/positions.rs @@ -9,7 +9,12 @@ use std::{ }; use vek::{Mat4, Vec2, Vec3, Vec4}; -use crate::CHUNK_WIDTH; +use thiserror::Error; + +use std::convert::TryFrom; + +use crate::{BlockFace, CHUNK_WIDTH}; + pub type Vec2i = Vec2; pub type Vec3i = Vec3; pub type Vec4i = Vec4; @@ -351,6 +356,16 @@ impl BlockPosition { } } + pub fn adjacent(self, face: BlockFace) -> Self { + match face { + BlockFace::Bottom => self.down(), + BlockFace::Top => self.up(), + BlockFace::North => self.north(), + BlockFace::South => self.south(), + BlockFace::West => self.west(), + BlockFace::East => self.east(), + } + } /// Returns `true` if the [`BlockPosition`] is valid. /// /// Minecraft defines a valid block position with the following limits: @@ -364,6 +379,21 @@ impl BlockPosition { } } +impl Add for BlockPosition { + type Output = Self; + + fn add(self, rhs: BlockFace) -> Self::Output { + match rhs { + BlockFace::Bottom => self.down(), + BlockFace::Top => self.up(), + BlockFace::North => self.north(), + BlockFace::South => self.south(), + BlockFace::West => self.west(), + BlockFace::East => self.east(), + } + } +} + impl Add for BlockPosition { type Output = BlockPosition; @@ -433,12 +463,223 @@ impl From for ChunkPosition { } } -#[derive(Debug, Serialize, Deserialize, Clone)] -pub enum BlockFace { - Bottom, - Top, - North, - South, - West, - East, +/// Validated position of a block. +/// +/// This structure is immutable. +/// All operations that change a [`ValidBlockPosition`] must be done by +/// turning it into a [`BlockPosition`], performing said operations, +/// then using [`ValidBlockPosition`]'s [`TryFrom`] impl to get a [`ValidBlockPosition`]. +/// +/// The definition of a valid block position is defined by [`BlockPosition::valid`]. +/// +/// # Examples +/// +/// Converting a [`BlockPosition`] to a [`ValidBlockPosition`], unwrapping any errors that +/// occur. +/// ``` +/// # use feather_libcraft::BlockPosition; +/// # use feather_libcraft::ValidBlockPosition; +/// # use std::convert::TryInto; +/// // Create an unvalidated block position +/// let block_position = BlockPosition::new(727, 32, 727); +/// +/// // Validate the block position and unwrap any errors +/// let valid_block_position: ValidBlockPosition = block_position.try_into().unwrap(); +/// ``` +/// +/// Performing operations on a [`ValidBlockPosition`], then re-validating it. +/// ``` +/// # use feather_libcraft::BlockPosition; +/// # use feather_libcraft::ValidBlockPosition; +/// # use std::convert::TryInto; +/// # let mut valid_block_position: ValidBlockPosition = BlockPosition::new(727, 32, 727).try_into().unwrap(); +/// // Convert the ValidBlockPosition into an unvalidated one to perform math +/// let mut block_position: BlockPosition = valid_block_position.into(); +/// +/// block_position.x = 821; +/// block_position.z += 32; +/// +/// assert!(block_position.valid()); +/// +/// valid_block_position = block_position.try_into().unwrap(); +/// ``` +#[derive( + Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Default, Serialize, Deserialize, +)] +#[repr(C)] +pub struct ValidBlockPosition { + x: i32, + y: i32, + z: i32, +} + +impl ValidBlockPosition { + pub fn x(&self) -> i32 { + self.x + } + + pub fn y(&self) -> i32 { + self.y + } + + pub fn z(&self) -> i32 { + self.z + } + + pub fn chunk(self) -> ChunkPosition { + self.into() + } + + pub fn position(self) -> Position { + self.into() + } +} + +impl TryFrom for ValidBlockPosition { + type Error = BlockPositionValidationError; + + fn try_from(value: BlockPosition) -> Result { + if value.valid() { + Ok(ValidBlockPosition { + x: value.x, + y: value.y, + z: value.z, + }) + } else { + Err(BlockPositionValidationError::OutOfRange(value)) + } + } +} + +impl From for BlockPosition { + fn from(position: ValidBlockPosition) -> Self { + BlockPosition { + x: position.x, + y: position.y, + z: position.z, + } + } +} + +impl From for ChunkPosition { + fn from(position: ValidBlockPosition) -> Self { + let position: BlockPosition = position.into(); + position.into() + } +} + +impl From for Position { + fn from(position: ValidBlockPosition) -> Self { + let position: BlockPosition = position.into(); + position.into() + } +} + +#[derive(Error, Debug)] +pub enum BlockPositionValidationError { + #[error("coordinate {0:?} out of range")] + OutOfRange(BlockPosition), +} + +#[cfg(test)] +mod tests { + use libcraft_core::BlockPosition; + use std::convert::TryInto; + + use crate::ValidBlockPosition; + + #[test] + #[should_panic] + fn check_out_of_bounds_up() { + let block_position = BlockPosition::new(0, 39483298, 0); + + >::try_into(block_position).unwrap(); + } + + #[test] + #[should_panic] + fn check_out_of_bounds_down() { + let block_position = BlockPosition::new(0, -39483298, 0); + + >::try_into(block_position).unwrap(); + } +} +impl BlockFace { + pub fn opposite(self) -> Self { + match self { + BlockFace::Bottom => BlockFace::Top, + BlockFace::Top => BlockFace::Bottom, + BlockFace::North => BlockFace::South, + BlockFace::South => BlockFace::North, + BlockFace::West => BlockFace::East, + BlockFace::East => BlockFace::West, + } + } + + pub fn left(self) -> Self { + match self { + BlockFace::Bottom => BlockFace::Bottom, + BlockFace::Top => BlockFace::Top, + BlockFace::North => BlockFace::West, + BlockFace::South => BlockFace::East, + BlockFace::West => BlockFace::South, + BlockFace::East => BlockFace::North, + } + } + + pub fn right(self) -> Self { + match self { + BlockFace::Bottom => BlockFace::Bottom, + BlockFace::Top => BlockFace::Top, + BlockFace::North => BlockFace::East, + BlockFace::South => BlockFace::West, + BlockFace::West => BlockFace::North, + BlockFace::East => BlockFace::South, + } + } + + pub fn to_cardinal(self) -> Option { + match self { + BlockFace::Top | BlockFace::Bottom => None, + f => Some(f), + } + } +} + +pub const REGION_SIZE: usize = 32; + +/// A region contains a 32x32 grid of chunk columns. +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] +pub struct RegionPosition { + pub x: i32, + pub z: i32, +} + +impl RegionPosition { + /// Returns the coordinates of the region corresponding + /// to the specified chunk position. + pub fn from_chunk(chunk_coords: ChunkPosition) -> Self { + Self { + x: chunk_coords.x >> 5, + z: chunk_coords.z >> 5, + } + } + + /// Returns the offset of the given chunk within this region. + pub fn chunk_offset(self, chunk: ChunkPosition) -> Option<(u32, u32)> { + let x = chunk.x - self.x * REGION_SIZE as i32; + let z = chunk.z - self.z * REGION_SIZE as i32; + if x >= 0 && z >= 0 && x < REGION_SIZE as i32 && z < REGION_SIZE as i32 { + Some((x as u32, z as u32)) + } else { + None + } + } + + pub fn chunk(self, chunk_x: u32, chunk_z: u32) -> ChunkPosition { + ChunkPosition { + x: self.x * REGION_SIZE as i32 + chunk_x as i32, + z: self.z * REGION_SIZE as i32 + chunk_z as i32, + } + } } diff --git a/libcraft/generators/Cargo.toml b/libcraft/generators/Cargo.toml index e657503f0..92d19524c 100644 --- a/libcraft/generators/Cargo.toml +++ b/libcraft/generators/Cargo.toml @@ -2,13 +2,24 @@ name = "libcraft-generators" version = "0.1.0" authors = ["Kalle Kankaanpää"] -edition = "2018" +edition = "2021" [dependencies] -libcraft-blocks = { path = "../blocks" } - anyhow = "1" -bincode = "1" +bincode = "2.0.0-rc.1" +convert_case = "0.5" flate2 = "1" +fs_extra = "1" +indexmap = { version = "1", features = [ "serde" ] } +libcraft = { path = ".." } +libcraft-blocks = { path = "../blocks" } +libcraft-chunk = { path = "../chunk" } +libcraft-core = { path = "../core" } +log = "0.4" +once_cell = "1" +proc-macro2 = "1" +quote = "1" +regex = "1" +serde = { version = "1", features = [ "derive" ] } serde_json = "1" -serde = "1" \ No newline at end of file +ureq = { version = "2", default-features = false, features = [ "tls" ] } diff --git a/libcraft/generators/README.md b/libcraft/generators/README.md deleted file mode 100644 index 1b8372f52..000000000 --- a/libcraft/generators/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# libcraft-generators -This crate contains the generators for all of the autogenerated files in libcraft. - -Code generators are written in python and live in `python` directory. The crate also contains rust code that generates the `raw_block_states` lookup table. - -There are both shell and powershell scripts available to invoke the generators and generate all code. - -Running these scripts requires `rustfmt`, `cargo` and `python` 3.6 or greater. Note that code generation is not a mandatory part of the build process, so you only need to regenerate code after modifying a generator script. - -`libcraft-generators` currently provides the following generators: -* Generator for `Biome` enum in `libcraft-core` -* Generator for `BlockKind` enum in `libcraft-blocks` -* Generator for `EntityKind` enum in `libcraft-core` -* Generator for `Item` enum in `libcraft-items` -* Generator for `SimplifiedBlockKind` enum in `libcraft-blocks` -* Generator for `Particle` enum in `libcraft-core` -* Generator for the block state lookup table - -Data is sourced from multiple sources. -* [`PrimsarineJS/minecraft-data`](https://github.com/PrismarineJS/minecraft-data), which provides the majority -of data. These files live in the `minecraft-data` subdirectory, which is a Git submodule. Make sure -that Git submodules are up to date before running the scripts. -* `libcraft-data` directory contains custom data files, made especially for libcraft. -* `raw_block_states` generator uses block state data generated by the vanilla minecraft `server.jar` - * The block state data can be generated by downloading the `server.jar` and running `java -cp server.jar net.minecraft.data.Main --all` \ No newline at end of file diff --git a/libcraft/generators/generate.ps1 b/libcraft/generators/generate.ps1 deleted file mode 100644 index 0320e8c90..000000000 --- a/libcraft/generators/generate.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -$generators = Get-ChildItem "python" -Filter *.py - -Write-Host "Running python generators" -foreach ($generator in $generators) { - python python/$generator -} - -Write-Host "Running rust generators" -cargo run --package libcraft-generators --bin libcraft-generators - -cargo fmt \ No newline at end of file diff --git a/libcraft/generators/generate.sh b/libcraft/generators/generate.sh deleted file mode 100755 index df5eb10a2..000000000 --- a/libcraft/generators/generate.sh +++ /dev/null @@ -1,12 +0,0 @@ -generators=$(find python/ -type f -name "*.py") - -echo "Running python generators" -for generator in ${generators[@]}; do - echo "Running $generator" - python3 $generator -done - -echo "Running rust generators" -cargo run --package libcraft-generators --bin libcraft-generators - -cargo fmt \ No newline at end of file diff --git a/libcraft/generators/python/.pep8 b/libcraft/generators/python/.pep8 deleted file mode 100644 index cdedc3786..000000000 --- a/libcraft/generators/python/.pep8 +++ /dev/null @@ -1,2 +0,0 @@ -[pycodestyle] -max_line_length = 120 \ No newline at end of file diff --git a/libcraft/generators/python/biome.py b/libcraft/generators/python/biome.py deleted file mode 100644 index 6d4ae6884..000000000 --- a/libcraft/generators/python/biome.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Generation of the Biome enum. Uses minecraft-data/biomes.json.""" -from common import load_minecraft_json, camel_case, generate_enum, generate_enum_property, output - -variants = [] -ids = {} -names = {} -display_names = {} -rainfalls = {} -temperatures = {} - -for biome in load_minecraft_json("biomes.json"): - variant = camel_case(biome['name']) - variants.append(variant) - ids[variant] = biome['id'] - names[variant] = biome['name'] - display_names[variant] = biome['displayName'] - rainfalls[variant] = biome['rainfall'] - temperatures[variant] = biome['temperature'] - - -output_data = generate_enum("Biome", variants) -output_data += generate_enum_property("Biome", "id", "u32", ids, True) -output_data += generate_enum_property("Biome", "name", "&str", names, True, "&'static str") -output_data += generate_enum_property("Biome", "display_name", "&str", display_names, True, "&'static str") -output_data += generate_enum_property("Biome", "rainfall", "f32", rainfalls) -output_data += generate_enum_property("Biome", "temperature", "f32", temperatures) - -output("core/src/biome.rs", output_data) - diff --git a/libcraft/generators/python/block.py b/libcraft/generators/python/block.py deleted file mode 100644 index 042ea03f7..000000000 --- a/libcraft/generators/python/block.py +++ /dev/null @@ -1,96 +0,0 @@ -from common import load_minecraft_json, camel_case, generate_enum, generate_enum_property, output - - -# build item ID => item kind index -item_kinds_by_id = {} -for item in load_minecraft_json("items.json"): - item_kinds_by_id[item['id']] = camel_case(item['name']) - -# Build material name => dig multipliers index -material_dig_multipliers = {} -for name, material in load_minecraft_json("materials.json").items(): - dig_multipliers = {} - for item_id, multiplier in material.items(): - dig_multipliers[item_kinds_by_id[int(item_id)]] = float(multiplier) - material_dig_multipliers[name] = dig_multipliers - -# Build material dig multipliers constants -material_constants = "" -material_constant_refs = {} -for name, dig_multipliers in material_dig_multipliers.items(): - dm = "" - for item, multiplier in dig_multipliers.items(): - dm += f"(libcraft_items::Item::{item}, {multiplier}_f32)," - constant = f"DIG_MULTIPLIERS_{name}" - material_constants += f"#[allow(dead_code, non_upper_case_globals)] const {constant}: &[(libcraft_items::Item, f32)] = &[{dm}];" - material_constant_refs[name] = constant - -blocks = [] -ids = {} -names = {} -display_names = {} -hardnesses = {} -diggables = {} -harvest_tools = {} -transparents = {} -light_emissions = {} -light_filters = {} -dig_multipliers = {} -solids = {} - -for block in load_minecraft_json("blocks.json"): - variant = camel_case(block['name']) - blocks.append(variant) - ids[variant] = block['id'] - names[variant] = block['name'] - display_names[variant] = block['displayName'] - hardnesses[variant] = block['hardness'] - if hardnesses[variant] is None: - hardnesses[variant] = 0 - diggables[variant] = block['diggable'] - transparents[variant] = block['transparent'] - light_emissions[variant] = block['emitLight'] - light_filters[variant] = block['filterLight'] - - solids[variant] = block['boundingBox'] == 'block' - - # Dig multipliers - material = block.get('material') - if material_constant_refs.get(material) is not None: - constant = material_constant_refs[material] - dig_multipliers[variant] = f"{constant}" - else: - dig_multipliers[variant] = "&[]" - - # Harvest tools - ht = "" - for tool_id in block.get('harvestTools', {}): - kind = item_kinds_by_id[int(tool_id)] - ht += f"libcraft_items::Item::{kind}," - - if len(ht) == 0: - harvest_tools[variant] = 'None' - else: - harvest_tools[variant] = f""" - const TOOLS: &[libcraft_items::Item] = &[{ht}]; - Some(TOOLS) - """ - -output_data = "#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, serde::Serialize, serde::Deserialize)]" + \ - generate_enum("BlockKind", blocks) -output_data += generate_enum_property("BlockKind", "id", "u32", ids, True) -output_data += generate_enum_property("BlockKind", "name", "&str", names, True, "&'static str") -output_data += generate_enum_property("BlockKind", "display_name", "&str", display_names, True, "&'static str") -output_data += generate_enum_property("BlockKind", "hardness", "f32", hardnesses) -output_data += generate_enum_property("BlockKind", "diggable", "bool", diggables) -output_data += generate_enum_property("BlockKind", "transparent", "bool", transparents) -output_data += generate_enum_property("BlockKind", "light_emission", "u8", light_emissions) -output_data += generate_enum_property("BlockKind", "light_filter", "u8", light_filters) -output_data += generate_enum_property("BlockKind", "solid", "bool", solids) -output_data += material_constants -output_data += generate_enum_property("BlockKind", "dig_multipliers", - "&'static [(libcraft_items::Item, f32)]", dig_multipliers) -output_data += generate_enum_property("BlockKind", "harvest_tools", - "Option<&'static [libcraft_items::Item]>", harvest_tools) - -output("blocks/src/block.rs", output_data) diff --git a/libcraft/generators/python/common.py b/libcraft/generators/python/common.py deleted file mode 100644 index 0a941583a..000000000 --- a/libcraft/generators/python/common.py +++ /dev/null @@ -1,164 +0,0 @@ -"""Common code shared by most code generators.""" - -from subprocess import run -from json import load -from re import split -from pathlib import Path - -from typing import List - -LIBCRAFT_ROOT = Path(__file__).parents[1] / ".." -PRISMARINEJS_BASE_PATH = Path(__file__).parents[1] / ".." / ".." / "minecraft-data" / "data" / "pc" -LIBCRAFT_DATA_BASE_PATH = Path(__file__).parents[1] / "libcraft-data" - - -def rustfmt(file_path): - """ Runs rustfmt on a file""" - run(["rustfmt", file_path]) - - -def load_minecraft_json(name: str, version="1.16.1") -> dict: - """ - Loads a JSON file from the minecraft-data sub repository. - - Parameters: - name (str): Name of the file to load - version (str): String matching the targe minecraft version, defaults to 1.16.1 - - Returns: - A dict containing JSON content - """ - file = open(PRISMARINEJS_BASE_PATH / version / name) - return load(file) - - -def load_feather_json(name: str) -> dict: - """ - Loads a JSON file from the feather directory - - Parameters: - name (str): Name of the file to load - - Returns: - A dict containing JSON contents - """ - file = open(LIBCRAFT_DATA_BASE_PATH / name) - return load(file) - - -def output(path: str, content: str): - """ - Writes the contents to a file in provided path, then runs rustfmt. - - Parameters: - path: Path to destination file, relative to libcraft root - content: Contents to be written in the file - """ - - path = LIBCRAFT_ROOT / path - if not path.parent.exists(): - return print(f"Couldn't write to file.\nPath {path.parent} does not exist") - f = open(path, "w") - f.write("// This file is @generated. Please do not edit.\n") - f.write(content) - f.close() - print(f"Generated {path.name}") - - rustfmt(path) - - -def generate_enum_property( - enum: str, # Identifier of the enum (e.g. "Biome") - property_name: str, # Name of the property - type_: str, # The property type (e.g. u32, &str - mapping: dict, # Dictionary mapping from enum variant name => property value expression - # Whether to generate the reverse mapping (property value => Some(Self)) - reverse=False, - return_type=None, - # Property type that should be returned. This is used when the type has a lifetime, such as &'static str - # Whether to bind enum fields using Enum::Variant { .. } - needs_bindings=False, -) -> str: - """ - Generates lookup functions for an enum. - - Generates two function for an enum, one which maps the enum value to some - property value and one which does the reverse (returning an Option) - """ - if return_type is None: - return_type = type_ - - self_to_prop = "" - prop_to_self = "" - - # Add quotes to strings - if type_ == "&str": - for key, property_value in mapping.items(): - mapping[key] = f'"{property_value}"' - - # If floats are needed, convert integers to floats - if type_ == "f32" or type_ == "f64": - for key, property_value in mapping.items(): - mapping[key] = f'{property_value} as {type_}' - - # Bools are lowercase in Rust - if type_ == "bool": - for key, property_value in mapping.items(): - mapping[key] = str(property_value).lower() - - for variant, property_value in mapping.items(): - fields = "" - if needs_bindings: - fields = "{ .. }" - self_to_prop += f"{enum}::{variant} {fields} => {{ {property_value} }}," - prop_to_self += f"{property_value} => Some({enum}::{variant})," - - result = f""" - #[allow(warnings)] - #[allow(clippy::all)] - impl {enum} {{ - /// Returns the `{property_name}` property of this `{enum}`. - pub fn {property_name}(&self) -> {return_type} {{ - match self {{ - {self_to_prop} - }} - }} - """ - - if reverse: - result += f""" - /// Gets a `{enum}` by its `{property_name}`. - pub fn from_{property_name}({property_name}: {type_}) -> Option {{ - match {property_name} {{ - {prop_to_self} - _ => None, - }} - }} - """ - - # closing brace - result += "}" - - return result - - -def generate_enum(name: str, variants: List[str], derives: List[str] = [], prelude: str = "") -> str: - """Generates an enum definition with the provided variants and extra derives.""" - body = ','.join(variants) + ',' - extra_derives = "" if len(derives) == 0 else ',' + ','.join(derives) - output = f""" - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord{extra_derives})]""" - if len(prelude) != 0: - output += f""" - {prelude}""" - output += f""" - pub enum {name} {{ - {body} - }} - """ - return output - - -def camel_case(string: str) -> str: - """Converts a string to UpperCamelCase.""" - return ''.join(a.capitalize() for a in split('([^a-zA-Z0-9])', string) if a.isalnum()) diff --git a/libcraft/generators/python/entity.py b/libcraft/generators/python/entity.py deleted file mode 100644 index e30c8b4e4..000000000 --- a/libcraft/generators/python/entity.py +++ /dev/null @@ -1,29 +0,0 @@ -from common import load_minecraft_json, camel_case, generate_enum, generate_enum_property, output - -entities = [] -ids = {} -internal_ids = {} -names = {} -display_names = {} -bboxes = {} - -for entity in load_minecraft_json("entities.json","1.16.2"): - variant = camel_case(entity['name']) - entities.append(variant) - ids[variant] = entity['id'] - internal_ids[variant] = entity['internalId'] - names[variant] = entity['name'] - display_names[variant] = entity['displayName'] - - width = entity['width'] - height = entity['height'] - bboxes[variant] = f"vek::Aabb {{ min: vek::Vec3::zero(), max: vek::Vec3::new({width} as f64, {height} as f64, {width} as f64), }}" - -output_data = generate_enum("EntityKind", entities) -output_data += generate_enum_property("EntityKind", "id", "u32", ids, True) -output_data += generate_enum_property("EntityKind", "internal_id", "u32", internal_ids, True) -output_data += generate_enum_property("EntityKind", "name", "&str", names, True, "&'static str") -output_data += generate_enum_property("EntityKind", "display_name", "&str", display_names, True, "&'static str") -output_data += generate_enum_property("EntityKind", "bounding_box", "vek::Aabb", bboxes) - -output("core/src/entity.rs", output_data) diff --git a/libcraft/generators/python/inventory.py b/libcraft/generators/python/inventory.py deleted file mode 100644 index e7f3e4712..000000000 --- a/libcraft/generators/python/inventory.py +++ /dev/null @@ -1,157 +0,0 @@ -from pathlib import Path -import common -import collections - -data = common.load_feather_json("inventory.json") - -# Areas -areas = [] -for area in data['areas']: - areas.append(common.camel_case(area)) - -# Windows -windows = [] -names = {} -inventories = {} -area_offsets = collections.OrderedDict() - -for name, window in data['windows'].items(): - variant = common.camel_case(name) - windows.append(variant) - - names[variant] = name - inventories[variant] = window['inventories'] - - ao = collections.OrderedDict() - slot_counter = 0 - for inventory_and_area, number_of_slots in window['slots'].items(): - parts = inventory_and_area.split(":") - inventory = parts[0] - area_in_inventory = parts[1] - ao[(inventory, area_in_inventory)] = (slot_counter, number_of_slots) - slot_counter += number_of_slots - area_offsets[variant] = ao - -output = common.generate_enum("Area", areas) - -window = "#[derive(Debug, Clone)] pub enum Window {" -index_to_slot = "#[allow(unused_comparisons)] pub fn index_to_slot(&self, index: usize) -> Option<(&crate::Inventory, Area, usize)> { match self {" -slot_to_index = "pub fn slot_to_index(&self, inventory: &crate::Inventory, area: Area, slot: usize) -> Option { match self {" - -for variant in windows: - window += f"{variant} {{" - for inventory in inventories[variant]: - window += f"{inventory}: crate::Inventory," - window += "}," - - match_pattern = f"Window::{variant} {{" - for inventory in inventories[variant]: - match_pattern += f"{inventory}," - match_pattern += "}" - - index_to_slot += f"{match_pattern} => {{" - first = True - for (inventory, area_in_inventory), (slot_offset, number_of_slots) in area_offsets[variant].items(): - if not first: - index_to_slot += "else" - first = False - - area_in_inventory = common.camel_case(area_in_inventory) - max_slot = slot_offset + number_of_slots - slot_offset_operation = "" - if slot_offset != 0: - slot_offset_operation += f" - {slot_offset}" - index_to_slot += f""" - if ({slot_offset}..{max_slot}).contains(&index) {{ - let area = Area::{area_in_inventory}; - let slot = index{slot_offset_operation}; - Some(({inventory}, area, slot)) - }} - """ - index_to_slot += "else { None } }," - - slot_to_index += f"{match_pattern} => {{" - first = True - for (inventory, area_in_inventory), (slot_offset, number_of_slots) in area_offsets[variant].items(): - if not first: - slot_to_index += "else " - first = False - - area_in_inventory = common.camel_case(area_in_inventory) - if slot_offset == 0: - slot_to_index += f"if area == Area::{area_in_inventory} && {inventory}.ptr_eq(inventory) {{ Some(slot) }}" - else: - slot_to_index += f"if area == Area::{area_in_inventory} && {inventory}.ptr_eq(inventory) {{ Some(slot + {slot_offset}) }}" - - slot_to_index += "else { None } }," - - -window += "}" -index_to_slot += "} }" -slot_to_index += "} }" - -output += window -output += f"impl Window {{ {index_to_slot} {slot_to_index} }}" -output += common.generate_enum_property("Window", "name", "&str", names, False, "&'static str", True) - -# Inventories -inventories = [] -for name, areas in data['inventories'].items(): - variant = common.camel_case(name) - inv = { - 'name': name, - 'variant': variant, - 'areas': areas, - } - inventories.append(inv) - - -output += "#[derive(Debug, Clone)] pub enum InventoryBacking {" -for inventory in inventories: - variant = inventory['variant'] - output += f"{variant} {{" - for area_name, area_size in inventory['areas'].items(): - output += f"{area_name}: [T; {area_size}]," - output += "}," -output += "}" - -get_area_fn = "pub fn area_slice(&self, area: Area) -> Option<&[T]> { match self {" -get_areas_fn = "pub fn areas(&self) -> &'static [Area] { match self {" -constructor_fns = "" -inventory_constructor_fns = "" - -for inventory in inventories: - name = inventory['name'] - variant = inventory['variant'] - areas = inventory['areas'] - match_arm = f"InventoryBacking::{variant} {{" - for area in areas: - match_arm += f"{area}," - match_arm += "}" - - get_area_fn += f"{match_arm} => match area {{" - for area in areas: - area_variant = common.camel_case(area) - get_area_fn += f"Area::{area_variant} => Some({area}.as_ref())," - get_area_fn += "_ => None }," - - get_areas_fn += f"\nInventoryBacking::{variant} {{ .. }} => {{static AREAS: [Area; {len(areas)}] = [" - for area in areas: - get_areas_fn += f"Area::{common.camel_case(area)}," - get_areas_fn += f"];\n &AREAS }}," - - constructor_fn = f"pub fn {name}() -> Self where T: Default {{ InventoryBacking::{variant} {{" - for area in areas: - constructor_fn += f"{area}: Default::default()," - - constructor_fn += "} }\n" - constructor_fns += constructor_fn - - inventory_constructor_fns += f"pub fn {name}() -> Self {{ Self {{ backing: std::sync::Arc::new(InventoryBacking::{name}()) }} }}" - -get_area_fn += "} }" -get_areas_fn += "} }" -output += f"impl InventoryBacking {{ {get_area_fn} {get_areas_fn} {constructor_fns} }}" -output += f"impl crate::Inventory {{ {inventory_constructor_fns} }}" - -common.output("inventory/src/inventory.rs", output) diff --git a/libcraft/generators/python/item.py b/libcraft/generators/python/item.py deleted file mode 100644 index 78d7ff2ab..000000000 --- a/libcraft/generators/python/item.py +++ /dev/null @@ -1,74 +0,0 @@ -from common import load_minecraft_json, camel_case, generate_enum, generate_enum_property, output - -items = [] -ids = {} -names = {} -display_names = {} -stack_sizes = {} -durabilities = {} - -for item in load_minecraft_json("items.json", "1.16.2"): - variant = camel_case(item['name']) - items.append(variant) - ids[variant] = item['id'] - names[variant] = item['name'] - display_names[variant] = item['displayName'] - stack_sizes[variant] = item['stackSize'] - - durability = item.get('durability') - if durability is None: - durabilities[variant] = "None" - else: - durabilities[variant] = f"Some({durability})" - -output_data = "use serde::{Serialize, Deserialize};" - -output_data += generate_enum("Item", items, derives=["Serialize", "Deserialize"], - prelude="#[serde(try_from = \"String\", into = \"&'static str\")]") -output_data += generate_enum_property("Item", "id", "u32", ids, True) -output_data += generate_enum_property("Item", "name", "&str", names, True, "&'static str") -output_data += generate_enum_property("Item", "display_name", "&str", display_names, False, "&'static str") -output_data += generate_enum_property("Item", "stack_size", "u32", stack_sizes) -output_data += generate_enum_property("Item", "durability", "Option", durabilities) - -output_data += f""" - use std::convert::TryFrom; - - impl TryFrom for Item {{ - type Error = &'static str; - - fn try_from(value: String) -> Result {{ - if let Some(item) = Item::from_name(value.as_str()) {{ - Ok(item) - }} else {{ - Err("Unknown item name.") - }} - }} - }} -""" - -output_data += f""" - impl From for &'static str {{ - fn from(i: Item) -> Self {{ - i.name() - }} - }} -""" - -output_data += f""" - use std::str::FromStr; - - impl FromStr for Item {{ - type Err = &'static str; - - fn from_str(s: &str) -> Result {{ - if let Some(item) = Item::from_name(s) {{ - Ok(item) - }} else {{ - Err("Unknown item name.") - }} - }} - }} -""" - -output("items/src/item.rs", output_data) diff --git a/libcraft/generators/python/particle.py b/libcraft/generators/python/particle.py deleted file mode 100644 index 2bb3dd775..000000000 --- a/libcraft/generators/python/particle.py +++ /dev/null @@ -1,51 +0,0 @@ -# This file cannot be generated anymore, since the current particle.rs in libcraft/crates/particles has a -# is an enum that has the particle data built into it. - -# I made an attempt on incorporating this into the generator, but ultimately gave up since it's not future-proof -# at all - -from common import load_minecraft_json, output, generate_enum, generate_enum_property, camel_case - -def main (): - particles = [] - ids = {} - names = {} - - types = load_minecraft_json("protocol.json", "1.16")["types"]["particleData"][1]['fields'] - print(types) - - for particle in load_minecraft_json("particles.json", "1.16"): - variant = camel_case(particle['name']) - id = str(particle['id']) - if id in types.keys(): - data = types[id] - print(data[1]) - particles.append(generate_particle_data(variant, data[1])) - else: - particles.append(variant) - ids[variant] = id - names[variant] = particle['name'] - - output_data = generate_enum("Particle", particles) - output_data += generate_enum_property("Particle", "id", "u32", ids, True) - output_data += generate_enum_property("Particle", "name", "&str", names, True, "&'static str") - output("core/src/particle.rs", output_data) - -def generate_particle_data (name: str, data: dict): - - if (len(data) == 1): - feather_type = "f32" - if data[0]['name'] == 'blockState': - feather_type = "BlockId" - return name + f"({feather_type})" - else: - enum_item = f"{name}{{" - for i in range(0, len(data)): - enum_item += f"{data[i]['name']}:{data[i]['type']}" - if i < len(data): - enum_item += "," - - return enum_item + "}" - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/libcraft/generators/python/simplified_block.py b/libcraft/generators/python/simplified_block.py deleted file mode 100644 index 170db4e46..000000000 --- a/libcraft/generators/python/simplified_block.py +++ /dev/null @@ -1,35 +0,0 @@ -from common import load_minecraft_json, load_feather_json, camel_case, generate_enum, generate_enum_property, output -from re import compile - -blocks = load_minecraft_json("blocks.json") -simplified_block = load_feather_json("simplified_block.json") - -regexes = {} -for name, regex in simplified_block['regexes'].items(): - regexes[name] = compile(regex) - -variants = [] -mapping = {} -for name in regexes: - variants.append(camel_case(name)) - -for block in blocks: - name = block['name'] - block_variant = camel_case(name) - - # Detect which SimplifiedBlockKind matches this block. - found = False - for simplified, regex in regexes.items(): - if regex.match(name) is not None: - mapping[block_variant] = "SimplifiedBlockKind::" + camel_case(simplified) - found = True - break - - if not found: - # Default to block variant - variants.append(block_variant) - mapping[block_variant] = "SimplifiedBlockKind::" + block_variant - -output_data = "use crate::BlockKind;" + generate_enum("SimplifiedBlockKind", variants) -output_data += generate_enum_property("BlockKind", "simplified_kind", "SimplifiedBlockKind", mapping) -output("blocks/src/simplified_block.rs", output_data) diff --git a/libcraft/generators/src/common.rs b/libcraft/generators/src/common.rs index 56c98fa07..0a2e0c6f1 100644 --- a/libcraft/generators/src/common.rs +++ b/libcraft/generators/src/common.rs @@ -1,12 +1,12 @@ use std::fs::{read_to_string, write}; use std::io::Write; +use bincode::Encode; use libcraft_blocks::data::BlockReport; use libcraft_blocks::BlockKind; use anyhow::{anyhow, Context, Result}; use flate2::Compression; -use serde::Serialize; pub fn load_block_report(path: &str) -> Result { println!("Reading BlockReport from blocks.json"); @@ -15,9 +15,9 @@ pub fn load_block_report(path: &str) -> Result { } /// Writes data to file provided in compressed binary format (.bc.gz) -pub fn compress_and_write(data: Vec, path: &str) -> Result<()> { - println!("Writing {} entries to {}", data.len(), path); - let encoded = bincode::serialize(&data)?; +pub fn compress_and_write(data: T, path: &str) -> Result<()> { + println!("Writing data to {}", path); + let encoded = bincode::encode_to_vec(&data, bincode::config::standard())?; let mut writer = flate2::write::GzEncoder::new(Vec::new(), Compression::best()); writer.write_all(&encoded)?; diff --git a/libcraft/generators/src/data.rs b/libcraft/generators/src/data.rs new file mode 100644 index 000000000..9232d8837 --- /dev/null +++ b/libcraft/generators/src/data.rs @@ -0,0 +1,47 @@ +use fs_extra::dir::CopyOptions; +use std::{io::Read, path::PathBuf}; + +use libcraft_core::{SERVER_DOWNLOAD_URL, VERSION_STRING}; + +pub fn extract_vanilla_data() { + const SERVER_JAR: &str = "server.jar"; + + if std::fs::read_to_string("generated/.version").ok() != Some(VERSION_STRING.to_string()) { + let _ = std::fs::remove_dir_all("generated"); + if !PathBuf::from(SERVER_JAR).is_file() { + log::info!("Downloading Minecraft server jar"); + let mut buf = Vec::new(); + ureq::get(SERVER_DOWNLOAD_URL) + .call() + .unwrap() + .into_reader() + .read_to_end(&mut buf) + .unwrap(); + std::fs::write(SERVER_JAR, &buf).unwrap(); + } + + log::info!("Running vanilla data generators"); + std::process::Command::new("java") + .args( + format!( + "-DbundlerMainClass=net.minecraft.data.Main -jar {} --all", + SERVER_JAR + ) + .split_whitespace(), + ) + .spawn() + .unwrap() + .wait() + .unwrap(); + std::fs::write("generated/.version", VERSION_STRING).unwrap(); + std::fs::remove_file(SERVER_JAR).unwrap(); + std::fs::remove_dir_all("libraries").unwrap(); + std::fs::remove_dir_all("logs").unwrap(); + std::fs::remove_dir_all("versions").unwrap(); + + log::info!("Copying ./generated/reports/worldgen/ to ./worldgen/"); + fs_extra::dir::create("worldgen", true).unwrap(); + fs_extra::dir::copy("generated/reports/worldgen/", "", &CopyOptions::default()) + .expect("Cannot copy ./generated/reports/worldgen/ to ./worldgen/"); + } +} diff --git a/libcraft/generators/src/generators.rs b/libcraft/generators/src/generators.rs index 15c7abc22..6683c053f 100644 --- a/libcraft/generators/src/generators.rs +++ b/libcraft/generators/src/generators.rs @@ -1,30 +1,20 @@ -use crate::common::{compress_and_write, state_name_to_block_kind}; -use libcraft_blocks::data::BlockReport; - -pub fn generate_block_states(block_report: &BlockReport, path: &str) -> anyhow::Result<()> { - let mut raw_block_states = Vec::new(); - - for (name, entry) in &block_report.blocks { - let kind = state_name_to_block_kind(name)?; - for state in &entry.states { - raw_block_states.push(state.to_raw_state(kind)); - } - } - - raw_block_states.sort_unstable_by_key(|state| state.id); - - compress_and_write(raw_block_states, path) -} - -pub fn generate_block_properties(block_report: &BlockReport, path: &str) -> anyhow::Result<()> { - let mut raw_block_properties = Vec::new(); - - for (name, entry) in &block_report.blocks { - let kind = state_name_to_block_kind(name)?; - raw_block_properties.push(entry.to_raw_properties(kind)) - } - - raw_block_properties.sort_unstable_by_key(|properties| properties.kind); - - compress_and_write(raw_block_properties, path) +mod biomes; +mod block_kinds; +mod block_states; +mod dimensions; +mod entities; +mod inventory; +mod items; +mod simplified_block; + +pub fn generate_all() -> anyhow::Result<()> { + items::generate(); + block_kinds::generate(); + block_states::generate()?; + simplified_block::generate(); + biomes::generate()?; + dimensions::generate()?; + inventory::generate(); + entities::generate(); + Ok(()) } diff --git a/libcraft/generators/src/generators/biomes.rs b/libcraft/generators/src/generators/biomes.rs new file mode 100644 index 000000000..626ad2ebd --- /dev/null +++ b/libcraft/generators/src/generators/biomes.rs @@ -0,0 +1,47 @@ +//! Generates the default `BiomeList`, serialized with `bincode`. + +use std::path::PathBuf; + +use anyhow::Context; +use libcraft_chunk::biome::{BiomeGeneratorInfo, BiomeList}; + +use crate::common::compress_and_write; + +pub fn generate() -> anyhow::Result<()> { + let mut biomes = BiomeList::default(); + + let worldgen = PathBuf::from("worldgen"); + for dir in std::fs::read_dir(&worldgen)?.flatten() { + let namespace = dir + .file_name() + .to_str() + .context(format!( + "Non-UTF8 characters in namespace directory: {:?}", + dir.file_name() + ))? + .to_string(); + let namespace_dir = dir.path(); + let namespace_worldgen = namespace_dir.join("worldgen"); + for file in std::fs::read_dir(namespace_worldgen.join("biome"))?.flatten() { + if let Some(file_name) = file.file_name().to_str() { + if file_name.ends_with(".json") { + let biome: BiomeGeneratorInfo = + serde_json::from_str(&std::fs::read_to_string(file.path())?)?; + let name = + format!("{}:{}", namespace, file_name.strip_suffix(".json").unwrap()); + println!("Loaded biome: {}", name); + biomes.insert(name, biome); + } + } else { + // non-utf8 namespaces are errors, but non-utf8 values are just ignored + println!( + "Ignoring a biome file with non-UTF8 characters in name: {:?}", + file.file_name() + ) + } + } + } + + compress_and_write(biomes, "libcraft/assets/vanilla_biomes.bc.gz")?; + Ok(()) +} diff --git a/libcraft/generators/src/generators/block_kinds.rs b/libcraft/generators/src/generators/block_kinds.rs new file mode 100644 index 000000000..ac960bc93 --- /dev/null +++ b/libcraft/generators/src/generators/block_kinds.rs @@ -0,0 +1,374 @@ +use convert_case::{Case, Casing}; +use indexmap::IndexMap; + +use crate::utils::*; + +pub fn generate() { + let item_names_by_id = load_minecraft_json::>("items.json") + .unwrap() + .into_iter() + .map(|IdAndName { id, name }| (id, name)) + .collect::>(); + let material_dig_multipliers: IndexMap> = + load_minecraft_json("materials.json").unwrap(); + let blocks: Vec = load_minecraft_json("blocks.json").unwrap(); + + let mut material_constant_refs = IndexMap::new(); + + let mut dig_multiplier_constants = Vec::new(); + for (name, dig_multipliers) in material_dig_multipliers { + let multipliers = dig_multipliers + .into_iter() + .map(|(item, multiplier)| { + let item_name = + format_ident!("{}", item_names_by_id[&item].to_case(Case::UpperCamel)); + quote! { (libcraft_items::Item::#item_name, #multiplier) } + }) + .collect::>(); + + let constant = format_ident!( + "{}", + name.to_ascii_uppercase() + .replace(';', "_AND_") + .replace('/', "_WITH_") + ); + dig_multiplier_constants.push(quote! { + pub const #constant: &[(libcraft_items::Item, f32)] = &[#(#multipliers),*]; + }); + material_constant_refs.insert(name, quote! { #constant }); + } + let mut out = quote! { + #[allow(dead_code)] + pub mod dig_multipliers { + #(#dig_multiplier_constants)* + } + }; + + out.extend(generate_enum!( + BlockKind, + blocks + .iter () + .map(|block| block.name.to_case(Case::UpperCamel)) + .collect::>(), + [ + num_derive::FromPrimitive, + num_derive::ToPrimitive, + serde::Serialize, + serde::Deserialize, + bincode::Encode, + bincode::Decode + ], + #[serde(rename_all = "snake_case")] + )); + out.extend(generate_enum_property!( + BlockKind, + "id", + u32, + blocks + .iter() + .map(|block| (block.name.to_case(Case::UpperCamel), { + let id = block.id; + quote! { #id } + })) + .collect(), + true, + )); + out.extend(generate_enum_property!( + BlockKind, + "name", + &str, + blocks + .iter() + .map(|block| (block.name.to_case(Case::UpperCamel), { + let name = &block.name; + quote! { #name } + })) + .collect(), + true, + &'static str + )); + out.extend(generate_enum_property!( + BlockKind, + "namespaced_id", + &str, + blocks + .iter() + .map(|block| (block.name.to_case(Case::UpperCamel), { + let name = format!("minecraft:{}", block.name); + quote! { #name } + })) + .collect(), + true, + &'static str + )); + out.extend(generate_enum_property!( + BlockKind, + "resistance", + f32, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let resistance = block.resistance; + quote! { #resistance } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "hardness", + f32, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let hardness = block.hardness.unwrap_or(-1.0); + quote! { #hardness } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "stack_size", + u32, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let stack_size = block.stack_size; + quote! { #stack_size } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "diggable", + bool, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let diggable = block.diggable; + quote! { #diggable } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "transparent", + bool, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let transparent = block.transparent; + quote! { #transparent } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "default_state_id", + u16, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let default_state = block.default_state; + quote! { #default_state } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "min_state_id", + u16, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let min_state_id = block.min_state_id; + quote! { #min_state_id } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "max_state_id", + u16, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let max_state_id = block.max_state_id; + quote! { #max_state_id } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "light_emission", + u8, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let emit_light = block.emit_light; + quote! { #emit_light } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "light_filter", + u8, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let filter_light = block.filter_light; + quote! { #filter_light } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "solid", + bool, + blocks + .iter() + .map(|block| { + (block.name.to_case(Case::UpperCamel), { + let solid = block.bounding_box == "block"; + quote! { #solid } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "dig_multipliers", + &'static [(libcraft_items::Item, f32)], + blocks + .iter() + .map(|block| { + ( + block.name.to_case(Case::UpperCamel), + material_constant_refs + .get(&block.name) + .cloned() + .unwrap_or_else(|| quote! { &[] }), + ) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "harvest_tools", + Option<&'static [libcraft_items::Item]>, + blocks + .iter() + .map(|block| { + ( + block.name.to_case(Case::UpperCamel), + if let Some(harvest_tools) = block.harvest_tools.as_ref() { + let items = harvest_tools + .keys() + .map(|item| { + format_ident!( + "{}", + item_names_by_id[&item.parse::().unwrap()] + .to_case(Case::UpperCamel) + ) + }) + .collect::>(); + quote! { + Some(&[#(libcraft_items::Item::#items),*]) + } + } else { + quote! { None } + }, + ) + }) + .collect(), + )); + out.extend(generate_enum_property!( + BlockKind, + "drops", + &'static [libcraft_items::Item], + blocks + .iter() + .map(|block| { + let items = block + .drops + .iter() + .map(|item| { + format_ident!("{}", item_names_by_id[item].to_case(Case::UpperCamel)) + }) + .collect::>(); + ( + block.name.to_case(Case::UpperCamel), + quote! { + &[#(libcraft_items::Item::#items),*] + }, + ) + }) + .collect() + )); + + output("libcraft/blocks/src/block.rs", out.to_string().as_str()); +} + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct Block { + id: u32, + name: String, + #[allow(dead_code)] + display_name: String, + hardness: Option, + resistance: f32, + stack_size: u32, + diggable: bool, + #[allow(dead_code)] + material: String, + transparent: bool, + emit_light: u8, + filter_light: u8, + default_state: u16, + min_state_id: u16, + max_state_id: u16, + #[allow(dead_code)] + states: Vec, + harvest_tools: Option>, + drops: Vec, + bounding_box: String, +} + +#[allow(dead_code)] +#[derive(Deserialize)] +struct State { + name: String, + r#type: StateType, + num_values: usize, + values: Option>, +} + +#[allow(dead_code)] +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +enum StateType { + Bool, + Int, + Enum, +} diff --git a/libcraft/generators/src/generators/block_states.rs b/libcraft/generators/src/generators/block_states.rs new file mode 100644 index 000000000..cb0c0321a --- /dev/null +++ b/libcraft/generators/src/generators/block_states.rs @@ -0,0 +1,39 @@ +use crate::common::{compress_and_write, load_block_report, state_name_to_block_kind}; +use libcraft_blocks::data::BlockReport; + +pub fn generate() -> anyhow::Result<()> { + let block_report = load_block_report("generated/reports/blocks.json")?; + println!("Generating raw block states"); + generate_block_states(&block_report, "libcraft/assets/raw_block_states.bc.gz")?; + println!("Generating raw block properties"); + generate_block_properties(&block_report, "libcraft/assets/raw_block_properties.bc.gz")?; + Ok(()) +} + +pub fn generate_block_states(block_report: &BlockReport, path: &str) -> anyhow::Result<()> { + let mut raw_block_states = Vec::new(); + + for (name, entry) in &block_report.blocks { + let kind = state_name_to_block_kind(name)?; + for state in &entry.states { + raw_block_states.push(state.to_raw_state(kind)); + } + } + + raw_block_states.sort_unstable_by_key(|state| state.id); + + compress_and_write(raw_block_states, path) +} + +pub fn generate_block_properties(block_report: &BlockReport, path: &str) -> anyhow::Result<()> { + let mut raw_block_properties = Vec::new(); + + for (name, entry) in &block_report.blocks { + let kind = state_name_to_block_kind(name)?; + raw_block_properties.push(entry.to_raw_properties(kind)) + } + + raw_block_properties.sort_unstable_by_key(|properties| properties.kind); + + compress_and_write(raw_block_properties, path) +} diff --git a/libcraft/generators/src/generators/dimensions.rs b/libcraft/generators/src/generators/dimensions.rs new file mode 100644 index 000000000..44fb0c84e --- /dev/null +++ b/libcraft/generators/src/generators/dimensions.rs @@ -0,0 +1,49 @@ +use std::path::PathBuf; + +use anyhow::{bail, Context}; +use libcraft::dimension::DimensionInfo; + +pub fn generate() -> anyhow::Result<()> { + let mut dimensions = Vec::new(); + let worldgen = PathBuf::from("worldgen"); + for namespace in std::fs::read_dir(&worldgen)?.flatten() { + let namespace_path = namespace.path(); + for file in std::fs::read_dir(namespace_path.join("dimension"))?.flatten() { + if file.path().is_dir() { + bail!( + "worldgen/{}/dimension/ shouldn't contain directories", + file.file_name().to_str().unwrap_or("") + ) + } + let mut dimension_info: DimensionInfo = + serde_json::from_str(&std::fs::read_to_string(file.path())?)?; + + let (dimension_namespace, dimension_value) = + dimension_info.r#type.split_once(':').context(format!( + "Invalid dimension type `{}`. It should contain `:` once", + dimension_info.r#type + ))?; + if dimension_value.contains(':') { + bail!( + "Invalid dimension type `{}`. It should contain `:` exactly once", + dimension_info.r#type + ); + } + let mut dimension_type_path = worldgen.join(dimension_namespace); + dimension_type_path.push("dimension_type"); + dimension_type_path.push(format!("{}.json", dimension_value)); + dimension_info.info = serde_json::from_str(&std::fs::read_to_string( + dimension_type_path, + )?) + .context(format!( + "Invalid dimension type format (worldgen/{}/dimension_type/{}.json", + dimension_namespace, dimension_value + ))?; + dimensions.push(dimension_info); + } + } + + crate::common::compress_and_write(dimensions, "libcraft/assets/vanilla_dimensions.bc.gz")?; + + Ok(()) +} diff --git a/libcraft/generators/src/generators/entities.rs b/libcraft/generators/src/generators/entities.rs new file mode 100644 index 000000000..1b662cd45 --- /dev/null +++ b/libcraft/generators/src/generators/entities.rs @@ -0,0 +1,204 @@ +use convert_case::{Case, Casing}; + +use crate::utils::*; + +pub fn generate() { + let entities: Vec = load_minecraft_json("entities.json").unwrap(); + let mut out = generate_enum!( + EntityKind, + entities.iter () + .map(|e| e.name.to_case(Case::UpperCamel)) + .collect::>(), + [serde::Serialize, serde::Deserialize, bincode::Encode, bincode::Decode], + #[serde(try_from = "String", into = "&'static str")] + ); + + out.extend(generate_enum_property!( + EntityKind, + "id", + u32, + entities + .iter() + .map(|e| (e.name.to_case(Case::UpperCamel), { + let id = e.id; + quote! { #id } + })) + .collect(), + true + )); + + out.extend(generate_enum_property!( + EntityKind, + "width", + f32, + entities + .iter() + .map(|e| (e.name.to_case(Case::UpperCamel), { + let width = e.width; + quote! { #width } + })) + .collect() + )); + + out.extend(generate_enum_property!( + EntityKind, + "height", + f32, + entities + .iter() + .map(|e| (e.name.to_case(Case::UpperCamel), { + let height = e.height; + quote! { #height } + })) + .collect() + )); + + out.extend(generate_enum_property!( + EntityKind, + "name", + &str, + entities + .iter() + .map(|e| (e.name.to_case(Case::UpperCamel), { + let name = &e.name; + quote! { #name } + })) + .collect(), + true, + &'static str + )); + + out.extend(generate_enum_property!( + EntityKind, + "namespaced_id", + &str, + entities + .iter() + .map(|e| (e.name.to_case(Case::UpperCamel), { + let namespaced_id = format!("minecraft:{}", e.name); + quote! { #namespaced_id } + })) + .collect(), + true, + &'static str + )); + + out.extend(quote! { + use std::convert::TryFrom; + use std::str::FromStr; + + impl TryFrom for EntityKind { + type Error = &'static str; + + fn try_from(value: String) -> Result { + if let Some(kind) = EntityKind::from_name(value.as_str()) { + Ok(kind) + } else { + Err("Unknown entity kind") + } + } + } + + impl From for &'static str { + fn from(i: EntityKind) -> Self { + i.name() + } + } + + impl FromStr for EntityKind { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + if let Some(kind) = EntityKind::from_name(s) { + Ok(kind) + } else { + Err("Unknown entity kind") + } + } + } + }); + + output("libcraft/core/src/entity.rs", out.to_string().as_str()); + + let mut markers = quote! { + use vane::Component; + }; + for entity in entities.iter() { + let name = format_ident!("{}", entity.name.to_case(Case::UpperCamel)); + let doc = format!("A marker component for {} entities.", entity.name); + markers.extend(quote! { + #[derive(Debug, Copy, Clone)] + #[doc = #doc] + pub struct #name; + impl Component for #name {} + }); + } + output("quill/src/entities.rs", markers.to_string().as_str()); + + for entity in entities.iter() { + let path = &format!("feather/common/src/entities/{}.rs", entity.name); + let file = std::fs::read_to_string(path); + if file.is_err() || file.unwrap().starts_with(GENERATED_COMMENT) { + let name = format_ident!("{}", entity.name.to_case(Case::UpperCamel)); + output( + path, + quote! { + use vane::EntityBuilder; + use quill::entities::#name; + use quill::components::EntityKindComponent; + use libcraft::EntityKind; + + pub fn build_default(builder: &mut EntityBuilder) { + super::build_default(builder); + builder.add(#name).add(EntityKindComponent(EntityKind::#name)); + } + } + .to_string() + .as_str(), + ); + } + } + + let name_snake = entities + .iter() + .map(|e| format_ident!("{}", e.name)) + .collect::>(); + let name_upper_camel = entities + .iter() + .map(|e| format_ident!("{}", e.name.to_case(Case::UpperCamel))); + output( + "feather/common/src/entities.rs", + quote! { + use libcraft::EntityKind; + use vane::EntityBuilder; + use quill::components::{OnGround, EntityUuid}; + use uuid::Uuid; + + #[doc = "Adds default components shared between all entities."] + fn build_default(builder: &mut EntityBuilder) { + builder + .add(EntityUuid(Uuid::new_v4())) + .add(OnGround(true)); + } + + #(pub mod #name_snake;)* + + pub fn add_entity_components(builder: &mut EntityBuilder, kind: EntityKind) { + match kind { + #(EntityKind::#name_upper_camel => #name_snake::build_default(builder)),*, + } + } + } + .to_string() + .as_str(), + ); +} + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct EntityInfo { + id: u32, + name: String, + width: f32, + height: f32, +} diff --git a/libcraft/generators/src/generators/inventory.rs b/libcraft/generators/src/generators/inventory.rs new file mode 100644 index 000000000..000c8cc56 --- /dev/null +++ b/libcraft/generators/src/generators/inventory.rs @@ -0,0 +1,228 @@ +use convert_case::{Case, Casing}; +use indexmap::IndexMap; +use proc_macro2::TokenStream; +use serde::de::{Error, Unexpected}; +use serde::Deserializer; + +use crate::utils::*; + +pub fn generate() { + let inventories: Inventories = load_libcraft_json("inventory.json").unwrap(); + + let mut out = generate_enum!( + Area, + inventories + .areas + .iter() + .map(|area| area.0.to_case(Case::UpperCamel)) + .collect::>() + ); + + let mut window_offsets = IndexMap::new(); + for (name, window) in &inventories.windows { + let mut offset = 0; + let mut offsets = IndexMap::new(); + for (inv_area, slots) in &window.slots { + offsets.insert(inv_area, offset..(offset + slots)); + offset += slots; + } + window_offsets.insert(name, offsets); + } + + let mut window_declaration = Vec::new(); + let mut index_to_slot = TokenStream::new(); + let mut slot_to_index = TokenStream::new(); + for (name, window) in &inventories.windows { + let window_name = format_ident!("{}", name.0.to_case(Case::UpperCamel)); + let window_inventories = window + .inventories + .iter() + .map(|inv| format_ident!("{}", inv.0)) + .collect::>(); + + window_declaration.push(quote! { + #window_name { + #(#window_inventories: crate::Inventory),* + } + }); + + let window_binding = quote! { + Window::#window_name { + #(#window_inventories),* + } + }; + let inv = window_offsets + .get(name) + .unwrap() + .keys() + .map(|inv_area| format_ident!("{}", inv_area.0 .0)) + .collect::>(); + let area = window_offsets + .get(name) + .unwrap() + .keys() + .map(|inv_area| format_ident!("{}", inv_area.1 .0.to_case(Case::UpperCamel))) + .collect::>(); + let offset_start = window_offsets + .get(name) + .unwrap() + .values() + .map(|offset| offset.start) + .collect::>(); + let offset_end = window_offsets + .get(name) + .unwrap() + .values() + .map(|offset| offset.end - 1) + .collect::>(); + index_to_slot.extend(quote! { + #((#window_binding, #offset_start..=#offset_end) => { + Some((#inv, Area::#area, index - #offset_start)) + },)* + }); + slot_to_index.extend(quote! { + #((#window_binding, Area::#area) if #inv.ptr_eq(inventory) => { + Some(slot + #offset_start) + })*, + }); + } + let mut inventory_declaration = Vec::new(); + let mut area_slice = TokenStream::new(); + let mut areas = TokenStream::new(); + let mut new_backing = TokenStream::new(); + let mut new_inventory = TokenStream::new(); + for (name, inventory_areas) in &inventories.inventories { + let inventory_name = format_ident!("{}", name.0); + let inventory_name_camel_case = format_ident!("{}", name.0.to_case(Case::UpperCamel)); + let area_name = inventory_areas + .keys() + .map(|area| format_ident!("{}", area.0)) + .collect::>(); + let area_name_camel_case = inventory_areas + .keys() + .map(|area| format_ident!("{}", area.0.to_case(Case::UpperCamel))) + .collect::>(); + let area_size = inventory_areas.values().collect::>(); + inventory_declaration.push(quote! { + #inventory_name_camel_case { + #(#area_name: [T; #area_size]),* + } + }); + let inventory_binding = quote! { + InventoryBacking::#inventory_name_camel_case { + #(#area_name),* + } + }; + area_slice.extend(quote! { + #((#inventory_binding, Area::#area_name_camel_case) => Some(#area_name),)* + }); + areas.extend(quote! { + InventoryBacking::#inventory_name_camel_case { .. } => &[ #(Area::#area_name_camel_case),* ], + }); + new_backing.extend(quote! { + pub fn #inventory_name() -> Self where T: Default { + InventoryBacking::#inventory_name_camel_case { + #(#area_name: Default::default()),* + } + } + }); + new_inventory.extend(quote! { + pub fn #inventory_name() -> Self { + Self { + inner: std::rc::Rc::new(crate::Inner { + backing: InventoryBacking::#inventory_name(), + slot_mutated_callback: std::cell::RefCell::new(None), + }), + } + } + }); + } + out.extend(quote! { + #[derive(Debug, Clone)] + pub enum Window { + #(#window_declaration),* + } + impl Window { + pub fn index_to_slot(&self, index: usize) -> Option<(&crate::Inventory, Area, usize)> { + match (self, index) { + #index_to_slot + _ => None + } + } + pub fn slot_to_index(&self, inventory: &crate::Inventory, area: Area, slot: usize) -> Option { + match (self, area) { + #slot_to_index + _ => None + } + } + } + #[derive(Debug, Clone)] + pub enum InventoryBacking { + #(#inventory_declaration),* + } + impl InventoryBacking { + #new_backing + pub fn area_slice(&self, area: Area) -> Option<&[T]> { + match (self, area) { + #area_slice + _ => None + } + } + pub fn areas(&self) -> &'static [Area] { + match self { + #areas + } + } + } + impl crate::Inventory { + #new_inventory + } + }); + + output( + "libcraft/inventory/src/inventory.rs", + out.to_string().as_str(), + ); +} + +#[derive(Deserialize)] +struct Inventories { + areas: Vec, + inventories: IndexMap>, + windows: IndexMap, +} + +#[derive(Deserialize)] +struct WindowInfo { + inventories: Vec, + slots: IndexMap, +} + +#[derive(Deserialize, Eq, PartialEq, Hash)] +struct AreaName(String); +#[derive(Deserialize, Eq, PartialEq, Hash)] +struct InventoryName(String); +#[derive(Deserialize, Eq, PartialEq, Hash)] +struct WindowName(String); + +#[derive(Eq, PartialEq, Hash)] +struct InventoryArea(InventoryName, AreaName); + +impl<'de> Deserialize<'de> for InventoryArea { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let (inventory, area) = s.split_once(':').ok_or_else(|| { + D::Error::invalid_value( + Unexpected::Str(&s), + &"string in format 'inventory_name:area_name'", + ) + })?; + Ok(InventoryArea( + InventoryName(inventory.to_owned()), + AreaName(area.to_owned()), + )) + } +} diff --git a/libcraft/generators/src/generators/items.rs b/libcraft/generators/src/generators/items.rs new file mode 100644 index 000000000..0f0ea8850 --- /dev/null +++ b/libcraft/generators/src/generators/items.rs @@ -0,0 +1,150 @@ +use convert_case::{Case, Casing}; + +use crate::utils::*; + +pub fn generate() { + let data: Vec = load_minecraft_json("items.json").unwrap(); + + let mut out = generate_enum!( + Item, + data.iter() + .map(|item| item.name.to_case(Case::UpperCamel)) + .collect::>(), + [serde::Serialize, serde::Deserialize], + #[serde(try_from = "String", into = "&'static str")] + ); + + out.extend(generate_enum_property!( + Item, + "id", + u32, + data.iter() + .map(|item| (item.name.to_case(Case::UpperCamel), { + let id = item.id; + quote! { #id } + })) + .collect(), + true + )); + out.extend(generate_enum_property!( + Item, + "name", + &str, + data.iter() + .map(|item| (item.name.to_case(Case::UpperCamel), { + let name = &item.name; + quote! { #name } + })) + .collect(), + true, + &'static str + )); + out.extend(generate_enum_property!( + Item, + "namespaced_id", + &str, + data.iter() + .map(|item| (item.name.to_case(Case::UpperCamel), { + let namespaced_id = format!("minecraft:{}", item.name); + quote! { #namespaced_id } + })) + .collect(), + true, + &'static str + )); + out.extend(generate_enum_property!( + Item, + "stack_size", + u32, + data.iter() + .map(|item| { + (item.name.to_case(Case::UpperCamel), { + let stack_size = item.stack_size; + quote! { #stack_size } + }) + }) + .collect(), + )); + out.extend(generate_enum_property!( + Item, + "max_durability", + Option, + data.iter() + .map(|item| { + ( + item.name.to_case(Case::UpperCamel), + if let Some(max_durability) = item.max_durability { + quote! { Some(#max_durability) } + } else { + quote! { None } + }, + ) + }) + .collect(), + )); + out.extend(generate_enum_property!( + Item, + "fixed_with", + Vec<&str>, + data.iter() + .map(|item| { + (item.name.to_case(Case::UpperCamel), { + let fixed_with = item.fixed_with.clone().unwrap_or_default(); + quote! { + vec![#(#fixed_with),*] + } + }) + }) + .collect(), + false, + Vec<&'static str> + )); + out.extend(quote! { + use std::convert::TryFrom; + use std::str::FromStr; + + impl TryFrom for Item { + type Error = &'static str; + + fn try_from(value: String) -> Result { + if let Some(item) = Item::from_name(value.as_str()) { + Ok(item) + } else { + Err("Unknown item name") + } + } + } + + impl From for &'static str { + fn from(i: Item) -> Self { + i.name() + } + } + + impl FromStr for Item { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + if let Some(item) = Item::from_name(s) { + Ok(item) + } else { + Err("Unknown item name") + } + } + } + }); + + output("libcraft/items/src/item.rs", out.to_string().as_str()); +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +struct Item { + id: u32, + name: String, + #[allow(dead_code)] + display_name: String, + stack_size: u32, + max_durability: Option, + fixed_with: Option>, +} diff --git a/libcraft/generators/src/generators/simplified_block.rs b/libcraft/generators/src/generators/simplified_block.rs new file mode 100644 index 000000000..841f0d149 --- /dev/null +++ b/libcraft/generators/src/generators/simplified_block.rs @@ -0,0 +1,55 @@ +use convert_case::{Case, Casing}; +use indexmap::map::IndexMap; +use regex::Regex; + +use crate::utils::*; + +pub fn generate() { + let simplified_blocks: SimplifiedBlocks = load_libcraft_json("simplified_block.json").unwrap(); + let blocks: Vec = load_minecraft_json("blocks.json").unwrap(); + + let mut out = quote! { use crate::BlockKind; }; + + let mappings = blocks + .into_iter() + .map(|block| { + ( + block.name.to_case(Case::UpperCamel), + simplified_blocks + .regexes + .iter() + .filter(|(_, regexp)| Regex::new(regexp).unwrap().is_match(&block.name)) + .map(|(kind, _)| kind.to_case(Case::UpperCamel)) + .next() + .unwrap_or_else(|| block.name.to_case(Case::UpperCamel)), + ) + }) + .collect::>(); + + let mut variants = mappings.values().collect::>(); + variants.sort(); + variants.dedup(); + out.extend(generate_enum!(SimplifiedBlockKind, variants)); + out.extend(generate_enum_property!( + BlockKind, + "simplified_kind", + SimplifiedBlockKind, + mappings + .into_iter() + .map(|(key, value)| (key, { + let kind = format_ident!("{}", value); + quote! { SimplifiedBlockKind::#kind } + })) + .collect(), + )); + + output( + "libcraft/blocks/src/simplified_block.rs", + out.to_string().as_str(), + ); +} + +#[derive(Deserialize)] +struct SimplifiedBlocks { + regexes: IndexMap, +} diff --git a/libcraft/generators/src/main.rs b/libcraft/generators/src/main.rs index 8dc3c9373..0c775333b 100644 --- a/libcraft/generators/src/main.rs +++ b/libcraft/generators/src/main.rs @@ -1,18 +1,16 @@ mod common; +mod data; mod generators; +mod utils; -use common::load_block_report; -use generators::{generate_block_properties, generate_block_states}; +use data::extract_vanilla_data; fn main() -> anyhow::Result<()> { - let block_report = load_block_report("blocks.json")?; - println!("Generating raw block states"); - generate_block_states(&block_report, "crates/blocks/assets/raw_block_states.bc.gz")?; - println!("Generating raw block properties"); - generate_block_properties( - &block_report, - "crates/blocks/assets/raw_block_properties.bc.gz", - )?; + extract_vanilla_data(); + + println!("Generating code"); + generators::generate_all()?; + println!("Done!"); Ok(()) } diff --git a/libcraft/generators/src/utils.rs b/libcraft/generators/src/utils.rs new file mode 100644 index 000000000..1b5d92522 --- /dev/null +++ b/libcraft/generators/src/utils.rs @@ -0,0 +1,213 @@ +use std::collections::HashMap; +use std::path::PathBuf; + +pub use quote::{format_ident, quote, ToTokens}; +use serde::de::DeserializeOwned; +pub use serde::Deserialize; + +pub use crate::{generate_enum, generate_enum_property}; + +const MINECRAFT_FILES_PATH: &str = "minecraft-data/data"; +const MINECRAFT_DATA_VERSION: &str = "1.18"; +const LIBCRAFT_FILES_PATH: &str = "libcraft-data"; +pub const GENERATED_COMMENT: &str = "// This file is @generated. Please do not edit."; + +pub fn load_minecraft_json(name: &str) -> Result +where + T: DeserializeOwned, +{ + let data_paths: HashMap>> = + serde_json::from_str( + &std::fs::read_to_string(format!("{}/dataPaths.json", MINECRAFT_FILES_PATH)).unwrap(), + )?; + let paths = &data_paths["pc"][MINECRAFT_DATA_VERSION]; + serde_json::from_str( + &std::fs::read_to_string(format!( + "{}/{}/{}", + MINECRAFT_FILES_PATH, + paths[name.trim_end_matches(".json")], + name + )) + .unwrap(), + ) +} + +pub fn load_libcraft_json(name: &str) -> Result +where + T: DeserializeOwned, +{ + serde_json::from_slice(&std::fs::read(format!("{}/{}", LIBCRAFT_FILES_PATH, name)).unwrap()) +} + +/// Writes the contents to a file in provided path, then runs rustfmt. +/// +/// Parameters: +/// path: Path to destination file, relative to feather root +/// content: Contents to be written in the file +pub fn output(file: &str, content: &str) { + let path = std::env::current_dir().unwrap().join(file); + if !path.parent().unwrap().exists() { + panic!( + "Couldn't write to file.\nPath {} does not exist", + path.parent().unwrap().to_str().unwrap() + ); + } + std::fs::write(&path, format!("{}\n{}", GENERATED_COMMENT, content)).unwrap(); + println!("Generated {}", path.to_str().unwrap()); + + rustfmt(path) +} + +fn rustfmt(path: impl Into + Clone) { + std::process::Command::new("rustfmt") + .arg(path.into().to_str().unwrap()) + .spawn() + .unwrap() + .wait() + .unwrap(); +} + +/// Generates an enum definition with the provided variants and extra derives. +#[macro_export] +macro_rules! generate_enum { + ($name: ident, $variants: expr $(,)?) => { + generate_enum!($name, $variants, []) + }; + ($name: ident, $variants: expr, [$($derive: ty),* $(,)?] $(, $(#[$prelude: meta]),*)?) => { + { + use proc_macro2::TokenStream; + + let prelude: TokenStream = quote! { + $($( + #[$prelude] + )*)? + }; + + let variants = $variants + .into_iter() + .map(|variant| format_ident!("{}", variant)) + .collect::>(); + let derives = quote! { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, $($derive),*)] }; + + quote! { + #derives + #prelude + pub enum $name { + #(#variants),* + } + + impl $name { + #[inline] + pub fn values() -> &'static [$name] { + use $name::*; + &[ + #(#variants),* + ] + } + } + } + } + }; +} + +/// Generates lookup functions for an enum. +/// +/// Generates two function for an enum, one which maps the enum value to some +/// property value and one which does the reverse (returning an Option) +#[macro_export] +macro_rules! generate_enum_property { + ($enum_name: ident, $property_name: literal, $typ: ty, $mapping: expr $(,)?) => { + generate_enum_property!($enum_name, $property_name, $typ, $mapping, false) + }; + ($enum_name: ident, $property_name: literal, $typ: ty, $mapping: expr, $reverse: expr $(,)?) => { + generate_enum_property!($enum_name, $property_name, $typ, $mapping, $reverse, $typ) + }; + ($enum_name: ident, $property_name: literal, $typ: ty, $mapping: expr, $reverse: expr, $return_type: ty $(,)?) => { + generate_enum_property!( + $enum_name, + $property_name, + $typ, + $mapping, + $reverse, + $return_type, + false + ) + }; + ($enum_name: ident, $property_name: literal, $typ: ty, $mapping: expr, $reverse: expr, $return_type: ty, $needs_bindings: expr $(,)?) => {{ + use indexmap::IndexMap; + use proc_macro2::TokenStream; + + let property_name: &str = $property_name; + let mapping: IndexMap = $mapping; + let reverse: bool = $reverse; + let needs_bindings: bool = $needs_bindings; + + let mut self_to_prop = Vec::new(); + let mut prop_to_self = Vec::new(); + + for (enum_variant, property_value) in mapping { + let fields = if needs_bindings { + quote! { { .. } } + } else { + quote! {} + }; + let enum_variant = format_ident!("{}", enum_variant); + self_to_prop.push(quote! { + $enum_name::#enum_variant #fields => { #property_value } + }); + prop_to_self.push(quote! { + #property_value => Some($enum_name::#enum_variant) + }); + } + + let mut fns = Vec::new(); + + let property_name_ident = format_ident!("{}", property_name); + let doc = format!( + "Returns the `{}` property of this `{}`.", + property_name, + quote! { $enum_name }.to_string() + ); + fns.push(quote! { + #[doc = #doc] + #[inline] + pub fn #property_name_ident(&self) -> $return_type { + match self { + #(#self_to_prop),* + } + } + }); + + if reverse { + let fn_name = format_ident!("from_{}", property_name); + let doc = format!( + "Gets a `{}` by its `{}`.", + quote! { $enum_name }.to_string(), + property_name + ); + fns.push(quote! { + #[doc = #doc] + #[inline] + pub fn #fn_name(#property_name_ident: $typ) -> Option { + match #property_name_ident { + #(#prop_to_self),*, + _ => None + } + } + }); + } + + quote! { + impl $enum_name { + #(#fns)* + } + } + }}; +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct IdAndName { + pub id: u32, + pub name: String, +} diff --git a/libcraft/inventory/Cargo.toml b/libcraft/inventory/Cargo.toml index 93fc27208..a76ce08c1 100644 --- a/libcraft/inventory/Cargo.toml +++ b/libcraft/inventory/Cargo.toml @@ -2,10 +2,7 @@ name = "libcraft-inventory" version = "0.1.0" authors = ["Tracreed "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +edition = "2021" [dependencies] libcraft-items = { path = "../items" } -parking_lot = "0.11" diff --git a/libcraft/inventory/src/inventory.rs b/libcraft/inventory/src/inventory.rs index 975d6030a..a9db447bb 100644 --- a/libcraft/inventory/src/inventory.rs +++ b/libcraft/inventory/src/inventory.rs @@ -1,5 +1,4 @@ // This file is @generated. Please do not edit. - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum Area { Storage, @@ -42,37 +41,84 @@ pub enum Area { StonecutterInput, StonecutterOutput, } +impl Area { + #[inline] + pub fn values() -> &'static [Area] { + use Area::*; + &[ + Storage, + CraftingOutput, + CraftingInput, + Helmet, + Chestplate, + Leggings, + Boots, + Hotbar, + Offhand, + FurnaceIngredient, + FurnaceFuel, + FurnaceOutput, + EnchantmentItem, + EnchantmentLapis, + BrewingBottle, + BrewingIngredient, + BrewingBlazePowder, + VillagerInput, + VillagerOutput, + BeaconPayment, + AnvilInput1, + AnvilInput2, + AnvilOutput, + Saddle, + HorseArmor, + LlamaCarpet, + CartographyMap, + CartographyPaper, + CartographyOutput, + GrindstoneInput1, + GrindstoneInput2, + GrindstoneOutput, + LecternBook, + LoomBanner, + LoomDye, + LoomPattern, + LoomOutput, + StonecutterInput, + StonecutterOutput, + ] + } +} #[derive(Debug, Clone)] pub enum Window { Player { player: crate::Inventory, }, - Generic9x1 { + Generic9X1 { block: crate::Inventory, player: crate::Inventory, }, - Generic9x2 { + Generic9X2 { block: crate::Inventory, player: crate::Inventory, }, - Generic9x3 { + Generic9X3 { block: crate::Inventory, player: crate::Inventory, }, - Generic9x4 { + Generic9X4 { block: crate::Inventory, player: crate::Inventory, }, - Generic9x5 { + Generic9X5 { block: crate::Inventory, player: crate::Inventory, }, - Generic9x6 { + Generic9X6 { left_chest: crate::Inventory, right_chest: crate::Inventory, player: crate::Inventory, }, - Generic3x3 { + Generic3X3 { block: crate::Inventory, player: crate::Inventory, }, @@ -138,533 +184,437 @@ pub enum Window { }, } impl Window { - #[allow(unused_comparisons)] pub fn index_to_slot(&self, index: usize) -> Option<(&crate::Inventory, Area, usize)> { - match self { - Window::Player { player } => { - if (0..1).contains(&index) { - let area = Area::CraftingOutput; - let slot = index; - Some((player, area, slot)) - } else if (1..5).contains(&index) { - let area = Area::CraftingInput; - let slot = index - 1; - Some((player, area, slot)) - } else if (5..6).contains(&index) { - let area = Area::Helmet; - let slot = index - 5; - Some((player, area, slot)) - } else if (6..7).contains(&index) { - let area = Area::Chestplate; - let slot = index - 6; - Some((player, area, slot)) - } else if (7..8).contains(&index) { - let area = Area::Leggings; - let slot = index - 7; - Some((player, area, slot)) - } else if (8..9).contains(&index) { - let area = Area::Boots; - let slot = index - 8; - Some((player, area, slot)) - } else if (9..36).contains(&index) { - let area = Area::Storage; - let slot = index - 9; - Some((player, area, slot)) - } else if (36..45).contains(&index) { - let area = Area::Hotbar; - let slot = index - 36; - Some((player, area, slot)) - } else if (45..46).contains(&index) { - let area = Area::Offhand; - let slot = index - 45; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x1 { block, player } => { - if (0..9).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (9..36).contains(&index) { - let area = Area::Storage; - let slot = index - 9; - Some((player, area, slot)) - } else if (36..45).contains(&index) { - let area = Area::Hotbar; - let slot = index - 36; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x2 { block, player } => { - if (0..18).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (18..45).contains(&index) { - let area = Area::Storage; - let slot = index - 18; - Some((player, area, slot)) - } else if (45..54).contains(&index) { - let area = Area::Hotbar; - let slot = index - 45; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x3 { block, player } => { - if (0..27).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (27..54).contains(&index) { - let area = Area::Storage; - let slot = index - 27; - Some((player, area, slot)) - } else if (54..63).contains(&index) { - let area = Area::Hotbar; - let slot = index - 54; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x4 { block, player } => { - if (0..36).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (36..63).contains(&index) { - let area = Area::Storage; - let slot = index - 36; - Some((player, area, slot)) - } else if (63..72).contains(&index) { - let area = Area::Hotbar; - let slot = index - 63; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x5 { block, player } => { - if (0..45).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (45..72).contains(&index) { - let area = Area::Storage; - let slot = index - 45; - Some((player, area, slot)) - } else if (72..81).contains(&index) { - let area = Area::Hotbar; - let slot = index - 72; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic9x6 { - left_chest, - right_chest, - player, - } => { - if (0..27).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((left_chest, area, slot)) - } else if (27..54).contains(&index) { - let area = Area::Storage; - let slot = index - 27; - Some((right_chest, area, slot)) - } else if (54..81).contains(&index) { - let area = Area::Storage; - let slot = index - 54; - Some((player, area, slot)) - } else if (81..90).contains(&index) { - let area = Area::Hotbar; - let slot = index - 81; - Some((player, area, slot)) - } else { - None - } - } - Window::Generic3x3 { block, player } => { - if (0..9).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((block, area, slot)) - } else if (9..36).contains(&index) { - let area = Area::Storage; - let slot = index - 9; - Some((player, area, slot)) - } else if (36..45).contains(&index) { - let area = Area::Hotbar; - let slot = index - 36; - Some((player, area, slot)) - } else { - None - } - } - Window::Crafting { - crafting_table, - player, - } => { - if (0..1).contains(&index) { - let area = Area::CraftingOutput; - let slot = index; - Some((crafting_table, area, slot)) - } else if (1..10).contains(&index) { - let area = Area::CraftingInput; - let slot = index - 1; - Some((crafting_table, area, slot)) - } else if (10..37).contains(&index) { - let area = Area::Storage; - let slot = index - 10; - Some((player, area, slot)) - } else if (37..46).contains(&index) { - let area = Area::Hotbar; - let slot = index - 37; - Some((player, area, slot)) - } else { - None - } - } - Window::Furnace { furnace, player } => { - if (0..1).contains(&index) { - let area = Area::FurnaceIngredient; - let slot = index; - Some((furnace, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::FurnaceFuel; - let slot = index - 1; - Some((furnace, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::FurnaceOutput; - let slot = index - 2; - Some((furnace, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::BlastFurnace { - blast_furnace, - player, - } => { - if (0..1).contains(&index) { - let area = Area::FurnaceIngredient; - let slot = index; - Some((blast_furnace, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::FurnaceFuel; - let slot = index - 1; - Some((blast_furnace, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::FurnaceOutput; - let slot = index - 2; - Some((blast_furnace, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::Smoker { smoker, player } => { - if (0..1).contains(&index) { - let area = Area::FurnaceIngredient; - let slot = index; - Some((smoker, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::FurnaceFuel; - let slot = index - 1; - Some((smoker, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::FurnaceOutput; - let slot = index - 2; - Some((smoker, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::Enchantment { - enchantment_table, - player, - } => { - if (0..1).contains(&index) { - let area = Area::EnchantmentItem; - let slot = index; - Some((enchantment_table, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::EnchantmentLapis; - let slot = index - 1; - Some((enchantment_table, area, slot)) - } else if (2..29).contains(&index) { - let area = Area::Storage; - let slot = index - 2; - Some((player, area, slot)) - } else if (29..38).contains(&index) { - let area = Area::Hotbar; - let slot = index - 29; - Some((player, area, slot)) - } else { - None - } - } - Window::BrewingStand { - brewing_stand, - player, - } => { - if (0..3).contains(&index) { - let area = Area::BrewingBottle; - let slot = index; - Some((brewing_stand, area, slot)) - } else if (3..4).contains(&index) { - let area = Area::BrewingIngredient; - let slot = index - 3; - Some((brewing_stand, area, slot)) - } else if (4..5).contains(&index) { - let area = Area::BrewingBlazePowder; - let slot = index - 4; - Some((brewing_stand, area, slot)) - } else if (5..32).contains(&index) { - let area = Area::Storage; - let slot = index - 5; - Some((player, area, slot)) - } else if (32..41).contains(&index) { - let area = Area::Hotbar; - let slot = index - 32; - Some((player, area, slot)) - } else { - None - } - } - Window::Beacon { beacon, player } => { - if (0..1).contains(&index) { - let area = Area::BeaconPayment; - let slot = index; - Some((beacon, area, slot)) - } else if (1..28).contains(&index) { - let area = Area::Storage; - let slot = index - 1; - Some((player, area, slot)) - } else if (28..37).contains(&index) { - let area = Area::Hotbar; - let slot = index - 28; - Some((player, area, slot)) - } else { - None - } - } - Window::Anvil { anvil, player } => { - if (0..1).contains(&index) { - let area = Area::AnvilInput1; - let slot = index; - Some((anvil, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::AnvilInput2; - let slot = index - 1; - Some((anvil, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::AnvilOutput; - let slot = index - 2; - Some((anvil, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::Hopper { hopper, player } => { - if (0..4).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((hopper, area, slot)) - } else if (4..31).contains(&index) { - let area = Area::Storage; - let slot = index - 4; - Some((player, area, slot)) - } else if (31..40).contains(&index) { - let area = Area::Hotbar; - let slot = index - 31; - Some((player, area, slot)) - } else { - None - } - } - Window::ShulkerBox { - shulker_box, - player, - } => { - if (0..27).contains(&index) { - let area = Area::Storage; - let slot = index; - Some((shulker_box, area, slot)) - } else if (27..54).contains(&index) { - let area = Area::Storage; - let slot = index - 27; - Some((player, area, slot)) - } else if (54..63).contains(&index) { - let area = Area::Hotbar; - let slot = index - 54; - Some((player, area, slot)) - } else { - None - } - } - Window::Cartography { - cartography_table, - player, - } => { - if (0..1).contains(&index) { - let area = Area::CartographyMap; - let slot = index; - Some((cartography_table, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::CartographyPaper; - let slot = index - 1; - Some((cartography_table, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::CartographyOutput; - let slot = index - 2; - Some((cartography_table, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::Grindstone { grindstone, player } => { - if (0..1).contains(&index) { - let area = Area::GrindstoneInput1; - let slot = index; - Some((grindstone, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::GrindstoneInput2; - let slot = index - 1; - Some((grindstone, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::GrindstoneOutput; - let slot = index - 2; - Some((grindstone, area, slot)) - } else if (3..30).contains(&index) { - let area = Area::Storage; - let slot = index - 3; - Some((player, area, slot)) - } else if (30..39).contains(&index) { - let area = Area::Hotbar; - let slot = index - 30; - Some((player, area, slot)) - } else { - None - } - } - Window::Lectern { lectern, player } => { - if (0..1).contains(&index) { - let area = Area::LecternBook; - let slot = index; - Some((lectern, area, slot)) - } else if (1..28).contains(&index) { - let area = Area::Storage; - let slot = index - 1; - Some((player, area, slot)) - } else if (28..37).contains(&index) { - let area = Area::Hotbar; - let slot = index - 28; - Some((player, area, slot)) - } else { - None - } - } - Window::Loom { loom, player } => { - if (0..1).contains(&index) { - let area = Area::LoomBanner; - let slot = index; - Some((loom, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::LoomDye; - let slot = index - 1; - Some((loom, area, slot)) - } else if (2..3).contains(&index) { - let area = Area::LoomPattern; - let slot = index - 2; - Some((loom, area, slot)) - } else if (3..4).contains(&index) { - let area = Area::LoomOutput; - let slot = index - 3; - Some((loom, area, slot)) - } else if (4..31).contains(&index) { - let area = Area::Storage; - let slot = index - 4; - Some((player, area, slot)) - } else if (31..40).contains(&index) { - let area = Area::Hotbar; - let slot = index - 31; - Some((player, area, slot)) - } else { - None - } - } - Window::Stonecutter { - stonecutter, - player, - } => { - if (0..1).contains(&index) { - let area = Area::StonecutterInput; - let slot = index; - Some((stonecutter, area, slot)) - } else if (1..2).contains(&index) { - let area = Area::StonecutterOutput; - let slot = index - 1; - Some((stonecutter, area, slot)) - } else if (2..29).contains(&index) { - let area = Area::Storage; - let slot = index - 2; - Some((player, area, slot)) - } else if (29..38).contains(&index) { - let area = Area::Hotbar; - let slot = index - 29; - Some((player, area, slot)) - } else { - None - } + match (self, index) { + (Window::Player { player }, 0usize..=0usize) => { + Some((player, Area::CraftingOutput, index - 0usize)) + } + (Window::Player { player }, 1usize..=4usize) => { + Some((player, Area::CraftingInput, index - 1usize)) + } + (Window::Player { player }, 5usize..=5usize) => { + Some((player, Area::Helmet, index - 5usize)) + } + (Window::Player { player }, 6usize..=6usize) => { + Some((player, Area::Chestplate, index - 6usize)) + } + (Window::Player { player }, 7usize..=7usize) => { + Some((player, Area::Leggings, index - 7usize)) + } + (Window::Player { player }, 8usize..=8usize) => { + Some((player, Area::Boots, index - 8usize)) + } + (Window::Player { player }, 9usize..=35usize) => { + Some((player, Area::Storage, index - 9usize)) + } + (Window::Player { player }, 36usize..=44usize) => { + Some((player, Area::Hotbar, index - 36usize)) + } + (Window::Player { player }, 45usize..=45usize) => { + Some((player, Area::Offhand, index - 45usize)) + } + (Window::Generic9X1 { block, player }, 0usize..=8usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic9X1 { block, player }, 9usize..=35usize) => { + Some((player, Area::Storage, index - 9usize)) + } + (Window::Generic9X1 { block, player }, 36usize..=44usize) => { + Some((player, Area::Hotbar, index - 36usize)) + } + (Window::Generic9X2 { block, player }, 0usize..=17usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic9X2 { block, player }, 18usize..=44usize) => { + Some((player, Area::Storage, index - 18usize)) + } + (Window::Generic9X2 { block, player }, 45usize..=53usize) => { + Some((player, Area::Hotbar, index - 45usize)) + } + (Window::Generic9X3 { block, player }, 0usize..=26usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic9X3 { block, player }, 27usize..=53usize) => { + Some((player, Area::Storage, index - 27usize)) + } + (Window::Generic9X3 { block, player }, 54usize..=62usize) => { + Some((player, Area::Hotbar, index - 54usize)) + } + (Window::Generic9X4 { block, player }, 0usize..=35usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic9X4 { block, player }, 36usize..=62usize) => { + Some((player, Area::Storage, index - 36usize)) + } + (Window::Generic9X4 { block, player }, 63usize..=71usize) => { + Some((player, Area::Hotbar, index - 63usize)) + } + (Window::Generic9X5 { block, player }, 0usize..=44usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic9X5 { block, player }, 45usize..=71usize) => { + Some((player, Area::Storage, index - 45usize)) + } + (Window::Generic9X5 { block, player }, 72usize..=80usize) => { + Some((player, Area::Hotbar, index - 72usize)) + } + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + 0usize..=26usize, + ) => Some((left_chest, Area::Storage, index - 0usize)), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + 27usize..=53usize, + ) => Some((right_chest, Area::Storage, index - 27usize)), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + 54usize..=80usize, + ) => Some((player, Area::Storage, index - 54usize)), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + 81usize..=89usize, + ) => Some((player, Area::Hotbar, index - 81usize)), + (Window::Generic3X3 { block, player }, 0usize..=8usize) => { + Some((block, Area::Storage, index - 0usize)) + } + (Window::Generic3X3 { block, player }, 9usize..=35usize) => { + Some((player, Area::Storage, index - 9usize)) + } + (Window::Generic3X3 { block, player }, 36usize..=44usize) => { + Some((player, Area::Hotbar, index - 36usize)) + } + ( + Window::Crafting { + crafting_table, + player, + }, + 0usize..=0usize, + ) => Some((crafting_table, Area::CraftingOutput, index - 0usize)), + ( + Window::Crafting { + crafting_table, + player, + }, + 1usize..=9usize, + ) => Some((crafting_table, Area::CraftingInput, index - 1usize)), + ( + Window::Crafting { + crafting_table, + player, + }, + 10usize..=36usize, + ) => Some((player, Area::Storage, index - 10usize)), + ( + Window::Crafting { + crafting_table, + player, + }, + 37usize..=45usize, + ) => Some((player, Area::Hotbar, index - 37usize)), + (Window::Furnace { furnace, player }, 0usize..=0usize) => { + Some((furnace, Area::FurnaceIngredient, index - 0usize)) + } + (Window::Furnace { furnace, player }, 1usize..=1usize) => { + Some((furnace, Area::FurnaceFuel, index - 1usize)) + } + (Window::Furnace { furnace, player }, 2usize..=2usize) => { + Some((furnace, Area::FurnaceOutput, index - 2usize)) + } + (Window::Furnace { furnace, player }, 3usize..=29usize) => { + Some((player, Area::Storage, index - 3usize)) + } + (Window::Furnace { furnace, player }, 30usize..=38usize) => { + Some((player, Area::Hotbar, index - 30usize)) + } + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + 0usize..=0usize, + ) => Some((blast_furnace, Area::FurnaceIngredient, index - 0usize)), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + 1usize..=1usize, + ) => Some((blast_furnace, Area::FurnaceFuel, index - 1usize)), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + 2usize..=2usize, + ) => Some((blast_furnace, Area::FurnaceOutput, index - 2usize)), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + 3usize..=29usize, + ) => Some((player, Area::Storage, index - 3usize)), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + 30usize..=38usize, + ) => Some((player, Area::Hotbar, index - 30usize)), + (Window::Smoker { smoker, player }, 0usize..=0usize) => { + Some((smoker, Area::FurnaceIngredient, index - 0usize)) + } + (Window::Smoker { smoker, player }, 1usize..=1usize) => { + Some((smoker, Area::FurnaceFuel, index - 1usize)) + } + (Window::Smoker { smoker, player }, 2usize..=2usize) => { + Some((smoker, Area::FurnaceOutput, index - 2usize)) } + (Window::Smoker { smoker, player }, 3usize..=29usize) => { + Some((player, Area::Storage, index - 3usize)) + } + (Window::Smoker { smoker, player }, 30usize..=38usize) => { + Some((player, Area::Hotbar, index - 30usize)) + } + ( + Window::Enchantment { + enchantment_table, + player, + }, + 0usize..=0usize, + ) => Some((enchantment_table, Area::EnchantmentItem, index - 0usize)), + ( + Window::Enchantment { + enchantment_table, + player, + }, + 1usize..=1usize, + ) => Some((enchantment_table, Area::EnchantmentLapis, index - 1usize)), + ( + Window::Enchantment { + enchantment_table, + player, + }, + 2usize..=28usize, + ) => Some((player, Area::Storage, index - 2usize)), + ( + Window::Enchantment { + enchantment_table, + player, + }, + 29usize..=37usize, + ) => Some((player, Area::Hotbar, index - 29usize)), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + 0usize..=2usize, + ) => Some((brewing_stand, Area::BrewingBottle, index - 0usize)), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + 3usize..=3usize, + ) => Some((brewing_stand, Area::BrewingIngredient, index - 3usize)), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + 4usize..=4usize, + ) => Some((brewing_stand, Area::BrewingBlazePowder, index - 4usize)), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + 5usize..=31usize, + ) => Some((player, Area::Storage, index - 5usize)), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + 32usize..=40usize, + ) => Some((player, Area::Hotbar, index - 32usize)), + (Window::Beacon { beacon, player }, 0usize..=0usize) => { + Some((beacon, Area::BeaconPayment, index - 0usize)) + } + (Window::Beacon { beacon, player }, 1usize..=27usize) => { + Some((player, Area::Storage, index - 1usize)) + } + (Window::Beacon { beacon, player }, 28usize..=36usize) => { + Some((player, Area::Hotbar, index - 28usize)) + } + (Window::Anvil { anvil, player }, 0usize..=0usize) => { + Some((anvil, Area::AnvilInput1, index - 0usize)) + } + (Window::Anvil { anvil, player }, 1usize..=1usize) => { + Some((anvil, Area::AnvilInput2, index - 1usize)) + } + (Window::Anvil { anvil, player }, 2usize..=2usize) => { + Some((anvil, Area::AnvilOutput, index - 2usize)) + } + (Window::Anvil { anvil, player }, 3usize..=29usize) => { + Some((player, Area::Storage, index - 3usize)) + } + (Window::Anvil { anvil, player }, 30usize..=38usize) => { + Some((player, Area::Hotbar, index - 30usize)) + } + (Window::Hopper { hopper, player }, 0usize..=3usize) => { + Some((hopper, Area::Storage, index - 0usize)) + } + (Window::Hopper { hopper, player }, 4usize..=30usize) => { + Some((player, Area::Storage, index - 4usize)) + } + (Window::Hopper { hopper, player }, 31usize..=39usize) => { + Some((player, Area::Hotbar, index - 31usize)) + } + ( + Window::ShulkerBox { + shulker_box, + player, + }, + 0usize..=26usize, + ) => Some((shulker_box, Area::Storage, index - 0usize)), + ( + Window::ShulkerBox { + shulker_box, + player, + }, + 27usize..=53usize, + ) => Some((player, Area::Storage, index - 27usize)), + ( + Window::ShulkerBox { + shulker_box, + player, + }, + 54usize..=62usize, + ) => Some((player, Area::Hotbar, index - 54usize)), + ( + Window::Cartography { + cartography_table, + player, + }, + 0usize..=0usize, + ) => Some((cartography_table, Area::CartographyMap, index - 0usize)), + ( + Window::Cartography { + cartography_table, + player, + }, + 1usize..=1usize, + ) => Some((cartography_table, Area::CartographyPaper, index - 1usize)), + ( + Window::Cartography { + cartography_table, + player, + }, + 2usize..=2usize, + ) => Some((cartography_table, Area::CartographyOutput, index - 2usize)), + ( + Window::Cartography { + cartography_table, + player, + }, + 3usize..=29usize, + ) => Some((player, Area::Storage, index - 3usize)), + ( + Window::Cartography { + cartography_table, + player, + }, + 30usize..=38usize, + ) => Some((player, Area::Hotbar, index - 30usize)), + (Window::Grindstone { grindstone, player }, 0usize..=0usize) => { + Some((grindstone, Area::GrindstoneInput1, index - 0usize)) + } + (Window::Grindstone { grindstone, player }, 1usize..=1usize) => { + Some((grindstone, Area::GrindstoneInput2, index - 1usize)) + } + (Window::Grindstone { grindstone, player }, 2usize..=2usize) => { + Some((grindstone, Area::GrindstoneOutput, index - 2usize)) + } + (Window::Grindstone { grindstone, player }, 3usize..=29usize) => { + Some((player, Area::Storage, index - 3usize)) + } + (Window::Grindstone { grindstone, player }, 30usize..=38usize) => { + Some((player, Area::Hotbar, index - 30usize)) + } + (Window::Lectern { lectern, player }, 0usize..=0usize) => { + Some((lectern, Area::LecternBook, index - 0usize)) + } + (Window::Lectern { lectern, player }, 1usize..=27usize) => { + Some((player, Area::Storage, index - 1usize)) + } + (Window::Lectern { lectern, player }, 28usize..=36usize) => { + Some((player, Area::Hotbar, index - 28usize)) + } + (Window::Loom { loom, player }, 0usize..=0usize) => { + Some((loom, Area::LoomBanner, index - 0usize)) + } + (Window::Loom { loom, player }, 1usize..=1usize) => { + Some((loom, Area::LoomDye, index - 1usize)) + } + (Window::Loom { loom, player }, 2usize..=2usize) => { + Some((loom, Area::LoomPattern, index - 2usize)) + } + (Window::Loom { loom, player }, 3usize..=3usize) => { + Some((loom, Area::LoomOutput, index - 3usize)) + } + (Window::Loom { loom, player }, 4usize..=30usize) => { + Some((player, Area::Storage, index - 4usize)) + } + (Window::Loom { loom, player }, 31usize..=39usize) => { + Some((player, Area::Hotbar, index - 31usize)) + } + ( + Window::Stonecutter { + stonecutter, + player, + }, + 0usize..=0usize, + ) => Some((stonecutter, Area::StonecutterInput, index - 0usize)), + ( + Window::Stonecutter { + stonecutter, + player, + }, + 1usize..=1usize, + ) => Some((stonecutter, Area::StonecutterOutput, index - 1usize)), + ( + Window::Stonecutter { + stonecutter, + player, + }, + 2usize..=28usize, + ) => Some((player, Area::Storage, index - 2usize)), + ( + Window::Stonecutter { + stonecutter, + player, + }, + 29usize..=37usize, + ) => Some((player, Area::Hotbar, index - 29usize)), + _ => None, } } pub fn slot_to_index( @@ -673,483 +623,490 @@ impl Window { area: Area, slot: usize, ) -> Option { - match self { - Window::Player { player } => { - if area == Area::CraftingOutput && player.ptr_eq(inventory) { - Some(slot) - } else if area == Area::CraftingInput && player.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Helmet && player.ptr_eq(inventory) { - Some(slot + 5) - } else if area == Area::Chestplate && player.ptr_eq(inventory) { - Some(slot + 6) - } else if area == Area::Leggings && player.ptr_eq(inventory) { - Some(slot + 7) - } else if area == Area::Boots && player.ptr_eq(inventory) { - Some(slot + 8) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 9) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 36) - } else if area == Area::Offhand && player.ptr_eq(inventory) { - Some(slot + 45) - } else { - None - } - } - Window::Generic9x1 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 9) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 36) - } else { - None - } - } - Window::Generic9x2 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 18) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 45) - } else { - None - } - } - Window::Generic9x3 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 27) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 54) - } else { - None - } - } - Window::Generic9x4 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 36) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 63) - } else { - None - } - } - Window::Generic9x5 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 45) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 72) - } else { - None - } - } - Window::Generic9x6 { - left_chest, - right_chest, - player, - } => { - if area == Area::Storage && left_chest.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && right_chest.ptr_eq(inventory) { - Some(slot + 27) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 54) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 81) - } else { - None - } - } - Window::Generic3x3 { block, player } => { - if area == Area::Storage && block.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 9) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 36) - } else { - None - } - } - Window::Crafting { - crafting_table, - player, - } => { - if area == Area::CraftingOutput && crafting_table.ptr_eq(inventory) { - Some(slot) - } else if area == Area::CraftingInput && crafting_table.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 10) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 37) - } else { - None - } - } - Window::Furnace { furnace, player } => { - if area == Area::FurnaceIngredient && furnace.ptr_eq(inventory) { - Some(slot) - } else if area == Area::FurnaceFuel && furnace.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::FurnaceOutput && furnace.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::BlastFurnace { - blast_furnace, - player, - } => { - if area == Area::FurnaceIngredient && blast_furnace.ptr_eq(inventory) { - Some(slot) - } else if area == Area::FurnaceFuel && blast_furnace.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::FurnaceOutput && blast_furnace.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::Smoker { smoker, player } => { - if area == Area::FurnaceIngredient && smoker.ptr_eq(inventory) { - Some(slot) - } else if area == Area::FurnaceFuel && smoker.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::FurnaceOutput && smoker.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::Enchantment { - enchantment_table, - player, - } => { - if area == Area::EnchantmentItem && enchantment_table.ptr_eq(inventory) { - Some(slot) - } else if area == Area::EnchantmentLapis && enchantment_table.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 29) - } else { - None - } - } - Window::BrewingStand { - brewing_stand, - player, - } => { - if area == Area::BrewingBottle && brewing_stand.ptr_eq(inventory) { - Some(slot) - } else if area == Area::BrewingIngredient && brewing_stand.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::BrewingBlazePowder && brewing_stand.ptr_eq(inventory) { - Some(slot + 4) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 5) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 32) - } else { - None - } - } - Window::Beacon { beacon, player } => { - if area == Area::BeaconPayment && beacon.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 28) - } else { - None - } - } - Window::Anvil { anvil, player } => { - if area == Area::AnvilInput1 && anvil.ptr_eq(inventory) { - Some(slot) - } else if area == Area::AnvilInput2 && anvil.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::AnvilOutput && anvil.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::Hopper { hopper, player } => { - if area == Area::Storage && hopper.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 4) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 31) - } else { - None - } - } - Window::ShulkerBox { - shulker_box, - player, - } => { - if area == Area::Storage && shulker_box.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 27) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 54) - } else { - None - } - } - Window::Cartography { - cartography_table, - player, - } => { - if area == Area::CartographyMap && cartography_table.ptr_eq(inventory) { - Some(slot) - } else if area == Area::CartographyPaper && cartography_table.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::CartographyOutput && cartography_table.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::Grindstone { grindstone, player } => { - if area == Area::GrindstoneInput1 && grindstone.ptr_eq(inventory) { - Some(slot) - } else if area == Area::GrindstoneInput2 && grindstone.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::GrindstoneOutput && grindstone.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 30) - } else { - None - } - } - Window::Lectern { lectern, player } => { - if area == Area::LecternBook && lectern.ptr_eq(inventory) { - Some(slot) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 28) - } else { - None - } - } - Window::Loom { loom, player } => { - if area == Area::LoomBanner && loom.ptr_eq(inventory) { - Some(slot) - } else if area == Area::LoomDye && loom.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::LoomPattern && loom.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::LoomOutput && loom.ptr_eq(inventory) { - Some(slot + 3) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 4) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 31) - } else { - None - } - } - Window::Stonecutter { - stonecutter, - player, - } => { - if area == Area::StonecutterInput && stonecutter.ptr_eq(inventory) { - Some(slot) - } else if area == Area::StonecutterOutput && stonecutter.ptr_eq(inventory) { - Some(slot + 1) - } else if area == Area::Storage && player.ptr_eq(inventory) { - Some(slot + 2) - } else if area == Area::Hotbar && player.ptr_eq(inventory) { - Some(slot + 29) - } else { - None - } + match (self, area) { + (Window::Player { player }, Area::CraftingOutput) if player.ptr_eq(inventory) => { + Some(slot + 0usize) } - } - } -} -#[allow(warnings)] -#[allow(clippy::all)] -impl Window { - /// Returns the `name` property of this `Window`. - pub fn name(&self) -> &'static str { - match self { - Window::Player { .. } => "player", - Window::Generic9x1 { .. } => "generic_9x1", - Window::Generic9x2 { .. } => "generic_9x2", - Window::Generic9x3 { .. } => "generic_9x3", - Window::Generic9x4 { .. } => "generic_9x4", - Window::Generic9x5 { .. } => "generic_9x5", - Window::Generic9x6 { .. } => "generic_9x6", - Window::Generic3x3 { .. } => "generic_3x3", - Window::Crafting { .. } => "crafting", - Window::Furnace { .. } => "furnace", - Window::BlastFurnace { .. } => "blast_furnace", - Window::Smoker { .. } => "smoker", - Window::Enchantment { .. } => "enchantment", - Window::BrewingStand { .. } => "brewing_stand", - Window::Beacon { .. } => "beacon", - Window::Anvil { .. } => "anvil", - Window::Hopper { .. } => "hopper", - Window::ShulkerBox { .. } => "shulker_box", - Window::Cartography { .. } => "cartography", - Window::Grindstone { .. } => "grindstone", - Window::Lectern { .. } => "lectern", - Window::Loom { .. } => "loom", - Window::Stonecutter { .. } => "stonecutter", + (Window::Player { player }, Area::CraftingInput) if player.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Player { player }, Area::Helmet) if player.ptr_eq(inventory) => { + Some(slot + 5usize) + } + (Window::Player { player }, Area::Chestplate) if player.ptr_eq(inventory) => { + Some(slot + 6usize) + } + (Window::Player { player }, Area::Leggings) if player.ptr_eq(inventory) => { + Some(slot + 7usize) + } + (Window::Player { player }, Area::Boots) if player.ptr_eq(inventory) => { + Some(slot + 8usize) + } + (Window::Player { player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 9usize) + } + (Window::Player { player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 36usize) + } + (Window::Player { player }, Area::Offhand) if player.ptr_eq(inventory) => { + Some(slot + 45usize) + } + (Window::Generic9X1 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic9X1 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 9usize) + } + (Window::Generic9X1 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 36usize) + } + (Window::Generic9X2 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic9X2 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 18usize) + } + (Window::Generic9X2 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 45usize) + } + (Window::Generic9X3 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic9X3 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 27usize) + } + (Window::Generic9X3 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 54usize) + } + (Window::Generic9X4 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic9X4 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 36usize) + } + (Window::Generic9X4 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 63usize) + } + (Window::Generic9X5 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic9X5 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 45usize) + } + (Window::Generic9X5 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 72usize) + } + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + Area::Storage, + ) if left_chest.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + Area::Storage, + ) if right_chest.ptr_eq(inventory) => Some(slot + 27usize), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 54usize), + ( + Window::Generic9X6 { + left_chest, + right_chest, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 81usize), + (Window::Generic3X3 { block, player }, Area::Storage) if block.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Generic3X3 { block, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 9usize) + } + (Window::Generic3X3 { block, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 36usize) + } + ( + Window::Crafting { + crafting_table, + player, + }, + Area::CraftingOutput, + ) if crafting_table.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::Crafting { + crafting_table, + player, + }, + Area::CraftingInput, + ) if crafting_table.ptr_eq(inventory) => Some(slot + 1usize), + ( + Window::Crafting { + crafting_table, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 10usize), + ( + Window::Crafting { + crafting_table, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 37usize), + (Window::Furnace { furnace, player }, Area::FurnaceIngredient) + if furnace.ptr_eq(inventory) => + { + Some(slot + 0usize) + } + (Window::Furnace { furnace, player }, Area::FurnaceFuel) + if furnace.ptr_eq(inventory) => + { + Some(slot + 1usize) + } + (Window::Furnace { furnace, player }, Area::FurnaceOutput) + if furnace.ptr_eq(inventory) => + { + Some(slot + 2usize) + } + (Window::Furnace { furnace, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 3usize) + } + (Window::Furnace { furnace, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 30usize) + } + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + Area::FurnaceIngredient, + ) if blast_furnace.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + Area::FurnaceFuel, + ) if blast_furnace.ptr_eq(inventory) => Some(slot + 1usize), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + Area::FurnaceOutput, + ) if blast_furnace.ptr_eq(inventory) => Some(slot + 2usize), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 3usize), + ( + Window::BlastFurnace { + blast_furnace, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 30usize), + (Window::Smoker { smoker, player }, Area::FurnaceIngredient) + if smoker.ptr_eq(inventory) => + { + Some(slot + 0usize) + } + (Window::Smoker { smoker, player }, Area::FurnaceFuel) if smoker.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Smoker { smoker, player }, Area::FurnaceOutput) + if smoker.ptr_eq(inventory) => + { + Some(slot + 2usize) + } + (Window::Smoker { smoker, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 3usize) + } + (Window::Smoker { smoker, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 30usize) + } + ( + Window::Enchantment { + enchantment_table, + player, + }, + Area::EnchantmentItem, + ) if enchantment_table.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::Enchantment { + enchantment_table, + player, + }, + Area::EnchantmentLapis, + ) if enchantment_table.ptr_eq(inventory) => Some(slot + 1usize), + ( + Window::Enchantment { + enchantment_table, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 2usize), + ( + Window::Enchantment { + enchantment_table, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 29usize), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + Area::BrewingBottle, + ) if brewing_stand.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + Area::BrewingIngredient, + ) if brewing_stand.ptr_eq(inventory) => Some(slot + 3usize), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + Area::BrewingBlazePowder, + ) if brewing_stand.ptr_eq(inventory) => Some(slot + 4usize), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 5usize), + ( + Window::BrewingStand { + brewing_stand, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 32usize), + (Window::Beacon { beacon, player }, Area::BeaconPayment) + if beacon.ptr_eq(inventory) => + { + Some(slot + 0usize) + } + (Window::Beacon { beacon, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Beacon { beacon, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 28usize) + } + (Window::Anvil { anvil, player }, Area::AnvilInput1) if anvil.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Anvil { anvil, player }, Area::AnvilInput2) if anvil.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Anvil { anvil, player }, Area::AnvilOutput) if anvil.ptr_eq(inventory) => { + Some(slot + 2usize) + } + (Window::Anvil { anvil, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 3usize) + } + (Window::Anvil { anvil, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 30usize) + } + (Window::Hopper { hopper, player }, Area::Storage) if hopper.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Hopper { hopper, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 4usize) + } + (Window::Hopper { hopper, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 31usize) + } + ( + Window::ShulkerBox { + shulker_box, + player, + }, + Area::Storage, + ) if shulker_box.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::ShulkerBox { + shulker_box, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 27usize), + ( + Window::ShulkerBox { + shulker_box, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 54usize), + ( + Window::Cartography { + cartography_table, + player, + }, + Area::CartographyMap, + ) if cartography_table.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::Cartography { + cartography_table, + player, + }, + Area::CartographyPaper, + ) if cartography_table.ptr_eq(inventory) => Some(slot + 1usize), + ( + Window::Cartography { + cartography_table, + player, + }, + Area::CartographyOutput, + ) if cartography_table.ptr_eq(inventory) => Some(slot + 2usize), + ( + Window::Cartography { + cartography_table, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 3usize), + ( + Window::Cartography { + cartography_table, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 30usize), + (Window::Grindstone { grindstone, player }, Area::GrindstoneInput1) + if grindstone.ptr_eq(inventory) => + { + Some(slot + 0usize) + } + (Window::Grindstone { grindstone, player }, Area::GrindstoneInput2) + if grindstone.ptr_eq(inventory) => + { + Some(slot + 1usize) + } + (Window::Grindstone { grindstone, player }, Area::GrindstoneOutput) + if grindstone.ptr_eq(inventory) => + { + Some(slot + 2usize) + } + (Window::Grindstone { grindstone, player }, Area::Storage) + if player.ptr_eq(inventory) => + { + Some(slot + 3usize) + } + (Window::Grindstone { grindstone, player }, Area::Hotbar) + if player.ptr_eq(inventory) => + { + Some(slot + 30usize) + } + (Window::Lectern { lectern, player }, Area::LecternBook) + if lectern.ptr_eq(inventory) => + { + Some(slot + 0usize) + } + (Window::Lectern { lectern, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Lectern { lectern, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 28usize) + } + (Window::Loom { loom, player }, Area::LoomBanner) if loom.ptr_eq(inventory) => { + Some(slot + 0usize) + } + (Window::Loom { loom, player }, Area::LoomDye) if loom.ptr_eq(inventory) => { + Some(slot + 1usize) + } + (Window::Loom { loom, player }, Area::LoomPattern) if loom.ptr_eq(inventory) => { + Some(slot + 2usize) + } + (Window::Loom { loom, player }, Area::LoomOutput) if loom.ptr_eq(inventory) => { + Some(slot + 3usize) + } + (Window::Loom { loom, player }, Area::Storage) if player.ptr_eq(inventory) => { + Some(slot + 4usize) + } + (Window::Loom { loom, player }, Area::Hotbar) if player.ptr_eq(inventory) => { + Some(slot + 31usize) + } + ( + Window::Stonecutter { + stonecutter, + player, + }, + Area::StonecutterInput, + ) if stonecutter.ptr_eq(inventory) => Some(slot + 0usize), + ( + Window::Stonecutter { + stonecutter, + player, + }, + Area::StonecutterOutput, + ) if stonecutter.ptr_eq(inventory) => Some(slot + 1usize), + ( + Window::Stonecutter { + stonecutter, + player, + }, + Area::Storage, + ) if player.ptr_eq(inventory) => Some(slot + 2usize), + ( + Window::Stonecutter { + stonecutter, + player, + }, + Area::Hotbar, + ) if player.ptr_eq(inventory) => Some(slot + 29usize), + _ => None, } } } #[derive(Debug, Clone)] pub enum InventoryBacking { Player { - crafting_input: [T; 4], - crafting_output: [T; 1], - helmet: [T; 1], - chestplate: [T; 1], - leggings: [T; 1], - boots: [T; 1], - storage: [T; 27], - hotbar: [T; 9], - offhand: [T; 1], + crafting_input: [T; 4usize], + crafting_output: [T; 1usize], + helmet: [T; 1usize], + chestplate: [T; 1usize], + leggings: [T; 1usize], + boots: [T; 1usize], + storage: [T; 27usize], + hotbar: [T; 9usize], + offhand: [T; 1usize], }, Chest { - storage: [T; 27], + storage: [T; 27usize], }, CraftingTable { - crafting_input: [T; 9], - crafting_output: [T; 1], + crafting_input: [T; 9usize], + crafting_output: [T; 1usize], }, Furnace { - furnace_ingredient: [T; 1], - furnace_fuel: [T; 1], - furnace_output: [T; 1], + furnace_ingredient: [T; 1usize], + furnace_fuel: [T; 1usize], + furnace_output: [T; 1usize], }, } impl InventoryBacking { - pub fn area_slice(&self, area: Area) -> Option<&[T]> { - match self { - InventoryBacking::Player { - crafting_input, - crafting_output, - helmet, - chestplate, - leggings, - boots, - storage, - hotbar, - offhand, - } => match area { - Area::CraftingInput => Some(crafting_input.as_ref()), - Area::CraftingOutput => Some(crafting_output.as_ref()), - Area::Helmet => Some(helmet.as_ref()), - Area::Chestplate => Some(chestplate.as_ref()), - Area::Leggings => Some(leggings.as_ref()), - Area::Boots => Some(boots.as_ref()), - Area::Storage => Some(storage.as_ref()), - Area::Hotbar => Some(hotbar.as_ref()), - Area::Offhand => Some(offhand.as_ref()), - _ => None, - }, - InventoryBacking::Chest { storage } => match area { - Area::Storage => Some(storage.as_ref()), - _ => None, - }, - InventoryBacking::CraftingTable { - crafting_input, - crafting_output, - } => match area { - Area::CraftingInput => Some(crafting_input.as_ref()), - Area::CraftingOutput => Some(crafting_output.as_ref()), - _ => None, - }, - InventoryBacking::Furnace { - furnace_ingredient, - furnace_fuel, - furnace_output, - } => match area { - Area::FurnaceIngredient => Some(furnace_ingredient.as_ref()), - Area::FurnaceFuel => Some(furnace_fuel.as_ref()), - Area::FurnaceOutput => Some(furnace_output.as_ref()), - _ => None, - }, - } - } - pub fn areas(&self) -> &'static [Area] { - match self { - InventoryBacking::Player { .. } => { - static AREAS: [Area; 9] = [ - Area::CraftingInput, - Area::CraftingOutput, - Area::Helmet, - Area::Chestplate, - Area::Leggings, - Area::Boots, - Area::Storage, - Area::Hotbar, - Area::Offhand, - ]; - &AREAS - } - InventoryBacking::Chest { .. } => { - static AREAS: [Area; 1] = [Area::Storage]; - &AREAS - } - InventoryBacking::CraftingTable { .. } => { - static AREAS: [Area; 2] = [Area::CraftingInput, Area::CraftingOutput]; - &AREAS - } - InventoryBacking::Furnace { .. } => { - static AREAS: [Area; 3] = [ - Area::FurnaceIngredient, - Area::FurnaceFuel, - Area::FurnaceOutput, - ]; - &AREAS - } - } - } pub fn player() -> Self where T: Default, @@ -1193,26 +1150,230 @@ impl InventoryBacking { furnace_output: Default::default(), } } + pub fn area_slice(&self, area: Area) -> Option<&[T]> { + match (self, area) { + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::CraftingInput, + ) => Some(crafting_input), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::CraftingOutput, + ) => Some(crafting_output), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Helmet, + ) => Some(helmet), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Chestplate, + ) => Some(chestplate), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Leggings, + ) => Some(leggings), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Boots, + ) => Some(boots), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Storage, + ) => Some(storage), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Hotbar, + ) => Some(hotbar), + ( + InventoryBacking::Player { + crafting_input, + crafting_output, + helmet, + chestplate, + leggings, + boots, + storage, + hotbar, + offhand, + }, + Area::Offhand, + ) => Some(offhand), + (InventoryBacking::Chest { storage }, Area::Storage) => Some(storage), + ( + InventoryBacking::CraftingTable { + crafting_input, + crafting_output, + }, + Area::CraftingInput, + ) => Some(crafting_input), + ( + InventoryBacking::CraftingTable { + crafting_input, + crafting_output, + }, + Area::CraftingOutput, + ) => Some(crafting_output), + ( + InventoryBacking::Furnace { + furnace_ingredient, + furnace_fuel, + furnace_output, + }, + Area::FurnaceIngredient, + ) => Some(furnace_ingredient), + ( + InventoryBacking::Furnace { + furnace_ingredient, + furnace_fuel, + furnace_output, + }, + Area::FurnaceFuel, + ) => Some(furnace_fuel), + ( + InventoryBacking::Furnace { + furnace_ingredient, + furnace_fuel, + furnace_output, + }, + Area::FurnaceOutput, + ) => Some(furnace_output), + _ => None, + } + } + pub fn areas(&self) -> &'static [Area] { + match self { + InventoryBacking::Player { .. } => &[ + Area::CraftingInput, + Area::CraftingOutput, + Area::Helmet, + Area::Chestplate, + Area::Leggings, + Area::Boots, + Area::Storage, + Area::Hotbar, + Area::Offhand, + ], + InventoryBacking::Chest { .. } => &[Area::Storage], + InventoryBacking::CraftingTable { .. } => &[Area::CraftingInput, Area::CraftingOutput], + InventoryBacking::Furnace { .. } => &[ + Area::FurnaceIngredient, + Area::FurnaceFuel, + Area::FurnaceOutput, + ], + } + } } impl crate::Inventory { pub fn player() -> Self { Self { - backing: std::sync::Arc::new(InventoryBacking::player()), + inner: std::rc::Rc::new(crate::Inner { + backing: InventoryBacking::player(), + slot_mutated_callback: std::cell::RefCell::new(None), + }), } } pub fn chest() -> Self { Self { - backing: std::sync::Arc::new(InventoryBacking::chest()), + inner: std::rc::Rc::new(crate::Inner { + backing: InventoryBacking::chest(), + slot_mutated_callback: std::cell::RefCell::new(None), + }), } } pub fn crafting_table() -> Self { Self { - backing: std::sync::Arc::new(InventoryBacking::crafting_table()), + inner: std::rc::Rc::new(crate::Inner { + backing: InventoryBacking::crafting_table(), + slot_mutated_callback: std::cell::RefCell::new(None), + }), } } pub fn furnace() -> Self { Self { - backing: std::sync::Arc::new(InventoryBacking::furnace()), + inner: std::rc::Rc::new(crate::Inner { + backing: InventoryBacking::furnace(), + slot_mutated_callback: std::cell::RefCell::new(None), + }), } } } diff --git a/libcraft/inventory/src/lib.rs b/libcraft/inventory/src/lib.rs index a2abc3cb6..677052e5d 100644 --- a/libcraft/inventory/src/lib.rs +++ b/libcraft/inventory/src/lib.rs @@ -1,13 +1,24 @@ +#![allow(unused_variables)] +#![allow(clippy::identity_op)] mod inventory; -use parking_lot::{Mutex, MutexGuard}; -use std::{error::Error, sync::Arc}; +use std::{ + cell::{Ref, RefCell, RefMut}, + error::Error, + fmt::Debug, + rc::Rc, +}; pub use inventory::{Area, InventoryBacking, Window}; use libcraft_items::InventorySlot; -type Slot = Mutex; +type Slot = RefCell; + +struct Inner { + backing: InventoryBacking, + slot_mutated_callback: RefCell>>, +} /// A handle to an inventory. /// @@ -16,39 +27,53 @@ type Slot = Mutex; /// by the `Area` enum; examples include `Storage`, `Hotbar`, `Helmet`, `Offhand`, /// and `CraftingInput`. /// -/// Note that an `Inventory` is a _handle_; it's backed by an `Arc`. As such, cloning +/// Note that an `Inventory` is a _handle_; it's backed by an `Rc`. As such, cloning /// it is cheap and creates a new handle to the same inventory. Interior mutability /// is used to make this safe. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Inventory { - backing: Arc>, + inner: Rc, +} + +impl Debug for Inventory { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Inventory") + .field("backing", &self.inner.backing) + .finish() + } } impl Inventory { /// Returns whether two `Inventory` handles point to the same /// backing inventory. pub fn ptr_eq(&self, other: &Self) -> bool { - Arc::ptr_eq(&self.backing, &other.backing) + Rc::ptr_eq(&self.inner, &other.inner) } /// Gets the item at the given index within an area in this inventory. - /// - /// The returned value is a `MutexGuard` and can be mutated. - /// - /// # Note - /// _Never_ keep two returned `MutexGuard`s for the same inventory alive - /// at once. Deadlocks are not fun. - pub fn item(&self, area: Area, slot: usize) -> Option> { - let slice = self.backing.area_slice(area)?; - slice.get(slot).map(Mutex::lock) + pub fn item(&self, area: Area, slot: usize) -> Option> { + self.item_cell(area, slot).map(RefCell::borrow) + } + + /// Mutably gets the item at the given index within an area in this inventory. + pub fn item_mut(&self, area: Area, slot: usize) -> Option> { + if let Some(callback) = &*self.inner.slot_mutated_callback.borrow() { + (&**callback)(area, slot); + } + self.item_cell(area, slot).map(RefCell::borrow_mut) + } + + fn item_cell(&self, area: Area, slot: usize) -> Option<&RefCell> { + let slice = self.inner.backing.area_slice(area)?; + slice.get(slot) } pub fn to_vec(&self) -> Vec { let mut vec = Vec::new(); - for area in self.backing.areas() { - if let Some(items) = self.backing.area_slice(*area) { + for area in self.inner.backing.areas() { + if let Some(items) = self.inner.backing.area_slice(*area) { for item in items { - let i = item.lock(); + let i = item.borrow(); vec.push(i.clone()); } } @@ -63,6 +88,12 @@ impl Inventory { pub fn new_handle(&self) -> Inventory { self.clone() } + + /// Sets a callback that will be invoked whenever + /// a slot in the inventory may have changed. + pub fn set_slot_mutated_callback(&mut self, callback: impl Fn(Area, usize) + 'static) { + *self.inner.slot_mutated_callback.borrow_mut() = Some(Box::new(callback)); + } } #[derive(Debug)] @@ -85,7 +116,7 @@ impl Error for WindowError {} impl Window { /// Gets the item at the provided protocol index. /// Returns an error if index is invalid. - pub fn item(&self, index: usize) -> Result, WindowError> { + pub fn item(&self, index: usize) -> Result, WindowError> { let (inventory, area, slot) = self .index_to_slot(index) .ok_or(WindowError::OutOfBounds(index))?; @@ -94,10 +125,21 @@ impl Window { .ok_or(WindowError::OutOfBounds(index)) } + /// Mutably gets the item at the provided protocol index. + /// Returns an error if the index is invalid. + pub fn item_mut(&self, index: usize) -> Result, WindowError> { + let (inventory, area, slot) = self + .index_to_slot(index) + .ok_or(WindowError::OutOfBounds(index))?; + inventory + .item_mut(area, slot) + .ok_or(WindowError::OutOfBounds(index)) + } + /// Sets the item at the provided protocol index. /// Returns an error if the index is invalid. pub fn set_item(&self, index: usize, item: InventorySlot) -> Result<(), WindowError> { - *self.item(index)? = item; + *self.item_mut(index)? = item; Ok(()) } diff --git a/libcraft/items/Cargo.toml b/libcraft/items/Cargo.toml index ea9e1fd38..4774360c4 100644 --- a/libcraft/items/Cargo.toml +++ b/libcraft/items/Cargo.toml @@ -2,7 +2,7 @@ name = "libcraft-items" version = "0.1.0" authors = ["Kalle Kankaanpää", "Pau Machetti "] -edition = "2018" +edition = "2021" [dependencies] serde = { version = "1", features = ["derive"] } diff --git a/libcraft/items/src/item.rs b/libcraft/items/src/item.rs index c29fd8b62..ee56bb452 100644 --- a/libcraft/items/src/item.rs +++ b/libcraft/items/src/item.rs @@ -1,9 +1,18 @@ // This file is @generated. Please do not edit. -use serde::{Deserialize, Serialize}; -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +#[derive( + Copy, + Clone, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + serde :: Serialize, + serde :: Deserialize, +)] #[serde(try_from = "String", into = "&'static str")] pub enum Item { - Air, Stone, Granite, PolishedGranite, @@ -11,10 +20,17 @@ pub enum Item { PolishedDiorite, Andesite, PolishedAndesite, + Deepslate, + CobbledDeepslate, + PolishedDeepslate, + Calcite, + Tuff, + DripstoneBlock, GrassBlock, Dirt, CoarseDirt, Podzol, + RootedDirt, CrimsonNylium, WarpedNylium, Cobblestone, @@ -36,10 +52,67 @@ pub enum Item { Sand, RedSand, Gravel, - GoldOre, - IronOre, CoalOre, + DeepslateCoalOre, + IronOre, + DeepslateIronOre, + CopperOre, + DeepslateCopperOre, + GoldOre, + DeepslateGoldOre, + RedstoneOre, + DeepslateRedstoneOre, + EmeraldOre, + DeepslateEmeraldOre, + LapisOre, + DeepslateLapisOre, + DiamondOre, + DeepslateDiamondOre, NetherGoldOre, + NetherQuartzOre, + AncientDebris, + CoalBlock, + RawIronBlock, + RawCopperBlock, + RawGoldBlock, + AmethystBlock, + BuddingAmethyst, + IronBlock, + CopperBlock, + GoldBlock, + DiamondBlock, + NetheriteBlock, + ExposedCopper, + WeatheredCopper, + OxidizedCopper, + CutCopper, + ExposedCutCopper, + WeatheredCutCopper, + OxidizedCutCopper, + CutCopperStairs, + ExposedCutCopperStairs, + WeatheredCutCopperStairs, + OxidizedCutCopperStairs, + CutCopperSlab, + ExposedCutCopperSlab, + WeatheredCutCopperSlab, + OxidizedCutCopperSlab, + WaxedCopperBlock, + WaxedExposedCopper, + WaxedWeatheredCopper, + WaxedOxidizedCopper, + WaxedCutCopper, + WaxedExposedCutCopper, + WaxedWeatheredCutCopper, + WaxedOxidizedCutCopper, + WaxedCutCopperStairs, + WaxedExposedCutCopperStairs, + WaxedWeatheredCutCopperStairs, + WaxedOxidizedCutCopperStairs, + WaxedCutCopperSlab, + WaxedExposedCutCopperSlab, + WaxedWeatheredCutCopperSlab, + WaxedOxidizedCutCopperSlab, OakLog, SpruceLog, BirchLog, @@ -78,26 +151,24 @@ pub enum Item { JungleLeaves, AcaciaLeaves, DarkOakLeaves, + AzaleaLeaves, + FloweringAzaleaLeaves, Sponge, WetSponge, Glass, - LapisOre, + TintedGlass, LapisBlock, - Dispenser, Sandstone, ChiseledSandstone, CutSandstone, - NoteBlock, - PoweredRail, - DetectorRail, - StickyPiston, Cobweb, Grass, Fern, + Azalea, + FloweringAzalea, DeadBush, Seagrass, SeaPickle, - Piston, WhiteWool, OrangeWool, MagentaWool, @@ -127,6 +198,7 @@ pub enum Item { Cornflower, LilyOfTheValley, WitherRose, + SporeBlossom, BrownMushroom, RedMushroom, CrimsonFungus, @@ -138,9 +210,12 @@ pub enum Item { TwistingVines, SugarCane, Kelp, + MossCarpet, + MossBlock, + HangingRoots, + BigDripleaf, + SmallDripleaf, Bamboo, - GoldBlock, - IronBlock, OakSlab, SpruceSlab, BirchSlab, @@ -170,7 +245,6 @@ pub enum Item { SmoothSandstone, SmoothStone, Bricks, - Tnt, Bookshelf, MossyCobblestone, Obsidian, @@ -184,27 +258,11 @@ pub enum Item { Spawner, OakStairs, Chest, - DiamondOre, - DiamondBlock, CraftingTable, Farmland, Furnace, Ladder, - Rail, CobblestoneStairs, - Lever, - StonePressurePlate, - OakPressurePlate, - SprucePressurePlate, - BirchPressurePlate, - JunglePressurePlate, - AcaciaPressurePlate, - DarkOakPressurePlate, - CrimsonPressurePlate, - WarpedPressurePlate, - PolishedBlackstonePressurePlate, - RedstoneOre, - RedstoneTorch, Snow, Ice, SnowBlock, @@ -221,32 +279,31 @@ pub enum Item { WarpedFence, Pumpkin, CarvedPumpkin, + JackOLantern, Netherrack, SoulSand, SoulSoil, Basalt, PolishedBasalt, + SmoothBasalt, SoulTorch, Glowstone, - JackOLantern, - OakTrapdoor, - SpruceTrapdoor, - BirchTrapdoor, - JungleTrapdoor, - AcaciaTrapdoor, - DarkOakTrapdoor, - CrimsonTrapdoor, - WarpedTrapdoor, InfestedStone, InfestedCobblestone, InfestedStoneBricks, InfestedMossyStoneBricks, InfestedCrackedStoneBricks, InfestedChiseledStoneBricks, + InfestedDeepslate, StoneBricks, MossyStoneBricks, CrackedStoneBricks, ChiseledStoneBricks, + DeepslateBricks, + CrackedDeepslateBricks, + DeepslateTiles, + CrackedDeepslateTiles, + ChiseledDeepslate, BrownMushroomBlock, RedMushroomBlock, MushroomStem, @@ -255,14 +312,7 @@ pub enum Item { GlassPane, Melon, Vine, - OakFenceGate, - SpruceFenceGate, - BirchFenceGate, - JungleFenceGate, - AcaciaFenceGate, - DarkOakFenceGate, - CrimsonFenceGate, - WarpedFenceGate, + GlowLichen, BrickStairs, StoneBrickStairs, Mycelium, @@ -277,11 +327,8 @@ pub enum Item { EndStone, EndStoneBricks, DragonEgg, - RedstoneLamp, SandstoneStairs, - EmeraldOre, EnderChest, - TripwireHook, EmeraldBlock, SpruceStairs, BirchStairs, @@ -307,33 +354,18 @@ pub enum Item { BlackstoneWall, PolishedBlackstoneWall, PolishedBlackstoneBrickWall, - StoneButton, - OakButton, - SpruceButton, - BirchButton, - JungleButton, - AcaciaButton, - DarkOakButton, - CrimsonButton, - WarpedButton, - PolishedBlackstoneButton, + CobbledDeepslateWall, + PolishedDeepslateWall, + DeepslateBrickWall, + DeepslateTileWall, Anvil, ChippedAnvil, DamagedAnvil, - TrappedChest, - LightWeightedPressurePlate, - HeavyWeightedPressurePlate, - DaylightDetector, - RedstoneBlock, - NetherQuartzOre, - Hopper, ChiseledQuartzBlock, QuartzBlock, QuartzBricks, QuartzPillar, QuartzStairs, - ActivatorRail, - Dropper, WhiteTerracotta, OrangeTerracotta, MagentaTerracotta, @@ -351,7 +383,7 @@ pub enum Item { RedTerracotta, BlackTerracotta, Barrier, - IronTrapdoor, + Light, HayBlock, WhiteCarpet, OrangeCarpet, @@ -370,12 +402,10 @@ pub enum Item { RedCarpet, BlackCarpet, Terracotta, - CoalBlock, PackedIce, AcaciaStairs, DarkOakStairs, - SlimeBlock, - GrassPath, + DirtPath, Sunflower, Lilac, RoseBush, @@ -433,7 +463,6 @@ pub enum Item { RedNetherBricks, BoneBlock, StructureVoid, - Observer, ShulkerBox, WhiteShulkerBox, OrangeShulkerBox, @@ -546,6 +575,10 @@ pub enum Item { RedNetherBrickStairs, PolishedAndesiteStairs, DioriteStairs, + CobbledDeepslateStairs, + PolishedDeepslateStairs, + DeepslateBrickStairs, + DeepslateTileStairs, PolishedGraniteSlab, SmoothRedSandstoneSlab, MossyStoneBrickSlab, @@ -559,7 +592,57 @@ pub enum Item { RedNetherBrickSlab, PolishedAndesiteSlab, DioriteSlab, + CobbledDeepslateSlab, + PolishedDeepslateSlab, + DeepslateBrickSlab, + DeepslateTileSlab, Scaffolding, + Redstone, + RedstoneTorch, + RedstoneBlock, + Repeater, + Comparator, + Piston, + StickyPiston, + SlimeBlock, + HoneyBlock, + Observer, + Hopper, + Dispenser, + Dropper, + Lectern, + Target, + Lever, + LightningRod, + DaylightDetector, + SculkSensor, + TripwireHook, + TrappedChest, + Tnt, + RedstoneLamp, + NoteBlock, + StoneButton, + PolishedBlackstoneButton, + OakButton, + SpruceButton, + BirchButton, + JungleButton, + AcaciaButton, + DarkOakButton, + CrimsonButton, + WarpedButton, + StonePressurePlate, + PolishedBlackstonePressurePlate, + LightWeightedPressurePlate, + HeavyWeightedPressurePlate, + OakPressurePlate, + SprucePressurePlate, + BirchPressurePlate, + JunglePressurePlate, + AcaciaPressurePlate, + DarkOakPressurePlate, + CrimsonPressurePlate, + WarpedPressurePlate, IronDoor, OakDoor, SpruceDoor, @@ -569,8 +652,42 @@ pub enum Item { DarkOakDoor, CrimsonDoor, WarpedDoor, - Repeater, - Comparator, + IronTrapdoor, + OakTrapdoor, + SpruceTrapdoor, + BirchTrapdoor, + JungleTrapdoor, + AcaciaTrapdoor, + DarkOakTrapdoor, + CrimsonTrapdoor, + WarpedTrapdoor, + OakFenceGate, + SpruceFenceGate, + BirchFenceGate, + JungleFenceGate, + AcaciaFenceGate, + DarkOakFenceGate, + CrimsonFenceGate, + WarpedFenceGate, + PoweredRail, + DetectorRail, + Rail, + ActivatorRail, + Saddle, + Minecart, + ChestMinecart, + FurnaceMinecart, + TntMinecart, + HopperMinecart, + CarrotOnAStick, + WarpedFungusOnAStick, + Elytra, + OakBoat, + SpruceBoat, + BirchBoat, + JungleBoat, + AcaciaBoat, + DarkOakBoat, StructureBlock, Jigsaw, TurtleHelmet, @@ -582,7 +699,15 @@ pub enum Item { Coal, Charcoal, Diamond, + Emerald, + LapisLazuli, + Quartz, + AmethystShard, + RawIron, IronIngot, + RawCopper, + CopperIngot, + RawGold, GoldIngot, NetheriteIngot, NetheriteScrap, @@ -666,29 +791,27 @@ pub enum Item { Bucket, WaterBucket, LavaBucket, - Minecart, - Saddle, - Redstone, + PowderSnowBucket, Snowball, - OakBoat, Leather, MilkBucket, PufferfishBucket, SalmonBucket, CodBucket, TropicalFishBucket, + AxolotlBucket, Brick, ClayBall, DriedKelpBlock, Paper, Book, SlimeBall, - ChestMinecart, - FurnaceMinecart, Egg, Compass, + Bundle, FishingRod, Clock, + Spyglass, GlowstoneDust, Cod, Salmon, @@ -697,8 +820,8 @@ pub enum Item { CookedCod, CookedSalmon, InkSac, + GlowInkSac, CocoaBeans, - LapisLazuli, WhiteDye, OrangeDye, MagentaDye, @@ -762,6 +885,7 @@ pub enum Item { Cauldron, EnderEye, GlisteringMelonSlice, + AxolotlSpawnEgg, BatSpawnEgg, BeeSpawnEgg, BlazeSpawnEgg, @@ -780,6 +904,8 @@ pub enum Item { EvokerSpawnEgg, FoxSpawnEgg, GhastSpawnEgg, + GlowSquidSpawnEgg, + GoatSpawnEgg, GuardianSpawnEgg, HoglinSpawnEgg, HorseSpawnEgg, @@ -830,8 +956,8 @@ pub enum Item { FireCharge, WritableBook, WrittenBook, - Emerald, ItemFrame, + GlowItemFrame, FlowerPot, Carrot, Potato, @@ -845,17 +971,12 @@ pub enum Item { ZombieHead, CreeperHead, DragonHead, - CarrotOnAStick, - WarpedFungusOnAStick, NetherStar, PumpkinPie, FireworkRocket, FireworkStar, EnchantedBook, NetherBrick, - Quartz, - TntMinecart, - HopperMinecart, PrismarineShard, PrismarineCrystals, Rabbit, @@ -901,12 +1022,6 @@ pub enum Item { TippedArrow, LingeringPotion, Shield, - Elytra, - SpruceBoat, - BirchBoat, - JungleBoat, - AcaciaBoat, - DarkOakBoat, TotemOfUndying, ShulkerShell, IronNugget, @@ -924,6 +1039,7 @@ pub enum Item { MusicDiscWard, MusicDisc11, MusicDiscWait, + MusicDiscOtherside, MusicDiscPigstep, Trident, PhantomMembrane, @@ -945,13 +1061,13 @@ pub enum Item { CartographyTable, FletchingTable, Grindstone, - Lectern, SmithingTable, Stonecutter, Bell, Lantern, SoulLantern, SweetBerries, + GlowBerries, Campfire, SoulCampfire, Shroomlight, @@ -959,12 +1075,8 @@ pub enum Item { BeeNest, Beehive, HoneyBottle, - HoneyBlock, HoneycombBlock, Lodestone, - NetheriteBlock, - AncientDebris, - Target, CryingObsidian, Blackstone, BlackstoneSlab, @@ -979,1983 +1091,3357 @@ pub enum Item { PolishedBlackstoneBrickStairs, CrackedPolishedBlackstoneBricks, RespawnAnchor, + Candle, + WhiteCandle, + OrangeCandle, + MagentaCandle, + LightBlueCandle, + YellowCandle, + LimeCandle, + PinkCandle, + GrayCandle, + LightGrayCandle, + CyanCandle, + PurpleCandle, + BlueCandle, + BrownCandle, + GreenCandle, + RedCandle, + BlackCandle, + SmallAmethystBud, + MediumAmethystBud, + LargeAmethystBud, + AmethystCluster, + PointedDripstone, } - -#[allow(warnings)] -#[allow(clippy::all)] impl Item { - /// Returns the `id` property of this `Item`. + #[inline] + pub fn values() -> &'static [Item] { + use Item::*; + &[ + Stone, + Granite, + PolishedGranite, + Diorite, + PolishedDiorite, + Andesite, + PolishedAndesite, + Deepslate, + CobbledDeepslate, + PolishedDeepslate, + Calcite, + Tuff, + DripstoneBlock, + GrassBlock, + Dirt, + CoarseDirt, + Podzol, + RootedDirt, + CrimsonNylium, + WarpedNylium, + Cobblestone, + OakPlanks, + SprucePlanks, + BirchPlanks, + JunglePlanks, + AcaciaPlanks, + DarkOakPlanks, + CrimsonPlanks, + WarpedPlanks, + OakSapling, + SpruceSapling, + BirchSapling, + JungleSapling, + AcaciaSapling, + DarkOakSapling, + Bedrock, + Sand, + RedSand, + Gravel, + CoalOre, + DeepslateCoalOre, + IronOre, + DeepslateIronOre, + CopperOre, + DeepslateCopperOre, + GoldOre, + DeepslateGoldOre, + RedstoneOre, + DeepslateRedstoneOre, + EmeraldOre, + DeepslateEmeraldOre, + LapisOre, + DeepslateLapisOre, + DiamondOre, + DeepslateDiamondOre, + NetherGoldOre, + NetherQuartzOre, + AncientDebris, + CoalBlock, + RawIronBlock, + RawCopperBlock, + RawGoldBlock, + AmethystBlock, + BuddingAmethyst, + IronBlock, + CopperBlock, + GoldBlock, + DiamondBlock, + NetheriteBlock, + ExposedCopper, + WeatheredCopper, + OxidizedCopper, + CutCopper, + ExposedCutCopper, + WeatheredCutCopper, + OxidizedCutCopper, + CutCopperStairs, + ExposedCutCopperStairs, + WeatheredCutCopperStairs, + OxidizedCutCopperStairs, + CutCopperSlab, + ExposedCutCopperSlab, + WeatheredCutCopperSlab, + OxidizedCutCopperSlab, + WaxedCopperBlock, + WaxedExposedCopper, + WaxedWeatheredCopper, + WaxedOxidizedCopper, + WaxedCutCopper, + WaxedExposedCutCopper, + WaxedWeatheredCutCopper, + WaxedOxidizedCutCopper, + WaxedCutCopperStairs, + WaxedExposedCutCopperStairs, + WaxedWeatheredCutCopperStairs, + WaxedOxidizedCutCopperStairs, + WaxedCutCopperSlab, + WaxedExposedCutCopperSlab, + WaxedWeatheredCutCopperSlab, + WaxedOxidizedCutCopperSlab, + OakLog, + SpruceLog, + BirchLog, + JungleLog, + AcaciaLog, + DarkOakLog, + CrimsonStem, + WarpedStem, + StrippedOakLog, + StrippedSpruceLog, + StrippedBirchLog, + StrippedJungleLog, + StrippedAcaciaLog, + StrippedDarkOakLog, + StrippedCrimsonStem, + StrippedWarpedStem, + StrippedOakWood, + StrippedSpruceWood, + StrippedBirchWood, + StrippedJungleWood, + StrippedAcaciaWood, + StrippedDarkOakWood, + StrippedCrimsonHyphae, + StrippedWarpedHyphae, + OakWood, + SpruceWood, + BirchWood, + JungleWood, + AcaciaWood, + DarkOakWood, + CrimsonHyphae, + WarpedHyphae, + OakLeaves, + SpruceLeaves, + BirchLeaves, + JungleLeaves, + AcaciaLeaves, + DarkOakLeaves, + AzaleaLeaves, + FloweringAzaleaLeaves, + Sponge, + WetSponge, + Glass, + TintedGlass, + LapisBlock, + Sandstone, + ChiseledSandstone, + CutSandstone, + Cobweb, + Grass, + Fern, + Azalea, + FloweringAzalea, + DeadBush, + Seagrass, + SeaPickle, + WhiteWool, + OrangeWool, + MagentaWool, + LightBlueWool, + YellowWool, + LimeWool, + PinkWool, + GrayWool, + LightGrayWool, + CyanWool, + PurpleWool, + BlueWool, + BrownWool, + GreenWool, + RedWool, + BlackWool, + Dandelion, + Poppy, + BlueOrchid, + Allium, + AzureBluet, + RedTulip, + OrangeTulip, + WhiteTulip, + PinkTulip, + OxeyeDaisy, + Cornflower, + LilyOfTheValley, + WitherRose, + SporeBlossom, + BrownMushroom, + RedMushroom, + CrimsonFungus, + WarpedFungus, + CrimsonRoots, + WarpedRoots, + NetherSprouts, + WeepingVines, + TwistingVines, + SugarCane, + Kelp, + MossCarpet, + MossBlock, + HangingRoots, + BigDripleaf, + SmallDripleaf, + Bamboo, + OakSlab, + SpruceSlab, + BirchSlab, + JungleSlab, + AcaciaSlab, + DarkOakSlab, + CrimsonSlab, + WarpedSlab, + StoneSlab, + SmoothStoneSlab, + SandstoneSlab, + CutSandstoneSlab, + PetrifiedOakSlab, + CobblestoneSlab, + BrickSlab, + StoneBrickSlab, + NetherBrickSlab, + QuartzSlab, + RedSandstoneSlab, + CutRedSandstoneSlab, + PurpurSlab, + PrismarineSlab, + PrismarineBrickSlab, + DarkPrismarineSlab, + SmoothQuartz, + SmoothRedSandstone, + SmoothSandstone, + SmoothStone, + Bricks, + Bookshelf, + MossyCobblestone, + Obsidian, + Torch, + EndRod, + ChorusPlant, + ChorusFlower, + PurpurBlock, + PurpurPillar, + PurpurStairs, + Spawner, + OakStairs, + Chest, + CraftingTable, + Farmland, + Furnace, + Ladder, + CobblestoneStairs, + Snow, + Ice, + SnowBlock, + Cactus, + Clay, + Jukebox, + OakFence, + SpruceFence, + BirchFence, + JungleFence, + AcaciaFence, + DarkOakFence, + CrimsonFence, + WarpedFence, + Pumpkin, + CarvedPumpkin, + JackOLantern, + Netherrack, + SoulSand, + SoulSoil, + Basalt, + PolishedBasalt, + SmoothBasalt, + SoulTorch, + Glowstone, + InfestedStone, + InfestedCobblestone, + InfestedStoneBricks, + InfestedMossyStoneBricks, + InfestedCrackedStoneBricks, + InfestedChiseledStoneBricks, + InfestedDeepslate, + StoneBricks, + MossyStoneBricks, + CrackedStoneBricks, + ChiseledStoneBricks, + DeepslateBricks, + CrackedDeepslateBricks, + DeepslateTiles, + CrackedDeepslateTiles, + ChiseledDeepslate, + BrownMushroomBlock, + RedMushroomBlock, + MushroomStem, + IronBars, + Chain, + GlassPane, + Melon, + Vine, + GlowLichen, + BrickStairs, + StoneBrickStairs, + Mycelium, + LilyPad, + NetherBricks, + CrackedNetherBricks, + ChiseledNetherBricks, + NetherBrickFence, + NetherBrickStairs, + EnchantingTable, + EndPortalFrame, + EndStone, + EndStoneBricks, + DragonEgg, + SandstoneStairs, + EnderChest, + EmeraldBlock, + SpruceStairs, + BirchStairs, + JungleStairs, + CrimsonStairs, + WarpedStairs, + CommandBlock, + Beacon, + CobblestoneWall, + MossyCobblestoneWall, + BrickWall, + PrismarineWall, + RedSandstoneWall, + MossyStoneBrickWall, + GraniteWall, + StoneBrickWall, + NetherBrickWall, + AndesiteWall, + RedNetherBrickWall, + SandstoneWall, + EndStoneBrickWall, + DioriteWall, + BlackstoneWall, + PolishedBlackstoneWall, + PolishedBlackstoneBrickWall, + CobbledDeepslateWall, + PolishedDeepslateWall, + DeepslateBrickWall, + DeepslateTileWall, + Anvil, + ChippedAnvil, + DamagedAnvil, + ChiseledQuartzBlock, + QuartzBlock, + QuartzBricks, + QuartzPillar, + QuartzStairs, + WhiteTerracotta, + OrangeTerracotta, + MagentaTerracotta, + LightBlueTerracotta, + YellowTerracotta, + LimeTerracotta, + PinkTerracotta, + GrayTerracotta, + LightGrayTerracotta, + CyanTerracotta, + PurpleTerracotta, + BlueTerracotta, + BrownTerracotta, + GreenTerracotta, + RedTerracotta, + BlackTerracotta, + Barrier, + Light, + HayBlock, + WhiteCarpet, + OrangeCarpet, + MagentaCarpet, + LightBlueCarpet, + YellowCarpet, + LimeCarpet, + PinkCarpet, + GrayCarpet, + LightGrayCarpet, + CyanCarpet, + PurpleCarpet, + BlueCarpet, + BrownCarpet, + GreenCarpet, + RedCarpet, + BlackCarpet, + Terracotta, + PackedIce, + AcaciaStairs, + DarkOakStairs, + DirtPath, + Sunflower, + Lilac, + RoseBush, + Peony, + TallGrass, + LargeFern, + WhiteStainedGlass, + OrangeStainedGlass, + MagentaStainedGlass, + LightBlueStainedGlass, + YellowStainedGlass, + LimeStainedGlass, + PinkStainedGlass, + GrayStainedGlass, + LightGrayStainedGlass, + CyanStainedGlass, + PurpleStainedGlass, + BlueStainedGlass, + BrownStainedGlass, + GreenStainedGlass, + RedStainedGlass, + BlackStainedGlass, + WhiteStainedGlassPane, + OrangeStainedGlassPane, + MagentaStainedGlassPane, + LightBlueStainedGlassPane, + YellowStainedGlassPane, + LimeStainedGlassPane, + PinkStainedGlassPane, + GrayStainedGlassPane, + LightGrayStainedGlassPane, + CyanStainedGlassPane, + PurpleStainedGlassPane, + BlueStainedGlassPane, + BrownStainedGlassPane, + GreenStainedGlassPane, + RedStainedGlassPane, + BlackStainedGlassPane, + Prismarine, + PrismarineBricks, + DarkPrismarine, + PrismarineStairs, + PrismarineBrickStairs, + DarkPrismarineStairs, + SeaLantern, + RedSandstone, + ChiseledRedSandstone, + CutRedSandstone, + RedSandstoneStairs, + RepeatingCommandBlock, + ChainCommandBlock, + MagmaBlock, + NetherWartBlock, + WarpedWartBlock, + RedNetherBricks, + BoneBlock, + StructureVoid, + ShulkerBox, + WhiteShulkerBox, + OrangeShulkerBox, + MagentaShulkerBox, + LightBlueShulkerBox, + YellowShulkerBox, + LimeShulkerBox, + PinkShulkerBox, + GrayShulkerBox, + LightGrayShulkerBox, + CyanShulkerBox, + PurpleShulkerBox, + BlueShulkerBox, + BrownShulkerBox, + GreenShulkerBox, + RedShulkerBox, + BlackShulkerBox, + WhiteGlazedTerracotta, + OrangeGlazedTerracotta, + MagentaGlazedTerracotta, + LightBlueGlazedTerracotta, + YellowGlazedTerracotta, + LimeGlazedTerracotta, + PinkGlazedTerracotta, + GrayGlazedTerracotta, + LightGrayGlazedTerracotta, + CyanGlazedTerracotta, + PurpleGlazedTerracotta, + BlueGlazedTerracotta, + BrownGlazedTerracotta, + GreenGlazedTerracotta, + RedGlazedTerracotta, + BlackGlazedTerracotta, + WhiteConcrete, + OrangeConcrete, + MagentaConcrete, + LightBlueConcrete, + YellowConcrete, + LimeConcrete, + PinkConcrete, + GrayConcrete, + LightGrayConcrete, + CyanConcrete, + PurpleConcrete, + BlueConcrete, + BrownConcrete, + GreenConcrete, + RedConcrete, + BlackConcrete, + WhiteConcretePowder, + OrangeConcretePowder, + MagentaConcretePowder, + LightBlueConcretePowder, + YellowConcretePowder, + LimeConcretePowder, + PinkConcretePowder, + GrayConcretePowder, + LightGrayConcretePowder, + CyanConcretePowder, + PurpleConcretePowder, + BlueConcretePowder, + BrownConcretePowder, + GreenConcretePowder, + RedConcretePowder, + BlackConcretePowder, + TurtleEgg, + DeadTubeCoralBlock, + DeadBrainCoralBlock, + DeadBubbleCoralBlock, + DeadFireCoralBlock, + DeadHornCoralBlock, + TubeCoralBlock, + BrainCoralBlock, + BubbleCoralBlock, + FireCoralBlock, + HornCoralBlock, + TubeCoral, + BrainCoral, + BubbleCoral, + FireCoral, + HornCoral, + DeadBrainCoral, + DeadBubbleCoral, + DeadFireCoral, + DeadHornCoral, + DeadTubeCoral, + TubeCoralFan, + BrainCoralFan, + BubbleCoralFan, + FireCoralFan, + HornCoralFan, + DeadTubeCoralFan, + DeadBrainCoralFan, + DeadBubbleCoralFan, + DeadFireCoralFan, + DeadHornCoralFan, + BlueIce, + Conduit, + PolishedGraniteStairs, + SmoothRedSandstoneStairs, + MossyStoneBrickStairs, + PolishedDioriteStairs, + MossyCobblestoneStairs, + EndStoneBrickStairs, + StoneStairs, + SmoothSandstoneStairs, + SmoothQuartzStairs, + GraniteStairs, + AndesiteStairs, + RedNetherBrickStairs, + PolishedAndesiteStairs, + DioriteStairs, + CobbledDeepslateStairs, + PolishedDeepslateStairs, + DeepslateBrickStairs, + DeepslateTileStairs, + PolishedGraniteSlab, + SmoothRedSandstoneSlab, + MossyStoneBrickSlab, + PolishedDioriteSlab, + MossyCobblestoneSlab, + EndStoneBrickSlab, + SmoothSandstoneSlab, + SmoothQuartzSlab, + GraniteSlab, + AndesiteSlab, + RedNetherBrickSlab, + PolishedAndesiteSlab, + DioriteSlab, + CobbledDeepslateSlab, + PolishedDeepslateSlab, + DeepslateBrickSlab, + DeepslateTileSlab, + Scaffolding, + Redstone, + RedstoneTorch, + RedstoneBlock, + Repeater, + Comparator, + Piston, + StickyPiston, + SlimeBlock, + HoneyBlock, + Observer, + Hopper, + Dispenser, + Dropper, + Lectern, + Target, + Lever, + LightningRod, + DaylightDetector, + SculkSensor, + TripwireHook, + TrappedChest, + Tnt, + RedstoneLamp, + NoteBlock, + StoneButton, + PolishedBlackstoneButton, + OakButton, + SpruceButton, + BirchButton, + JungleButton, + AcaciaButton, + DarkOakButton, + CrimsonButton, + WarpedButton, + StonePressurePlate, + PolishedBlackstonePressurePlate, + LightWeightedPressurePlate, + HeavyWeightedPressurePlate, + OakPressurePlate, + SprucePressurePlate, + BirchPressurePlate, + JunglePressurePlate, + AcaciaPressurePlate, + DarkOakPressurePlate, + CrimsonPressurePlate, + WarpedPressurePlate, + IronDoor, + OakDoor, + SpruceDoor, + BirchDoor, + JungleDoor, + AcaciaDoor, + DarkOakDoor, + CrimsonDoor, + WarpedDoor, + IronTrapdoor, + OakTrapdoor, + SpruceTrapdoor, + BirchTrapdoor, + JungleTrapdoor, + AcaciaTrapdoor, + DarkOakTrapdoor, + CrimsonTrapdoor, + WarpedTrapdoor, + OakFenceGate, + SpruceFenceGate, + BirchFenceGate, + JungleFenceGate, + AcaciaFenceGate, + DarkOakFenceGate, + CrimsonFenceGate, + WarpedFenceGate, + PoweredRail, + DetectorRail, + Rail, + ActivatorRail, + Saddle, + Minecart, + ChestMinecart, + FurnaceMinecart, + TntMinecart, + HopperMinecart, + CarrotOnAStick, + WarpedFungusOnAStick, + Elytra, + OakBoat, + SpruceBoat, + BirchBoat, + JungleBoat, + AcaciaBoat, + DarkOakBoat, + StructureBlock, + Jigsaw, + TurtleHelmet, + Scute, + FlintAndSteel, + Apple, + Bow, + Arrow, + Coal, + Charcoal, + Diamond, + Emerald, + LapisLazuli, + Quartz, + AmethystShard, + RawIron, + IronIngot, + RawCopper, + CopperIngot, + RawGold, + GoldIngot, + NetheriteIngot, + NetheriteScrap, + WoodenSword, + WoodenShovel, + WoodenPickaxe, + WoodenAxe, + WoodenHoe, + StoneSword, + StoneShovel, + StonePickaxe, + StoneAxe, + StoneHoe, + GoldenSword, + GoldenShovel, + GoldenPickaxe, + GoldenAxe, + GoldenHoe, + IronSword, + IronShovel, + IronPickaxe, + IronAxe, + IronHoe, + DiamondSword, + DiamondShovel, + DiamondPickaxe, + DiamondAxe, + DiamondHoe, + NetheriteSword, + NetheriteShovel, + NetheritePickaxe, + NetheriteAxe, + NetheriteHoe, + Stick, + Bowl, + MushroomStew, + String, + Feather, + Gunpowder, + WheatSeeds, + Wheat, + Bread, + LeatherHelmet, + LeatherChestplate, + LeatherLeggings, + LeatherBoots, + ChainmailHelmet, + ChainmailChestplate, + ChainmailLeggings, + ChainmailBoots, + IronHelmet, + IronChestplate, + IronLeggings, + IronBoots, + DiamondHelmet, + DiamondChestplate, + DiamondLeggings, + DiamondBoots, + GoldenHelmet, + GoldenChestplate, + GoldenLeggings, + GoldenBoots, + NetheriteHelmet, + NetheriteChestplate, + NetheriteLeggings, + NetheriteBoots, + Flint, + Porkchop, + CookedPorkchop, + Painting, + GoldenApple, + EnchantedGoldenApple, + OakSign, + SpruceSign, + BirchSign, + JungleSign, + AcaciaSign, + DarkOakSign, + CrimsonSign, + WarpedSign, + Bucket, + WaterBucket, + LavaBucket, + PowderSnowBucket, + Snowball, + Leather, + MilkBucket, + PufferfishBucket, + SalmonBucket, + CodBucket, + TropicalFishBucket, + AxolotlBucket, + Brick, + ClayBall, + DriedKelpBlock, + Paper, + Book, + SlimeBall, + Egg, + Compass, + Bundle, + FishingRod, + Clock, + Spyglass, + GlowstoneDust, + Cod, + Salmon, + TropicalFish, + Pufferfish, + CookedCod, + CookedSalmon, + InkSac, + GlowInkSac, + CocoaBeans, + WhiteDye, + OrangeDye, + MagentaDye, + LightBlueDye, + YellowDye, + LimeDye, + PinkDye, + GrayDye, + LightGrayDye, + CyanDye, + PurpleDye, + BlueDye, + BrownDye, + GreenDye, + RedDye, + BlackDye, + BoneMeal, + Bone, + Sugar, + Cake, + WhiteBed, + OrangeBed, + MagentaBed, + LightBlueBed, + YellowBed, + LimeBed, + PinkBed, + GrayBed, + LightGrayBed, + CyanBed, + PurpleBed, + BlueBed, + BrownBed, + GreenBed, + RedBed, + BlackBed, + Cookie, + FilledMap, + Shears, + MelonSlice, + DriedKelp, + PumpkinSeeds, + MelonSeeds, + Beef, + CookedBeef, + Chicken, + CookedChicken, + RottenFlesh, + EnderPearl, + BlazeRod, + GhastTear, + GoldNugget, + NetherWart, + Potion, + GlassBottle, + SpiderEye, + FermentedSpiderEye, + BlazePowder, + MagmaCream, + BrewingStand, + Cauldron, + EnderEye, + GlisteringMelonSlice, + AxolotlSpawnEgg, + BatSpawnEgg, + BeeSpawnEgg, + BlazeSpawnEgg, + CatSpawnEgg, + CaveSpiderSpawnEgg, + ChickenSpawnEgg, + CodSpawnEgg, + CowSpawnEgg, + CreeperSpawnEgg, + DolphinSpawnEgg, + DonkeySpawnEgg, + DrownedSpawnEgg, + ElderGuardianSpawnEgg, + EndermanSpawnEgg, + EndermiteSpawnEgg, + EvokerSpawnEgg, + FoxSpawnEgg, + GhastSpawnEgg, + GlowSquidSpawnEgg, + GoatSpawnEgg, + GuardianSpawnEgg, + HoglinSpawnEgg, + HorseSpawnEgg, + HuskSpawnEgg, + LlamaSpawnEgg, + MagmaCubeSpawnEgg, + MooshroomSpawnEgg, + MuleSpawnEgg, + OcelotSpawnEgg, + PandaSpawnEgg, + ParrotSpawnEgg, + PhantomSpawnEgg, + PigSpawnEgg, + PiglinSpawnEgg, + PiglinBruteSpawnEgg, + PillagerSpawnEgg, + PolarBearSpawnEgg, + PufferfishSpawnEgg, + RabbitSpawnEgg, + RavagerSpawnEgg, + SalmonSpawnEgg, + SheepSpawnEgg, + ShulkerSpawnEgg, + SilverfishSpawnEgg, + SkeletonSpawnEgg, + SkeletonHorseSpawnEgg, + SlimeSpawnEgg, + SpiderSpawnEgg, + SquidSpawnEgg, + StraySpawnEgg, + StriderSpawnEgg, + TraderLlamaSpawnEgg, + TropicalFishSpawnEgg, + TurtleSpawnEgg, + VexSpawnEgg, + VillagerSpawnEgg, + VindicatorSpawnEgg, + WanderingTraderSpawnEgg, + WitchSpawnEgg, + WitherSkeletonSpawnEgg, + WolfSpawnEgg, + ZoglinSpawnEgg, + ZombieSpawnEgg, + ZombieHorseSpawnEgg, + ZombieVillagerSpawnEgg, + ZombifiedPiglinSpawnEgg, + ExperienceBottle, + FireCharge, + WritableBook, + WrittenBook, + ItemFrame, + GlowItemFrame, + FlowerPot, + Carrot, + Potato, + BakedPotato, + PoisonousPotato, + Map, + GoldenCarrot, + SkeletonSkull, + WitherSkeletonSkull, + PlayerHead, + ZombieHead, + CreeperHead, + DragonHead, + NetherStar, + PumpkinPie, + FireworkRocket, + FireworkStar, + EnchantedBook, + NetherBrick, + PrismarineShard, + PrismarineCrystals, + Rabbit, + CookedRabbit, + RabbitStew, + RabbitFoot, + RabbitHide, + ArmorStand, + IronHorseArmor, + GoldenHorseArmor, + DiamondHorseArmor, + LeatherHorseArmor, + Lead, + NameTag, + CommandBlockMinecart, + Mutton, + CookedMutton, + WhiteBanner, + OrangeBanner, + MagentaBanner, + LightBlueBanner, + YellowBanner, + LimeBanner, + PinkBanner, + GrayBanner, + LightGrayBanner, + CyanBanner, + PurpleBanner, + BlueBanner, + BrownBanner, + GreenBanner, + RedBanner, + BlackBanner, + EndCrystal, + ChorusFruit, + PoppedChorusFruit, + Beetroot, + BeetrootSeeds, + BeetrootSoup, + DragonBreath, + SplashPotion, + SpectralArrow, + TippedArrow, + LingeringPotion, + Shield, + TotemOfUndying, + ShulkerShell, + IronNugget, + KnowledgeBook, + DebugStick, + MusicDisc13, + MusicDiscCat, + MusicDiscBlocks, + MusicDiscChirp, + MusicDiscFar, + MusicDiscMall, + MusicDiscMellohi, + MusicDiscStal, + MusicDiscStrad, + MusicDiscWard, + MusicDisc11, + MusicDiscWait, + MusicDiscOtherside, + MusicDiscPigstep, + Trident, + PhantomMembrane, + NautilusShell, + HeartOfTheSea, + Crossbow, + SuspiciousStew, + Loom, + FlowerBannerPattern, + CreeperBannerPattern, + SkullBannerPattern, + MojangBannerPattern, + GlobeBannerPattern, + PiglinBannerPattern, + Composter, + Barrel, + Smoker, + BlastFurnace, + CartographyTable, + FletchingTable, + Grindstone, + SmithingTable, + Stonecutter, + Bell, + Lantern, + SoulLantern, + SweetBerries, + GlowBerries, + Campfire, + SoulCampfire, + Shroomlight, + Honeycomb, + BeeNest, + Beehive, + HoneyBottle, + HoneycombBlock, + Lodestone, + CryingObsidian, + Blackstone, + BlackstoneSlab, + BlackstoneStairs, + GildedBlackstone, + PolishedBlackstone, + PolishedBlackstoneSlab, + PolishedBlackstoneStairs, + ChiseledPolishedBlackstone, + PolishedBlackstoneBricks, + PolishedBlackstoneBrickSlab, + PolishedBlackstoneBrickStairs, + CrackedPolishedBlackstoneBricks, + RespawnAnchor, + Candle, + WhiteCandle, + OrangeCandle, + MagentaCandle, + LightBlueCandle, + YellowCandle, + LimeCandle, + PinkCandle, + GrayCandle, + LightGrayCandle, + CyanCandle, + PurpleCandle, + BlueCandle, + BrownCandle, + GreenCandle, + RedCandle, + BlackCandle, + SmallAmethystBud, + MediumAmethystBud, + LargeAmethystBud, + AmethystCluster, + PointedDripstone, + ] + } +} +impl Item { + #[doc = "Returns the `id` property of this `Item`."] + #[inline] pub fn id(&self) -> u32 { match self { - Item::Air => 0, - Item::Stone => 1, - Item::Granite => 2, - Item::PolishedGranite => 3, - Item::Diorite => 4, - Item::PolishedDiorite => 5, - Item::Andesite => 6, - Item::PolishedAndesite => 7, - Item::GrassBlock => 8, - Item::Dirt => 9, - Item::CoarseDirt => 10, - Item::Podzol => 11, - Item::CrimsonNylium => 12, - Item::WarpedNylium => 13, - Item::Cobblestone => 14, - Item::OakPlanks => 15, - Item::SprucePlanks => 16, - Item::BirchPlanks => 17, - Item::JunglePlanks => 18, - Item::AcaciaPlanks => 19, - Item::DarkOakPlanks => 20, - Item::CrimsonPlanks => 21, - Item::WarpedPlanks => 22, - Item::OakSapling => 23, - Item::SpruceSapling => 24, - Item::BirchSapling => 25, - Item::JungleSapling => 26, - Item::AcaciaSapling => 27, - Item::DarkOakSapling => 28, - Item::Bedrock => 29, - Item::Sand => 30, - Item::RedSand => 31, - Item::Gravel => 32, - Item::GoldOre => 33, - Item::IronOre => 34, - Item::CoalOre => 35, - Item::NetherGoldOre => 36, - Item::OakLog => 37, - Item::SpruceLog => 38, - Item::BirchLog => 39, - Item::JungleLog => 40, - Item::AcaciaLog => 41, - Item::DarkOakLog => 42, - Item::CrimsonStem => 43, - Item::WarpedStem => 44, - Item::StrippedOakLog => 45, - Item::StrippedSpruceLog => 46, - Item::StrippedBirchLog => 47, - Item::StrippedJungleLog => 48, - Item::StrippedAcaciaLog => 49, - Item::StrippedDarkOakLog => 50, - Item::StrippedCrimsonStem => 51, - Item::StrippedWarpedStem => 52, - Item::StrippedOakWood => 53, - Item::StrippedSpruceWood => 54, - Item::StrippedBirchWood => 55, - Item::StrippedJungleWood => 56, - Item::StrippedAcaciaWood => 57, - Item::StrippedDarkOakWood => 58, - Item::StrippedCrimsonHyphae => 59, - Item::StrippedWarpedHyphae => 60, - Item::OakWood => 61, - Item::SpruceWood => 62, - Item::BirchWood => 63, - Item::JungleWood => 64, - Item::AcaciaWood => 65, - Item::DarkOakWood => 66, - Item::CrimsonHyphae => 67, - Item::WarpedHyphae => 68, - Item::OakLeaves => 69, - Item::SpruceLeaves => 70, - Item::BirchLeaves => 71, - Item::JungleLeaves => 72, - Item::AcaciaLeaves => 73, - Item::DarkOakLeaves => 74, - Item::Sponge => 75, - Item::WetSponge => 76, - Item::Glass => 77, - Item::LapisOre => 78, - Item::LapisBlock => 79, - Item::Dispenser => 80, - Item::Sandstone => 81, - Item::ChiseledSandstone => 82, - Item::CutSandstone => 83, - Item::NoteBlock => 84, - Item::PoweredRail => 85, - Item::DetectorRail => 86, - Item::StickyPiston => 87, - Item::Cobweb => 88, - Item::Grass => 89, - Item::Fern => 90, - Item::DeadBush => 91, - Item::Seagrass => 92, - Item::SeaPickle => 93, - Item::Piston => 94, - Item::WhiteWool => 95, - Item::OrangeWool => 96, - Item::MagentaWool => 97, - Item::LightBlueWool => 98, - Item::YellowWool => 99, - Item::LimeWool => 100, - Item::PinkWool => 101, - Item::GrayWool => 102, - Item::LightGrayWool => 103, - Item::CyanWool => 104, - Item::PurpleWool => 105, - Item::BlueWool => 106, - Item::BrownWool => 107, - Item::GreenWool => 108, - Item::RedWool => 109, - Item::BlackWool => 110, - Item::Dandelion => 111, - Item::Poppy => 112, - Item::BlueOrchid => 113, - Item::Allium => 114, - Item::AzureBluet => 115, - Item::RedTulip => 116, - Item::OrangeTulip => 117, - Item::WhiteTulip => 118, - Item::PinkTulip => 119, - Item::OxeyeDaisy => 120, - Item::Cornflower => 121, - Item::LilyOfTheValley => 122, - Item::WitherRose => 123, - Item::BrownMushroom => 124, - Item::RedMushroom => 125, - Item::CrimsonFungus => 126, - Item::WarpedFungus => 127, - Item::CrimsonRoots => 128, - Item::WarpedRoots => 129, - Item::NetherSprouts => 130, - Item::WeepingVines => 131, - Item::TwistingVines => 132, - Item::SugarCane => 133, - Item::Kelp => 134, - Item::Bamboo => 135, - Item::GoldBlock => 136, - Item::IronBlock => 137, - Item::OakSlab => 138, - Item::SpruceSlab => 139, - Item::BirchSlab => 140, - Item::JungleSlab => 141, - Item::AcaciaSlab => 142, - Item::DarkOakSlab => 143, - Item::CrimsonSlab => 144, - Item::WarpedSlab => 145, - Item::StoneSlab => 146, - Item::SmoothStoneSlab => 147, - Item::SandstoneSlab => 148, - Item::CutSandstoneSlab => 149, - Item::PetrifiedOakSlab => 150, - Item::CobblestoneSlab => 151, - Item::BrickSlab => 152, - Item::StoneBrickSlab => 153, - Item::NetherBrickSlab => 154, - Item::QuartzSlab => 155, - Item::RedSandstoneSlab => 156, - Item::CutRedSandstoneSlab => 157, - Item::PurpurSlab => 158, - Item::PrismarineSlab => 159, - Item::PrismarineBrickSlab => 160, - Item::DarkPrismarineSlab => 161, - Item::SmoothQuartz => 162, - Item::SmoothRedSandstone => 163, - Item::SmoothSandstone => 164, - Item::SmoothStone => 165, - Item::Bricks => 166, - Item::Tnt => 167, - Item::Bookshelf => 168, - Item::MossyCobblestone => 169, - Item::Obsidian => 170, - Item::Torch => 171, - Item::EndRod => 172, - Item::ChorusPlant => 173, - Item::ChorusFlower => 174, - Item::PurpurBlock => 175, - Item::PurpurPillar => 176, - Item::PurpurStairs => 177, - Item::Spawner => 178, - Item::OakStairs => 179, - Item::Chest => 180, - Item::DiamondOre => 181, - Item::DiamondBlock => 182, - Item::CraftingTable => 183, - Item::Farmland => 184, - Item::Furnace => 185, - Item::Ladder => 186, - Item::Rail => 187, - Item::CobblestoneStairs => 188, - Item::Lever => 189, - Item::StonePressurePlate => 190, - Item::OakPressurePlate => 191, - Item::SprucePressurePlate => 192, - Item::BirchPressurePlate => 193, - Item::JunglePressurePlate => 194, - Item::AcaciaPressurePlate => 195, - Item::DarkOakPressurePlate => 196, - Item::CrimsonPressurePlate => 197, - Item::WarpedPressurePlate => 198, - Item::PolishedBlackstonePressurePlate => 199, - Item::RedstoneOre => 200, - Item::RedstoneTorch => 201, - Item::Snow => 202, - Item::Ice => 203, - Item::SnowBlock => 204, - Item::Cactus => 205, - Item::Clay => 206, - Item::Jukebox => 207, - Item::OakFence => 208, - Item::SpruceFence => 209, - Item::BirchFence => 210, - Item::JungleFence => 211, - Item::AcaciaFence => 212, - Item::DarkOakFence => 213, - Item::CrimsonFence => 214, - Item::WarpedFence => 215, - Item::Pumpkin => 216, - Item::CarvedPumpkin => 217, - Item::Netherrack => 218, - Item::SoulSand => 219, - Item::SoulSoil => 220, - Item::Basalt => 221, - Item::PolishedBasalt => 222, - Item::SoulTorch => 223, - Item::Glowstone => 224, - Item::JackOLantern => 225, - Item::OakTrapdoor => 226, - Item::SpruceTrapdoor => 227, - Item::BirchTrapdoor => 228, - Item::JungleTrapdoor => 229, - Item::AcaciaTrapdoor => 230, - Item::DarkOakTrapdoor => 231, - Item::CrimsonTrapdoor => 232, - Item::WarpedTrapdoor => 233, - Item::InfestedStone => 234, - Item::InfestedCobblestone => 235, - Item::InfestedStoneBricks => 236, - Item::InfestedMossyStoneBricks => 237, - Item::InfestedCrackedStoneBricks => 238, - Item::InfestedChiseledStoneBricks => 239, - Item::StoneBricks => 240, - Item::MossyStoneBricks => 241, - Item::CrackedStoneBricks => 242, - Item::ChiseledStoneBricks => 243, - Item::BrownMushroomBlock => 244, - Item::RedMushroomBlock => 245, - Item::MushroomStem => 246, - Item::IronBars => 247, - Item::Chain => 248, - Item::GlassPane => 249, - Item::Melon => 250, - Item::Vine => 251, - Item::OakFenceGate => 252, - Item::SpruceFenceGate => 253, - Item::BirchFenceGate => 254, - Item::JungleFenceGate => 255, - Item::AcaciaFenceGate => 256, - Item::DarkOakFenceGate => 257, - Item::CrimsonFenceGate => 258, - Item::WarpedFenceGate => 259, - Item::BrickStairs => 260, - Item::StoneBrickStairs => 261, - Item::Mycelium => 262, - Item::LilyPad => 263, - Item::NetherBricks => 264, - Item::CrackedNetherBricks => 265, - Item::ChiseledNetherBricks => 266, - Item::NetherBrickFence => 267, - Item::NetherBrickStairs => 268, - Item::EnchantingTable => 269, - Item::EndPortalFrame => 270, - Item::EndStone => 271, - Item::EndStoneBricks => 272, - Item::DragonEgg => 273, - Item::RedstoneLamp => 274, - Item::SandstoneStairs => 275, - Item::EmeraldOre => 276, - Item::EnderChest => 277, - Item::TripwireHook => 278, - Item::EmeraldBlock => 279, - Item::SpruceStairs => 280, - Item::BirchStairs => 281, - Item::JungleStairs => 282, - Item::CrimsonStairs => 283, - Item::WarpedStairs => 284, - Item::CommandBlock => 285, - Item::Beacon => 286, - Item::CobblestoneWall => 287, - Item::MossyCobblestoneWall => 288, - Item::BrickWall => 289, - Item::PrismarineWall => 290, - Item::RedSandstoneWall => 291, - Item::MossyStoneBrickWall => 292, - Item::GraniteWall => 293, - Item::StoneBrickWall => 294, - Item::NetherBrickWall => 295, - Item::AndesiteWall => 296, - Item::RedNetherBrickWall => 297, - Item::SandstoneWall => 298, - Item::EndStoneBrickWall => 299, - Item::DioriteWall => 300, - Item::BlackstoneWall => 301, - Item::PolishedBlackstoneWall => 302, - Item::PolishedBlackstoneBrickWall => 303, - Item::StoneButton => 304, - Item::OakButton => 305, - Item::SpruceButton => 306, - Item::BirchButton => 307, - Item::JungleButton => 308, - Item::AcaciaButton => 309, - Item::DarkOakButton => 310, - Item::CrimsonButton => 311, - Item::WarpedButton => 312, - Item::PolishedBlackstoneButton => 313, - Item::Anvil => 314, - Item::ChippedAnvil => 315, - Item::DamagedAnvil => 316, - Item::TrappedChest => 317, - Item::LightWeightedPressurePlate => 318, - Item::HeavyWeightedPressurePlate => 319, - Item::DaylightDetector => 320, - Item::RedstoneBlock => 321, - Item::NetherQuartzOre => 322, - Item::Hopper => 323, - Item::ChiseledQuartzBlock => 324, - Item::QuartzBlock => 325, - Item::QuartzBricks => 326, - Item::QuartzPillar => 327, - Item::QuartzStairs => 328, - Item::ActivatorRail => 329, - Item::Dropper => 330, - Item::WhiteTerracotta => 331, - Item::OrangeTerracotta => 332, - Item::MagentaTerracotta => 333, - Item::LightBlueTerracotta => 334, - Item::YellowTerracotta => 335, - Item::LimeTerracotta => 336, - Item::PinkTerracotta => 337, - Item::GrayTerracotta => 338, - Item::LightGrayTerracotta => 339, - Item::CyanTerracotta => 340, - Item::PurpleTerracotta => 341, - Item::BlueTerracotta => 342, - Item::BrownTerracotta => 343, - Item::GreenTerracotta => 344, - Item::RedTerracotta => 345, - Item::BlackTerracotta => 346, - Item::Barrier => 347, - Item::IronTrapdoor => 348, - Item::HayBlock => 349, - Item::WhiteCarpet => 350, - Item::OrangeCarpet => 351, - Item::MagentaCarpet => 352, - Item::LightBlueCarpet => 353, - Item::YellowCarpet => 354, - Item::LimeCarpet => 355, - Item::PinkCarpet => 356, - Item::GrayCarpet => 357, - Item::LightGrayCarpet => 358, - Item::CyanCarpet => 359, - Item::PurpleCarpet => 360, - Item::BlueCarpet => 361, - Item::BrownCarpet => 362, - Item::GreenCarpet => 363, - Item::RedCarpet => 364, - Item::BlackCarpet => 365, - Item::Terracotta => 366, - Item::CoalBlock => 367, - Item::PackedIce => 368, - Item::AcaciaStairs => 369, - Item::DarkOakStairs => 370, - Item::SlimeBlock => 371, - Item::GrassPath => 372, - Item::Sunflower => 373, - Item::Lilac => 374, - Item::RoseBush => 375, - Item::Peony => 376, - Item::TallGrass => 377, - Item::LargeFern => 378, - Item::WhiteStainedGlass => 379, - Item::OrangeStainedGlass => 380, - Item::MagentaStainedGlass => 381, - Item::LightBlueStainedGlass => 382, - Item::YellowStainedGlass => 383, - Item::LimeStainedGlass => 384, - Item::PinkStainedGlass => 385, - Item::GrayStainedGlass => 386, - Item::LightGrayStainedGlass => 387, - Item::CyanStainedGlass => 388, - Item::PurpleStainedGlass => 389, - Item::BlueStainedGlass => 390, - Item::BrownStainedGlass => 391, - Item::GreenStainedGlass => 392, - Item::RedStainedGlass => 393, - Item::BlackStainedGlass => 394, - Item::WhiteStainedGlassPane => 395, - Item::OrangeStainedGlassPane => 396, - Item::MagentaStainedGlassPane => 397, - Item::LightBlueStainedGlassPane => 398, - Item::YellowStainedGlassPane => 399, - Item::LimeStainedGlassPane => 400, - Item::PinkStainedGlassPane => 401, - Item::GrayStainedGlassPane => 402, - Item::LightGrayStainedGlassPane => 403, - Item::CyanStainedGlassPane => 404, - Item::PurpleStainedGlassPane => 405, - Item::BlueStainedGlassPane => 406, - Item::BrownStainedGlassPane => 407, - Item::GreenStainedGlassPane => 408, - Item::RedStainedGlassPane => 409, - Item::BlackStainedGlassPane => 410, - Item::Prismarine => 411, - Item::PrismarineBricks => 412, - Item::DarkPrismarine => 413, - Item::PrismarineStairs => 414, - Item::PrismarineBrickStairs => 415, - Item::DarkPrismarineStairs => 416, - Item::SeaLantern => 417, - Item::RedSandstone => 418, - Item::ChiseledRedSandstone => 419, - Item::CutRedSandstone => 420, - Item::RedSandstoneStairs => 421, - Item::RepeatingCommandBlock => 422, - Item::ChainCommandBlock => 423, - Item::MagmaBlock => 424, - Item::NetherWartBlock => 425, - Item::WarpedWartBlock => 426, - Item::RedNetherBricks => 427, - Item::BoneBlock => 428, - Item::StructureVoid => 429, - Item::Observer => 430, - Item::ShulkerBox => 431, - Item::WhiteShulkerBox => 432, - Item::OrangeShulkerBox => 433, - Item::MagentaShulkerBox => 434, - Item::LightBlueShulkerBox => 435, - Item::YellowShulkerBox => 436, - Item::LimeShulkerBox => 437, - Item::PinkShulkerBox => 438, - Item::GrayShulkerBox => 439, - Item::LightGrayShulkerBox => 440, - Item::CyanShulkerBox => 441, - Item::PurpleShulkerBox => 442, - Item::BlueShulkerBox => 443, - Item::BrownShulkerBox => 444, - Item::GreenShulkerBox => 445, - Item::RedShulkerBox => 446, - Item::BlackShulkerBox => 447, - Item::WhiteGlazedTerracotta => 448, - Item::OrangeGlazedTerracotta => 449, - Item::MagentaGlazedTerracotta => 450, - Item::LightBlueGlazedTerracotta => 451, - Item::YellowGlazedTerracotta => 452, - Item::LimeGlazedTerracotta => 453, - Item::PinkGlazedTerracotta => 454, - Item::GrayGlazedTerracotta => 455, - Item::LightGrayGlazedTerracotta => 456, - Item::CyanGlazedTerracotta => 457, - Item::PurpleGlazedTerracotta => 458, - Item::BlueGlazedTerracotta => 459, - Item::BrownGlazedTerracotta => 460, - Item::GreenGlazedTerracotta => 461, - Item::RedGlazedTerracotta => 462, - Item::BlackGlazedTerracotta => 463, - Item::WhiteConcrete => 464, - Item::OrangeConcrete => 465, - Item::MagentaConcrete => 466, - Item::LightBlueConcrete => 467, - Item::YellowConcrete => 468, - Item::LimeConcrete => 469, - Item::PinkConcrete => 470, - Item::GrayConcrete => 471, - Item::LightGrayConcrete => 472, - Item::CyanConcrete => 473, - Item::PurpleConcrete => 474, - Item::BlueConcrete => 475, - Item::BrownConcrete => 476, - Item::GreenConcrete => 477, - Item::RedConcrete => 478, - Item::BlackConcrete => 479, - Item::WhiteConcretePowder => 480, - Item::OrangeConcretePowder => 481, - Item::MagentaConcretePowder => 482, - Item::LightBlueConcretePowder => 483, - Item::YellowConcretePowder => 484, - Item::LimeConcretePowder => 485, - Item::PinkConcretePowder => 486, - Item::GrayConcretePowder => 487, - Item::LightGrayConcretePowder => 488, - Item::CyanConcretePowder => 489, - Item::PurpleConcretePowder => 490, - Item::BlueConcretePowder => 491, - Item::BrownConcretePowder => 492, - Item::GreenConcretePowder => 493, - Item::RedConcretePowder => 494, - Item::BlackConcretePowder => 495, - Item::TurtleEgg => 496, - Item::DeadTubeCoralBlock => 497, - Item::DeadBrainCoralBlock => 498, - Item::DeadBubbleCoralBlock => 499, - Item::DeadFireCoralBlock => 500, - Item::DeadHornCoralBlock => 501, - Item::TubeCoralBlock => 502, - Item::BrainCoralBlock => 503, - Item::BubbleCoralBlock => 504, - Item::FireCoralBlock => 505, - Item::HornCoralBlock => 506, - Item::TubeCoral => 507, - Item::BrainCoral => 508, - Item::BubbleCoral => 509, - Item::FireCoral => 510, - Item::HornCoral => 511, - Item::DeadBrainCoral => 512, - Item::DeadBubbleCoral => 513, - Item::DeadFireCoral => 514, - Item::DeadHornCoral => 515, - Item::DeadTubeCoral => 516, - Item::TubeCoralFan => 517, - Item::BrainCoralFan => 518, - Item::BubbleCoralFan => 519, - Item::FireCoralFan => 520, - Item::HornCoralFan => 521, - Item::DeadTubeCoralFan => 522, - Item::DeadBrainCoralFan => 523, - Item::DeadBubbleCoralFan => 524, - Item::DeadFireCoralFan => 525, - Item::DeadHornCoralFan => 526, - Item::BlueIce => 527, - Item::Conduit => 528, - Item::PolishedGraniteStairs => 529, - Item::SmoothRedSandstoneStairs => 530, - Item::MossyStoneBrickStairs => 531, - Item::PolishedDioriteStairs => 532, - Item::MossyCobblestoneStairs => 533, - Item::EndStoneBrickStairs => 534, - Item::StoneStairs => 535, - Item::SmoothSandstoneStairs => 536, - Item::SmoothQuartzStairs => 537, - Item::GraniteStairs => 538, - Item::AndesiteStairs => 539, - Item::RedNetherBrickStairs => 540, - Item::PolishedAndesiteStairs => 541, - Item::DioriteStairs => 542, - Item::PolishedGraniteSlab => 543, - Item::SmoothRedSandstoneSlab => 544, - Item::MossyStoneBrickSlab => 545, - Item::PolishedDioriteSlab => 546, - Item::MossyCobblestoneSlab => 547, - Item::EndStoneBrickSlab => 548, - Item::SmoothSandstoneSlab => 549, - Item::SmoothQuartzSlab => 550, - Item::GraniteSlab => 551, - Item::AndesiteSlab => 552, - Item::RedNetherBrickSlab => 553, - Item::PolishedAndesiteSlab => 554, - Item::DioriteSlab => 555, - Item::Scaffolding => 556, - Item::IronDoor => 557, - Item::OakDoor => 558, - Item::SpruceDoor => 559, - Item::BirchDoor => 560, - Item::JungleDoor => 561, - Item::AcaciaDoor => 562, - Item::DarkOakDoor => 563, - Item::CrimsonDoor => 564, - Item::WarpedDoor => 565, - Item::Repeater => 566, - Item::Comparator => 567, - Item::StructureBlock => 568, - Item::Jigsaw => 569, - Item::TurtleHelmet => 570, - Item::Scute => 571, - Item::FlintAndSteel => 572, - Item::Apple => 573, - Item::Bow => 574, - Item::Arrow => 575, - Item::Coal => 576, - Item::Charcoal => 577, - Item::Diamond => 578, - Item::IronIngot => 579, - Item::GoldIngot => 580, - Item::NetheriteIngot => 581, - Item::NetheriteScrap => 582, - Item::WoodenSword => 583, - Item::WoodenShovel => 584, - Item::WoodenPickaxe => 585, - Item::WoodenAxe => 586, - Item::WoodenHoe => 587, - Item::StoneSword => 588, - Item::StoneShovel => 589, - Item::StonePickaxe => 590, - Item::StoneAxe => 591, - Item::StoneHoe => 592, - Item::GoldenSword => 593, - Item::GoldenShovel => 594, - Item::GoldenPickaxe => 595, - Item::GoldenAxe => 596, - Item::GoldenHoe => 597, - Item::IronSword => 598, - Item::IronShovel => 599, - Item::IronPickaxe => 600, - Item::IronAxe => 601, - Item::IronHoe => 602, - Item::DiamondSword => 603, - Item::DiamondShovel => 604, - Item::DiamondPickaxe => 605, - Item::DiamondAxe => 606, - Item::DiamondHoe => 607, - Item::NetheriteSword => 608, - Item::NetheriteShovel => 609, - Item::NetheritePickaxe => 610, - Item::NetheriteAxe => 611, - Item::NetheriteHoe => 612, - Item::Stick => 613, - Item::Bowl => 614, - Item::MushroomStew => 615, - Item::String => 616, - Item::Feather => 617, - Item::Gunpowder => 618, - Item::WheatSeeds => 619, - Item::Wheat => 620, - Item::Bread => 621, - Item::LeatherHelmet => 622, - Item::LeatherChestplate => 623, - Item::LeatherLeggings => 624, - Item::LeatherBoots => 625, - Item::ChainmailHelmet => 626, - Item::ChainmailChestplate => 627, - Item::ChainmailLeggings => 628, - Item::ChainmailBoots => 629, - Item::IronHelmet => 630, - Item::IronChestplate => 631, - Item::IronLeggings => 632, - Item::IronBoots => 633, - Item::DiamondHelmet => 634, - Item::DiamondChestplate => 635, - Item::DiamondLeggings => 636, - Item::DiamondBoots => 637, - Item::GoldenHelmet => 638, - Item::GoldenChestplate => 639, - Item::GoldenLeggings => 640, - Item::GoldenBoots => 641, - Item::NetheriteHelmet => 642, - Item::NetheriteChestplate => 643, - Item::NetheriteLeggings => 644, - Item::NetheriteBoots => 645, - Item::Flint => 646, - Item::Porkchop => 647, - Item::CookedPorkchop => 648, - Item::Painting => 649, - Item::GoldenApple => 650, - Item::EnchantedGoldenApple => 651, - Item::OakSign => 652, - Item::SpruceSign => 653, - Item::BirchSign => 654, - Item::JungleSign => 655, - Item::AcaciaSign => 656, - Item::DarkOakSign => 657, - Item::CrimsonSign => 658, - Item::WarpedSign => 659, - Item::Bucket => 660, - Item::WaterBucket => 661, - Item::LavaBucket => 662, - Item::Minecart => 663, - Item::Saddle => 664, - Item::Redstone => 665, - Item::Snowball => 666, - Item::OakBoat => 667, - Item::Leather => 668, - Item::MilkBucket => 669, - Item::PufferfishBucket => 670, - Item::SalmonBucket => 671, - Item::CodBucket => 672, - Item::TropicalFishBucket => 673, - Item::Brick => 674, - Item::ClayBall => 675, - Item::DriedKelpBlock => 676, - Item::Paper => 677, - Item::Book => 678, - Item::SlimeBall => 679, - Item::ChestMinecart => 680, - Item::FurnaceMinecart => 681, - Item::Egg => 682, - Item::Compass => 683, - Item::FishingRod => 684, - Item::Clock => 685, - Item::GlowstoneDust => 686, - Item::Cod => 687, - Item::Salmon => 688, - Item::TropicalFish => 689, - Item::Pufferfish => 690, - Item::CookedCod => 691, - Item::CookedSalmon => 692, - Item::InkSac => 693, - Item::CocoaBeans => 694, - Item::LapisLazuli => 695, - Item::WhiteDye => 696, - Item::OrangeDye => 697, - Item::MagentaDye => 698, - Item::LightBlueDye => 699, - Item::YellowDye => 700, - Item::LimeDye => 701, - Item::PinkDye => 702, - Item::GrayDye => 703, - Item::LightGrayDye => 704, - Item::CyanDye => 705, - Item::PurpleDye => 706, - Item::BlueDye => 707, - Item::BrownDye => 708, - Item::GreenDye => 709, - Item::RedDye => 710, - Item::BlackDye => 711, - Item::BoneMeal => 712, - Item::Bone => 713, - Item::Sugar => 714, - Item::Cake => 715, - Item::WhiteBed => 716, - Item::OrangeBed => 717, - Item::MagentaBed => 718, - Item::LightBlueBed => 719, - Item::YellowBed => 720, - Item::LimeBed => 721, - Item::PinkBed => 722, - Item::GrayBed => 723, - Item::LightGrayBed => 724, - Item::CyanBed => 725, - Item::PurpleBed => 726, - Item::BlueBed => 727, - Item::BrownBed => 728, - Item::GreenBed => 729, - Item::RedBed => 730, - Item::BlackBed => 731, - Item::Cookie => 732, - Item::FilledMap => 733, - Item::Shears => 734, - Item::MelonSlice => 735, - Item::DriedKelp => 736, - Item::PumpkinSeeds => 737, - Item::MelonSeeds => 738, - Item::Beef => 739, - Item::CookedBeef => 740, - Item::Chicken => 741, - Item::CookedChicken => 742, - Item::RottenFlesh => 743, - Item::EnderPearl => 744, - Item::BlazeRod => 745, - Item::GhastTear => 746, - Item::GoldNugget => 747, - Item::NetherWart => 748, - Item::Potion => 749, - Item::GlassBottle => 750, - Item::SpiderEye => 751, - Item::FermentedSpiderEye => 752, - Item::BlazePowder => 753, - Item::MagmaCream => 754, - Item::BrewingStand => 755, - Item::Cauldron => 756, - Item::EnderEye => 757, - Item::GlisteringMelonSlice => 758, - Item::BatSpawnEgg => 759, - Item::BeeSpawnEgg => 760, - Item::BlazeSpawnEgg => 761, - Item::CatSpawnEgg => 762, - Item::CaveSpiderSpawnEgg => 763, - Item::ChickenSpawnEgg => 764, - Item::CodSpawnEgg => 765, - Item::CowSpawnEgg => 766, - Item::CreeperSpawnEgg => 767, - Item::DolphinSpawnEgg => 768, - Item::DonkeySpawnEgg => 769, - Item::DrownedSpawnEgg => 770, - Item::ElderGuardianSpawnEgg => 771, - Item::EndermanSpawnEgg => 772, - Item::EndermiteSpawnEgg => 773, - Item::EvokerSpawnEgg => 774, - Item::FoxSpawnEgg => 775, - Item::GhastSpawnEgg => 776, - Item::GuardianSpawnEgg => 777, - Item::HoglinSpawnEgg => 778, - Item::HorseSpawnEgg => 779, - Item::HuskSpawnEgg => 780, - Item::LlamaSpawnEgg => 781, - Item::MagmaCubeSpawnEgg => 782, - Item::MooshroomSpawnEgg => 783, - Item::MuleSpawnEgg => 784, - Item::OcelotSpawnEgg => 785, - Item::PandaSpawnEgg => 786, - Item::ParrotSpawnEgg => 787, - Item::PhantomSpawnEgg => 788, - Item::PigSpawnEgg => 789, - Item::PiglinSpawnEgg => 790, - Item::PiglinBruteSpawnEgg => 791, - Item::PillagerSpawnEgg => 792, - Item::PolarBearSpawnEgg => 793, - Item::PufferfishSpawnEgg => 794, - Item::RabbitSpawnEgg => 795, - Item::RavagerSpawnEgg => 796, - Item::SalmonSpawnEgg => 797, - Item::SheepSpawnEgg => 798, - Item::ShulkerSpawnEgg => 799, - Item::SilverfishSpawnEgg => 800, - Item::SkeletonSpawnEgg => 801, - Item::SkeletonHorseSpawnEgg => 802, - Item::SlimeSpawnEgg => 803, - Item::SpiderSpawnEgg => 804, - Item::SquidSpawnEgg => 805, - Item::StraySpawnEgg => 806, - Item::StriderSpawnEgg => 807, - Item::TraderLlamaSpawnEgg => 808, - Item::TropicalFishSpawnEgg => 809, - Item::TurtleSpawnEgg => 810, - Item::VexSpawnEgg => 811, - Item::VillagerSpawnEgg => 812, - Item::VindicatorSpawnEgg => 813, - Item::WanderingTraderSpawnEgg => 814, - Item::WitchSpawnEgg => 815, - Item::WitherSkeletonSpawnEgg => 816, - Item::WolfSpawnEgg => 817, - Item::ZoglinSpawnEgg => 818, - Item::ZombieSpawnEgg => 819, - Item::ZombieHorseSpawnEgg => 820, - Item::ZombieVillagerSpawnEgg => 821, - Item::ZombifiedPiglinSpawnEgg => 822, - Item::ExperienceBottle => 823, - Item::FireCharge => 824, - Item::WritableBook => 825, - Item::WrittenBook => 826, - Item::Emerald => 827, - Item::ItemFrame => 828, - Item::FlowerPot => 829, - Item::Carrot => 830, - Item::Potato => 831, - Item::BakedPotato => 832, - Item::PoisonousPotato => 833, - Item::Map => 834, - Item::GoldenCarrot => 835, - Item::SkeletonSkull => 836, - Item::WitherSkeletonSkull => 837, - Item::PlayerHead => 838, - Item::ZombieHead => 839, - Item::CreeperHead => 840, - Item::DragonHead => 841, - Item::CarrotOnAStick => 842, - Item::WarpedFungusOnAStick => 843, - Item::NetherStar => 844, - Item::PumpkinPie => 845, - Item::FireworkRocket => 846, - Item::FireworkStar => 847, - Item::EnchantedBook => 848, - Item::NetherBrick => 849, - Item::Quartz => 850, - Item::TntMinecart => 851, - Item::HopperMinecart => 852, - Item::PrismarineShard => 853, - Item::PrismarineCrystals => 854, - Item::Rabbit => 855, - Item::CookedRabbit => 856, - Item::RabbitStew => 857, - Item::RabbitFoot => 858, - Item::RabbitHide => 859, - Item::ArmorStand => 860, - Item::IronHorseArmor => 861, - Item::GoldenHorseArmor => 862, - Item::DiamondHorseArmor => 863, - Item::LeatherHorseArmor => 864, - Item::Lead => 865, - Item::NameTag => 866, - Item::CommandBlockMinecart => 867, - Item::Mutton => 868, - Item::CookedMutton => 869, - Item::WhiteBanner => 870, - Item::OrangeBanner => 871, - Item::MagentaBanner => 872, - Item::LightBlueBanner => 873, - Item::YellowBanner => 874, - Item::LimeBanner => 875, - Item::PinkBanner => 876, - Item::GrayBanner => 877, - Item::LightGrayBanner => 878, - Item::CyanBanner => 879, - Item::PurpleBanner => 880, - Item::BlueBanner => 881, - Item::BrownBanner => 882, - Item::GreenBanner => 883, - Item::RedBanner => 884, - Item::BlackBanner => 885, - Item::EndCrystal => 886, - Item::ChorusFruit => 887, - Item::PoppedChorusFruit => 888, - Item::Beetroot => 889, - Item::BeetrootSeeds => 890, - Item::BeetrootSoup => 891, - Item::DragonBreath => 892, - Item::SplashPotion => 893, - Item::SpectralArrow => 894, - Item::TippedArrow => 895, - Item::LingeringPotion => 896, - Item::Shield => 897, - Item::Elytra => 898, - Item::SpruceBoat => 899, - Item::BirchBoat => 900, - Item::JungleBoat => 901, - Item::AcaciaBoat => 902, - Item::DarkOakBoat => 903, - Item::TotemOfUndying => 904, - Item::ShulkerShell => 905, - Item::IronNugget => 906, - Item::KnowledgeBook => 907, - Item::DebugStick => 908, - Item::MusicDisc13 => 909, - Item::MusicDiscCat => 910, - Item::MusicDiscBlocks => 911, - Item::MusicDiscChirp => 912, - Item::MusicDiscFar => 913, - Item::MusicDiscMall => 914, - Item::MusicDiscMellohi => 915, - Item::MusicDiscStal => 916, - Item::MusicDiscStrad => 917, - Item::MusicDiscWard => 918, - Item::MusicDisc11 => 919, - Item::MusicDiscWait => 920, - Item::MusicDiscPigstep => 921, - Item::Trident => 922, - Item::PhantomMembrane => 923, - Item::NautilusShell => 924, - Item::HeartOfTheSea => 925, - Item::Crossbow => 926, - Item::SuspiciousStew => 927, - Item::Loom => 928, - Item::FlowerBannerPattern => 929, - Item::CreeperBannerPattern => 930, - Item::SkullBannerPattern => 931, - Item::MojangBannerPattern => 932, - Item::GlobeBannerPattern => 933, - Item::PiglinBannerPattern => 934, - Item::Composter => 935, - Item::Barrel => 936, - Item::Smoker => 937, - Item::BlastFurnace => 938, - Item::CartographyTable => 939, - Item::FletchingTable => 940, - Item::Grindstone => 941, - Item::Lectern => 942, - Item::SmithingTable => 943, - Item::Stonecutter => 944, - Item::Bell => 945, - Item::Lantern => 946, - Item::SoulLantern => 947, - Item::SweetBerries => 948, - Item::Campfire => 949, - Item::SoulCampfire => 950, - Item::Shroomlight => 951, - Item::Honeycomb => 952, - Item::BeeNest => 953, - Item::Beehive => 954, - Item::HoneyBottle => 955, - Item::HoneyBlock => 956, - Item::HoneycombBlock => 957, - Item::Lodestone => 958, - Item::NetheriteBlock => 959, - Item::AncientDebris => 960, - Item::Target => 961, - Item::CryingObsidian => 962, - Item::Blackstone => 963, - Item::BlackstoneSlab => 964, - Item::BlackstoneStairs => 965, - Item::GildedBlackstone => 966, - Item::PolishedBlackstone => 967, - Item::PolishedBlackstoneSlab => 968, - Item::PolishedBlackstoneStairs => 969, - Item::ChiseledPolishedBlackstone => 970, - Item::PolishedBlackstoneBricks => 971, - Item::PolishedBlackstoneBrickSlab => 972, - Item::PolishedBlackstoneBrickStairs => 973, - Item::CrackedPolishedBlackstoneBricks => 974, - Item::RespawnAnchor => 975, + Item::Stone => 1u32, + Item::Granite => 2u32, + Item::PolishedGranite => 3u32, + Item::Diorite => 4u32, + Item::PolishedDiorite => 5u32, + Item::Andesite => 6u32, + Item::PolishedAndesite => 7u32, + Item::Deepslate => 8u32, + Item::CobbledDeepslate => 9u32, + Item::PolishedDeepslate => 10u32, + Item::Calcite => 11u32, + Item::Tuff => 12u32, + Item::DripstoneBlock => 13u32, + Item::GrassBlock => 14u32, + Item::Dirt => 15u32, + Item::CoarseDirt => 16u32, + Item::Podzol => 17u32, + Item::RootedDirt => 18u32, + Item::CrimsonNylium => 19u32, + Item::WarpedNylium => 20u32, + Item::Cobblestone => 21u32, + Item::OakPlanks => 22u32, + Item::SprucePlanks => 23u32, + Item::BirchPlanks => 24u32, + Item::JunglePlanks => 25u32, + Item::AcaciaPlanks => 26u32, + Item::DarkOakPlanks => 27u32, + Item::CrimsonPlanks => 28u32, + Item::WarpedPlanks => 29u32, + Item::OakSapling => 30u32, + Item::SpruceSapling => 31u32, + Item::BirchSapling => 32u32, + Item::JungleSapling => 33u32, + Item::AcaciaSapling => 34u32, + Item::DarkOakSapling => 35u32, + Item::Bedrock => 36u32, + Item::Sand => 37u32, + Item::RedSand => 38u32, + Item::Gravel => 39u32, + Item::CoalOre => 40u32, + Item::DeepslateCoalOre => 41u32, + Item::IronOre => 42u32, + Item::DeepslateIronOre => 43u32, + Item::CopperOre => 44u32, + Item::DeepslateCopperOre => 45u32, + Item::GoldOre => 46u32, + Item::DeepslateGoldOre => 47u32, + Item::RedstoneOre => 48u32, + Item::DeepslateRedstoneOre => 49u32, + Item::EmeraldOre => 50u32, + Item::DeepslateEmeraldOre => 51u32, + Item::LapisOre => 52u32, + Item::DeepslateLapisOre => 53u32, + Item::DiamondOre => 54u32, + Item::DeepslateDiamondOre => 55u32, + Item::NetherGoldOre => 56u32, + Item::NetherQuartzOre => 57u32, + Item::AncientDebris => 58u32, + Item::CoalBlock => 59u32, + Item::RawIronBlock => 60u32, + Item::RawCopperBlock => 61u32, + Item::RawGoldBlock => 62u32, + Item::AmethystBlock => 63u32, + Item::BuddingAmethyst => 64u32, + Item::IronBlock => 65u32, + Item::CopperBlock => 66u32, + Item::GoldBlock => 67u32, + Item::DiamondBlock => 68u32, + Item::NetheriteBlock => 69u32, + Item::ExposedCopper => 70u32, + Item::WeatheredCopper => 71u32, + Item::OxidizedCopper => 72u32, + Item::CutCopper => 73u32, + Item::ExposedCutCopper => 74u32, + Item::WeatheredCutCopper => 75u32, + Item::OxidizedCutCopper => 76u32, + Item::CutCopperStairs => 77u32, + Item::ExposedCutCopperStairs => 78u32, + Item::WeatheredCutCopperStairs => 79u32, + Item::OxidizedCutCopperStairs => 80u32, + Item::CutCopperSlab => 81u32, + Item::ExposedCutCopperSlab => 82u32, + Item::WeatheredCutCopperSlab => 83u32, + Item::OxidizedCutCopperSlab => 84u32, + Item::WaxedCopperBlock => 85u32, + Item::WaxedExposedCopper => 86u32, + Item::WaxedWeatheredCopper => 87u32, + Item::WaxedOxidizedCopper => 88u32, + Item::WaxedCutCopper => 89u32, + Item::WaxedExposedCutCopper => 90u32, + Item::WaxedWeatheredCutCopper => 91u32, + Item::WaxedOxidizedCutCopper => 92u32, + Item::WaxedCutCopperStairs => 93u32, + Item::WaxedExposedCutCopperStairs => 94u32, + Item::WaxedWeatheredCutCopperStairs => 95u32, + Item::WaxedOxidizedCutCopperStairs => 96u32, + Item::WaxedCutCopperSlab => 97u32, + Item::WaxedExposedCutCopperSlab => 98u32, + Item::WaxedWeatheredCutCopperSlab => 99u32, + Item::WaxedOxidizedCutCopperSlab => 100u32, + Item::OakLog => 101u32, + Item::SpruceLog => 102u32, + Item::BirchLog => 103u32, + Item::JungleLog => 104u32, + Item::AcaciaLog => 105u32, + Item::DarkOakLog => 106u32, + Item::CrimsonStem => 107u32, + Item::WarpedStem => 108u32, + Item::StrippedOakLog => 109u32, + Item::StrippedSpruceLog => 110u32, + Item::StrippedBirchLog => 111u32, + Item::StrippedJungleLog => 112u32, + Item::StrippedAcaciaLog => 113u32, + Item::StrippedDarkOakLog => 114u32, + Item::StrippedCrimsonStem => 115u32, + Item::StrippedWarpedStem => 116u32, + Item::StrippedOakWood => 117u32, + Item::StrippedSpruceWood => 118u32, + Item::StrippedBirchWood => 119u32, + Item::StrippedJungleWood => 120u32, + Item::StrippedAcaciaWood => 121u32, + Item::StrippedDarkOakWood => 122u32, + Item::StrippedCrimsonHyphae => 123u32, + Item::StrippedWarpedHyphae => 124u32, + Item::OakWood => 125u32, + Item::SpruceWood => 126u32, + Item::BirchWood => 127u32, + Item::JungleWood => 128u32, + Item::AcaciaWood => 129u32, + Item::DarkOakWood => 130u32, + Item::CrimsonHyphae => 131u32, + Item::WarpedHyphae => 132u32, + Item::OakLeaves => 133u32, + Item::SpruceLeaves => 134u32, + Item::BirchLeaves => 135u32, + Item::JungleLeaves => 136u32, + Item::AcaciaLeaves => 137u32, + Item::DarkOakLeaves => 138u32, + Item::AzaleaLeaves => 139u32, + Item::FloweringAzaleaLeaves => 140u32, + Item::Sponge => 141u32, + Item::WetSponge => 142u32, + Item::Glass => 143u32, + Item::TintedGlass => 144u32, + Item::LapisBlock => 145u32, + Item::Sandstone => 146u32, + Item::ChiseledSandstone => 147u32, + Item::CutSandstone => 148u32, + Item::Cobweb => 149u32, + Item::Grass => 150u32, + Item::Fern => 151u32, + Item::Azalea => 152u32, + Item::FloweringAzalea => 153u32, + Item::DeadBush => 154u32, + Item::Seagrass => 155u32, + Item::SeaPickle => 156u32, + Item::WhiteWool => 157u32, + Item::OrangeWool => 158u32, + Item::MagentaWool => 159u32, + Item::LightBlueWool => 160u32, + Item::YellowWool => 161u32, + Item::LimeWool => 162u32, + Item::PinkWool => 163u32, + Item::GrayWool => 164u32, + Item::LightGrayWool => 165u32, + Item::CyanWool => 166u32, + Item::PurpleWool => 167u32, + Item::BlueWool => 168u32, + Item::BrownWool => 169u32, + Item::GreenWool => 170u32, + Item::RedWool => 171u32, + Item::BlackWool => 172u32, + Item::Dandelion => 173u32, + Item::Poppy => 174u32, + Item::BlueOrchid => 175u32, + Item::Allium => 176u32, + Item::AzureBluet => 177u32, + Item::RedTulip => 178u32, + Item::OrangeTulip => 179u32, + Item::WhiteTulip => 180u32, + Item::PinkTulip => 181u32, + Item::OxeyeDaisy => 182u32, + Item::Cornflower => 183u32, + Item::LilyOfTheValley => 184u32, + Item::WitherRose => 185u32, + Item::SporeBlossom => 186u32, + Item::BrownMushroom => 187u32, + Item::RedMushroom => 188u32, + Item::CrimsonFungus => 189u32, + Item::WarpedFungus => 190u32, + Item::CrimsonRoots => 191u32, + Item::WarpedRoots => 192u32, + Item::NetherSprouts => 193u32, + Item::WeepingVines => 194u32, + Item::TwistingVines => 195u32, + Item::SugarCane => 196u32, + Item::Kelp => 197u32, + Item::MossCarpet => 198u32, + Item::MossBlock => 199u32, + Item::HangingRoots => 200u32, + Item::BigDripleaf => 201u32, + Item::SmallDripleaf => 202u32, + Item::Bamboo => 203u32, + Item::OakSlab => 204u32, + Item::SpruceSlab => 205u32, + Item::BirchSlab => 206u32, + Item::JungleSlab => 207u32, + Item::AcaciaSlab => 208u32, + Item::DarkOakSlab => 209u32, + Item::CrimsonSlab => 210u32, + Item::WarpedSlab => 211u32, + Item::StoneSlab => 212u32, + Item::SmoothStoneSlab => 213u32, + Item::SandstoneSlab => 214u32, + Item::CutSandstoneSlab => 215u32, + Item::PetrifiedOakSlab => 216u32, + Item::CobblestoneSlab => 217u32, + Item::BrickSlab => 218u32, + Item::StoneBrickSlab => 219u32, + Item::NetherBrickSlab => 220u32, + Item::QuartzSlab => 221u32, + Item::RedSandstoneSlab => 222u32, + Item::CutRedSandstoneSlab => 223u32, + Item::PurpurSlab => 224u32, + Item::PrismarineSlab => 225u32, + Item::PrismarineBrickSlab => 226u32, + Item::DarkPrismarineSlab => 227u32, + Item::SmoothQuartz => 228u32, + Item::SmoothRedSandstone => 229u32, + Item::SmoothSandstone => 230u32, + Item::SmoothStone => 231u32, + Item::Bricks => 232u32, + Item::Bookshelf => 233u32, + Item::MossyCobblestone => 234u32, + Item::Obsidian => 235u32, + Item::Torch => 236u32, + Item::EndRod => 237u32, + Item::ChorusPlant => 238u32, + Item::ChorusFlower => 239u32, + Item::PurpurBlock => 240u32, + Item::PurpurPillar => 241u32, + Item::PurpurStairs => 242u32, + Item::Spawner => 243u32, + Item::OakStairs => 244u32, + Item::Chest => 245u32, + Item::CraftingTable => 246u32, + Item::Farmland => 247u32, + Item::Furnace => 248u32, + Item::Ladder => 249u32, + Item::CobblestoneStairs => 250u32, + Item::Snow => 251u32, + Item::Ice => 252u32, + Item::SnowBlock => 253u32, + Item::Cactus => 254u32, + Item::Clay => 255u32, + Item::Jukebox => 256u32, + Item::OakFence => 257u32, + Item::SpruceFence => 258u32, + Item::BirchFence => 259u32, + Item::JungleFence => 260u32, + Item::AcaciaFence => 261u32, + Item::DarkOakFence => 262u32, + Item::CrimsonFence => 263u32, + Item::WarpedFence => 264u32, + Item::Pumpkin => 265u32, + Item::CarvedPumpkin => 266u32, + Item::JackOLantern => 267u32, + Item::Netherrack => 268u32, + Item::SoulSand => 269u32, + Item::SoulSoil => 270u32, + Item::Basalt => 271u32, + Item::PolishedBasalt => 272u32, + Item::SmoothBasalt => 273u32, + Item::SoulTorch => 274u32, + Item::Glowstone => 275u32, + Item::InfestedStone => 276u32, + Item::InfestedCobblestone => 277u32, + Item::InfestedStoneBricks => 278u32, + Item::InfestedMossyStoneBricks => 279u32, + Item::InfestedCrackedStoneBricks => 280u32, + Item::InfestedChiseledStoneBricks => 281u32, + Item::InfestedDeepslate => 282u32, + Item::StoneBricks => 283u32, + Item::MossyStoneBricks => 284u32, + Item::CrackedStoneBricks => 285u32, + Item::ChiseledStoneBricks => 286u32, + Item::DeepslateBricks => 287u32, + Item::CrackedDeepslateBricks => 288u32, + Item::DeepslateTiles => 289u32, + Item::CrackedDeepslateTiles => 290u32, + Item::ChiseledDeepslate => 291u32, + Item::BrownMushroomBlock => 292u32, + Item::RedMushroomBlock => 293u32, + Item::MushroomStem => 294u32, + Item::IronBars => 295u32, + Item::Chain => 296u32, + Item::GlassPane => 297u32, + Item::Melon => 298u32, + Item::Vine => 299u32, + Item::GlowLichen => 300u32, + Item::BrickStairs => 301u32, + Item::StoneBrickStairs => 302u32, + Item::Mycelium => 303u32, + Item::LilyPad => 304u32, + Item::NetherBricks => 305u32, + Item::CrackedNetherBricks => 306u32, + Item::ChiseledNetherBricks => 307u32, + Item::NetherBrickFence => 308u32, + Item::NetherBrickStairs => 309u32, + Item::EnchantingTable => 310u32, + Item::EndPortalFrame => 311u32, + Item::EndStone => 312u32, + Item::EndStoneBricks => 313u32, + Item::DragonEgg => 314u32, + Item::SandstoneStairs => 315u32, + Item::EnderChest => 316u32, + Item::EmeraldBlock => 317u32, + Item::SpruceStairs => 318u32, + Item::BirchStairs => 319u32, + Item::JungleStairs => 320u32, + Item::CrimsonStairs => 321u32, + Item::WarpedStairs => 322u32, + Item::CommandBlock => 323u32, + Item::Beacon => 324u32, + Item::CobblestoneWall => 325u32, + Item::MossyCobblestoneWall => 326u32, + Item::BrickWall => 327u32, + Item::PrismarineWall => 328u32, + Item::RedSandstoneWall => 329u32, + Item::MossyStoneBrickWall => 330u32, + Item::GraniteWall => 331u32, + Item::StoneBrickWall => 332u32, + Item::NetherBrickWall => 333u32, + Item::AndesiteWall => 334u32, + Item::RedNetherBrickWall => 335u32, + Item::SandstoneWall => 336u32, + Item::EndStoneBrickWall => 337u32, + Item::DioriteWall => 338u32, + Item::BlackstoneWall => 339u32, + Item::PolishedBlackstoneWall => 340u32, + Item::PolishedBlackstoneBrickWall => 341u32, + Item::CobbledDeepslateWall => 342u32, + Item::PolishedDeepslateWall => 343u32, + Item::DeepslateBrickWall => 344u32, + Item::DeepslateTileWall => 345u32, + Item::Anvil => 346u32, + Item::ChippedAnvil => 347u32, + Item::DamagedAnvil => 348u32, + Item::ChiseledQuartzBlock => 349u32, + Item::QuartzBlock => 350u32, + Item::QuartzBricks => 351u32, + Item::QuartzPillar => 352u32, + Item::QuartzStairs => 353u32, + Item::WhiteTerracotta => 354u32, + Item::OrangeTerracotta => 355u32, + Item::MagentaTerracotta => 356u32, + Item::LightBlueTerracotta => 357u32, + Item::YellowTerracotta => 358u32, + Item::LimeTerracotta => 359u32, + Item::PinkTerracotta => 360u32, + Item::GrayTerracotta => 361u32, + Item::LightGrayTerracotta => 362u32, + Item::CyanTerracotta => 363u32, + Item::PurpleTerracotta => 364u32, + Item::BlueTerracotta => 365u32, + Item::BrownTerracotta => 366u32, + Item::GreenTerracotta => 367u32, + Item::RedTerracotta => 368u32, + Item::BlackTerracotta => 369u32, + Item::Barrier => 370u32, + Item::Light => 371u32, + Item::HayBlock => 372u32, + Item::WhiteCarpet => 373u32, + Item::OrangeCarpet => 374u32, + Item::MagentaCarpet => 375u32, + Item::LightBlueCarpet => 376u32, + Item::YellowCarpet => 377u32, + Item::LimeCarpet => 378u32, + Item::PinkCarpet => 379u32, + Item::GrayCarpet => 380u32, + Item::LightGrayCarpet => 381u32, + Item::CyanCarpet => 382u32, + Item::PurpleCarpet => 383u32, + Item::BlueCarpet => 384u32, + Item::BrownCarpet => 385u32, + Item::GreenCarpet => 386u32, + Item::RedCarpet => 387u32, + Item::BlackCarpet => 388u32, + Item::Terracotta => 389u32, + Item::PackedIce => 390u32, + Item::AcaciaStairs => 391u32, + Item::DarkOakStairs => 392u32, + Item::DirtPath => 393u32, + Item::Sunflower => 394u32, + Item::Lilac => 395u32, + Item::RoseBush => 396u32, + Item::Peony => 397u32, + Item::TallGrass => 398u32, + Item::LargeFern => 399u32, + Item::WhiteStainedGlass => 400u32, + Item::OrangeStainedGlass => 401u32, + Item::MagentaStainedGlass => 402u32, + Item::LightBlueStainedGlass => 403u32, + Item::YellowStainedGlass => 404u32, + Item::LimeStainedGlass => 405u32, + Item::PinkStainedGlass => 406u32, + Item::GrayStainedGlass => 407u32, + Item::LightGrayStainedGlass => 408u32, + Item::CyanStainedGlass => 409u32, + Item::PurpleStainedGlass => 410u32, + Item::BlueStainedGlass => 411u32, + Item::BrownStainedGlass => 412u32, + Item::GreenStainedGlass => 413u32, + Item::RedStainedGlass => 414u32, + Item::BlackStainedGlass => 415u32, + Item::WhiteStainedGlassPane => 416u32, + Item::OrangeStainedGlassPane => 417u32, + Item::MagentaStainedGlassPane => 418u32, + Item::LightBlueStainedGlassPane => 419u32, + Item::YellowStainedGlassPane => 420u32, + Item::LimeStainedGlassPane => 421u32, + Item::PinkStainedGlassPane => 422u32, + Item::GrayStainedGlassPane => 423u32, + Item::LightGrayStainedGlassPane => 424u32, + Item::CyanStainedGlassPane => 425u32, + Item::PurpleStainedGlassPane => 426u32, + Item::BlueStainedGlassPane => 427u32, + Item::BrownStainedGlassPane => 428u32, + Item::GreenStainedGlassPane => 429u32, + Item::RedStainedGlassPane => 430u32, + Item::BlackStainedGlassPane => 431u32, + Item::Prismarine => 432u32, + Item::PrismarineBricks => 433u32, + Item::DarkPrismarine => 434u32, + Item::PrismarineStairs => 435u32, + Item::PrismarineBrickStairs => 436u32, + Item::DarkPrismarineStairs => 437u32, + Item::SeaLantern => 438u32, + Item::RedSandstone => 439u32, + Item::ChiseledRedSandstone => 440u32, + Item::CutRedSandstone => 441u32, + Item::RedSandstoneStairs => 442u32, + Item::RepeatingCommandBlock => 443u32, + Item::ChainCommandBlock => 444u32, + Item::MagmaBlock => 445u32, + Item::NetherWartBlock => 446u32, + Item::WarpedWartBlock => 447u32, + Item::RedNetherBricks => 448u32, + Item::BoneBlock => 449u32, + Item::StructureVoid => 450u32, + Item::ShulkerBox => 451u32, + Item::WhiteShulkerBox => 452u32, + Item::OrangeShulkerBox => 453u32, + Item::MagentaShulkerBox => 454u32, + Item::LightBlueShulkerBox => 455u32, + Item::YellowShulkerBox => 456u32, + Item::LimeShulkerBox => 457u32, + Item::PinkShulkerBox => 458u32, + Item::GrayShulkerBox => 459u32, + Item::LightGrayShulkerBox => 460u32, + Item::CyanShulkerBox => 461u32, + Item::PurpleShulkerBox => 462u32, + Item::BlueShulkerBox => 463u32, + Item::BrownShulkerBox => 464u32, + Item::GreenShulkerBox => 465u32, + Item::RedShulkerBox => 466u32, + Item::BlackShulkerBox => 467u32, + Item::WhiteGlazedTerracotta => 468u32, + Item::OrangeGlazedTerracotta => 469u32, + Item::MagentaGlazedTerracotta => 470u32, + Item::LightBlueGlazedTerracotta => 471u32, + Item::YellowGlazedTerracotta => 472u32, + Item::LimeGlazedTerracotta => 473u32, + Item::PinkGlazedTerracotta => 474u32, + Item::GrayGlazedTerracotta => 475u32, + Item::LightGrayGlazedTerracotta => 476u32, + Item::CyanGlazedTerracotta => 477u32, + Item::PurpleGlazedTerracotta => 478u32, + Item::BlueGlazedTerracotta => 479u32, + Item::BrownGlazedTerracotta => 480u32, + Item::GreenGlazedTerracotta => 481u32, + Item::RedGlazedTerracotta => 482u32, + Item::BlackGlazedTerracotta => 483u32, + Item::WhiteConcrete => 484u32, + Item::OrangeConcrete => 485u32, + Item::MagentaConcrete => 486u32, + Item::LightBlueConcrete => 487u32, + Item::YellowConcrete => 488u32, + Item::LimeConcrete => 489u32, + Item::PinkConcrete => 490u32, + Item::GrayConcrete => 491u32, + Item::LightGrayConcrete => 492u32, + Item::CyanConcrete => 493u32, + Item::PurpleConcrete => 494u32, + Item::BlueConcrete => 495u32, + Item::BrownConcrete => 496u32, + Item::GreenConcrete => 497u32, + Item::RedConcrete => 498u32, + Item::BlackConcrete => 499u32, + Item::WhiteConcretePowder => 500u32, + Item::OrangeConcretePowder => 501u32, + Item::MagentaConcretePowder => 502u32, + Item::LightBlueConcretePowder => 503u32, + Item::YellowConcretePowder => 504u32, + Item::LimeConcretePowder => 505u32, + Item::PinkConcretePowder => 506u32, + Item::GrayConcretePowder => 507u32, + Item::LightGrayConcretePowder => 508u32, + Item::CyanConcretePowder => 509u32, + Item::PurpleConcretePowder => 510u32, + Item::BlueConcretePowder => 511u32, + Item::BrownConcretePowder => 512u32, + Item::GreenConcretePowder => 513u32, + Item::RedConcretePowder => 514u32, + Item::BlackConcretePowder => 515u32, + Item::TurtleEgg => 516u32, + Item::DeadTubeCoralBlock => 517u32, + Item::DeadBrainCoralBlock => 518u32, + Item::DeadBubbleCoralBlock => 519u32, + Item::DeadFireCoralBlock => 520u32, + Item::DeadHornCoralBlock => 521u32, + Item::TubeCoralBlock => 522u32, + Item::BrainCoralBlock => 523u32, + Item::BubbleCoralBlock => 524u32, + Item::FireCoralBlock => 525u32, + Item::HornCoralBlock => 526u32, + Item::TubeCoral => 527u32, + Item::BrainCoral => 528u32, + Item::BubbleCoral => 529u32, + Item::FireCoral => 530u32, + Item::HornCoral => 531u32, + Item::DeadBrainCoral => 532u32, + Item::DeadBubbleCoral => 533u32, + Item::DeadFireCoral => 534u32, + Item::DeadHornCoral => 535u32, + Item::DeadTubeCoral => 536u32, + Item::TubeCoralFan => 537u32, + Item::BrainCoralFan => 538u32, + Item::BubbleCoralFan => 539u32, + Item::FireCoralFan => 540u32, + Item::HornCoralFan => 541u32, + Item::DeadTubeCoralFan => 542u32, + Item::DeadBrainCoralFan => 543u32, + Item::DeadBubbleCoralFan => 544u32, + Item::DeadFireCoralFan => 545u32, + Item::DeadHornCoralFan => 546u32, + Item::BlueIce => 547u32, + Item::Conduit => 548u32, + Item::PolishedGraniteStairs => 549u32, + Item::SmoothRedSandstoneStairs => 550u32, + Item::MossyStoneBrickStairs => 551u32, + Item::PolishedDioriteStairs => 552u32, + Item::MossyCobblestoneStairs => 553u32, + Item::EndStoneBrickStairs => 554u32, + Item::StoneStairs => 555u32, + Item::SmoothSandstoneStairs => 556u32, + Item::SmoothQuartzStairs => 557u32, + Item::GraniteStairs => 558u32, + Item::AndesiteStairs => 559u32, + Item::RedNetherBrickStairs => 560u32, + Item::PolishedAndesiteStairs => 561u32, + Item::DioriteStairs => 562u32, + Item::CobbledDeepslateStairs => 563u32, + Item::PolishedDeepslateStairs => 564u32, + Item::DeepslateBrickStairs => 565u32, + Item::DeepslateTileStairs => 566u32, + Item::PolishedGraniteSlab => 567u32, + Item::SmoothRedSandstoneSlab => 568u32, + Item::MossyStoneBrickSlab => 569u32, + Item::PolishedDioriteSlab => 570u32, + Item::MossyCobblestoneSlab => 571u32, + Item::EndStoneBrickSlab => 572u32, + Item::SmoothSandstoneSlab => 573u32, + Item::SmoothQuartzSlab => 574u32, + Item::GraniteSlab => 575u32, + Item::AndesiteSlab => 576u32, + Item::RedNetherBrickSlab => 577u32, + Item::PolishedAndesiteSlab => 578u32, + Item::DioriteSlab => 579u32, + Item::CobbledDeepslateSlab => 580u32, + Item::PolishedDeepslateSlab => 581u32, + Item::DeepslateBrickSlab => 582u32, + Item::DeepslateTileSlab => 583u32, + Item::Scaffolding => 584u32, + Item::Redstone => 585u32, + Item::RedstoneTorch => 586u32, + Item::RedstoneBlock => 587u32, + Item::Repeater => 588u32, + Item::Comparator => 589u32, + Item::Piston => 590u32, + Item::StickyPiston => 591u32, + Item::SlimeBlock => 592u32, + Item::HoneyBlock => 593u32, + Item::Observer => 594u32, + Item::Hopper => 595u32, + Item::Dispenser => 596u32, + Item::Dropper => 597u32, + Item::Lectern => 598u32, + Item::Target => 599u32, + Item::Lever => 600u32, + Item::LightningRod => 601u32, + Item::DaylightDetector => 602u32, + Item::SculkSensor => 603u32, + Item::TripwireHook => 604u32, + Item::TrappedChest => 605u32, + Item::Tnt => 606u32, + Item::RedstoneLamp => 607u32, + Item::NoteBlock => 608u32, + Item::StoneButton => 609u32, + Item::PolishedBlackstoneButton => 610u32, + Item::OakButton => 611u32, + Item::SpruceButton => 612u32, + Item::BirchButton => 613u32, + Item::JungleButton => 614u32, + Item::AcaciaButton => 615u32, + Item::DarkOakButton => 616u32, + Item::CrimsonButton => 617u32, + Item::WarpedButton => 618u32, + Item::StonePressurePlate => 619u32, + Item::PolishedBlackstonePressurePlate => 620u32, + Item::LightWeightedPressurePlate => 621u32, + Item::HeavyWeightedPressurePlate => 622u32, + Item::OakPressurePlate => 623u32, + Item::SprucePressurePlate => 624u32, + Item::BirchPressurePlate => 625u32, + Item::JunglePressurePlate => 626u32, + Item::AcaciaPressurePlate => 627u32, + Item::DarkOakPressurePlate => 628u32, + Item::CrimsonPressurePlate => 629u32, + Item::WarpedPressurePlate => 630u32, + Item::IronDoor => 631u32, + Item::OakDoor => 632u32, + Item::SpruceDoor => 633u32, + Item::BirchDoor => 634u32, + Item::JungleDoor => 635u32, + Item::AcaciaDoor => 636u32, + Item::DarkOakDoor => 637u32, + Item::CrimsonDoor => 638u32, + Item::WarpedDoor => 639u32, + Item::IronTrapdoor => 640u32, + Item::OakTrapdoor => 641u32, + Item::SpruceTrapdoor => 642u32, + Item::BirchTrapdoor => 643u32, + Item::JungleTrapdoor => 644u32, + Item::AcaciaTrapdoor => 645u32, + Item::DarkOakTrapdoor => 646u32, + Item::CrimsonTrapdoor => 647u32, + Item::WarpedTrapdoor => 648u32, + Item::OakFenceGate => 649u32, + Item::SpruceFenceGate => 650u32, + Item::BirchFenceGate => 651u32, + Item::JungleFenceGate => 652u32, + Item::AcaciaFenceGate => 653u32, + Item::DarkOakFenceGate => 654u32, + Item::CrimsonFenceGate => 655u32, + Item::WarpedFenceGate => 656u32, + Item::PoweredRail => 657u32, + Item::DetectorRail => 658u32, + Item::Rail => 659u32, + Item::ActivatorRail => 660u32, + Item::Saddle => 661u32, + Item::Minecart => 662u32, + Item::ChestMinecart => 663u32, + Item::FurnaceMinecart => 664u32, + Item::TntMinecart => 665u32, + Item::HopperMinecart => 666u32, + Item::CarrotOnAStick => 667u32, + Item::WarpedFungusOnAStick => 668u32, + Item::Elytra => 669u32, + Item::OakBoat => 670u32, + Item::SpruceBoat => 671u32, + Item::BirchBoat => 672u32, + Item::JungleBoat => 673u32, + Item::AcaciaBoat => 674u32, + Item::DarkOakBoat => 675u32, + Item::StructureBlock => 676u32, + Item::Jigsaw => 677u32, + Item::TurtleHelmet => 678u32, + Item::Scute => 679u32, + Item::FlintAndSteel => 680u32, + Item::Apple => 681u32, + Item::Bow => 682u32, + Item::Arrow => 683u32, + Item::Coal => 684u32, + Item::Charcoal => 685u32, + Item::Diamond => 686u32, + Item::Emerald => 687u32, + Item::LapisLazuli => 688u32, + Item::Quartz => 689u32, + Item::AmethystShard => 690u32, + Item::RawIron => 691u32, + Item::IronIngot => 692u32, + Item::RawCopper => 693u32, + Item::CopperIngot => 694u32, + Item::RawGold => 695u32, + Item::GoldIngot => 696u32, + Item::NetheriteIngot => 697u32, + Item::NetheriteScrap => 698u32, + Item::WoodenSword => 699u32, + Item::WoodenShovel => 700u32, + Item::WoodenPickaxe => 701u32, + Item::WoodenAxe => 702u32, + Item::WoodenHoe => 703u32, + Item::StoneSword => 704u32, + Item::StoneShovel => 705u32, + Item::StonePickaxe => 706u32, + Item::StoneAxe => 707u32, + Item::StoneHoe => 708u32, + Item::GoldenSword => 709u32, + Item::GoldenShovel => 710u32, + Item::GoldenPickaxe => 711u32, + Item::GoldenAxe => 712u32, + Item::GoldenHoe => 713u32, + Item::IronSword => 714u32, + Item::IronShovel => 715u32, + Item::IronPickaxe => 716u32, + Item::IronAxe => 717u32, + Item::IronHoe => 718u32, + Item::DiamondSword => 719u32, + Item::DiamondShovel => 720u32, + Item::DiamondPickaxe => 721u32, + Item::DiamondAxe => 722u32, + Item::DiamondHoe => 723u32, + Item::NetheriteSword => 724u32, + Item::NetheriteShovel => 725u32, + Item::NetheritePickaxe => 726u32, + Item::NetheriteAxe => 727u32, + Item::NetheriteHoe => 728u32, + Item::Stick => 729u32, + Item::Bowl => 730u32, + Item::MushroomStew => 731u32, + Item::String => 732u32, + Item::Feather => 733u32, + Item::Gunpowder => 734u32, + Item::WheatSeeds => 735u32, + Item::Wheat => 736u32, + Item::Bread => 737u32, + Item::LeatherHelmet => 738u32, + Item::LeatherChestplate => 739u32, + Item::LeatherLeggings => 740u32, + Item::LeatherBoots => 741u32, + Item::ChainmailHelmet => 742u32, + Item::ChainmailChestplate => 743u32, + Item::ChainmailLeggings => 744u32, + Item::ChainmailBoots => 745u32, + Item::IronHelmet => 746u32, + Item::IronChestplate => 747u32, + Item::IronLeggings => 748u32, + Item::IronBoots => 749u32, + Item::DiamondHelmet => 750u32, + Item::DiamondChestplate => 751u32, + Item::DiamondLeggings => 752u32, + Item::DiamondBoots => 753u32, + Item::GoldenHelmet => 754u32, + Item::GoldenChestplate => 755u32, + Item::GoldenLeggings => 756u32, + Item::GoldenBoots => 757u32, + Item::NetheriteHelmet => 758u32, + Item::NetheriteChestplate => 759u32, + Item::NetheriteLeggings => 760u32, + Item::NetheriteBoots => 761u32, + Item::Flint => 762u32, + Item::Porkchop => 763u32, + Item::CookedPorkchop => 764u32, + Item::Painting => 765u32, + Item::GoldenApple => 766u32, + Item::EnchantedGoldenApple => 767u32, + Item::OakSign => 768u32, + Item::SpruceSign => 769u32, + Item::BirchSign => 770u32, + Item::JungleSign => 771u32, + Item::AcaciaSign => 772u32, + Item::DarkOakSign => 773u32, + Item::CrimsonSign => 774u32, + Item::WarpedSign => 775u32, + Item::Bucket => 776u32, + Item::WaterBucket => 777u32, + Item::LavaBucket => 778u32, + Item::PowderSnowBucket => 779u32, + Item::Snowball => 780u32, + Item::Leather => 781u32, + Item::MilkBucket => 782u32, + Item::PufferfishBucket => 783u32, + Item::SalmonBucket => 784u32, + Item::CodBucket => 785u32, + Item::TropicalFishBucket => 786u32, + Item::AxolotlBucket => 787u32, + Item::Brick => 788u32, + Item::ClayBall => 789u32, + Item::DriedKelpBlock => 790u32, + Item::Paper => 791u32, + Item::Book => 792u32, + Item::SlimeBall => 793u32, + Item::Egg => 794u32, + Item::Compass => 795u32, + Item::Bundle => 796u32, + Item::FishingRod => 797u32, + Item::Clock => 798u32, + Item::Spyglass => 799u32, + Item::GlowstoneDust => 800u32, + Item::Cod => 801u32, + Item::Salmon => 802u32, + Item::TropicalFish => 803u32, + Item::Pufferfish => 804u32, + Item::CookedCod => 805u32, + Item::CookedSalmon => 806u32, + Item::InkSac => 807u32, + Item::GlowInkSac => 808u32, + Item::CocoaBeans => 809u32, + Item::WhiteDye => 810u32, + Item::OrangeDye => 811u32, + Item::MagentaDye => 812u32, + Item::LightBlueDye => 813u32, + Item::YellowDye => 814u32, + Item::LimeDye => 815u32, + Item::PinkDye => 816u32, + Item::GrayDye => 817u32, + Item::LightGrayDye => 818u32, + Item::CyanDye => 819u32, + Item::PurpleDye => 820u32, + Item::BlueDye => 821u32, + Item::BrownDye => 822u32, + Item::GreenDye => 823u32, + Item::RedDye => 824u32, + Item::BlackDye => 825u32, + Item::BoneMeal => 826u32, + Item::Bone => 827u32, + Item::Sugar => 828u32, + Item::Cake => 829u32, + Item::WhiteBed => 830u32, + Item::OrangeBed => 831u32, + Item::MagentaBed => 832u32, + Item::LightBlueBed => 833u32, + Item::YellowBed => 834u32, + Item::LimeBed => 835u32, + Item::PinkBed => 836u32, + Item::GrayBed => 837u32, + Item::LightGrayBed => 838u32, + Item::CyanBed => 839u32, + Item::PurpleBed => 840u32, + Item::BlueBed => 841u32, + Item::BrownBed => 842u32, + Item::GreenBed => 843u32, + Item::RedBed => 844u32, + Item::BlackBed => 845u32, + Item::Cookie => 846u32, + Item::FilledMap => 847u32, + Item::Shears => 848u32, + Item::MelonSlice => 849u32, + Item::DriedKelp => 850u32, + Item::PumpkinSeeds => 851u32, + Item::MelonSeeds => 852u32, + Item::Beef => 853u32, + Item::CookedBeef => 854u32, + Item::Chicken => 855u32, + Item::CookedChicken => 856u32, + Item::RottenFlesh => 857u32, + Item::EnderPearl => 858u32, + Item::BlazeRod => 859u32, + Item::GhastTear => 860u32, + Item::GoldNugget => 861u32, + Item::NetherWart => 862u32, + Item::Potion => 863u32, + Item::GlassBottle => 864u32, + Item::SpiderEye => 865u32, + Item::FermentedSpiderEye => 866u32, + Item::BlazePowder => 867u32, + Item::MagmaCream => 868u32, + Item::BrewingStand => 869u32, + Item::Cauldron => 870u32, + Item::EnderEye => 871u32, + Item::GlisteringMelonSlice => 872u32, + Item::AxolotlSpawnEgg => 873u32, + Item::BatSpawnEgg => 874u32, + Item::BeeSpawnEgg => 875u32, + Item::BlazeSpawnEgg => 876u32, + Item::CatSpawnEgg => 877u32, + Item::CaveSpiderSpawnEgg => 878u32, + Item::ChickenSpawnEgg => 879u32, + Item::CodSpawnEgg => 880u32, + Item::CowSpawnEgg => 881u32, + Item::CreeperSpawnEgg => 882u32, + Item::DolphinSpawnEgg => 883u32, + Item::DonkeySpawnEgg => 884u32, + Item::DrownedSpawnEgg => 885u32, + Item::ElderGuardianSpawnEgg => 886u32, + Item::EndermanSpawnEgg => 887u32, + Item::EndermiteSpawnEgg => 888u32, + Item::EvokerSpawnEgg => 889u32, + Item::FoxSpawnEgg => 890u32, + Item::GhastSpawnEgg => 891u32, + Item::GlowSquidSpawnEgg => 892u32, + Item::GoatSpawnEgg => 893u32, + Item::GuardianSpawnEgg => 894u32, + Item::HoglinSpawnEgg => 895u32, + Item::HorseSpawnEgg => 896u32, + Item::HuskSpawnEgg => 897u32, + Item::LlamaSpawnEgg => 898u32, + Item::MagmaCubeSpawnEgg => 899u32, + Item::MooshroomSpawnEgg => 900u32, + Item::MuleSpawnEgg => 901u32, + Item::OcelotSpawnEgg => 902u32, + Item::PandaSpawnEgg => 903u32, + Item::ParrotSpawnEgg => 904u32, + Item::PhantomSpawnEgg => 905u32, + Item::PigSpawnEgg => 906u32, + Item::PiglinSpawnEgg => 907u32, + Item::PiglinBruteSpawnEgg => 908u32, + Item::PillagerSpawnEgg => 909u32, + Item::PolarBearSpawnEgg => 910u32, + Item::PufferfishSpawnEgg => 911u32, + Item::RabbitSpawnEgg => 912u32, + Item::RavagerSpawnEgg => 913u32, + Item::SalmonSpawnEgg => 914u32, + Item::SheepSpawnEgg => 915u32, + Item::ShulkerSpawnEgg => 916u32, + Item::SilverfishSpawnEgg => 917u32, + Item::SkeletonSpawnEgg => 918u32, + Item::SkeletonHorseSpawnEgg => 919u32, + Item::SlimeSpawnEgg => 920u32, + Item::SpiderSpawnEgg => 921u32, + Item::SquidSpawnEgg => 922u32, + Item::StraySpawnEgg => 923u32, + Item::StriderSpawnEgg => 924u32, + Item::TraderLlamaSpawnEgg => 925u32, + Item::TropicalFishSpawnEgg => 926u32, + Item::TurtleSpawnEgg => 927u32, + Item::VexSpawnEgg => 928u32, + Item::VillagerSpawnEgg => 929u32, + Item::VindicatorSpawnEgg => 930u32, + Item::WanderingTraderSpawnEgg => 931u32, + Item::WitchSpawnEgg => 932u32, + Item::WitherSkeletonSpawnEgg => 933u32, + Item::WolfSpawnEgg => 934u32, + Item::ZoglinSpawnEgg => 935u32, + Item::ZombieSpawnEgg => 936u32, + Item::ZombieHorseSpawnEgg => 937u32, + Item::ZombieVillagerSpawnEgg => 938u32, + Item::ZombifiedPiglinSpawnEgg => 939u32, + Item::ExperienceBottle => 940u32, + Item::FireCharge => 941u32, + Item::WritableBook => 942u32, + Item::WrittenBook => 943u32, + Item::ItemFrame => 944u32, + Item::GlowItemFrame => 945u32, + Item::FlowerPot => 946u32, + Item::Carrot => 947u32, + Item::Potato => 948u32, + Item::BakedPotato => 949u32, + Item::PoisonousPotato => 950u32, + Item::Map => 951u32, + Item::GoldenCarrot => 952u32, + Item::SkeletonSkull => 953u32, + Item::WitherSkeletonSkull => 954u32, + Item::PlayerHead => 955u32, + Item::ZombieHead => 956u32, + Item::CreeperHead => 957u32, + Item::DragonHead => 958u32, + Item::NetherStar => 959u32, + Item::PumpkinPie => 960u32, + Item::FireworkRocket => 961u32, + Item::FireworkStar => 962u32, + Item::EnchantedBook => 963u32, + Item::NetherBrick => 964u32, + Item::PrismarineShard => 965u32, + Item::PrismarineCrystals => 966u32, + Item::Rabbit => 967u32, + Item::CookedRabbit => 968u32, + Item::RabbitStew => 969u32, + Item::RabbitFoot => 970u32, + Item::RabbitHide => 971u32, + Item::ArmorStand => 972u32, + Item::IronHorseArmor => 973u32, + Item::GoldenHorseArmor => 974u32, + Item::DiamondHorseArmor => 975u32, + Item::LeatherHorseArmor => 976u32, + Item::Lead => 977u32, + Item::NameTag => 978u32, + Item::CommandBlockMinecart => 979u32, + Item::Mutton => 980u32, + Item::CookedMutton => 981u32, + Item::WhiteBanner => 982u32, + Item::OrangeBanner => 983u32, + Item::MagentaBanner => 984u32, + Item::LightBlueBanner => 985u32, + Item::YellowBanner => 986u32, + Item::LimeBanner => 987u32, + Item::PinkBanner => 988u32, + Item::GrayBanner => 989u32, + Item::LightGrayBanner => 990u32, + Item::CyanBanner => 991u32, + Item::PurpleBanner => 992u32, + Item::BlueBanner => 993u32, + Item::BrownBanner => 994u32, + Item::GreenBanner => 995u32, + Item::RedBanner => 996u32, + Item::BlackBanner => 997u32, + Item::EndCrystal => 998u32, + Item::ChorusFruit => 999u32, + Item::PoppedChorusFruit => 1000u32, + Item::Beetroot => 1001u32, + Item::BeetrootSeeds => 1002u32, + Item::BeetrootSoup => 1003u32, + Item::DragonBreath => 1004u32, + Item::SplashPotion => 1005u32, + Item::SpectralArrow => 1006u32, + Item::TippedArrow => 1007u32, + Item::LingeringPotion => 1008u32, + Item::Shield => 1009u32, + Item::TotemOfUndying => 1010u32, + Item::ShulkerShell => 1011u32, + Item::IronNugget => 1012u32, + Item::KnowledgeBook => 1013u32, + Item::DebugStick => 1014u32, + Item::MusicDisc13 => 1015u32, + Item::MusicDiscCat => 1016u32, + Item::MusicDiscBlocks => 1017u32, + Item::MusicDiscChirp => 1018u32, + Item::MusicDiscFar => 1019u32, + Item::MusicDiscMall => 1020u32, + Item::MusicDiscMellohi => 1021u32, + Item::MusicDiscStal => 1022u32, + Item::MusicDiscStrad => 1023u32, + Item::MusicDiscWard => 1024u32, + Item::MusicDisc11 => 1025u32, + Item::MusicDiscWait => 1026u32, + Item::MusicDiscOtherside => 1027u32, + Item::MusicDiscPigstep => 1028u32, + Item::Trident => 1029u32, + Item::PhantomMembrane => 1030u32, + Item::NautilusShell => 1031u32, + Item::HeartOfTheSea => 1032u32, + Item::Crossbow => 1033u32, + Item::SuspiciousStew => 1034u32, + Item::Loom => 1035u32, + Item::FlowerBannerPattern => 1036u32, + Item::CreeperBannerPattern => 1037u32, + Item::SkullBannerPattern => 1038u32, + Item::MojangBannerPattern => 1039u32, + Item::GlobeBannerPattern => 1040u32, + Item::PiglinBannerPattern => 1041u32, + Item::Composter => 1042u32, + Item::Barrel => 1043u32, + Item::Smoker => 1044u32, + Item::BlastFurnace => 1045u32, + Item::CartographyTable => 1046u32, + Item::FletchingTable => 1047u32, + Item::Grindstone => 1048u32, + Item::SmithingTable => 1049u32, + Item::Stonecutter => 1050u32, + Item::Bell => 1051u32, + Item::Lantern => 1052u32, + Item::SoulLantern => 1053u32, + Item::SweetBerries => 1054u32, + Item::GlowBerries => 1055u32, + Item::Campfire => 1056u32, + Item::SoulCampfire => 1057u32, + Item::Shroomlight => 1058u32, + Item::Honeycomb => 1059u32, + Item::BeeNest => 1060u32, + Item::Beehive => 1061u32, + Item::HoneyBottle => 1062u32, + Item::HoneycombBlock => 1063u32, + Item::Lodestone => 1064u32, + Item::CryingObsidian => 1065u32, + Item::Blackstone => 1066u32, + Item::BlackstoneSlab => 1067u32, + Item::BlackstoneStairs => 1068u32, + Item::GildedBlackstone => 1069u32, + Item::PolishedBlackstone => 1070u32, + Item::PolishedBlackstoneSlab => 1071u32, + Item::PolishedBlackstoneStairs => 1072u32, + Item::ChiseledPolishedBlackstone => 1073u32, + Item::PolishedBlackstoneBricks => 1074u32, + Item::PolishedBlackstoneBrickSlab => 1075u32, + Item::PolishedBlackstoneBrickStairs => 1076u32, + Item::CrackedPolishedBlackstoneBricks => 1077u32, + Item::RespawnAnchor => 1078u32, + Item::Candle => 1079u32, + Item::WhiteCandle => 1080u32, + Item::OrangeCandle => 1081u32, + Item::MagentaCandle => 1082u32, + Item::LightBlueCandle => 1083u32, + Item::YellowCandle => 1084u32, + Item::LimeCandle => 1085u32, + Item::PinkCandle => 1086u32, + Item::GrayCandle => 1087u32, + Item::LightGrayCandle => 1088u32, + Item::CyanCandle => 1089u32, + Item::PurpleCandle => 1090u32, + Item::BlueCandle => 1091u32, + Item::BrownCandle => 1092u32, + Item::GreenCandle => 1093u32, + Item::RedCandle => 1094u32, + Item::BlackCandle => 1095u32, + Item::SmallAmethystBud => 1096u32, + Item::MediumAmethystBud => 1097u32, + Item::LargeAmethystBud => 1098u32, + Item::AmethystCluster => 1099u32, + Item::PointedDripstone => 1100u32, } } - - /// Gets a `Item` by its `id`. + #[doc = "Gets a `Item` by its `id`."] + #[inline] pub fn from_id(id: u32) -> Option { match id { - 0 => Some(Item::Air), - 1 => Some(Item::Stone), - 2 => Some(Item::Granite), - 3 => Some(Item::PolishedGranite), - 4 => Some(Item::Diorite), - 5 => Some(Item::PolishedDiorite), - 6 => Some(Item::Andesite), - 7 => Some(Item::PolishedAndesite), - 8 => Some(Item::GrassBlock), - 9 => Some(Item::Dirt), - 10 => Some(Item::CoarseDirt), - 11 => Some(Item::Podzol), - 12 => Some(Item::CrimsonNylium), - 13 => Some(Item::WarpedNylium), - 14 => Some(Item::Cobblestone), - 15 => Some(Item::OakPlanks), - 16 => Some(Item::SprucePlanks), - 17 => Some(Item::BirchPlanks), - 18 => Some(Item::JunglePlanks), - 19 => Some(Item::AcaciaPlanks), - 20 => Some(Item::DarkOakPlanks), - 21 => Some(Item::CrimsonPlanks), - 22 => Some(Item::WarpedPlanks), - 23 => Some(Item::OakSapling), - 24 => Some(Item::SpruceSapling), - 25 => Some(Item::BirchSapling), - 26 => Some(Item::JungleSapling), - 27 => Some(Item::AcaciaSapling), - 28 => Some(Item::DarkOakSapling), - 29 => Some(Item::Bedrock), - 30 => Some(Item::Sand), - 31 => Some(Item::RedSand), - 32 => Some(Item::Gravel), - 33 => Some(Item::GoldOre), - 34 => Some(Item::IronOre), - 35 => Some(Item::CoalOre), - 36 => Some(Item::NetherGoldOre), - 37 => Some(Item::OakLog), - 38 => Some(Item::SpruceLog), - 39 => Some(Item::BirchLog), - 40 => Some(Item::JungleLog), - 41 => Some(Item::AcaciaLog), - 42 => Some(Item::DarkOakLog), - 43 => Some(Item::CrimsonStem), - 44 => Some(Item::WarpedStem), - 45 => Some(Item::StrippedOakLog), - 46 => Some(Item::StrippedSpruceLog), - 47 => Some(Item::StrippedBirchLog), - 48 => Some(Item::StrippedJungleLog), - 49 => Some(Item::StrippedAcaciaLog), - 50 => Some(Item::StrippedDarkOakLog), - 51 => Some(Item::StrippedCrimsonStem), - 52 => Some(Item::StrippedWarpedStem), - 53 => Some(Item::StrippedOakWood), - 54 => Some(Item::StrippedSpruceWood), - 55 => Some(Item::StrippedBirchWood), - 56 => Some(Item::StrippedJungleWood), - 57 => Some(Item::StrippedAcaciaWood), - 58 => Some(Item::StrippedDarkOakWood), - 59 => Some(Item::StrippedCrimsonHyphae), - 60 => Some(Item::StrippedWarpedHyphae), - 61 => Some(Item::OakWood), - 62 => Some(Item::SpruceWood), - 63 => Some(Item::BirchWood), - 64 => Some(Item::JungleWood), - 65 => Some(Item::AcaciaWood), - 66 => Some(Item::DarkOakWood), - 67 => Some(Item::CrimsonHyphae), - 68 => Some(Item::WarpedHyphae), - 69 => Some(Item::OakLeaves), - 70 => Some(Item::SpruceLeaves), - 71 => Some(Item::BirchLeaves), - 72 => Some(Item::JungleLeaves), - 73 => Some(Item::AcaciaLeaves), - 74 => Some(Item::DarkOakLeaves), - 75 => Some(Item::Sponge), - 76 => Some(Item::WetSponge), - 77 => Some(Item::Glass), - 78 => Some(Item::LapisOre), - 79 => Some(Item::LapisBlock), - 80 => Some(Item::Dispenser), - 81 => Some(Item::Sandstone), - 82 => Some(Item::ChiseledSandstone), - 83 => Some(Item::CutSandstone), - 84 => Some(Item::NoteBlock), - 85 => Some(Item::PoweredRail), - 86 => Some(Item::DetectorRail), - 87 => Some(Item::StickyPiston), - 88 => Some(Item::Cobweb), - 89 => Some(Item::Grass), - 90 => Some(Item::Fern), - 91 => Some(Item::DeadBush), - 92 => Some(Item::Seagrass), - 93 => Some(Item::SeaPickle), - 94 => Some(Item::Piston), - 95 => Some(Item::WhiteWool), - 96 => Some(Item::OrangeWool), - 97 => Some(Item::MagentaWool), - 98 => Some(Item::LightBlueWool), - 99 => Some(Item::YellowWool), - 100 => Some(Item::LimeWool), - 101 => Some(Item::PinkWool), - 102 => Some(Item::GrayWool), - 103 => Some(Item::LightGrayWool), - 104 => Some(Item::CyanWool), - 105 => Some(Item::PurpleWool), - 106 => Some(Item::BlueWool), - 107 => Some(Item::BrownWool), - 108 => Some(Item::GreenWool), - 109 => Some(Item::RedWool), - 110 => Some(Item::BlackWool), - 111 => Some(Item::Dandelion), - 112 => Some(Item::Poppy), - 113 => Some(Item::BlueOrchid), - 114 => Some(Item::Allium), - 115 => Some(Item::AzureBluet), - 116 => Some(Item::RedTulip), - 117 => Some(Item::OrangeTulip), - 118 => Some(Item::WhiteTulip), - 119 => Some(Item::PinkTulip), - 120 => Some(Item::OxeyeDaisy), - 121 => Some(Item::Cornflower), - 122 => Some(Item::LilyOfTheValley), - 123 => Some(Item::WitherRose), - 124 => Some(Item::BrownMushroom), - 125 => Some(Item::RedMushroom), - 126 => Some(Item::CrimsonFungus), - 127 => Some(Item::WarpedFungus), - 128 => Some(Item::CrimsonRoots), - 129 => Some(Item::WarpedRoots), - 130 => Some(Item::NetherSprouts), - 131 => Some(Item::WeepingVines), - 132 => Some(Item::TwistingVines), - 133 => Some(Item::SugarCane), - 134 => Some(Item::Kelp), - 135 => Some(Item::Bamboo), - 136 => Some(Item::GoldBlock), - 137 => Some(Item::IronBlock), - 138 => Some(Item::OakSlab), - 139 => Some(Item::SpruceSlab), - 140 => Some(Item::BirchSlab), - 141 => Some(Item::JungleSlab), - 142 => Some(Item::AcaciaSlab), - 143 => Some(Item::DarkOakSlab), - 144 => Some(Item::CrimsonSlab), - 145 => Some(Item::WarpedSlab), - 146 => Some(Item::StoneSlab), - 147 => Some(Item::SmoothStoneSlab), - 148 => Some(Item::SandstoneSlab), - 149 => Some(Item::CutSandstoneSlab), - 150 => Some(Item::PetrifiedOakSlab), - 151 => Some(Item::CobblestoneSlab), - 152 => Some(Item::BrickSlab), - 153 => Some(Item::StoneBrickSlab), - 154 => Some(Item::NetherBrickSlab), - 155 => Some(Item::QuartzSlab), - 156 => Some(Item::RedSandstoneSlab), - 157 => Some(Item::CutRedSandstoneSlab), - 158 => Some(Item::PurpurSlab), - 159 => Some(Item::PrismarineSlab), - 160 => Some(Item::PrismarineBrickSlab), - 161 => Some(Item::DarkPrismarineSlab), - 162 => Some(Item::SmoothQuartz), - 163 => Some(Item::SmoothRedSandstone), - 164 => Some(Item::SmoothSandstone), - 165 => Some(Item::SmoothStone), - 166 => Some(Item::Bricks), - 167 => Some(Item::Tnt), - 168 => Some(Item::Bookshelf), - 169 => Some(Item::MossyCobblestone), - 170 => Some(Item::Obsidian), - 171 => Some(Item::Torch), - 172 => Some(Item::EndRod), - 173 => Some(Item::ChorusPlant), - 174 => Some(Item::ChorusFlower), - 175 => Some(Item::PurpurBlock), - 176 => Some(Item::PurpurPillar), - 177 => Some(Item::PurpurStairs), - 178 => Some(Item::Spawner), - 179 => Some(Item::OakStairs), - 180 => Some(Item::Chest), - 181 => Some(Item::DiamondOre), - 182 => Some(Item::DiamondBlock), - 183 => Some(Item::CraftingTable), - 184 => Some(Item::Farmland), - 185 => Some(Item::Furnace), - 186 => Some(Item::Ladder), - 187 => Some(Item::Rail), - 188 => Some(Item::CobblestoneStairs), - 189 => Some(Item::Lever), - 190 => Some(Item::StonePressurePlate), - 191 => Some(Item::OakPressurePlate), - 192 => Some(Item::SprucePressurePlate), - 193 => Some(Item::BirchPressurePlate), - 194 => Some(Item::JunglePressurePlate), - 195 => Some(Item::AcaciaPressurePlate), - 196 => Some(Item::DarkOakPressurePlate), - 197 => Some(Item::CrimsonPressurePlate), - 198 => Some(Item::WarpedPressurePlate), - 199 => Some(Item::PolishedBlackstonePressurePlate), - 200 => Some(Item::RedstoneOre), - 201 => Some(Item::RedstoneTorch), - 202 => Some(Item::Snow), - 203 => Some(Item::Ice), - 204 => Some(Item::SnowBlock), - 205 => Some(Item::Cactus), - 206 => Some(Item::Clay), - 207 => Some(Item::Jukebox), - 208 => Some(Item::OakFence), - 209 => Some(Item::SpruceFence), - 210 => Some(Item::BirchFence), - 211 => Some(Item::JungleFence), - 212 => Some(Item::AcaciaFence), - 213 => Some(Item::DarkOakFence), - 214 => Some(Item::CrimsonFence), - 215 => Some(Item::WarpedFence), - 216 => Some(Item::Pumpkin), - 217 => Some(Item::CarvedPumpkin), - 218 => Some(Item::Netherrack), - 219 => Some(Item::SoulSand), - 220 => Some(Item::SoulSoil), - 221 => Some(Item::Basalt), - 222 => Some(Item::PolishedBasalt), - 223 => Some(Item::SoulTorch), - 224 => Some(Item::Glowstone), - 225 => Some(Item::JackOLantern), - 226 => Some(Item::OakTrapdoor), - 227 => Some(Item::SpruceTrapdoor), - 228 => Some(Item::BirchTrapdoor), - 229 => Some(Item::JungleTrapdoor), - 230 => Some(Item::AcaciaTrapdoor), - 231 => Some(Item::DarkOakTrapdoor), - 232 => Some(Item::CrimsonTrapdoor), - 233 => Some(Item::WarpedTrapdoor), - 234 => Some(Item::InfestedStone), - 235 => Some(Item::InfestedCobblestone), - 236 => Some(Item::InfestedStoneBricks), - 237 => Some(Item::InfestedMossyStoneBricks), - 238 => Some(Item::InfestedCrackedStoneBricks), - 239 => Some(Item::InfestedChiseledStoneBricks), - 240 => Some(Item::StoneBricks), - 241 => Some(Item::MossyStoneBricks), - 242 => Some(Item::CrackedStoneBricks), - 243 => Some(Item::ChiseledStoneBricks), - 244 => Some(Item::BrownMushroomBlock), - 245 => Some(Item::RedMushroomBlock), - 246 => Some(Item::MushroomStem), - 247 => Some(Item::IronBars), - 248 => Some(Item::Chain), - 249 => Some(Item::GlassPane), - 250 => Some(Item::Melon), - 251 => Some(Item::Vine), - 252 => Some(Item::OakFenceGate), - 253 => Some(Item::SpruceFenceGate), - 254 => Some(Item::BirchFenceGate), - 255 => Some(Item::JungleFenceGate), - 256 => Some(Item::AcaciaFenceGate), - 257 => Some(Item::DarkOakFenceGate), - 258 => Some(Item::CrimsonFenceGate), - 259 => Some(Item::WarpedFenceGate), - 260 => Some(Item::BrickStairs), - 261 => Some(Item::StoneBrickStairs), - 262 => Some(Item::Mycelium), - 263 => Some(Item::LilyPad), - 264 => Some(Item::NetherBricks), - 265 => Some(Item::CrackedNetherBricks), - 266 => Some(Item::ChiseledNetherBricks), - 267 => Some(Item::NetherBrickFence), - 268 => Some(Item::NetherBrickStairs), - 269 => Some(Item::EnchantingTable), - 270 => Some(Item::EndPortalFrame), - 271 => Some(Item::EndStone), - 272 => Some(Item::EndStoneBricks), - 273 => Some(Item::DragonEgg), - 274 => Some(Item::RedstoneLamp), - 275 => Some(Item::SandstoneStairs), - 276 => Some(Item::EmeraldOre), - 277 => Some(Item::EnderChest), - 278 => Some(Item::TripwireHook), - 279 => Some(Item::EmeraldBlock), - 280 => Some(Item::SpruceStairs), - 281 => Some(Item::BirchStairs), - 282 => Some(Item::JungleStairs), - 283 => Some(Item::CrimsonStairs), - 284 => Some(Item::WarpedStairs), - 285 => Some(Item::CommandBlock), - 286 => Some(Item::Beacon), - 287 => Some(Item::CobblestoneWall), - 288 => Some(Item::MossyCobblestoneWall), - 289 => Some(Item::BrickWall), - 290 => Some(Item::PrismarineWall), - 291 => Some(Item::RedSandstoneWall), - 292 => Some(Item::MossyStoneBrickWall), - 293 => Some(Item::GraniteWall), - 294 => Some(Item::StoneBrickWall), - 295 => Some(Item::NetherBrickWall), - 296 => Some(Item::AndesiteWall), - 297 => Some(Item::RedNetherBrickWall), - 298 => Some(Item::SandstoneWall), - 299 => Some(Item::EndStoneBrickWall), - 300 => Some(Item::DioriteWall), - 301 => Some(Item::BlackstoneWall), - 302 => Some(Item::PolishedBlackstoneWall), - 303 => Some(Item::PolishedBlackstoneBrickWall), - 304 => Some(Item::StoneButton), - 305 => Some(Item::OakButton), - 306 => Some(Item::SpruceButton), - 307 => Some(Item::BirchButton), - 308 => Some(Item::JungleButton), - 309 => Some(Item::AcaciaButton), - 310 => Some(Item::DarkOakButton), - 311 => Some(Item::CrimsonButton), - 312 => Some(Item::WarpedButton), - 313 => Some(Item::PolishedBlackstoneButton), - 314 => Some(Item::Anvil), - 315 => Some(Item::ChippedAnvil), - 316 => Some(Item::DamagedAnvil), - 317 => Some(Item::TrappedChest), - 318 => Some(Item::LightWeightedPressurePlate), - 319 => Some(Item::HeavyWeightedPressurePlate), - 320 => Some(Item::DaylightDetector), - 321 => Some(Item::RedstoneBlock), - 322 => Some(Item::NetherQuartzOre), - 323 => Some(Item::Hopper), - 324 => Some(Item::ChiseledQuartzBlock), - 325 => Some(Item::QuartzBlock), - 326 => Some(Item::QuartzBricks), - 327 => Some(Item::QuartzPillar), - 328 => Some(Item::QuartzStairs), - 329 => Some(Item::ActivatorRail), - 330 => Some(Item::Dropper), - 331 => Some(Item::WhiteTerracotta), - 332 => Some(Item::OrangeTerracotta), - 333 => Some(Item::MagentaTerracotta), - 334 => Some(Item::LightBlueTerracotta), - 335 => Some(Item::YellowTerracotta), - 336 => Some(Item::LimeTerracotta), - 337 => Some(Item::PinkTerracotta), - 338 => Some(Item::GrayTerracotta), - 339 => Some(Item::LightGrayTerracotta), - 340 => Some(Item::CyanTerracotta), - 341 => Some(Item::PurpleTerracotta), - 342 => Some(Item::BlueTerracotta), - 343 => Some(Item::BrownTerracotta), - 344 => Some(Item::GreenTerracotta), - 345 => Some(Item::RedTerracotta), - 346 => Some(Item::BlackTerracotta), - 347 => Some(Item::Barrier), - 348 => Some(Item::IronTrapdoor), - 349 => Some(Item::HayBlock), - 350 => Some(Item::WhiteCarpet), - 351 => Some(Item::OrangeCarpet), - 352 => Some(Item::MagentaCarpet), - 353 => Some(Item::LightBlueCarpet), - 354 => Some(Item::YellowCarpet), - 355 => Some(Item::LimeCarpet), - 356 => Some(Item::PinkCarpet), - 357 => Some(Item::GrayCarpet), - 358 => Some(Item::LightGrayCarpet), - 359 => Some(Item::CyanCarpet), - 360 => Some(Item::PurpleCarpet), - 361 => Some(Item::BlueCarpet), - 362 => Some(Item::BrownCarpet), - 363 => Some(Item::GreenCarpet), - 364 => Some(Item::RedCarpet), - 365 => Some(Item::BlackCarpet), - 366 => Some(Item::Terracotta), - 367 => Some(Item::CoalBlock), - 368 => Some(Item::PackedIce), - 369 => Some(Item::AcaciaStairs), - 370 => Some(Item::DarkOakStairs), - 371 => Some(Item::SlimeBlock), - 372 => Some(Item::GrassPath), - 373 => Some(Item::Sunflower), - 374 => Some(Item::Lilac), - 375 => Some(Item::RoseBush), - 376 => Some(Item::Peony), - 377 => Some(Item::TallGrass), - 378 => Some(Item::LargeFern), - 379 => Some(Item::WhiteStainedGlass), - 380 => Some(Item::OrangeStainedGlass), - 381 => Some(Item::MagentaStainedGlass), - 382 => Some(Item::LightBlueStainedGlass), - 383 => Some(Item::YellowStainedGlass), - 384 => Some(Item::LimeStainedGlass), - 385 => Some(Item::PinkStainedGlass), - 386 => Some(Item::GrayStainedGlass), - 387 => Some(Item::LightGrayStainedGlass), - 388 => Some(Item::CyanStainedGlass), - 389 => Some(Item::PurpleStainedGlass), - 390 => Some(Item::BlueStainedGlass), - 391 => Some(Item::BrownStainedGlass), - 392 => Some(Item::GreenStainedGlass), - 393 => Some(Item::RedStainedGlass), - 394 => Some(Item::BlackStainedGlass), - 395 => Some(Item::WhiteStainedGlassPane), - 396 => Some(Item::OrangeStainedGlassPane), - 397 => Some(Item::MagentaStainedGlassPane), - 398 => Some(Item::LightBlueStainedGlassPane), - 399 => Some(Item::YellowStainedGlassPane), - 400 => Some(Item::LimeStainedGlassPane), - 401 => Some(Item::PinkStainedGlassPane), - 402 => Some(Item::GrayStainedGlassPane), - 403 => Some(Item::LightGrayStainedGlassPane), - 404 => Some(Item::CyanStainedGlassPane), - 405 => Some(Item::PurpleStainedGlassPane), - 406 => Some(Item::BlueStainedGlassPane), - 407 => Some(Item::BrownStainedGlassPane), - 408 => Some(Item::GreenStainedGlassPane), - 409 => Some(Item::RedStainedGlassPane), - 410 => Some(Item::BlackStainedGlassPane), - 411 => Some(Item::Prismarine), - 412 => Some(Item::PrismarineBricks), - 413 => Some(Item::DarkPrismarine), - 414 => Some(Item::PrismarineStairs), - 415 => Some(Item::PrismarineBrickStairs), - 416 => Some(Item::DarkPrismarineStairs), - 417 => Some(Item::SeaLantern), - 418 => Some(Item::RedSandstone), - 419 => Some(Item::ChiseledRedSandstone), - 420 => Some(Item::CutRedSandstone), - 421 => Some(Item::RedSandstoneStairs), - 422 => Some(Item::RepeatingCommandBlock), - 423 => Some(Item::ChainCommandBlock), - 424 => Some(Item::MagmaBlock), - 425 => Some(Item::NetherWartBlock), - 426 => Some(Item::WarpedWartBlock), - 427 => Some(Item::RedNetherBricks), - 428 => Some(Item::BoneBlock), - 429 => Some(Item::StructureVoid), - 430 => Some(Item::Observer), - 431 => Some(Item::ShulkerBox), - 432 => Some(Item::WhiteShulkerBox), - 433 => Some(Item::OrangeShulkerBox), - 434 => Some(Item::MagentaShulkerBox), - 435 => Some(Item::LightBlueShulkerBox), - 436 => Some(Item::YellowShulkerBox), - 437 => Some(Item::LimeShulkerBox), - 438 => Some(Item::PinkShulkerBox), - 439 => Some(Item::GrayShulkerBox), - 440 => Some(Item::LightGrayShulkerBox), - 441 => Some(Item::CyanShulkerBox), - 442 => Some(Item::PurpleShulkerBox), - 443 => Some(Item::BlueShulkerBox), - 444 => Some(Item::BrownShulkerBox), - 445 => Some(Item::GreenShulkerBox), - 446 => Some(Item::RedShulkerBox), - 447 => Some(Item::BlackShulkerBox), - 448 => Some(Item::WhiteGlazedTerracotta), - 449 => Some(Item::OrangeGlazedTerracotta), - 450 => Some(Item::MagentaGlazedTerracotta), - 451 => Some(Item::LightBlueGlazedTerracotta), - 452 => Some(Item::YellowGlazedTerracotta), - 453 => Some(Item::LimeGlazedTerracotta), - 454 => Some(Item::PinkGlazedTerracotta), - 455 => Some(Item::GrayGlazedTerracotta), - 456 => Some(Item::LightGrayGlazedTerracotta), - 457 => Some(Item::CyanGlazedTerracotta), - 458 => Some(Item::PurpleGlazedTerracotta), - 459 => Some(Item::BlueGlazedTerracotta), - 460 => Some(Item::BrownGlazedTerracotta), - 461 => Some(Item::GreenGlazedTerracotta), - 462 => Some(Item::RedGlazedTerracotta), - 463 => Some(Item::BlackGlazedTerracotta), - 464 => Some(Item::WhiteConcrete), - 465 => Some(Item::OrangeConcrete), - 466 => Some(Item::MagentaConcrete), - 467 => Some(Item::LightBlueConcrete), - 468 => Some(Item::YellowConcrete), - 469 => Some(Item::LimeConcrete), - 470 => Some(Item::PinkConcrete), - 471 => Some(Item::GrayConcrete), - 472 => Some(Item::LightGrayConcrete), - 473 => Some(Item::CyanConcrete), - 474 => Some(Item::PurpleConcrete), - 475 => Some(Item::BlueConcrete), - 476 => Some(Item::BrownConcrete), - 477 => Some(Item::GreenConcrete), - 478 => Some(Item::RedConcrete), - 479 => Some(Item::BlackConcrete), - 480 => Some(Item::WhiteConcretePowder), - 481 => Some(Item::OrangeConcretePowder), - 482 => Some(Item::MagentaConcretePowder), - 483 => Some(Item::LightBlueConcretePowder), - 484 => Some(Item::YellowConcretePowder), - 485 => Some(Item::LimeConcretePowder), - 486 => Some(Item::PinkConcretePowder), - 487 => Some(Item::GrayConcretePowder), - 488 => Some(Item::LightGrayConcretePowder), - 489 => Some(Item::CyanConcretePowder), - 490 => Some(Item::PurpleConcretePowder), - 491 => Some(Item::BlueConcretePowder), - 492 => Some(Item::BrownConcretePowder), - 493 => Some(Item::GreenConcretePowder), - 494 => Some(Item::RedConcretePowder), - 495 => Some(Item::BlackConcretePowder), - 496 => Some(Item::TurtleEgg), - 497 => Some(Item::DeadTubeCoralBlock), - 498 => Some(Item::DeadBrainCoralBlock), - 499 => Some(Item::DeadBubbleCoralBlock), - 500 => Some(Item::DeadFireCoralBlock), - 501 => Some(Item::DeadHornCoralBlock), - 502 => Some(Item::TubeCoralBlock), - 503 => Some(Item::BrainCoralBlock), - 504 => Some(Item::BubbleCoralBlock), - 505 => Some(Item::FireCoralBlock), - 506 => Some(Item::HornCoralBlock), - 507 => Some(Item::TubeCoral), - 508 => Some(Item::BrainCoral), - 509 => Some(Item::BubbleCoral), - 510 => Some(Item::FireCoral), - 511 => Some(Item::HornCoral), - 512 => Some(Item::DeadBrainCoral), - 513 => Some(Item::DeadBubbleCoral), - 514 => Some(Item::DeadFireCoral), - 515 => Some(Item::DeadHornCoral), - 516 => Some(Item::DeadTubeCoral), - 517 => Some(Item::TubeCoralFan), - 518 => Some(Item::BrainCoralFan), - 519 => Some(Item::BubbleCoralFan), - 520 => Some(Item::FireCoralFan), - 521 => Some(Item::HornCoralFan), - 522 => Some(Item::DeadTubeCoralFan), - 523 => Some(Item::DeadBrainCoralFan), - 524 => Some(Item::DeadBubbleCoralFan), - 525 => Some(Item::DeadFireCoralFan), - 526 => Some(Item::DeadHornCoralFan), - 527 => Some(Item::BlueIce), - 528 => Some(Item::Conduit), - 529 => Some(Item::PolishedGraniteStairs), - 530 => Some(Item::SmoothRedSandstoneStairs), - 531 => Some(Item::MossyStoneBrickStairs), - 532 => Some(Item::PolishedDioriteStairs), - 533 => Some(Item::MossyCobblestoneStairs), - 534 => Some(Item::EndStoneBrickStairs), - 535 => Some(Item::StoneStairs), - 536 => Some(Item::SmoothSandstoneStairs), - 537 => Some(Item::SmoothQuartzStairs), - 538 => Some(Item::GraniteStairs), - 539 => Some(Item::AndesiteStairs), - 540 => Some(Item::RedNetherBrickStairs), - 541 => Some(Item::PolishedAndesiteStairs), - 542 => Some(Item::DioriteStairs), - 543 => Some(Item::PolishedGraniteSlab), - 544 => Some(Item::SmoothRedSandstoneSlab), - 545 => Some(Item::MossyStoneBrickSlab), - 546 => Some(Item::PolishedDioriteSlab), - 547 => Some(Item::MossyCobblestoneSlab), - 548 => Some(Item::EndStoneBrickSlab), - 549 => Some(Item::SmoothSandstoneSlab), - 550 => Some(Item::SmoothQuartzSlab), - 551 => Some(Item::GraniteSlab), - 552 => Some(Item::AndesiteSlab), - 553 => Some(Item::RedNetherBrickSlab), - 554 => Some(Item::PolishedAndesiteSlab), - 555 => Some(Item::DioriteSlab), - 556 => Some(Item::Scaffolding), - 557 => Some(Item::IronDoor), - 558 => Some(Item::OakDoor), - 559 => Some(Item::SpruceDoor), - 560 => Some(Item::BirchDoor), - 561 => Some(Item::JungleDoor), - 562 => Some(Item::AcaciaDoor), - 563 => Some(Item::DarkOakDoor), - 564 => Some(Item::CrimsonDoor), - 565 => Some(Item::WarpedDoor), - 566 => Some(Item::Repeater), - 567 => Some(Item::Comparator), - 568 => Some(Item::StructureBlock), - 569 => Some(Item::Jigsaw), - 570 => Some(Item::TurtleHelmet), - 571 => Some(Item::Scute), - 572 => Some(Item::FlintAndSteel), - 573 => Some(Item::Apple), - 574 => Some(Item::Bow), - 575 => Some(Item::Arrow), - 576 => Some(Item::Coal), - 577 => Some(Item::Charcoal), - 578 => Some(Item::Diamond), - 579 => Some(Item::IronIngot), - 580 => Some(Item::GoldIngot), - 581 => Some(Item::NetheriteIngot), - 582 => Some(Item::NetheriteScrap), - 583 => Some(Item::WoodenSword), - 584 => Some(Item::WoodenShovel), - 585 => Some(Item::WoodenPickaxe), - 586 => Some(Item::WoodenAxe), - 587 => Some(Item::WoodenHoe), - 588 => Some(Item::StoneSword), - 589 => Some(Item::StoneShovel), - 590 => Some(Item::StonePickaxe), - 591 => Some(Item::StoneAxe), - 592 => Some(Item::StoneHoe), - 593 => Some(Item::GoldenSword), - 594 => Some(Item::GoldenShovel), - 595 => Some(Item::GoldenPickaxe), - 596 => Some(Item::GoldenAxe), - 597 => Some(Item::GoldenHoe), - 598 => Some(Item::IronSword), - 599 => Some(Item::IronShovel), - 600 => Some(Item::IronPickaxe), - 601 => Some(Item::IronAxe), - 602 => Some(Item::IronHoe), - 603 => Some(Item::DiamondSword), - 604 => Some(Item::DiamondShovel), - 605 => Some(Item::DiamondPickaxe), - 606 => Some(Item::DiamondAxe), - 607 => Some(Item::DiamondHoe), - 608 => Some(Item::NetheriteSword), - 609 => Some(Item::NetheriteShovel), - 610 => Some(Item::NetheritePickaxe), - 611 => Some(Item::NetheriteAxe), - 612 => Some(Item::NetheriteHoe), - 613 => Some(Item::Stick), - 614 => Some(Item::Bowl), - 615 => Some(Item::MushroomStew), - 616 => Some(Item::String), - 617 => Some(Item::Feather), - 618 => Some(Item::Gunpowder), - 619 => Some(Item::WheatSeeds), - 620 => Some(Item::Wheat), - 621 => Some(Item::Bread), - 622 => Some(Item::LeatherHelmet), - 623 => Some(Item::LeatherChestplate), - 624 => Some(Item::LeatherLeggings), - 625 => Some(Item::LeatherBoots), - 626 => Some(Item::ChainmailHelmet), - 627 => Some(Item::ChainmailChestplate), - 628 => Some(Item::ChainmailLeggings), - 629 => Some(Item::ChainmailBoots), - 630 => Some(Item::IronHelmet), - 631 => Some(Item::IronChestplate), - 632 => Some(Item::IronLeggings), - 633 => Some(Item::IronBoots), - 634 => Some(Item::DiamondHelmet), - 635 => Some(Item::DiamondChestplate), - 636 => Some(Item::DiamondLeggings), - 637 => Some(Item::DiamondBoots), - 638 => Some(Item::GoldenHelmet), - 639 => Some(Item::GoldenChestplate), - 640 => Some(Item::GoldenLeggings), - 641 => Some(Item::GoldenBoots), - 642 => Some(Item::NetheriteHelmet), - 643 => Some(Item::NetheriteChestplate), - 644 => Some(Item::NetheriteLeggings), - 645 => Some(Item::NetheriteBoots), - 646 => Some(Item::Flint), - 647 => Some(Item::Porkchop), - 648 => Some(Item::CookedPorkchop), - 649 => Some(Item::Painting), - 650 => Some(Item::GoldenApple), - 651 => Some(Item::EnchantedGoldenApple), - 652 => Some(Item::OakSign), - 653 => Some(Item::SpruceSign), - 654 => Some(Item::BirchSign), - 655 => Some(Item::JungleSign), - 656 => Some(Item::AcaciaSign), - 657 => Some(Item::DarkOakSign), - 658 => Some(Item::CrimsonSign), - 659 => Some(Item::WarpedSign), - 660 => Some(Item::Bucket), - 661 => Some(Item::WaterBucket), - 662 => Some(Item::LavaBucket), - 663 => Some(Item::Minecart), - 664 => Some(Item::Saddle), - 665 => Some(Item::Redstone), - 666 => Some(Item::Snowball), - 667 => Some(Item::OakBoat), - 668 => Some(Item::Leather), - 669 => Some(Item::MilkBucket), - 670 => Some(Item::PufferfishBucket), - 671 => Some(Item::SalmonBucket), - 672 => Some(Item::CodBucket), - 673 => Some(Item::TropicalFishBucket), - 674 => Some(Item::Brick), - 675 => Some(Item::ClayBall), - 676 => Some(Item::DriedKelpBlock), - 677 => Some(Item::Paper), - 678 => Some(Item::Book), - 679 => Some(Item::SlimeBall), - 680 => Some(Item::ChestMinecart), - 681 => Some(Item::FurnaceMinecart), - 682 => Some(Item::Egg), - 683 => Some(Item::Compass), - 684 => Some(Item::FishingRod), - 685 => Some(Item::Clock), - 686 => Some(Item::GlowstoneDust), - 687 => Some(Item::Cod), - 688 => Some(Item::Salmon), - 689 => Some(Item::TropicalFish), - 690 => Some(Item::Pufferfish), - 691 => Some(Item::CookedCod), - 692 => Some(Item::CookedSalmon), - 693 => Some(Item::InkSac), - 694 => Some(Item::CocoaBeans), - 695 => Some(Item::LapisLazuli), - 696 => Some(Item::WhiteDye), - 697 => Some(Item::OrangeDye), - 698 => Some(Item::MagentaDye), - 699 => Some(Item::LightBlueDye), - 700 => Some(Item::YellowDye), - 701 => Some(Item::LimeDye), - 702 => Some(Item::PinkDye), - 703 => Some(Item::GrayDye), - 704 => Some(Item::LightGrayDye), - 705 => Some(Item::CyanDye), - 706 => Some(Item::PurpleDye), - 707 => Some(Item::BlueDye), - 708 => Some(Item::BrownDye), - 709 => Some(Item::GreenDye), - 710 => Some(Item::RedDye), - 711 => Some(Item::BlackDye), - 712 => Some(Item::BoneMeal), - 713 => Some(Item::Bone), - 714 => Some(Item::Sugar), - 715 => Some(Item::Cake), - 716 => Some(Item::WhiteBed), - 717 => Some(Item::OrangeBed), - 718 => Some(Item::MagentaBed), - 719 => Some(Item::LightBlueBed), - 720 => Some(Item::YellowBed), - 721 => Some(Item::LimeBed), - 722 => Some(Item::PinkBed), - 723 => Some(Item::GrayBed), - 724 => Some(Item::LightGrayBed), - 725 => Some(Item::CyanBed), - 726 => Some(Item::PurpleBed), - 727 => Some(Item::BlueBed), - 728 => Some(Item::BrownBed), - 729 => Some(Item::GreenBed), - 730 => Some(Item::RedBed), - 731 => Some(Item::BlackBed), - 732 => Some(Item::Cookie), - 733 => Some(Item::FilledMap), - 734 => Some(Item::Shears), - 735 => Some(Item::MelonSlice), - 736 => Some(Item::DriedKelp), - 737 => Some(Item::PumpkinSeeds), - 738 => Some(Item::MelonSeeds), - 739 => Some(Item::Beef), - 740 => Some(Item::CookedBeef), - 741 => Some(Item::Chicken), - 742 => Some(Item::CookedChicken), - 743 => Some(Item::RottenFlesh), - 744 => Some(Item::EnderPearl), - 745 => Some(Item::BlazeRod), - 746 => Some(Item::GhastTear), - 747 => Some(Item::GoldNugget), - 748 => Some(Item::NetherWart), - 749 => Some(Item::Potion), - 750 => Some(Item::GlassBottle), - 751 => Some(Item::SpiderEye), - 752 => Some(Item::FermentedSpiderEye), - 753 => Some(Item::BlazePowder), - 754 => Some(Item::MagmaCream), - 755 => Some(Item::BrewingStand), - 756 => Some(Item::Cauldron), - 757 => Some(Item::EnderEye), - 758 => Some(Item::GlisteringMelonSlice), - 759 => Some(Item::BatSpawnEgg), - 760 => Some(Item::BeeSpawnEgg), - 761 => Some(Item::BlazeSpawnEgg), - 762 => Some(Item::CatSpawnEgg), - 763 => Some(Item::CaveSpiderSpawnEgg), - 764 => Some(Item::ChickenSpawnEgg), - 765 => Some(Item::CodSpawnEgg), - 766 => Some(Item::CowSpawnEgg), - 767 => Some(Item::CreeperSpawnEgg), - 768 => Some(Item::DolphinSpawnEgg), - 769 => Some(Item::DonkeySpawnEgg), - 770 => Some(Item::DrownedSpawnEgg), - 771 => Some(Item::ElderGuardianSpawnEgg), - 772 => Some(Item::EndermanSpawnEgg), - 773 => Some(Item::EndermiteSpawnEgg), - 774 => Some(Item::EvokerSpawnEgg), - 775 => Some(Item::FoxSpawnEgg), - 776 => Some(Item::GhastSpawnEgg), - 777 => Some(Item::GuardianSpawnEgg), - 778 => Some(Item::HoglinSpawnEgg), - 779 => Some(Item::HorseSpawnEgg), - 780 => Some(Item::HuskSpawnEgg), - 781 => Some(Item::LlamaSpawnEgg), - 782 => Some(Item::MagmaCubeSpawnEgg), - 783 => Some(Item::MooshroomSpawnEgg), - 784 => Some(Item::MuleSpawnEgg), - 785 => Some(Item::OcelotSpawnEgg), - 786 => Some(Item::PandaSpawnEgg), - 787 => Some(Item::ParrotSpawnEgg), - 788 => Some(Item::PhantomSpawnEgg), - 789 => Some(Item::PigSpawnEgg), - 790 => Some(Item::PiglinSpawnEgg), - 791 => Some(Item::PiglinBruteSpawnEgg), - 792 => Some(Item::PillagerSpawnEgg), - 793 => Some(Item::PolarBearSpawnEgg), - 794 => Some(Item::PufferfishSpawnEgg), - 795 => Some(Item::RabbitSpawnEgg), - 796 => Some(Item::RavagerSpawnEgg), - 797 => Some(Item::SalmonSpawnEgg), - 798 => Some(Item::SheepSpawnEgg), - 799 => Some(Item::ShulkerSpawnEgg), - 800 => Some(Item::SilverfishSpawnEgg), - 801 => Some(Item::SkeletonSpawnEgg), - 802 => Some(Item::SkeletonHorseSpawnEgg), - 803 => Some(Item::SlimeSpawnEgg), - 804 => Some(Item::SpiderSpawnEgg), - 805 => Some(Item::SquidSpawnEgg), - 806 => Some(Item::StraySpawnEgg), - 807 => Some(Item::StriderSpawnEgg), - 808 => Some(Item::TraderLlamaSpawnEgg), - 809 => Some(Item::TropicalFishSpawnEgg), - 810 => Some(Item::TurtleSpawnEgg), - 811 => Some(Item::VexSpawnEgg), - 812 => Some(Item::VillagerSpawnEgg), - 813 => Some(Item::VindicatorSpawnEgg), - 814 => Some(Item::WanderingTraderSpawnEgg), - 815 => Some(Item::WitchSpawnEgg), - 816 => Some(Item::WitherSkeletonSpawnEgg), - 817 => Some(Item::WolfSpawnEgg), - 818 => Some(Item::ZoglinSpawnEgg), - 819 => Some(Item::ZombieSpawnEgg), - 820 => Some(Item::ZombieHorseSpawnEgg), - 821 => Some(Item::ZombieVillagerSpawnEgg), - 822 => Some(Item::ZombifiedPiglinSpawnEgg), - 823 => Some(Item::ExperienceBottle), - 824 => Some(Item::FireCharge), - 825 => Some(Item::WritableBook), - 826 => Some(Item::WrittenBook), - 827 => Some(Item::Emerald), - 828 => Some(Item::ItemFrame), - 829 => Some(Item::FlowerPot), - 830 => Some(Item::Carrot), - 831 => Some(Item::Potato), - 832 => Some(Item::BakedPotato), - 833 => Some(Item::PoisonousPotato), - 834 => Some(Item::Map), - 835 => Some(Item::GoldenCarrot), - 836 => Some(Item::SkeletonSkull), - 837 => Some(Item::WitherSkeletonSkull), - 838 => Some(Item::PlayerHead), - 839 => Some(Item::ZombieHead), - 840 => Some(Item::CreeperHead), - 841 => Some(Item::DragonHead), - 842 => Some(Item::CarrotOnAStick), - 843 => Some(Item::WarpedFungusOnAStick), - 844 => Some(Item::NetherStar), - 845 => Some(Item::PumpkinPie), - 846 => Some(Item::FireworkRocket), - 847 => Some(Item::FireworkStar), - 848 => Some(Item::EnchantedBook), - 849 => Some(Item::NetherBrick), - 850 => Some(Item::Quartz), - 851 => Some(Item::TntMinecart), - 852 => Some(Item::HopperMinecart), - 853 => Some(Item::PrismarineShard), - 854 => Some(Item::PrismarineCrystals), - 855 => Some(Item::Rabbit), - 856 => Some(Item::CookedRabbit), - 857 => Some(Item::RabbitStew), - 858 => Some(Item::RabbitFoot), - 859 => Some(Item::RabbitHide), - 860 => Some(Item::ArmorStand), - 861 => Some(Item::IronHorseArmor), - 862 => Some(Item::GoldenHorseArmor), - 863 => Some(Item::DiamondHorseArmor), - 864 => Some(Item::LeatherHorseArmor), - 865 => Some(Item::Lead), - 866 => Some(Item::NameTag), - 867 => Some(Item::CommandBlockMinecart), - 868 => Some(Item::Mutton), - 869 => Some(Item::CookedMutton), - 870 => Some(Item::WhiteBanner), - 871 => Some(Item::OrangeBanner), - 872 => Some(Item::MagentaBanner), - 873 => Some(Item::LightBlueBanner), - 874 => Some(Item::YellowBanner), - 875 => Some(Item::LimeBanner), - 876 => Some(Item::PinkBanner), - 877 => Some(Item::GrayBanner), - 878 => Some(Item::LightGrayBanner), - 879 => Some(Item::CyanBanner), - 880 => Some(Item::PurpleBanner), - 881 => Some(Item::BlueBanner), - 882 => Some(Item::BrownBanner), - 883 => Some(Item::GreenBanner), - 884 => Some(Item::RedBanner), - 885 => Some(Item::BlackBanner), - 886 => Some(Item::EndCrystal), - 887 => Some(Item::ChorusFruit), - 888 => Some(Item::PoppedChorusFruit), - 889 => Some(Item::Beetroot), - 890 => Some(Item::BeetrootSeeds), - 891 => Some(Item::BeetrootSoup), - 892 => Some(Item::DragonBreath), - 893 => Some(Item::SplashPotion), - 894 => Some(Item::SpectralArrow), - 895 => Some(Item::TippedArrow), - 896 => Some(Item::LingeringPotion), - 897 => Some(Item::Shield), - 898 => Some(Item::Elytra), - 899 => Some(Item::SpruceBoat), - 900 => Some(Item::BirchBoat), - 901 => Some(Item::JungleBoat), - 902 => Some(Item::AcaciaBoat), - 903 => Some(Item::DarkOakBoat), - 904 => Some(Item::TotemOfUndying), - 905 => Some(Item::ShulkerShell), - 906 => Some(Item::IronNugget), - 907 => Some(Item::KnowledgeBook), - 908 => Some(Item::DebugStick), - 909 => Some(Item::MusicDisc13), - 910 => Some(Item::MusicDiscCat), - 911 => Some(Item::MusicDiscBlocks), - 912 => Some(Item::MusicDiscChirp), - 913 => Some(Item::MusicDiscFar), - 914 => Some(Item::MusicDiscMall), - 915 => Some(Item::MusicDiscMellohi), - 916 => Some(Item::MusicDiscStal), - 917 => Some(Item::MusicDiscStrad), - 918 => Some(Item::MusicDiscWard), - 919 => Some(Item::MusicDisc11), - 920 => Some(Item::MusicDiscWait), - 921 => Some(Item::MusicDiscPigstep), - 922 => Some(Item::Trident), - 923 => Some(Item::PhantomMembrane), - 924 => Some(Item::NautilusShell), - 925 => Some(Item::HeartOfTheSea), - 926 => Some(Item::Crossbow), - 927 => Some(Item::SuspiciousStew), - 928 => Some(Item::Loom), - 929 => Some(Item::FlowerBannerPattern), - 930 => Some(Item::CreeperBannerPattern), - 931 => Some(Item::SkullBannerPattern), - 932 => Some(Item::MojangBannerPattern), - 933 => Some(Item::GlobeBannerPattern), - 934 => Some(Item::PiglinBannerPattern), - 935 => Some(Item::Composter), - 936 => Some(Item::Barrel), - 937 => Some(Item::Smoker), - 938 => Some(Item::BlastFurnace), - 939 => Some(Item::CartographyTable), - 940 => Some(Item::FletchingTable), - 941 => Some(Item::Grindstone), - 942 => Some(Item::Lectern), - 943 => Some(Item::SmithingTable), - 944 => Some(Item::Stonecutter), - 945 => Some(Item::Bell), - 946 => Some(Item::Lantern), - 947 => Some(Item::SoulLantern), - 948 => Some(Item::SweetBerries), - 949 => Some(Item::Campfire), - 950 => Some(Item::SoulCampfire), - 951 => Some(Item::Shroomlight), - 952 => Some(Item::Honeycomb), - 953 => Some(Item::BeeNest), - 954 => Some(Item::Beehive), - 955 => Some(Item::HoneyBottle), - 956 => Some(Item::HoneyBlock), - 957 => Some(Item::HoneycombBlock), - 958 => Some(Item::Lodestone), - 959 => Some(Item::NetheriteBlock), - 960 => Some(Item::AncientDebris), - 961 => Some(Item::Target), - 962 => Some(Item::CryingObsidian), - 963 => Some(Item::Blackstone), - 964 => Some(Item::BlackstoneSlab), - 965 => Some(Item::BlackstoneStairs), - 966 => Some(Item::GildedBlackstone), - 967 => Some(Item::PolishedBlackstone), - 968 => Some(Item::PolishedBlackstoneSlab), - 969 => Some(Item::PolishedBlackstoneStairs), - 970 => Some(Item::ChiseledPolishedBlackstone), - 971 => Some(Item::PolishedBlackstoneBricks), - 972 => Some(Item::PolishedBlackstoneBrickSlab), - 973 => Some(Item::PolishedBlackstoneBrickStairs), - 974 => Some(Item::CrackedPolishedBlackstoneBricks), - 975 => Some(Item::RespawnAnchor), + 1u32 => Some(Item::Stone), + 2u32 => Some(Item::Granite), + 3u32 => Some(Item::PolishedGranite), + 4u32 => Some(Item::Diorite), + 5u32 => Some(Item::PolishedDiorite), + 6u32 => Some(Item::Andesite), + 7u32 => Some(Item::PolishedAndesite), + 8u32 => Some(Item::Deepslate), + 9u32 => Some(Item::CobbledDeepslate), + 10u32 => Some(Item::PolishedDeepslate), + 11u32 => Some(Item::Calcite), + 12u32 => Some(Item::Tuff), + 13u32 => Some(Item::DripstoneBlock), + 14u32 => Some(Item::GrassBlock), + 15u32 => Some(Item::Dirt), + 16u32 => Some(Item::CoarseDirt), + 17u32 => Some(Item::Podzol), + 18u32 => Some(Item::RootedDirt), + 19u32 => Some(Item::CrimsonNylium), + 20u32 => Some(Item::WarpedNylium), + 21u32 => Some(Item::Cobblestone), + 22u32 => Some(Item::OakPlanks), + 23u32 => Some(Item::SprucePlanks), + 24u32 => Some(Item::BirchPlanks), + 25u32 => Some(Item::JunglePlanks), + 26u32 => Some(Item::AcaciaPlanks), + 27u32 => Some(Item::DarkOakPlanks), + 28u32 => Some(Item::CrimsonPlanks), + 29u32 => Some(Item::WarpedPlanks), + 30u32 => Some(Item::OakSapling), + 31u32 => Some(Item::SpruceSapling), + 32u32 => Some(Item::BirchSapling), + 33u32 => Some(Item::JungleSapling), + 34u32 => Some(Item::AcaciaSapling), + 35u32 => Some(Item::DarkOakSapling), + 36u32 => Some(Item::Bedrock), + 37u32 => Some(Item::Sand), + 38u32 => Some(Item::RedSand), + 39u32 => Some(Item::Gravel), + 40u32 => Some(Item::CoalOre), + 41u32 => Some(Item::DeepslateCoalOre), + 42u32 => Some(Item::IronOre), + 43u32 => Some(Item::DeepslateIronOre), + 44u32 => Some(Item::CopperOre), + 45u32 => Some(Item::DeepslateCopperOre), + 46u32 => Some(Item::GoldOre), + 47u32 => Some(Item::DeepslateGoldOre), + 48u32 => Some(Item::RedstoneOre), + 49u32 => Some(Item::DeepslateRedstoneOre), + 50u32 => Some(Item::EmeraldOre), + 51u32 => Some(Item::DeepslateEmeraldOre), + 52u32 => Some(Item::LapisOre), + 53u32 => Some(Item::DeepslateLapisOre), + 54u32 => Some(Item::DiamondOre), + 55u32 => Some(Item::DeepslateDiamondOre), + 56u32 => Some(Item::NetherGoldOre), + 57u32 => Some(Item::NetherQuartzOre), + 58u32 => Some(Item::AncientDebris), + 59u32 => Some(Item::CoalBlock), + 60u32 => Some(Item::RawIronBlock), + 61u32 => Some(Item::RawCopperBlock), + 62u32 => Some(Item::RawGoldBlock), + 63u32 => Some(Item::AmethystBlock), + 64u32 => Some(Item::BuddingAmethyst), + 65u32 => Some(Item::IronBlock), + 66u32 => Some(Item::CopperBlock), + 67u32 => Some(Item::GoldBlock), + 68u32 => Some(Item::DiamondBlock), + 69u32 => Some(Item::NetheriteBlock), + 70u32 => Some(Item::ExposedCopper), + 71u32 => Some(Item::WeatheredCopper), + 72u32 => Some(Item::OxidizedCopper), + 73u32 => Some(Item::CutCopper), + 74u32 => Some(Item::ExposedCutCopper), + 75u32 => Some(Item::WeatheredCutCopper), + 76u32 => Some(Item::OxidizedCutCopper), + 77u32 => Some(Item::CutCopperStairs), + 78u32 => Some(Item::ExposedCutCopperStairs), + 79u32 => Some(Item::WeatheredCutCopperStairs), + 80u32 => Some(Item::OxidizedCutCopperStairs), + 81u32 => Some(Item::CutCopperSlab), + 82u32 => Some(Item::ExposedCutCopperSlab), + 83u32 => Some(Item::WeatheredCutCopperSlab), + 84u32 => Some(Item::OxidizedCutCopperSlab), + 85u32 => Some(Item::WaxedCopperBlock), + 86u32 => Some(Item::WaxedExposedCopper), + 87u32 => Some(Item::WaxedWeatheredCopper), + 88u32 => Some(Item::WaxedOxidizedCopper), + 89u32 => Some(Item::WaxedCutCopper), + 90u32 => Some(Item::WaxedExposedCutCopper), + 91u32 => Some(Item::WaxedWeatheredCutCopper), + 92u32 => Some(Item::WaxedOxidizedCutCopper), + 93u32 => Some(Item::WaxedCutCopperStairs), + 94u32 => Some(Item::WaxedExposedCutCopperStairs), + 95u32 => Some(Item::WaxedWeatheredCutCopperStairs), + 96u32 => Some(Item::WaxedOxidizedCutCopperStairs), + 97u32 => Some(Item::WaxedCutCopperSlab), + 98u32 => Some(Item::WaxedExposedCutCopperSlab), + 99u32 => Some(Item::WaxedWeatheredCutCopperSlab), + 100u32 => Some(Item::WaxedOxidizedCutCopperSlab), + 101u32 => Some(Item::OakLog), + 102u32 => Some(Item::SpruceLog), + 103u32 => Some(Item::BirchLog), + 104u32 => Some(Item::JungleLog), + 105u32 => Some(Item::AcaciaLog), + 106u32 => Some(Item::DarkOakLog), + 107u32 => Some(Item::CrimsonStem), + 108u32 => Some(Item::WarpedStem), + 109u32 => Some(Item::StrippedOakLog), + 110u32 => Some(Item::StrippedSpruceLog), + 111u32 => Some(Item::StrippedBirchLog), + 112u32 => Some(Item::StrippedJungleLog), + 113u32 => Some(Item::StrippedAcaciaLog), + 114u32 => Some(Item::StrippedDarkOakLog), + 115u32 => Some(Item::StrippedCrimsonStem), + 116u32 => Some(Item::StrippedWarpedStem), + 117u32 => Some(Item::StrippedOakWood), + 118u32 => Some(Item::StrippedSpruceWood), + 119u32 => Some(Item::StrippedBirchWood), + 120u32 => Some(Item::StrippedJungleWood), + 121u32 => Some(Item::StrippedAcaciaWood), + 122u32 => Some(Item::StrippedDarkOakWood), + 123u32 => Some(Item::StrippedCrimsonHyphae), + 124u32 => Some(Item::StrippedWarpedHyphae), + 125u32 => Some(Item::OakWood), + 126u32 => Some(Item::SpruceWood), + 127u32 => Some(Item::BirchWood), + 128u32 => Some(Item::JungleWood), + 129u32 => Some(Item::AcaciaWood), + 130u32 => Some(Item::DarkOakWood), + 131u32 => Some(Item::CrimsonHyphae), + 132u32 => Some(Item::WarpedHyphae), + 133u32 => Some(Item::OakLeaves), + 134u32 => Some(Item::SpruceLeaves), + 135u32 => Some(Item::BirchLeaves), + 136u32 => Some(Item::JungleLeaves), + 137u32 => Some(Item::AcaciaLeaves), + 138u32 => Some(Item::DarkOakLeaves), + 139u32 => Some(Item::AzaleaLeaves), + 140u32 => Some(Item::FloweringAzaleaLeaves), + 141u32 => Some(Item::Sponge), + 142u32 => Some(Item::WetSponge), + 143u32 => Some(Item::Glass), + 144u32 => Some(Item::TintedGlass), + 145u32 => Some(Item::LapisBlock), + 146u32 => Some(Item::Sandstone), + 147u32 => Some(Item::ChiseledSandstone), + 148u32 => Some(Item::CutSandstone), + 149u32 => Some(Item::Cobweb), + 150u32 => Some(Item::Grass), + 151u32 => Some(Item::Fern), + 152u32 => Some(Item::Azalea), + 153u32 => Some(Item::FloweringAzalea), + 154u32 => Some(Item::DeadBush), + 155u32 => Some(Item::Seagrass), + 156u32 => Some(Item::SeaPickle), + 157u32 => Some(Item::WhiteWool), + 158u32 => Some(Item::OrangeWool), + 159u32 => Some(Item::MagentaWool), + 160u32 => Some(Item::LightBlueWool), + 161u32 => Some(Item::YellowWool), + 162u32 => Some(Item::LimeWool), + 163u32 => Some(Item::PinkWool), + 164u32 => Some(Item::GrayWool), + 165u32 => Some(Item::LightGrayWool), + 166u32 => Some(Item::CyanWool), + 167u32 => Some(Item::PurpleWool), + 168u32 => Some(Item::BlueWool), + 169u32 => Some(Item::BrownWool), + 170u32 => Some(Item::GreenWool), + 171u32 => Some(Item::RedWool), + 172u32 => Some(Item::BlackWool), + 173u32 => Some(Item::Dandelion), + 174u32 => Some(Item::Poppy), + 175u32 => Some(Item::BlueOrchid), + 176u32 => Some(Item::Allium), + 177u32 => Some(Item::AzureBluet), + 178u32 => Some(Item::RedTulip), + 179u32 => Some(Item::OrangeTulip), + 180u32 => Some(Item::WhiteTulip), + 181u32 => Some(Item::PinkTulip), + 182u32 => Some(Item::OxeyeDaisy), + 183u32 => Some(Item::Cornflower), + 184u32 => Some(Item::LilyOfTheValley), + 185u32 => Some(Item::WitherRose), + 186u32 => Some(Item::SporeBlossom), + 187u32 => Some(Item::BrownMushroom), + 188u32 => Some(Item::RedMushroom), + 189u32 => Some(Item::CrimsonFungus), + 190u32 => Some(Item::WarpedFungus), + 191u32 => Some(Item::CrimsonRoots), + 192u32 => Some(Item::WarpedRoots), + 193u32 => Some(Item::NetherSprouts), + 194u32 => Some(Item::WeepingVines), + 195u32 => Some(Item::TwistingVines), + 196u32 => Some(Item::SugarCane), + 197u32 => Some(Item::Kelp), + 198u32 => Some(Item::MossCarpet), + 199u32 => Some(Item::MossBlock), + 200u32 => Some(Item::HangingRoots), + 201u32 => Some(Item::BigDripleaf), + 202u32 => Some(Item::SmallDripleaf), + 203u32 => Some(Item::Bamboo), + 204u32 => Some(Item::OakSlab), + 205u32 => Some(Item::SpruceSlab), + 206u32 => Some(Item::BirchSlab), + 207u32 => Some(Item::JungleSlab), + 208u32 => Some(Item::AcaciaSlab), + 209u32 => Some(Item::DarkOakSlab), + 210u32 => Some(Item::CrimsonSlab), + 211u32 => Some(Item::WarpedSlab), + 212u32 => Some(Item::StoneSlab), + 213u32 => Some(Item::SmoothStoneSlab), + 214u32 => Some(Item::SandstoneSlab), + 215u32 => Some(Item::CutSandstoneSlab), + 216u32 => Some(Item::PetrifiedOakSlab), + 217u32 => Some(Item::CobblestoneSlab), + 218u32 => Some(Item::BrickSlab), + 219u32 => Some(Item::StoneBrickSlab), + 220u32 => Some(Item::NetherBrickSlab), + 221u32 => Some(Item::QuartzSlab), + 222u32 => Some(Item::RedSandstoneSlab), + 223u32 => Some(Item::CutRedSandstoneSlab), + 224u32 => Some(Item::PurpurSlab), + 225u32 => Some(Item::PrismarineSlab), + 226u32 => Some(Item::PrismarineBrickSlab), + 227u32 => Some(Item::DarkPrismarineSlab), + 228u32 => Some(Item::SmoothQuartz), + 229u32 => Some(Item::SmoothRedSandstone), + 230u32 => Some(Item::SmoothSandstone), + 231u32 => Some(Item::SmoothStone), + 232u32 => Some(Item::Bricks), + 233u32 => Some(Item::Bookshelf), + 234u32 => Some(Item::MossyCobblestone), + 235u32 => Some(Item::Obsidian), + 236u32 => Some(Item::Torch), + 237u32 => Some(Item::EndRod), + 238u32 => Some(Item::ChorusPlant), + 239u32 => Some(Item::ChorusFlower), + 240u32 => Some(Item::PurpurBlock), + 241u32 => Some(Item::PurpurPillar), + 242u32 => Some(Item::PurpurStairs), + 243u32 => Some(Item::Spawner), + 244u32 => Some(Item::OakStairs), + 245u32 => Some(Item::Chest), + 246u32 => Some(Item::CraftingTable), + 247u32 => Some(Item::Farmland), + 248u32 => Some(Item::Furnace), + 249u32 => Some(Item::Ladder), + 250u32 => Some(Item::CobblestoneStairs), + 251u32 => Some(Item::Snow), + 252u32 => Some(Item::Ice), + 253u32 => Some(Item::SnowBlock), + 254u32 => Some(Item::Cactus), + 255u32 => Some(Item::Clay), + 256u32 => Some(Item::Jukebox), + 257u32 => Some(Item::OakFence), + 258u32 => Some(Item::SpruceFence), + 259u32 => Some(Item::BirchFence), + 260u32 => Some(Item::JungleFence), + 261u32 => Some(Item::AcaciaFence), + 262u32 => Some(Item::DarkOakFence), + 263u32 => Some(Item::CrimsonFence), + 264u32 => Some(Item::WarpedFence), + 265u32 => Some(Item::Pumpkin), + 266u32 => Some(Item::CarvedPumpkin), + 267u32 => Some(Item::JackOLantern), + 268u32 => Some(Item::Netherrack), + 269u32 => Some(Item::SoulSand), + 270u32 => Some(Item::SoulSoil), + 271u32 => Some(Item::Basalt), + 272u32 => Some(Item::PolishedBasalt), + 273u32 => Some(Item::SmoothBasalt), + 274u32 => Some(Item::SoulTorch), + 275u32 => Some(Item::Glowstone), + 276u32 => Some(Item::InfestedStone), + 277u32 => Some(Item::InfestedCobblestone), + 278u32 => Some(Item::InfestedStoneBricks), + 279u32 => Some(Item::InfestedMossyStoneBricks), + 280u32 => Some(Item::InfestedCrackedStoneBricks), + 281u32 => Some(Item::InfestedChiseledStoneBricks), + 282u32 => Some(Item::InfestedDeepslate), + 283u32 => Some(Item::StoneBricks), + 284u32 => Some(Item::MossyStoneBricks), + 285u32 => Some(Item::CrackedStoneBricks), + 286u32 => Some(Item::ChiseledStoneBricks), + 287u32 => Some(Item::DeepslateBricks), + 288u32 => Some(Item::CrackedDeepslateBricks), + 289u32 => Some(Item::DeepslateTiles), + 290u32 => Some(Item::CrackedDeepslateTiles), + 291u32 => Some(Item::ChiseledDeepslate), + 292u32 => Some(Item::BrownMushroomBlock), + 293u32 => Some(Item::RedMushroomBlock), + 294u32 => Some(Item::MushroomStem), + 295u32 => Some(Item::IronBars), + 296u32 => Some(Item::Chain), + 297u32 => Some(Item::GlassPane), + 298u32 => Some(Item::Melon), + 299u32 => Some(Item::Vine), + 300u32 => Some(Item::GlowLichen), + 301u32 => Some(Item::BrickStairs), + 302u32 => Some(Item::StoneBrickStairs), + 303u32 => Some(Item::Mycelium), + 304u32 => Some(Item::LilyPad), + 305u32 => Some(Item::NetherBricks), + 306u32 => Some(Item::CrackedNetherBricks), + 307u32 => Some(Item::ChiseledNetherBricks), + 308u32 => Some(Item::NetherBrickFence), + 309u32 => Some(Item::NetherBrickStairs), + 310u32 => Some(Item::EnchantingTable), + 311u32 => Some(Item::EndPortalFrame), + 312u32 => Some(Item::EndStone), + 313u32 => Some(Item::EndStoneBricks), + 314u32 => Some(Item::DragonEgg), + 315u32 => Some(Item::SandstoneStairs), + 316u32 => Some(Item::EnderChest), + 317u32 => Some(Item::EmeraldBlock), + 318u32 => Some(Item::SpruceStairs), + 319u32 => Some(Item::BirchStairs), + 320u32 => Some(Item::JungleStairs), + 321u32 => Some(Item::CrimsonStairs), + 322u32 => Some(Item::WarpedStairs), + 323u32 => Some(Item::CommandBlock), + 324u32 => Some(Item::Beacon), + 325u32 => Some(Item::CobblestoneWall), + 326u32 => Some(Item::MossyCobblestoneWall), + 327u32 => Some(Item::BrickWall), + 328u32 => Some(Item::PrismarineWall), + 329u32 => Some(Item::RedSandstoneWall), + 330u32 => Some(Item::MossyStoneBrickWall), + 331u32 => Some(Item::GraniteWall), + 332u32 => Some(Item::StoneBrickWall), + 333u32 => Some(Item::NetherBrickWall), + 334u32 => Some(Item::AndesiteWall), + 335u32 => Some(Item::RedNetherBrickWall), + 336u32 => Some(Item::SandstoneWall), + 337u32 => Some(Item::EndStoneBrickWall), + 338u32 => Some(Item::DioriteWall), + 339u32 => Some(Item::BlackstoneWall), + 340u32 => Some(Item::PolishedBlackstoneWall), + 341u32 => Some(Item::PolishedBlackstoneBrickWall), + 342u32 => Some(Item::CobbledDeepslateWall), + 343u32 => Some(Item::PolishedDeepslateWall), + 344u32 => Some(Item::DeepslateBrickWall), + 345u32 => Some(Item::DeepslateTileWall), + 346u32 => Some(Item::Anvil), + 347u32 => Some(Item::ChippedAnvil), + 348u32 => Some(Item::DamagedAnvil), + 349u32 => Some(Item::ChiseledQuartzBlock), + 350u32 => Some(Item::QuartzBlock), + 351u32 => Some(Item::QuartzBricks), + 352u32 => Some(Item::QuartzPillar), + 353u32 => Some(Item::QuartzStairs), + 354u32 => Some(Item::WhiteTerracotta), + 355u32 => Some(Item::OrangeTerracotta), + 356u32 => Some(Item::MagentaTerracotta), + 357u32 => Some(Item::LightBlueTerracotta), + 358u32 => Some(Item::YellowTerracotta), + 359u32 => Some(Item::LimeTerracotta), + 360u32 => Some(Item::PinkTerracotta), + 361u32 => Some(Item::GrayTerracotta), + 362u32 => Some(Item::LightGrayTerracotta), + 363u32 => Some(Item::CyanTerracotta), + 364u32 => Some(Item::PurpleTerracotta), + 365u32 => Some(Item::BlueTerracotta), + 366u32 => Some(Item::BrownTerracotta), + 367u32 => Some(Item::GreenTerracotta), + 368u32 => Some(Item::RedTerracotta), + 369u32 => Some(Item::BlackTerracotta), + 370u32 => Some(Item::Barrier), + 371u32 => Some(Item::Light), + 372u32 => Some(Item::HayBlock), + 373u32 => Some(Item::WhiteCarpet), + 374u32 => Some(Item::OrangeCarpet), + 375u32 => Some(Item::MagentaCarpet), + 376u32 => Some(Item::LightBlueCarpet), + 377u32 => Some(Item::YellowCarpet), + 378u32 => Some(Item::LimeCarpet), + 379u32 => Some(Item::PinkCarpet), + 380u32 => Some(Item::GrayCarpet), + 381u32 => Some(Item::LightGrayCarpet), + 382u32 => Some(Item::CyanCarpet), + 383u32 => Some(Item::PurpleCarpet), + 384u32 => Some(Item::BlueCarpet), + 385u32 => Some(Item::BrownCarpet), + 386u32 => Some(Item::GreenCarpet), + 387u32 => Some(Item::RedCarpet), + 388u32 => Some(Item::BlackCarpet), + 389u32 => Some(Item::Terracotta), + 390u32 => Some(Item::PackedIce), + 391u32 => Some(Item::AcaciaStairs), + 392u32 => Some(Item::DarkOakStairs), + 393u32 => Some(Item::DirtPath), + 394u32 => Some(Item::Sunflower), + 395u32 => Some(Item::Lilac), + 396u32 => Some(Item::RoseBush), + 397u32 => Some(Item::Peony), + 398u32 => Some(Item::TallGrass), + 399u32 => Some(Item::LargeFern), + 400u32 => Some(Item::WhiteStainedGlass), + 401u32 => Some(Item::OrangeStainedGlass), + 402u32 => Some(Item::MagentaStainedGlass), + 403u32 => Some(Item::LightBlueStainedGlass), + 404u32 => Some(Item::YellowStainedGlass), + 405u32 => Some(Item::LimeStainedGlass), + 406u32 => Some(Item::PinkStainedGlass), + 407u32 => Some(Item::GrayStainedGlass), + 408u32 => Some(Item::LightGrayStainedGlass), + 409u32 => Some(Item::CyanStainedGlass), + 410u32 => Some(Item::PurpleStainedGlass), + 411u32 => Some(Item::BlueStainedGlass), + 412u32 => Some(Item::BrownStainedGlass), + 413u32 => Some(Item::GreenStainedGlass), + 414u32 => Some(Item::RedStainedGlass), + 415u32 => Some(Item::BlackStainedGlass), + 416u32 => Some(Item::WhiteStainedGlassPane), + 417u32 => Some(Item::OrangeStainedGlassPane), + 418u32 => Some(Item::MagentaStainedGlassPane), + 419u32 => Some(Item::LightBlueStainedGlassPane), + 420u32 => Some(Item::YellowStainedGlassPane), + 421u32 => Some(Item::LimeStainedGlassPane), + 422u32 => Some(Item::PinkStainedGlassPane), + 423u32 => Some(Item::GrayStainedGlassPane), + 424u32 => Some(Item::LightGrayStainedGlassPane), + 425u32 => Some(Item::CyanStainedGlassPane), + 426u32 => Some(Item::PurpleStainedGlassPane), + 427u32 => Some(Item::BlueStainedGlassPane), + 428u32 => Some(Item::BrownStainedGlassPane), + 429u32 => Some(Item::GreenStainedGlassPane), + 430u32 => Some(Item::RedStainedGlassPane), + 431u32 => Some(Item::BlackStainedGlassPane), + 432u32 => Some(Item::Prismarine), + 433u32 => Some(Item::PrismarineBricks), + 434u32 => Some(Item::DarkPrismarine), + 435u32 => Some(Item::PrismarineStairs), + 436u32 => Some(Item::PrismarineBrickStairs), + 437u32 => Some(Item::DarkPrismarineStairs), + 438u32 => Some(Item::SeaLantern), + 439u32 => Some(Item::RedSandstone), + 440u32 => Some(Item::ChiseledRedSandstone), + 441u32 => Some(Item::CutRedSandstone), + 442u32 => Some(Item::RedSandstoneStairs), + 443u32 => Some(Item::RepeatingCommandBlock), + 444u32 => Some(Item::ChainCommandBlock), + 445u32 => Some(Item::MagmaBlock), + 446u32 => Some(Item::NetherWartBlock), + 447u32 => Some(Item::WarpedWartBlock), + 448u32 => Some(Item::RedNetherBricks), + 449u32 => Some(Item::BoneBlock), + 450u32 => Some(Item::StructureVoid), + 451u32 => Some(Item::ShulkerBox), + 452u32 => Some(Item::WhiteShulkerBox), + 453u32 => Some(Item::OrangeShulkerBox), + 454u32 => Some(Item::MagentaShulkerBox), + 455u32 => Some(Item::LightBlueShulkerBox), + 456u32 => Some(Item::YellowShulkerBox), + 457u32 => Some(Item::LimeShulkerBox), + 458u32 => Some(Item::PinkShulkerBox), + 459u32 => Some(Item::GrayShulkerBox), + 460u32 => Some(Item::LightGrayShulkerBox), + 461u32 => Some(Item::CyanShulkerBox), + 462u32 => Some(Item::PurpleShulkerBox), + 463u32 => Some(Item::BlueShulkerBox), + 464u32 => Some(Item::BrownShulkerBox), + 465u32 => Some(Item::GreenShulkerBox), + 466u32 => Some(Item::RedShulkerBox), + 467u32 => Some(Item::BlackShulkerBox), + 468u32 => Some(Item::WhiteGlazedTerracotta), + 469u32 => Some(Item::OrangeGlazedTerracotta), + 470u32 => Some(Item::MagentaGlazedTerracotta), + 471u32 => Some(Item::LightBlueGlazedTerracotta), + 472u32 => Some(Item::YellowGlazedTerracotta), + 473u32 => Some(Item::LimeGlazedTerracotta), + 474u32 => Some(Item::PinkGlazedTerracotta), + 475u32 => Some(Item::GrayGlazedTerracotta), + 476u32 => Some(Item::LightGrayGlazedTerracotta), + 477u32 => Some(Item::CyanGlazedTerracotta), + 478u32 => Some(Item::PurpleGlazedTerracotta), + 479u32 => Some(Item::BlueGlazedTerracotta), + 480u32 => Some(Item::BrownGlazedTerracotta), + 481u32 => Some(Item::GreenGlazedTerracotta), + 482u32 => Some(Item::RedGlazedTerracotta), + 483u32 => Some(Item::BlackGlazedTerracotta), + 484u32 => Some(Item::WhiteConcrete), + 485u32 => Some(Item::OrangeConcrete), + 486u32 => Some(Item::MagentaConcrete), + 487u32 => Some(Item::LightBlueConcrete), + 488u32 => Some(Item::YellowConcrete), + 489u32 => Some(Item::LimeConcrete), + 490u32 => Some(Item::PinkConcrete), + 491u32 => Some(Item::GrayConcrete), + 492u32 => Some(Item::LightGrayConcrete), + 493u32 => Some(Item::CyanConcrete), + 494u32 => Some(Item::PurpleConcrete), + 495u32 => Some(Item::BlueConcrete), + 496u32 => Some(Item::BrownConcrete), + 497u32 => Some(Item::GreenConcrete), + 498u32 => Some(Item::RedConcrete), + 499u32 => Some(Item::BlackConcrete), + 500u32 => Some(Item::WhiteConcretePowder), + 501u32 => Some(Item::OrangeConcretePowder), + 502u32 => Some(Item::MagentaConcretePowder), + 503u32 => Some(Item::LightBlueConcretePowder), + 504u32 => Some(Item::YellowConcretePowder), + 505u32 => Some(Item::LimeConcretePowder), + 506u32 => Some(Item::PinkConcretePowder), + 507u32 => Some(Item::GrayConcretePowder), + 508u32 => Some(Item::LightGrayConcretePowder), + 509u32 => Some(Item::CyanConcretePowder), + 510u32 => Some(Item::PurpleConcretePowder), + 511u32 => Some(Item::BlueConcretePowder), + 512u32 => Some(Item::BrownConcretePowder), + 513u32 => Some(Item::GreenConcretePowder), + 514u32 => Some(Item::RedConcretePowder), + 515u32 => Some(Item::BlackConcretePowder), + 516u32 => Some(Item::TurtleEgg), + 517u32 => Some(Item::DeadTubeCoralBlock), + 518u32 => Some(Item::DeadBrainCoralBlock), + 519u32 => Some(Item::DeadBubbleCoralBlock), + 520u32 => Some(Item::DeadFireCoralBlock), + 521u32 => Some(Item::DeadHornCoralBlock), + 522u32 => Some(Item::TubeCoralBlock), + 523u32 => Some(Item::BrainCoralBlock), + 524u32 => Some(Item::BubbleCoralBlock), + 525u32 => Some(Item::FireCoralBlock), + 526u32 => Some(Item::HornCoralBlock), + 527u32 => Some(Item::TubeCoral), + 528u32 => Some(Item::BrainCoral), + 529u32 => Some(Item::BubbleCoral), + 530u32 => Some(Item::FireCoral), + 531u32 => Some(Item::HornCoral), + 532u32 => Some(Item::DeadBrainCoral), + 533u32 => Some(Item::DeadBubbleCoral), + 534u32 => Some(Item::DeadFireCoral), + 535u32 => Some(Item::DeadHornCoral), + 536u32 => Some(Item::DeadTubeCoral), + 537u32 => Some(Item::TubeCoralFan), + 538u32 => Some(Item::BrainCoralFan), + 539u32 => Some(Item::BubbleCoralFan), + 540u32 => Some(Item::FireCoralFan), + 541u32 => Some(Item::HornCoralFan), + 542u32 => Some(Item::DeadTubeCoralFan), + 543u32 => Some(Item::DeadBrainCoralFan), + 544u32 => Some(Item::DeadBubbleCoralFan), + 545u32 => Some(Item::DeadFireCoralFan), + 546u32 => Some(Item::DeadHornCoralFan), + 547u32 => Some(Item::BlueIce), + 548u32 => Some(Item::Conduit), + 549u32 => Some(Item::PolishedGraniteStairs), + 550u32 => Some(Item::SmoothRedSandstoneStairs), + 551u32 => Some(Item::MossyStoneBrickStairs), + 552u32 => Some(Item::PolishedDioriteStairs), + 553u32 => Some(Item::MossyCobblestoneStairs), + 554u32 => Some(Item::EndStoneBrickStairs), + 555u32 => Some(Item::StoneStairs), + 556u32 => Some(Item::SmoothSandstoneStairs), + 557u32 => Some(Item::SmoothQuartzStairs), + 558u32 => Some(Item::GraniteStairs), + 559u32 => Some(Item::AndesiteStairs), + 560u32 => Some(Item::RedNetherBrickStairs), + 561u32 => Some(Item::PolishedAndesiteStairs), + 562u32 => Some(Item::DioriteStairs), + 563u32 => Some(Item::CobbledDeepslateStairs), + 564u32 => Some(Item::PolishedDeepslateStairs), + 565u32 => Some(Item::DeepslateBrickStairs), + 566u32 => Some(Item::DeepslateTileStairs), + 567u32 => Some(Item::PolishedGraniteSlab), + 568u32 => Some(Item::SmoothRedSandstoneSlab), + 569u32 => Some(Item::MossyStoneBrickSlab), + 570u32 => Some(Item::PolishedDioriteSlab), + 571u32 => Some(Item::MossyCobblestoneSlab), + 572u32 => Some(Item::EndStoneBrickSlab), + 573u32 => Some(Item::SmoothSandstoneSlab), + 574u32 => Some(Item::SmoothQuartzSlab), + 575u32 => Some(Item::GraniteSlab), + 576u32 => Some(Item::AndesiteSlab), + 577u32 => Some(Item::RedNetherBrickSlab), + 578u32 => Some(Item::PolishedAndesiteSlab), + 579u32 => Some(Item::DioriteSlab), + 580u32 => Some(Item::CobbledDeepslateSlab), + 581u32 => Some(Item::PolishedDeepslateSlab), + 582u32 => Some(Item::DeepslateBrickSlab), + 583u32 => Some(Item::DeepslateTileSlab), + 584u32 => Some(Item::Scaffolding), + 585u32 => Some(Item::Redstone), + 586u32 => Some(Item::RedstoneTorch), + 587u32 => Some(Item::RedstoneBlock), + 588u32 => Some(Item::Repeater), + 589u32 => Some(Item::Comparator), + 590u32 => Some(Item::Piston), + 591u32 => Some(Item::StickyPiston), + 592u32 => Some(Item::SlimeBlock), + 593u32 => Some(Item::HoneyBlock), + 594u32 => Some(Item::Observer), + 595u32 => Some(Item::Hopper), + 596u32 => Some(Item::Dispenser), + 597u32 => Some(Item::Dropper), + 598u32 => Some(Item::Lectern), + 599u32 => Some(Item::Target), + 600u32 => Some(Item::Lever), + 601u32 => Some(Item::LightningRod), + 602u32 => Some(Item::DaylightDetector), + 603u32 => Some(Item::SculkSensor), + 604u32 => Some(Item::TripwireHook), + 605u32 => Some(Item::TrappedChest), + 606u32 => Some(Item::Tnt), + 607u32 => Some(Item::RedstoneLamp), + 608u32 => Some(Item::NoteBlock), + 609u32 => Some(Item::StoneButton), + 610u32 => Some(Item::PolishedBlackstoneButton), + 611u32 => Some(Item::OakButton), + 612u32 => Some(Item::SpruceButton), + 613u32 => Some(Item::BirchButton), + 614u32 => Some(Item::JungleButton), + 615u32 => Some(Item::AcaciaButton), + 616u32 => Some(Item::DarkOakButton), + 617u32 => Some(Item::CrimsonButton), + 618u32 => Some(Item::WarpedButton), + 619u32 => Some(Item::StonePressurePlate), + 620u32 => Some(Item::PolishedBlackstonePressurePlate), + 621u32 => Some(Item::LightWeightedPressurePlate), + 622u32 => Some(Item::HeavyWeightedPressurePlate), + 623u32 => Some(Item::OakPressurePlate), + 624u32 => Some(Item::SprucePressurePlate), + 625u32 => Some(Item::BirchPressurePlate), + 626u32 => Some(Item::JunglePressurePlate), + 627u32 => Some(Item::AcaciaPressurePlate), + 628u32 => Some(Item::DarkOakPressurePlate), + 629u32 => Some(Item::CrimsonPressurePlate), + 630u32 => Some(Item::WarpedPressurePlate), + 631u32 => Some(Item::IronDoor), + 632u32 => Some(Item::OakDoor), + 633u32 => Some(Item::SpruceDoor), + 634u32 => Some(Item::BirchDoor), + 635u32 => Some(Item::JungleDoor), + 636u32 => Some(Item::AcaciaDoor), + 637u32 => Some(Item::DarkOakDoor), + 638u32 => Some(Item::CrimsonDoor), + 639u32 => Some(Item::WarpedDoor), + 640u32 => Some(Item::IronTrapdoor), + 641u32 => Some(Item::OakTrapdoor), + 642u32 => Some(Item::SpruceTrapdoor), + 643u32 => Some(Item::BirchTrapdoor), + 644u32 => Some(Item::JungleTrapdoor), + 645u32 => Some(Item::AcaciaTrapdoor), + 646u32 => Some(Item::DarkOakTrapdoor), + 647u32 => Some(Item::CrimsonTrapdoor), + 648u32 => Some(Item::WarpedTrapdoor), + 649u32 => Some(Item::OakFenceGate), + 650u32 => Some(Item::SpruceFenceGate), + 651u32 => Some(Item::BirchFenceGate), + 652u32 => Some(Item::JungleFenceGate), + 653u32 => Some(Item::AcaciaFenceGate), + 654u32 => Some(Item::DarkOakFenceGate), + 655u32 => Some(Item::CrimsonFenceGate), + 656u32 => Some(Item::WarpedFenceGate), + 657u32 => Some(Item::PoweredRail), + 658u32 => Some(Item::DetectorRail), + 659u32 => Some(Item::Rail), + 660u32 => Some(Item::ActivatorRail), + 661u32 => Some(Item::Saddle), + 662u32 => Some(Item::Minecart), + 663u32 => Some(Item::ChestMinecart), + 664u32 => Some(Item::FurnaceMinecart), + 665u32 => Some(Item::TntMinecart), + 666u32 => Some(Item::HopperMinecart), + 667u32 => Some(Item::CarrotOnAStick), + 668u32 => Some(Item::WarpedFungusOnAStick), + 669u32 => Some(Item::Elytra), + 670u32 => Some(Item::OakBoat), + 671u32 => Some(Item::SpruceBoat), + 672u32 => Some(Item::BirchBoat), + 673u32 => Some(Item::JungleBoat), + 674u32 => Some(Item::AcaciaBoat), + 675u32 => Some(Item::DarkOakBoat), + 676u32 => Some(Item::StructureBlock), + 677u32 => Some(Item::Jigsaw), + 678u32 => Some(Item::TurtleHelmet), + 679u32 => Some(Item::Scute), + 680u32 => Some(Item::FlintAndSteel), + 681u32 => Some(Item::Apple), + 682u32 => Some(Item::Bow), + 683u32 => Some(Item::Arrow), + 684u32 => Some(Item::Coal), + 685u32 => Some(Item::Charcoal), + 686u32 => Some(Item::Diamond), + 687u32 => Some(Item::Emerald), + 688u32 => Some(Item::LapisLazuli), + 689u32 => Some(Item::Quartz), + 690u32 => Some(Item::AmethystShard), + 691u32 => Some(Item::RawIron), + 692u32 => Some(Item::IronIngot), + 693u32 => Some(Item::RawCopper), + 694u32 => Some(Item::CopperIngot), + 695u32 => Some(Item::RawGold), + 696u32 => Some(Item::GoldIngot), + 697u32 => Some(Item::NetheriteIngot), + 698u32 => Some(Item::NetheriteScrap), + 699u32 => Some(Item::WoodenSword), + 700u32 => Some(Item::WoodenShovel), + 701u32 => Some(Item::WoodenPickaxe), + 702u32 => Some(Item::WoodenAxe), + 703u32 => Some(Item::WoodenHoe), + 704u32 => Some(Item::StoneSword), + 705u32 => Some(Item::StoneShovel), + 706u32 => Some(Item::StonePickaxe), + 707u32 => Some(Item::StoneAxe), + 708u32 => Some(Item::StoneHoe), + 709u32 => Some(Item::GoldenSword), + 710u32 => Some(Item::GoldenShovel), + 711u32 => Some(Item::GoldenPickaxe), + 712u32 => Some(Item::GoldenAxe), + 713u32 => Some(Item::GoldenHoe), + 714u32 => Some(Item::IronSword), + 715u32 => Some(Item::IronShovel), + 716u32 => Some(Item::IronPickaxe), + 717u32 => Some(Item::IronAxe), + 718u32 => Some(Item::IronHoe), + 719u32 => Some(Item::DiamondSword), + 720u32 => Some(Item::DiamondShovel), + 721u32 => Some(Item::DiamondPickaxe), + 722u32 => Some(Item::DiamondAxe), + 723u32 => Some(Item::DiamondHoe), + 724u32 => Some(Item::NetheriteSword), + 725u32 => Some(Item::NetheriteShovel), + 726u32 => Some(Item::NetheritePickaxe), + 727u32 => Some(Item::NetheriteAxe), + 728u32 => Some(Item::NetheriteHoe), + 729u32 => Some(Item::Stick), + 730u32 => Some(Item::Bowl), + 731u32 => Some(Item::MushroomStew), + 732u32 => Some(Item::String), + 733u32 => Some(Item::Feather), + 734u32 => Some(Item::Gunpowder), + 735u32 => Some(Item::WheatSeeds), + 736u32 => Some(Item::Wheat), + 737u32 => Some(Item::Bread), + 738u32 => Some(Item::LeatherHelmet), + 739u32 => Some(Item::LeatherChestplate), + 740u32 => Some(Item::LeatherLeggings), + 741u32 => Some(Item::LeatherBoots), + 742u32 => Some(Item::ChainmailHelmet), + 743u32 => Some(Item::ChainmailChestplate), + 744u32 => Some(Item::ChainmailLeggings), + 745u32 => Some(Item::ChainmailBoots), + 746u32 => Some(Item::IronHelmet), + 747u32 => Some(Item::IronChestplate), + 748u32 => Some(Item::IronLeggings), + 749u32 => Some(Item::IronBoots), + 750u32 => Some(Item::DiamondHelmet), + 751u32 => Some(Item::DiamondChestplate), + 752u32 => Some(Item::DiamondLeggings), + 753u32 => Some(Item::DiamondBoots), + 754u32 => Some(Item::GoldenHelmet), + 755u32 => Some(Item::GoldenChestplate), + 756u32 => Some(Item::GoldenLeggings), + 757u32 => Some(Item::GoldenBoots), + 758u32 => Some(Item::NetheriteHelmet), + 759u32 => Some(Item::NetheriteChestplate), + 760u32 => Some(Item::NetheriteLeggings), + 761u32 => Some(Item::NetheriteBoots), + 762u32 => Some(Item::Flint), + 763u32 => Some(Item::Porkchop), + 764u32 => Some(Item::CookedPorkchop), + 765u32 => Some(Item::Painting), + 766u32 => Some(Item::GoldenApple), + 767u32 => Some(Item::EnchantedGoldenApple), + 768u32 => Some(Item::OakSign), + 769u32 => Some(Item::SpruceSign), + 770u32 => Some(Item::BirchSign), + 771u32 => Some(Item::JungleSign), + 772u32 => Some(Item::AcaciaSign), + 773u32 => Some(Item::DarkOakSign), + 774u32 => Some(Item::CrimsonSign), + 775u32 => Some(Item::WarpedSign), + 776u32 => Some(Item::Bucket), + 777u32 => Some(Item::WaterBucket), + 778u32 => Some(Item::LavaBucket), + 779u32 => Some(Item::PowderSnowBucket), + 780u32 => Some(Item::Snowball), + 781u32 => Some(Item::Leather), + 782u32 => Some(Item::MilkBucket), + 783u32 => Some(Item::PufferfishBucket), + 784u32 => Some(Item::SalmonBucket), + 785u32 => Some(Item::CodBucket), + 786u32 => Some(Item::TropicalFishBucket), + 787u32 => Some(Item::AxolotlBucket), + 788u32 => Some(Item::Brick), + 789u32 => Some(Item::ClayBall), + 790u32 => Some(Item::DriedKelpBlock), + 791u32 => Some(Item::Paper), + 792u32 => Some(Item::Book), + 793u32 => Some(Item::SlimeBall), + 794u32 => Some(Item::Egg), + 795u32 => Some(Item::Compass), + 796u32 => Some(Item::Bundle), + 797u32 => Some(Item::FishingRod), + 798u32 => Some(Item::Clock), + 799u32 => Some(Item::Spyglass), + 800u32 => Some(Item::GlowstoneDust), + 801u32 => Some(Item::Cod), + 802u32 => Some(Item::Salmon), + 803u32 => Some(Item::TropicalFish), + 804u32 => Some(Item::Pufferfish), + 805u32 => Some(Item::CookedCod), + 806u32 => Some(Item::CookedSalmon), + 807u32 => Some(Item::InkSac), + 808u32 => Some(Item::GlowInkSac), + 809u32 => Some(Item::CocoaBeans), + 810u32 => Some(Item::WhiteDye), + 811u32 => Some(Item::OrangeDye), + 812u32 => Some(Item::MagentaDye), + 813u32 => Some(Item::LightBlueDye), + 814u32 => Some(Item::YellowDye), + 815u32 => Some(Item::LimeDye), + 816u32 => Some(Item::PinkDye), + 817u32 => Some(Item::GrayDye), + 818u32 => Some(Item::LightGrayDye), + 819u32 => Some(Item::CyanDye), + 820u32 => Some(Item::PurpleDye), + 821u32 => Some(Item::BlueDye), + 822u32 => Some(Item::BrownDye), + 823u32 => Some(Item::GreenDye), + 824u32 => Some(Item::RedDye), + 825u32 => Some(Item::BlackDye), + 826u32 => Some(Item::BoneMeal), + 827u32 => Some(Item::Bone), + 828u32 => Some(Item::Sugar), + 829u32 => Some(Item::Cake), + 830u32 => Some(Item::WhiteBed), + 831u32 => Some(Item::OrangeBed), + 832u32 => Some(Item::MagentaBed), + 833u32 => Some(Item::LightBlueBed), + 834u32 => Some(Item::YellowBed), + 835u32 => Some(Item::LimeBed), + 836u32 => Some(Item::PinkBed), + 837u32 => Some(Item::GrayBed), + 838u32 => Some(Item::LightGrayBed), + 839u32 => Some(Item::CyanBed), + 840u32 => Some(Item::PurpleBed), + 841u32 => Some(Item::BlueBed), + 842u32 => Some(Item::BrownBed), + 843u32 => Some(Item::GreenBed), + 844u32 => Some(Item::RedBed), + 845u32 => Some(Item::BlackBed), + 846u32 => Some(Item::Cookie), + 847u32 => Some(Item::FilledMap), + 848u32 => Some(Item::Shears), + 849u32 => Some(Item::MelonSlice), + 850u32 => Some(Item::DriedKelp), + 851u32 => Some(Item::PumpkinSeeds), + 852u32 => Some(Item::MelonSeeds), + 853u32 => Some(Item::Beef), + 854u32 => Some(Item::CookedBeef), + 855u32 => Some(Item::Chicken), + 856u32 => Some(Item::CookedChicken), + 857u32 => Some(Item::RottenFlesh), + 858u32 => Some(Item::EnderPearl), + 859u32 => Some(Item::BlazeRod), + 860u32 => Some(Item::GhastTear), + 861u32 => Some(Item::GoldNugget), + 862u32 => Some(Item::NetherWart), + 863u32 => Some(Item::Potion), + 864u32 => Some(Item::GlassBottle), + 865u32 => Some(Item::SpiderEye), + 866u32 => Some(Item::FermentedSpiderEye), + 867u32 => Some(Item::BlazePowder), + 868u32 => Some(Item::MagmaCream), + 869u32 => Some(Item::BrewingStand), + 870u32 => Some(Item::Cauldron), + 871u32 => Some(Item::EnderEye), + 872u32 => Some(Item::GlisteringMelonSlice), + 873u32 => Some(Item::AxolotlSpawnEgg), + 874u32 => Some(Item::BatSpawnEgg), + 875u32 => Some(Item::BeeSpawnEgg), + 876u32 => Some(Item::BlazeSpawnEgg), + 877u32 => Some(Item::CatSpawnEgg), + 878u32 => Some(Item::CaveSpiderSpawnEgg), + 879u32 => Some(Item::ChickenSpawnEgg), + 880u32 => Some(Item::CodSpawnEgg), + 881u32 => Some(Item::CowSpawnEgg), + 882u32 => Some(Item::CreeperSpawnEgg), + 883u32 => Some(Item::DolphinSpawnEgg), + 884u32 => Some(Item::DonkeySpawnEgg), + 885u32 => Some(Item::DrownedSpawnEgg), + 886u32 => Some(Item::ElderGuardianSpawnEgg), + 887u32 => Some(Item::EndermanSpawnEgg), + 888u32 => Some(Item::EndermiteSpawnEgg), + 889u32 => Some(Item::EvokerSpawnEgg), + 890u32 => Some(Item::FoxSpawnEgg), + 891u32 => Some(Item::GhastSpawnEgg), + 892u32 => Some(Item::GlowSquidSpawnEgg), + 893u32 => Some(Item::GoatSpawnEgg), + 894u32 => Some(Item::GuardianSpawnEgg), + 895u32 => Some(Item::HoglinSpawnEgg), + 896u32 => Some(Item::HorseSpawnEgg), + 897u32 => Some(Item::HuskSpawnEgg), + 898u32 => Some(Item::LlamaSpawnEgg), + 899u32 => Some(Item::MagmaCubeSpawnEgg), + 900u32 => Some(Item::MooshroomSpawnEgg), + 901u32 => Some(Item::MuleSpawnEgg), + 902u32 => Some(Item::OcelotSpawnEgg), + 903u32 => Some(Item::PandaSpawnEgg), + 904u32 => Some(Item::ParrotSpawnEgg), + 905u32 => Some(Item::PhantomSpawnEgg), + 906u32 => Some(Item::PigSpawnEgg), + 907u32 => Some(Item::PiglinSpawnEgg), + 908u32 => Some(Item::PiglinBruteSpawnEgg), + 909u32 => Some(Item::PillagerSpawnEgg), + 910u32 => Some(Item::PolarBearSpawnEgg), + 911u32 => Some(Item::PufferfishSpawnEgg), + 912u32 => Some(Item::RabbitSpawnEgg), + 913u32 => Some(Item::RavagerSpawnEgg), + 914u32 => Some(Item::SalmonSpawnEgg), + 915u32 => Some(Item::SheepSpawnEgg), + 916u32 => Some(Item::ShulkerSpawnEgg), + 917u32 => Some(Item::SilverfishSpawnEgg), + 918u32 => Some(Item::SkeletonSpawnEgg), + 919u32 => Some(Item::SkeletonHorseSpawnEgg), + 920u32 => Some(Item::SlimeSpawnEgg), + 921u32 => Some(Item::SpiderSpawnEgg), + 922u32 => Some(Item::SquidSpawnEgg), + 923u32 => Some(Item::StraySpawnEgg), + 924u32 => Some(Item::StriderSpawnEgg), + 925u32 => Some(Item::TraderLlamaSpawnEgg), + 926u32 => Some(Item::TropicalFishSpawnEgg), + 927u32 => Some(Item::TurtleSpawnEgg), + 928u32 => Some(Item::VexSpawnEgg), + 929u32 => Some(Item::VillagerSpawnEgg), + 930u32 => Some(Item::VindicatorSpawnEgg), + 931u32 => Some(Item::WanderingTraderSpawnEgg), + 932u32 => Some(Item::WitchSpawnEgg), + 933u32 => Some(Item::WitherSkeletonSpawnEgg), + 934u32 => Some(Item::WolfSpawnEgg), + 935u32 => Some(Item::ZoglinSpawnEgg), + 936u32 => Some(Item::ZombieSpawnEgg), + 937u32 => Some(Item::ZombieHorseSpawnEgg), + 938u32 => Some(Item::ZombieVillagerSpawnEgg), + 939u32 => Some(Item::ZombifiedPiglinSpawnEgg), + 940u32 => Some(Item::ExperienceBottle), + 941u32 => Some(Item::FireCharge), + 942u32 => Some(Item::WritableBook), + 943u32 => Some(Item::WrittenBook), + 944u32 => Some(Item::ItemFrame), + 945u32 => Some(Item::GlowItemFrame), + 946u32 => Some(Item::FlowerPot), + 947u32 => Some(Item::Carrot), + 948u32 => Some(Item::Potato), + 949u32 => Some(Item::BakedPotato), + 950u32 => Some(Item::PoisonousPotato), + 951u32 => Some(Item::Map), + 952u32 => Some(Item::GoldenCarrot), + 953u32 => Some(Item::SkeletonSkull), + 954u32 => Some(Item::WitherSkeletonSkull), + 955u32 => Some(Item::PlayerHead), + 956u32 => Some(Item::ZombieHead), + 957u32 => Some(Item::CreeperHead), + 958u32 => Some(Item::DragonHead), + 959u32 => Some(Item::NetherStar), + 960u32 => Some(Item::PumpkinPie), + 961u32 => Some(Item::FireworkRocket), + 962u32 => Some(Item::FireworkStar), + 963u32 => Some(Item::EnchantedBook), + 964u32 => Some(Item::NetherBrick), + 965u32 => Some(Item::PrismarineShard), + 966u32 => Some(Item::PrismarineCrystals), + 967u32 => Some(Item::Rabbit), + 968u32 => Some(Item::CookedRabbit), + 969u32 => Some(Item::RabbitStew), + 970u32 => Some(Item::RabbitFoot), + 971u32 => Some(Item::RabbitHide), + 972u32 => Some(Item::ArmorStand), + 973u32 => Some(Item::IronHorseArmor), + 974u32 => Some(Item::GoldenHorseArmor), + 975u32 => Some(Item::DiamondHorseArmor), + 976u32 => Some(Item::LeatherHorseArmor), + 977u32 => Some(Item::Lead), + 978u32 => Some(Item::NameTag), + 979u32 => Some(Item::CommandBlockMinecart), + 980u32 => Some(Item::Mutton), + 981u32 => Some(Item::CookedMutton), + 982u32 => Some(Item::WhiteBanner), + 983u32 => Some(Item::OrangeBanner), + 984u32 => Some(Item::MagentaBanner), + 985u32 => Some(Item::LightBlueBanner), + 986u32 => Some(Item::YellowBanner), + 987u32 => Some(Item::LimeBanner), + 988u32 => Some(Item::PinkBanner), + 989u32 => Some(Item::GrayBanner), + 990u32 => Some(Item::LightGrayBanner), + 991u32 => Some(Item::CyanBanner), + 992u32 => Some(Item::PurpleBanner), + 993u32 => Some(Item::BlueBanner), + 994u32 => Some(Item::BrownBanner), + 995u32 => Some(Item::GreenBanner), + 996u32 => Some(Item::RedBanner), + 997u32 => Some(Item::BlackBanner), + 998u32 => Some(Item::EndCrystal), + 999u32 => Some(Item::ChorusFruit), + 1000u32 => Some(Item::PoppedChorusFruit), + 1001u32 => Some(Item::Beetroot), + 1002u32 => Some(Item::BeetrootSeeds), + 1003u32 => Some(Item::BeetrootSoup), + 1004u32 => Some(Item::DragonBreath), + 1005u32 => Some(Item::SplashPotion), + 1006u32 => Some(Item::SpectralArrow), + 1007u32 => Some(Item::TippedArrow), + 1008u32 => Some(Item::LingeringPotion), + 1009u32 => Some(Item::Shield), + 1010u32 => Some(Item::TotemOfUndying), + 1011u32 => Some(Item::ShulkerShell), + 1012u32 => Some(Item::IronNugget), + 1013u32 => Some(Item::KnowledgeBook), + 1014u32 => Some(Item::DebugStick), + 1015u32 => Some(Item::MusicDisc13), + 1016u32 => Some(Item::MusicDiscCat), + 1017u32 => Some(Item::MusicDiscBlocks), + 1018u32 => Some(Item::MusicDiscChirp), + 1019u32 => Some(Item::MusicDiscFar), + 1020u32 => Some(Item::MusicDiscMall), + 1021u32 => Some(Item::MusicDiscMellohi), + 1022u32 => Some(Item::MusicDiscStal), + 1023u32 => Some(Item::MusicDiscStrad), + 1024u32 => Some(Item::MusicDiscWard), + 1025u32 => Some(Item::MusicDisc11), + 1026u32 => Some(Item::MusicDiscWait), + 1027u32 => Some(Item::MusicDiscOtherside), + 1028u32 => Some(Item::MusicDiscPigstep), + 1029u32 => Some(Item::Trident), + 1030u32 => Some(Item::PhantomMembrane), + 1031u32 => Some(Item::NautilusShell), + 1032u32 => Some(Item::HeartOfTheSea), + 1033u32 => Some(Item::Crossbow), + 1034u32 => Some(Item::SuspiciousStew), + 1035u32 => Some(Item::Loom), + 1036u32 => Some(Item::FlowerBannerPattern), + 1037u32 => Some(Item::CreeperBannerPattern), + 1038u32 => Some(Item::SkullBannerPattern), + 1039u32 => Some(Item::MojangBannerPattern), + 1040u32 => Some(Item::GlobeBannerPattern), + 1041u32 => Some(Item::PiglinBannerPattern), + 1042u32 => Some(Item::Composter), + 1043u32 => Some(Item::Barrel), + 1044u32 => Some(Item::Smoker), + 1045u32 => Some(Item::BlastFurnace), + 1046u32 => Some(Item::CartographyTable), + 1047u32 => Some(Item::FletchingTable), + 1048u32 => Some(Item::Grindstone), + 1049u32 => Some(Item::SmithingTable), + 1050u32 => Some(Item::Stonecutter), + 1051u32 => Some(Item::Bell), + 1052u32 => Some(Item::Lantern), + 1053u32 => Some(Item::SoulLantern), + 1054u32 => Some(Item::SweetBerries), + 1055u32 => Some(Item::GlowBerries), + 1056u32 => Some(Item::Campfire), + 1057u32 => Some(Item::SoulCampfire), + 1058u32 => Some(Item::Shroomlight), + 1059u32 => Some(Item::Honeycomb), + 1060u32 => Some(Item::BeeNest), + 1061u32 => Some(Item::Beehive), + 1062u32 => Some(Item::HoneyBottle), + 1063u32 => Some(Item::HoneycombBlock), + 1064u32 => Some(Item::Lodestone), + 1065u32 => Some(Item::CryingObsidian), + 1066u32 => Some(Item::Blackstone), + 1067u32 => Some(Item::BlackstoneSlab), + 1068u32 => Some(Item::BlackstoneStairs), + 1069u32 => Some(Item::GildedBlackstone), + 1070u32 => Some(Item::PolishedBlackstone), + 1071u32 => Some(Item::PolishedBlackstoneSlab), + 1072u32 => Some(Item::PolishedBlackstoneStairs), + 1073u32 => Some(Item::ChiseledPolishedBlackstone), + 1074u32 => Some(Item::PolishedBlackstoneBricks), + 1075u32 => Some(Item::PolishedBlackstoneBrickSlab), + 1076u32 => Some(Item::PolishedBlackstoneBrickStairs), + 1077u32 => Some(Item::CrackedPolishedBlackstoneBricks), + 1078u32 => Some(Item::RespawnAnchor), + 1079u32 => Some(Item::Candle), + 1080u32 => Some(Item::WhiteCandle), + 1081u32 => Some(Item::OrangeCandle), + 1082u32 => Some(Item::MagentaCandle), + 1083u32 => Some(Item::LightBlueCandle), + 1084u32 => Some(Item::YellowCandle), + 1085u32 => Some(Item::LimeCandle), + 1086u32 => Some(Item::PinkCandle), + 1087u32 => Some(Item::GrayCandle), + 1088u32 => Some(Item::LightGrayCandle), + 1089u32 => Some(Item::CyanCandle), + 1090u32 => Some(Item::PurpleCandle), + 1091u32 => Some(Item::BlueCandle), + 1092u32 => Some(Item::BrownCandle), + 1093u32 => Some(Item::GreenCandle), + 1094u32 => Some(Item::RedCandle), + 1095u32 => Some(Item::BlackCandle), + 1096u32 => Some(Item::SmallAmethystBud), + 1097u32 => Some(Item::MediumAmethystBud), + 1098u32 => Some(Item::LargeAmethystBud), + 1099u32 => Some(Item::AmethystCluster), + 1100u32 => Some(Item::PointedDripstone), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl Item { - /// Returns the `name` property of this `Item`. + #[doc = "Returns the `name` property of this `Item`."] + #[inline] pub fn name(&self) -> &'static str { match self { - Item::Air => "air", Item::Stone => "stone", Item::Granite => "granite", Item::PolishedGranite => "polished_granite", @@ -2963,10 +4449,17 @@ impl Item { Item::PolishedDiorite => "polished_diorite", Item::Andesite => "andesite", Item::PolishedAndesite => "polished_andesite", + Item::Deepslate => "deepslate", + Item::CobbledDeepslate => "cobbled_deepslate", + Item::PolishedDeepslate => "polished_deepslate", + Item::Calcite => "calcite", + Item::Tuff => "tuff", + Item::DripstoneBlock => "dripstone_block", Item::GrassBlock => "grass_block", Item::Dirt => "dirt", Item::CoarseDirt => "coarse_dirt", Item::Podzol => "podzol", + Item::RootedDirt => "rooted_dirt", Item::CrimsonNylium => "crimson_nylium", Item::WarpedNylium => "warped_nylium", Item::Cobblestone => "cobblestone", @@ -2988,10 +4481,67 @@ impl Item { Item::Sand => "sand", Item::RedSand => "red_sand", Item::Gravel => "gravel", - Item::GoldOre => "gold_ore", - Item::IronOre => "iron_ore", Item::CoalOre => "coal_ore", + Item::DeepslateCoalOre => "deepslate_coal_ore", + Item::IronOre => "iron_ore", + Item::DeepslateIronOre => "deepslate_iron_ore", + Item::CopperOre => "copper_ore", + Item::DeepslateCopperOre => "deepslate_copper_ore", + Item::GoldOre => "gold_ore", + Item::DeepslateGoldOre => "deepslate_gold_ore", + Item::RedstoneOre => "redstone_ore", + Item::DeepslateRedstoneOre => "deepslate_redstone_ore", + Item::EmeraldOre => "emerald_ore", + Item::DeepslateEmeraldOre => "deepslate_emerald_ore", + Item::LapisOre => "lapis_ore", + Item::DeepslateLapisOre => "deepslate_lapis_ore", + Item::DiamondOre => "diamond_ore", + Item::DeepslateDiamondOre => "deepslate_diamond_ore", Item::NetherGoldOre => "nether_gold_ore", + Item::NetherQuartzOre => "nether_quartz_ore", + Item::AncientDebris => "ancient_debris", + Item::CoalBlock => "coal_block", + Item::RawIronBlock => "raw_iron_block", + Item::RawCopperBlock => "raw_copper_block", + Item::RawGoldBlock => "raw_gold_block", + Item::AmethystBlock => "amethyst_block", + Item::BuddingAmethyst => "budding_amethyst", + Item::IronBlock => "iron_block", + Item::CopperBlock => "copper_block", + Item::GoldBlock => "gold_block", + Item::DiamondBlock => "diamond_block", + Item::NetheriteBlock => "netherite_block", + Item::ExposedCopper => "exposed_copper", + Item::WeatheredCopper => "weathered_copper", + Item::OxidizedCopper => "oxidized_copper", + Item::CutCopper => "cut_copper", + Item::ExposedCutCopper => "exposed_cut_copper", + Item::WeatheredCutCopper => "weathered_cut_copper", + Item::OxidizedCutCopper => "oxidized_cut_copper", + Item::CutCopperStairs => "cut_copper_stairs", + Item::ExposedCutCopperStairs => "exposed_cut_copper_stairs", + Item::WeatheredCutCopperStairs => "weathered_cut_copper_stairs", + Item::OxidizedCutCopperStairs => "oxidized_cut_copper_stairs", + Item::CutCopperSlab => "cut_copper_slab", + Item::ExposedCutCopperSlab => "exposed_cut_copper_slab", + Item::WeatheredCutCopperSlab => "weathered_cut_copper_slab", + Item::OxidizedCutCopperSlab => "oxidized_cut_copper_slab", + Item::WaxedCopperBlock => "waxed_copper_block", + Item::WaxedExposedCopper => "waxed_exposed_copper", + Item::WaxedWeatheredCopper => "waxed_weathered_copper", + Item::WaxedOxidizedCopper => "waxed_oxidized_copper", + Item::WaxedCutCopper => "waxed_cut_copper", + Item::WaxedExposedCutCopper => "waxed_exposed_cut_copper", + Item::WaxedWeatheredCutCopper => "waxed_weathered_cut_copper", + Item::WaxedOxidizedCutCopper => "waxed_oxidized_cut_copper", + Item::WaxedCutCopperStairs => "waxed_cut_copper_stairs", + Item::WaxedExposedCutCopperStairs => "waxed_exposed_cut_copper_stairs", + Item::WaxedWeatheredCutCopperStairs => "waxed_weathered_cut_copper_stairs", + Item::WaxedOxidizedCutCopperStairs => "waxed_oxidized_cut_copper_stairs", + Item::WaxedCutCopperSlab => "waxed_cut_copper_slab", + Item::WaxedExposedCutCopperSlab => "waxed_exposed_cut_copper_slab", + Item::WaxedWeatheredCutCopperSlab => "waxed_weathered_cut_copper_slab", + Item::WaxedOxidizedCutCopperSlab => "waxed_oxidized_cut_copper_slab", Item::OakLog => "oak_log", Item::SpruceLog => "spruce_log", Item::BirchLog => "birch_log", @@ -3030,26 +4580,24 @@ impl Item { Item::JungleLeaves => "jungle_leaves", Item::AcaciaLeaves => "acacia_leaves", Item::DarkOakLeaves => "dark_oak_leaves", + Item::AzaleaLeaves => "azalea_leaves", + Item::FloweringAzaleaLeaves => "flowering_azalea_leaves", Item::Sponge => "sponge", Item::WetSponge => "wet_sponge", Item::Glass => "glass", - Item::LapisOre => "lapis_ore", + Item::TintedGlass => "tinted_glass", Item::LapisBlock => "lapis_block", - Item::Dispenser => "dispenser", Item::Sandstone => "sandstone", Item::ChiseledSandstone => "chiseled_sandstone", Item::CutSandstone => "cut_sandstone", - Item::NoteBlock => "note_block", - Item::PoweredRail => "powered_rail", - Item::DetectorRail => "detector_rail", - Item::StickyPiston => "sticky_piston", Item::Cobweb => "cobweb", Item::Grass => "grass", Item::Fern => "fern", + Item::Azalea => "azalea", + Item::FloweringAzalea => "flowering_azalea", Item::DeadBush => "dead_bush", Item::Seagrass => "seagrass", Item::SeaPickle => "sea_pickle", - Item::Piston => "piston", Item::WhiteWool => "white_wool", Item::OrangeWool => "orange_wool", Item::MagentaWool => "magenta_wool", @@ -3079,6 +4627,7 @@ impl Item { Item::Cornflower => "cornflower", Item::LilyOfTheValley => "lily_of_the_valley", Item::WitherRose => "wither_rose", + Item::SporeBlossom => "spore_blossom", Item::BrownMushroom => "brown_mushroom", Item::RedMushroom => "red_mushroom", Item::CrimsonFungus => "crimson_fungus", @@ -3090,9 +4639,12 @@ impl Item { Item::TwistingVines => "twisting_vines", Item::SugarCane => "sugar_cane", Item::Kelp => "kelp", + Item::MossCarpet => "moss_carpet", + Item::MossBlock => "moss_block", + Item::HangingRoots => "hanging_roots", + Item::BigDripleaf => "big_dripleaf", + Item::SmallDripleaf => "small_dripleaf", Item::Bamboo => "bamboo", - Item::GoldBlock => "gold_block", - Item::IronBlock => "iron_block", Item::OakSlab => "oak_slab", Item::SpruceSlab => "spruce_slab", Item::BirchSlab => "birch_slab", @@ -3122,7 +4674,6 @@ impl Item { Item::SmoothSandstone => "smooth_sandstone", Item::SmoothStone => "smooth_stone", Item::Bricks => "bricks", - Item::Tnt => "tnt", Item::Bookshelf => "bookshelf", Item::MossyCobblestone => "mossy_cobblestone", Item::Obsidian => "obsidian", @@ -3136,27 +4687,11 @@ impl Item { Item::Spawner => "spawner", Item::OakStairs => "oak_stairs", Item::Chest => "chest", - Item::DiamondOre => "diamond_ore", - Item::DiamondBlock => "diamond_block", Item::CraftingTable => "crafting_table", Item::Farmland => "farmland", Item::Furnace => "furnace", Item::Ladder => "ladder", - Item::Rail => "rail", Item::CobblestoneStairs => "cobblestone_stairs", - Item::Lever => "lever", - Item::StonePressurePlate => "stone_pressure_plate", - Item::OakPressurePlate => "oak_pressure_plate", - Item::SprucePressurePlate => "spruce_pressure_plate", - Item::BirchPressurePlate => "birch_pressure_plate", - Item::JunglePressurePlate => "jungle_pressure_plate", - Item::AcaciaPressurePlate => "acacia_pressure_plate", - Item::DarkOakPressurePlate => "dark_oak_pressure_plate", - Item::CrimsonPressurePlate => "crimson_pressure_plate", - Item::WarpedPressurePlate => "warped_pressure_plate", - Item::PolishedBlackstonePressurePlate => "polished_blackstone_pressure_plate", - Item::RedstoneOre => "redstone_ore", - Item::RedstoneTorch => "redstone_torch", Item::Snow => "snow", Item::Ice => "ice", Item::SnowBlock => "snow_block", @@ -3173,32 +4708,31 @@ impl Item { Item::WarpedFence => "warped_fence", Item::Pumpkin => "pumpkin", Item::CarvedPumpkin => "carved_pumpkin", + Item::JackOLantern => "jack_o_lantern", Item::Netherrack => "netherrack", Item::SoulSand => "soul_sand", Item::SoulSoil => "soul_soil", Item::Basalt => "basalt", Item::PolishedBasalt => "polished_basalt", + Item::SmoothBasalt => "smooth_basalt", Item::SoulTorch => "soul_torch", Item::Glowstone => "glowstone", - Item::JackOLantern => "jack_o_lantern", - Item::OakTrapdoor => "oak_trapdoor", - Item::SpruceTrapdoor => "spruce_trapdoor", - Item::BirchTrapdoor => "birch_trapdoor", - Item::JungleTrapdoor => "jungle_trapdoor", - Item::AcaciaTrapdoor => "acacia_trapdoor", - Item::DarkOakTrapdoor => "dark_oak_trapdoor", - Item::CrimsonTrapdoor => "crimson_trapdoor", - Item::WarpedTrapdoor => "warped_trapdoor", Item::InfestedStone => "infested_stone", Item::InfestedCobblestone => "infested_cobblestone", Item::InfestedStoneBricks => "infested_stone_bricks", Item::InfestedMossyStoneBricks => "infested_mossy_stone_bricks", Item::InfestedCrackedStoneBricks => "infested_cracked_stone_bricks", Item::InfestedChiseledStoneBricks => "infested_chiseled_stone_bricks", + Item::InfestedDeepslate => "infested_deepslate", Item::StoneBricks => "stone_bricks", Item::MossyStoneBricks => "mossy_stone_bricks", Item::CrackedStoneBricks => "cracked_stone_bricks", Item::ChiseledStoneBricks => "chiseled_stone_bricks", + Item::DeepslateBricks => "deepslate_bricks", + Item::CrackedDeepslateBricks => "cracked_deepslate_bricks", + Item::DeepslateTiles => "deepslate_tiles", + Item::CrackedDeepslateTiles => "cracked_deepslate_tiles", + Item::ChiseledDeepslate => "chiseled_deepslate", Item::BrownMushroomBlock => "brown_mushroom_block", Item::RedMushroomBlock => "red_mushroom_block", Item::MushroomStem => "mushroom_stem", @@ -3207,14 +4741,7 @@ impl Item { Item::GlassPane => "glass_pane", Item::Melon => "melon", Item::Vine => "vine", - Item::OakFenceGate => "oak_fence_gate", - Item::SpruceFenceGate => "spruce_fence_gate", - Item::BirchFenceGate => "birch_fence_gate", - Item::JungleFenceGate => "jungle_fence_gate", - Item::AcaciaFenceGate => "acacia_fence_gate", - Item::DarkOakFenceGate => "dark_oak_fence_gate", - Item::CrimsonFenceGate => "crimson_fence_gate", - Item::WarpedFenceGate => "warped_fence_gate", + Item::GlowLichen => "glow_lichen", Item::BrickStairs => "brick_stairs", Item::StoneBrickStairs => "stone_brick_stairs", Item::Mycelium => "mycelium", @@ -3229,11 +4756,8 @@ impl Item { Item::EndStone => "end_stone", Item::EndStoneBricks => "end_stone_bricks", Item::DragonEgg => "dragon_egg", - Item::RedstoneLamp => "redstone_lamp", Item::SandstoneStairs => "sandstone_stairs", - Item::EmeraldOre => "emerald_ore", Item::EnderChest => "ender_chest", - Item::TripwireHook => "tripwire_hook", Item::EmeraldBlock => "emerald_block", Item::SpruceStairs => "spruce_stairs", Item::BirchStairs => "birch_stairs", @@ -3257,35 +4781,20 @@ impl Item { Item::EndStoneBrickWall => "end_stone_brick_wall", Item::DioriteWall => "diorite_wall", Item::BlackstoneWall => "blackstone_wall", - Item::PolishedBlackstoneWall => "polished_blackstone_wall", - Item::PolishedBlackstoneBrickWall => "polished_blackstone_brick_wall", - Item::StoneButton => "stone_button", - Item::OakButton => "oak_button", - Item::SpruceButton => "spruce_button", - Item::BirchButton => "birch_button", - Item::JungleButton => "jungle_button", - Item::AcaciaButton => "acacia_button", - Item::DarkOakButton => "dark_oak_button", - Item::CrimsonButton => "crimson_button", - Item::WarpedButton => "warped_button", - Item::PolishedBlackstoneButton => "polished_blackstone_button", - Item::Anvil => "anvil", - Item::ChippedAnvil => "chipped_anvil", - Item::DamagedAnvil => "damaged_anvil", - Item::TrappedChest => "trapped_chest", - Item::LightWeightedPressurePlate => "light_weighted_pressure_plate", - Item::HeavyWeightedPressurePlate => "heavy_weighted_pressure_plate", - Item::DaylightDetector => "daylight_detector", - Item::RedstoneBlock => "redstone_block", - Item::NetherQuartzOre => "nether_quartz_ore", - Item::Hopper => "hopper", + Item::PolishedBlackstoneWall => "polished_blackstone_wall", + Item::PolishedBlackstoneBrickWall => "polished_blackstone_brick_wall", + Item::CobbledDeepslateWall => "cobbled_deepslate_wall", + Item::PolishedDeepslateWall => "polished_deepslate_wall", + Item::DeepslateBrickWall => "deepslate_brick_wall", + Item::DeepslateTileWall => "deepslate_tile_wall", + Item::Anvil => "anvil", + Item::ChippedAnvil => "chipped_anvil", + Item::DamagedAnvil => "damaged_anvil", Item::ChiseledQuartzBlock => "chiseled_quartz_block", Item::QuartzBlock => "quartz_block", Item::QuartzBricks => "quartz_bricks", Item::QuartzPillar => "quartz_pillar", Item::QuartzStairs => "quartz_stairs", - Item::ActivatorRail => "activator_rail", - Item::Dropper => "dropper", Item::WhiteTerracotta => "white_terracotta", Item::OrangeTerracotta => "orange_terracotta", Item::MagentaTerracotta => "magenta_terracotta", @@ -3303,7 +4812,7 @@ impl Item { Item::RedTerracotta => "red_terracotta", Item::BlackTerracotta => "black_terracotta", Item::Barrier => "barrier", - Item::IronTrapdoor => "iron_trapdoor", + Item::Light => "light", Item::HayBlock => "hay_block", Item::WhiteCarpet => "white_carpet", Item::OrangeCarpet => "orange_carpet", @@ -3322,12 +4831,10 @@ impl Item { Item::RedCarpet => "red_carpet", Item::BlackCarpet => "black_carpet", Item::Terracotta => "terracotta", - Item::CoalBlock => "coal_block", Item::PackedIce => "packed_ice", Item::AcaciaStairs => "acacia_stairs", Item::DarkOakStairs => "dark_oak_stairs", - Item::SlimeBlock => "slime_block", - Item::GrassPath => "grass_path", + Item::DirtPath => "dirt_path", Item::Sunflower => "sunflower", Item::Lilac => "lilac", Item::RoseBush => "rose_bush", @@ -3385,7 +4892,6 @@ impl Item { Item::RedNetherBricks => "red_nether_bricks", Item::BoneBlock => "bone_block", Item::StructureVoid => "structure_void", - Item::Observer => "observer", Item::ShulkerBox => "shulker_box", Item::WhiteShulkerBox => "white_shulker_box", Item::OrangeShulkerBox => "orange_shulker_box", @@ -3498,6 +5004,10 @@ impl Item { Item::RedNetherBrickStairs => "red_nether_brick_stairs", Item::PolishedAndesiteStairs => "polished_andesite_stairs", Item::DioriteStairs => "diorite_stairs", + Item::CobbledDeepslateStairs => "cobbled_deepslate_stairs", + Item::PolishedDeepslateStairs => "polished_deepslate_stairs", + Item::DeepslateBrickStairs => "deepslate_brick_stairs", + Item::DeepslateTileStairs => "deepslate_tile_stairs", Item::PolishedGraniteSlab => "polished_granite_slab", Item::SmoothRedSandstoneSlab => "smooth_red_sandstone_slab", Item::MossyStoneBrickSlab => "mossy_stone_brick_slab", @@ -3511,7 +5021,57 @@ impl Item { Item::RedNetherBrickSlab => "red_nether_brick_slab", Item::PolishedAndesiteSlab => "polished_andesite_slab", Item::DioriteSlab => "diorite_slab", + Item::CobbledDeepslateSlab => "cobbled_deepslate_slab", + Item::PolishedDeepslateSlab => "polished_deepslate_slab", + Item::DeepslateBrickSlab => "deepslate_brick_slab", + Item::DeepslateTileSlab => "deepslate_tile_slab", Item::Scaffolding => "scaffolding", + Item::Redstone => "redstone", + Item::RedstoneTorch => "redstone_torch", + Item::RedstoneBlock => "redstone_block", + Item::Repeater => "repeater", + Item::Comparator => "comparator", + Item::Piston => "piston", + Item::StickyPiston => "sticky_piston", + Item::SlimeBlock => "slime_block", + Item::HoneyBlock => "honey_block", + Item::Observer => "observer", + Item::Hopper => "hopper", + Item::Dispenser => "dispenser", + Item::Dropper => "dropper", + Item::Lectern => "lectern", + Item::Target => "target", + Item::Lever => "lever", + Item::LightningRod => "lightning_rod", + Item::DaylightDetector => "daylight_detector", + Item::SculkSensor => "sculk_sensor", + Item::TripwireHook => "tripwire_hook", + Item::TrappedChest => "trapped_chest", + Item::Tnt => "tnt", + Item::RedstoneLamp => "redstone_lamp", + Item::NoteBlock => "note_block", + Item::StoneButton => "stone_button", + Item::PolishedBlackstoneButton => "polished_blackstone_button", + Item::OakButton => "oak_button", + Item::SpruceButton => "spruce_button", + Item::BirchButton => "birch_button", + Item::JungleButton => "jungle_button", + Item::AcaciaButton => "acacia_button", + Item::DarkOakButton => "dark_oak_button", + Item::CrimsonButton => "crimson_button", + Item::WarpedButton => "warped_button", + Item::StonePressurePlate => "stone_pressure_plate", + Item::PolishedBlackstonePressurePlate => "polished_blackstone_pressure_plate", + Item::LightWeightedPressurePlate => "light_weighted_pressure_plate", + Item::HeavyWeightedPressurePlate => "heavy_weighted_pressure_plate", + Item::OakPressurePlate => "oak_pressure_plate", + Item::SprucePressurePlate => "spruce_pressure_plate", + Item::BirchPressurePlate => "birch_pressure_plate", + Item::JunglePressurePlate => "jungle_pressure_plate", + Item::AcaciaPressurePlate => "acacia_pressure_plate", + Item::DarkOakPressurePlate => "dark_oak_pressure_plate", + Item::CrimsonPressurePlate => "crimson_pressure_plate", + Item::WarpedPressurePlate => "warped_pressure_plate", Item::IronDoor => "iron_door", Item::OakDoor => "oak_door", Item::SpruceDoor => "spruce_door", @@ -3521,8 +5081,42 @@ impl Item { Item::DarkOakDoor => "dark_oak_door", Item::CrimsonDoor => "crimson_door", Item::WarpedDoor => "warped_door", - Item::Repeater => "repeater", - Item::Comparator => "comparator", + Item::IronTrapdoor => "iron_trapdoor", + Item::OakTrapdoor => "oak_trapdoor", + Item::SpruceTrapdoor => "spruce_trapdoor", + Item::BirchTrapdoor => "birch_trapdoor", + Item::JungleTrapdoor => "jungle_trapdoor", + Item::AcaciaTrapdoor => "acacia_trapdoor", + Item::DarkOakTrapdoor => "dark_oak_trapdoor", + Item::CrimsonTrapdoor => "crimson_trapdoor", + Item::WarpedTrapdoor => "warped_trapdoor", + Item::OakFenceGate => "oak_fence_gate", + Item::SpruceFenceGate => "spruce_fence_gate", + Item::BirchFenceGate => "birch_fence_gate", + Item::JungleFenceGate => "jungle_fence_gate", + Item::AcaciaFenceGate => "acacia_fence_gate", + Item::DarkOakFenceGate => "dark_oak_fence_gate", + Item::CrimsonFenceGate => "crimson_fence_gate", + Item::WarpedFenceGate => "warped_fence_gate", + Item::PoweredRail => "powered_rail", + Item::DetectorRail => "detector_rail", + Item::Rail => "rail", + Item::ActivatorRail => "activator_rail", + Item::Saddle => "saddle", + Item::Minecart => "minecart", + Item::ChestMinecart => "chest_minecart", + Item::FurnaceMinecart => "furnace_minecart", + Item::TntMinecart => "tnt_minecart", + Item::HopperMinecart => "hopper_minecart", + Item::CarrotOnAStick => "carrot_on_a_stick", + Item::WarpedFungusOnAStick => "warped_fungus_on_a_stick", + Item::Elytra => "elytra", + Item::OakBoat => "oak_boat", + Item::SpruceBoat => "spruce_boat", + Item::BirchBoat => "birch_boat", + Item::JungleBoat => "jungle_boat", + Item::AcaciaBoat => "acacia_boat", + Item::DarkOakBoat => "dark_oak_boat", Item::StructureBlock => "structure_block", Item::Jigsaw => "jigsaw", Item::TurtleHelmet => "turtle_helmet", @@ -3534,7 +5128,15 @@ impl Item { Item::Coal => "coal", Item::Charcoal => "charcoal", Item::Diamond => "diamond", + Item::Emerald => "emerald", + Item::LapisLazuli => "lapis_lazuli", + Item::Quartz => "quartz", + Item::AmethystShard => "amethyst_shard", + Item::RawIron => "raw_iron", Item::IronIngot => "iron_ingot", + Item::RawCopper => "raw_copper", + Item::CopperIngot => "copper_ingot", + Item::RawGold => "raw_gold", Item::GoldIngot => "gold_ingot", Item::NetheriteIngot => "netherite_ingot", Item::NetheriteScrap => "netherite_scrap", @@ -3618,29 +5220,27 @@ impl Item { Item::Bucket => "bucket", Item::WaterBucket => "water_bucket", Item::LavaBucket => "lava_bucket", - Item::Minecart => "minecart", - Item::Saddle => "saddle", - Item::Redstone => "redstone", + Item::PowderSnowBucket => "powder_snow_bucket", Item::Snowball => "snowball", - Item::OakBoat => "oak_boat", Item::Leather => "leather", Item::MilkBucket => "milk_bucket", Item::PufferfishBucket => "pufferfish_bucket", Item::SalmonBucket => "salmon_bucket", Item::CodBucket => "cod_bucket", Item::TropicalFishBucket => "tropical_fish_bucket", + Item::AxolotlBucket => "axolotl_bucket", Item::Brick => "brick", Item::ClayBall => "clay_ball", Item::DriedKelpBlock => "dried_kelp_block", Item::Paper => "paper", Item::Book => "book", Item::SlimeBall => "slime_ball", - Item::ChestMinecart => "chest_minecart", - Item::FurnaceMinecart => "furnace_minecart", Item::Egg => "egg", Item::Compass => "compass", + Item::Bundle => "bundle", Item::FishingRod => "fishing_rod", Item::Clock => "clock", + Item::Spyglass => "spyglass", Item::GlowstoneDust => "glowstone_dust", Item::Cod => "cod", Item::Salmon => "salmon", @@ -3649,8 +5249,8 @@ impl Item { Item::CookedCod => "cooked_cod", Item::CookedSalmon => "cooked_salmon", Item::InkSac => "ink_sac", + Item::GlowInkSac => "glow_ink_sac", Item::CocoaBeans => "cocoa_beans", - Item::LapisLazuli => "lapis_lazuli", Item::WhiteDye => "white_dye", Item::OrangeDye => "orange_dye", Item::MagentaDye => "magenta_dye", @@ -3714,6 +5314,7 @@ impl Item { Item::Cauldron => "cauldron", Item::EnderEye => "ender_eye", Item::GlisteringMelonSlice => "glistering_melon_slice", + Item::AxolotlSpawnEgg => "axolotl_spawn_egg", Item::BatSpawnEgg => "bat_spawn_egg", Item::BeeSpawnEgg => "bee_spawn_egg", Item::BlazeSpawnEgg => "blaze_spawn_egg", @@ -3732,6 +5333,8 @@ impl Item { Item::EvokerSpawnEgg => "evoker_spawn_egg", Item::FoxSpawnEgg => "fox_spawn_egg", Item::GhastSpawnEgg => "ghast_spawn_egg", + Item::GlowSquidSpawnEgg => "glow_squid_spawn_egg", + Item::GoatSpawnEgg => "goat_spawn_egg", Item::GuardianSpawnEgg => "guardian_spawn_egg", Item::HoglinSpawnEgg => "hoglin_spawn_egg", Item::HorseSpawnEgg => "horse_spawn_egg", @@ -3782,8 +5385,8 @@ impl Item { Item::FireCharge => "fire_charge", Item::WritableBook => "writable_book", Item::WrittenBook => "written_book", - Item::Emerald => "emerald", Item::ItemFrame => "item_frame", + Item::GlowItemFrame => "glow_item_frame", Item::FlowerPot => "flower_pot", Item::Carrot => "carrot", Item::Potato => "potato", @@ -3797,17 +5400,12 @@ impl Item { Item::ZombieHead => "zombie_head", Item::CreeperHead => "creeper_head", Item::DragonHead => "dragon_head", - Item::CarrotOnAStick => "carrot_on_a_stick", - Item::WarpedFungusOnAStick => "warped_fungus_on_a_stick", Item::NetherStar => "nether_star", Item::PumpkinPie => "pumpkin_pie", Item::FireworkRocket => "firework_rocket", Item::FireworkStar => "firework_star", Item::EnchantedBook => "enchanted_book", Item::NetherBrick => "nether_brick", - Item::Quartz => "quartz", - Item::TntMinecart => "tnt_minecart", - Item::HopperMinecart => "hopper_minecart", Item::PrismarineShard => "prismarine_shard", Item::PrismarineCrystals => "prismarine_crystals", Item::Rabbit => "rabbit", @@ -3853,12 +5451,6 @@ impl Item { Item::TippedArrow => "tipped_arrow", Item::LingeringPotion => "lingering_potion", Item::Shield => "shield", - Item::Elytra => "elytra", - Item::SpruceBoat => "spruce_boat", - Item::BirchBoat => "birch_boat", - Item::JungleBoat => "jungle_boat", - Item::AcaciaBoat => "acacia_boat", - Item::DarkOakBoat => "dark_oak_boat", Item::TotemOfUndying => "totem_of_undying", Item::ShulkerShell => "shulker_shell", Item::IronNugget => "iron_nugget", @@ -3876,6 +5468,7 @@ impl Item { Item::MusicDiscWard => "music_disc_ward", Item::MusicDisc11 => "music_disc_11", Item::MusicDiscWait => "music_disc_wait", + Item::MusicDiscOtherside => "music_disc_otherside", Item::MusicDiscPigstep => "music_disc_pigstep", Item::Trident => "trident", Item::PhantomMembrane => "phantom_membrane", @@ -3897,13 +5490,13 @@ impl Item { Item::CartographyTable => "cartography_table", Item::FletchingTable => "fletching_table", Item::Grindstone => "grindstone", - Item::Lectern => "lectern", Item::SmithingTable => "smithing_table", Item::Stonecutter => "stonecutter", Item::Bell => "bell", Item::Lantern => "lantern", Item::SoulLantern => "soul_lantern", Item::SweetBerries => "sweet_berries", + Item::GlowBerries => "glow_berries", Item::Campfire => "campfire", Item::SoulCampfire => "soul_campfire", Item::Shroomlight => "shroomlight", @@ -3911,12 +5504,8 @@ impl Item { Item::BeeNest => "bee_nest", Item::Beehive => "beehive", Item::HoneyBottle => "honey_bottle", - Item::HoneyBlock => "honey_block", Item::HoneycombBlock => "honeycomb_block", Item::Lodestone => "lodestone", - Item::NetheriteBlock => "netherite_block", - Item::AncientDebris => "ancient_debris", - Item::Target => "target", Item::CryingObsidian => "crying_obsidian", Item::Blackstone => "blackstone", Item::BlackstoneSlab => "blackstone_slab", @@ -3931,13 +5520,34 @@ impl Item { Item::PolishedBlackstoneBrickStairs => "polished_blackstone_brick_stairs", Item::CrackedPolishedBlackstoneBricks => "cracked_polished_blackstone_bricks", Item::RespawnAnchor => "respawn_anchor", + Item::Candle => "candle", + Item::WhiteCandle => "white_candle", + Item::OrangeCandle => "orange_candle", + Item::MagentaCandle => "magenta_candle", + Item::LightBlueCandle => "light_blue_candle", + Item::YellowCandle => "yellow_candle", + Item::LimeCandle => "lime_candle", + Item::PinkCandle => "pink_candle", + Item::GrayCandle => "gray_candle", + Item::LightGrayCandle => "light_gray_candle", + Item::CyanCandle => "cyan_candle", + Item::PurpleCandle => "purple_candle", + Item::BlueCandle => "blue_candle", + Item::BrownCandle => "brown_candle", + Item::GreenCandle => "green_candle", + Item::RedCandle => "red_candle", + Item::BlackCandle => "black_candle", + Item::SmallAmethystBud => "small_amethyst_bud", + Item::MediumAmethystBud => "medium_amethyst_bud", + Item::LargeAmethystBud => "large_amethyst_bud", + Item::AmethystCluster => "amethyst_cluster", + Item::PointedDripstone => "pointed_dripstone", } } - - /// Gets a `Item` by its `name`. + #[doc = "Gets a `Item` by its `name`."] + #[inline] pub fn from_name(name: &str) -> Option { match name { - "air" => Some(Item::Air), "stone" => Some(Item::Stone), "granite" => Some(Item::Granite), "polished_granite" => Some(Item::PolishedGranite), @@ -3945,10 +5555,17 @@ impl Item { "polished_diorite" => Some(Item::PolishedDiorite), "andesite" => Some(Item::Andesite), "polished_andesite" => Some(Item::PolishedAndesite), + "deepslate" => Some(Item::Deepslate), + "cobbled_deepslate" => Some(Item::CobbledDeepslate), + "polished_deepslate" => Some(Item::PolishedDeepslate), + "calcite" => Some(Item::Calcite), + "tuff" => Some(Item::Tuff), + "dripstone_block" => Some(Item::DripstoneBlock), "grass_block" => Some(Item::GrassBlock), "dirt" => Some(Item::Dirt), "coarse_dirt" => Some(Item::CoarseDirt), "podzol" => Some(Item::Podzol), + "rooted_dirt" => Some(Item::RootedDirt), "crimson_nylium" => Some(Item::CrimsonNylium), "warped_nylium" => Some(Item::WarpedNylium), "cobblestone" => Some(Item::Cobblestone), @@ -3970,10 +5587,67 @@ impl Item { "sand" => Some(Item::Sand), "red_sand" => Some(Item::RedSand), "gravel" => Some(Item::Gravel), - "gold_ore" => Some(Item::GoldOre), - "iron_ore" => Some(Item::IronOre), "coal_ore" => Some(Item::CoalOre), + "deepslate_coal_ore" => Some(Item::DeepslateCoalOre), + "iron_ore" => Some(Item::IronOre), + "deepslate_iron_ore" => Some(Item::DeepslateIronOre), + "copper_ore" => Some(Item::CopperOre), + "deepslate_copper_ore" => Some(Item::DeepslateCopperOre), + "gold_ore" => Some(Item::GoldOre), + "deepslate_gold_ore" => Some(Item::DeepslateGoldOre), + "redstone_ore" => Some(Item::RedstoneOre), + "deepslate_redstone_ore" => Some(Item::DeepslateRedstoneOre), + "emerald_ore" => Some(Item::EmeraldOre), + "deepslate_emerald_ore" => Some(Item::DeepslateEmeraldOre), + "lapis_ore" => Some(Item::LapisOre), + "deepslate_lapis_ore" => Some(Item::DeepslateLapisOre), + "diamond_ore" => Some(Item::DiamondOre), + "deepslate_diamond_ore" => Some(Item::DeepslateDiamondOre), "nether_gold_ore" => Some(Item::NetherGoldOre), + "nether_quartz_ore" => Some(Item::NetherQuartzOre), + "ancient_debris" => Some(Item::AncientDebris), + "coal_block" => Some(Item::CoalBlock), + "raw_iron_block" => Some(Item::RawIronBlock), + "raw_copper_block" => Some(Item::RawCopperBlock), + "raw_gold_block" => Some(Item::RawGoldBlock), + "amethyst_block" => Some(Item::AmethystBlock), + "budding_amethyst" => Some(Item::BuddingAmethyst), + "iron_block" => Some(Item::IronBlock), + "copper_block" => Some(Item::CopperBlock), + "gold_block" => Some(Item::GoldBlock), + "diamond_block" => Some(Item::DiamondBlock), + "netherite_block" => Some(Item::NetheriteBlock), + "exposed_copper" => Some(Item::ExposedCopper), + "weathered_copper" => Some(Item::WeatheredCopper), + "oxidized_copper" => Some(Item::OxidizedCopper), + "cut_copper" => Some(Item::CutCopper), + "exposed_cut_copper" => Some(Item::ExposedCutCopper), + "weathered_cut_copper" => Some(Item::WeatheredCutCopper), + "oxidized_cut_copper" => Some(Item::OxidizedCutCopper), + "cut_copper_stairs" => Some(Item::CutCopperStairs), + "exposed_cut_copper_stairs" => Some(Item::ExposedCutCopperStairs), + "weathered_cut_copper_stairs" => Some(Item::WeatheredCutCopperStairs), + "oxidized_cut_copper_stairs" => Some(Item::OxidizedCutCopperStairs), + "cut_copper_slab" => Some(Item::CutCopperSlab), + "exposed_cut_copper_slab" => Some(Item::ExposedCutCopperSlab), + "weathered_cut_copper_slab" => Some(Item::WeatheredCutCopperSlab), + "oxidized_cut_copper_slab" => Some(Item::OxidizedCutCopperSlab), + "waxed_copper_block" => Some(Item::WaxedCopperBlock), + "waxed_exposed_copper" => Some(Item::WaxedExposedCopper), + "waxed_weathered_copper" => Some(Item::WaxedWeatheredCopper), + "waxed_oxidized_copper" => Some(Item::WaxedOxidizedCopper), + "waxed_cut_copper" => Some(Item::WaxedCutCopper), + "waxed_exposed_cut_copper" => Some(Item::WaxedExposedCutCopper), + "waxed_weathered_cut_copper" => Some(Item::WaxedWeatheredCutCopper), + "waxed_oxidized_cut_copper" => Some(Item::WaxedOxidizedCutCopper), + "waxed_cut_copper_stairs" => Some(Item::WaxedCutCopperStairs), + "waxed_exposed_cut_copper_stairs" => Some(Item::WaxedExposedCutCopperStairs), + "waxed_weathered_cut_copper_stairs" => Some(Item::WaxedWeatheredCutCopperStairs), + "waxed_oxidized_cut_copper_stairs" => Some(Item::WaxedOxidizedCutCopperStairs), + "waxed_cut_copper_slab" => Some(Item::WaxedCutCopperSlab), + "waxed_exposed_cut_copper_slab" => Some(Item::WaxedExposedCutCopperSlab), + "waxed_weathered_cut_copper_slab" => Some(Item::WaxedWeatheredCutCopperSlab), + "waxed_oxidized_cut_copper_slab" => Some(Item::WaxedOxidizedCutCopperSlab), "oak_log" => Some(Item::OakLog), "spruce_log" => Some(Item::SpruceLog), "birch_log" => Some(Item::BirchLog), @@ -4012,26 +5686,24 @@ impl Item { "jungle_leaves" => Some(Item::JungleLeaves), "acacia_leaves" => Some(Item::AcaciaLeaves), "dark_oak_leaves" => Some(Item::DarkOakLeaves), + "azalea_leaves" => Some(Item::AzaleaLeaves), + "flowering_azalea_leaves" => Some(Item::FloweringAzaleaLeaves), "sponge" => Some(Item::Sponge), "wet_sponge" => Some(Item::WetSponge), "glass" => Some(Item::Glass), - "lapis_ore" => Some(Item::LapisOre), + "tinted_glass" => Some(Item::TintedGlass), "lapis_block" => Some(Item::LapisBlock), - "dispenser" => Some(Item::Dispenser), "sandstone" => Some(Item::Sandstone), "chiseled_sandstone" => Some(Item::ChiseledSandstone), "cut_sandstone" => Some(Item::CutSandstone), - "note_block" => Some(Item::NoteBlock), - "powered_rail" => Some(Item::PoweredRail), - "detector_rail" => Some(Item::DetectorRail), - "sticky_piston" => Some(Item::StickyPiston), "cobweb" => Some(Item::Cobweb), "grass" => Some(Item::Grass), "fern" => Some(Item::Fern), + "azalea" => Some(Item::Azalea), + "flowering_azalea" => Some(Item::FloweringAzalea), "dead_bush" => Some(Item::DeadBush), "seagrass" => Some(Item::Seagrass), "sea_pickle" => Some(Item::SeaPickle), - "piston" => Some(Item::Piston), "white_wool" => Some(Item::WhiteWool), "orange_wool" => Some(Item::OrangeWool), "magenta_wool" => Some(Item::MagentaWool), @@ -4061,6 +5733,7 @@ impl Item { "cornflower" => Some(Item::Cornflower), "lily_of_the_valley" => Some(Item::LilyOfTheValley), "wither_rose" => Some(Item::WitherRose), + "spore_blossom" => Some(Item::SporeBlossom), "brown_mushroom" => Some(Item::BrownMushroom), "red_mushroom" => Some(Item::RedMushroom), "crimson_fungus" => Some(Item::CrimsonFungus), @@ -4072,9 +5745,12 @@ impl Item { "twisting_vines" => Some(Item::TwistingVines), "sugar_cane" => Some(Item::SugarCane), "kelp" => Some(Item::Kelp), + "moss_carpet" => Some(Item::MossCarpet), + "moss_block" => Some(Item::MossBlock), + "hanging_roots" => Some(Item::HangingRoots), + "big_dripleaf" => Some(Item::BigDripleaf), + "small_dripleaf" => Some(Item::SmallDripleaf), "bamboo" => Some(Item::Bamboo), - "gold_block" => Some(Item::GoldBlock), - "iron_block" => Some(Item::IronBlock), "oak_slab" => Some(Item::OakSlab), "spruce_slab" => Some(Item::SpruceSlab), "birch_slab" => Some(Item::BirchSlab), @@ -4104,7 +5780,6 @@ impl Item { "smooth_sandstone" => Some(Item::SmoothSandstone), "smooth_stone" => Some(Item::SmoothStone), "bricks" => Some(Item::Bricks), - "tnt" => Some(Item::Tnt), "bookshelf" => Some(Item::Bookshelf), "mossy_cobblestone" => Some(Item::MossyCobblestone), "obsidian" => Some(Item::Obsidian), @@ -4118,27 +5793,11 @@ impl Item { "spawner" => Some(Item::Spawner), "oak_stairs" => Some(Item::OakStairs), "chest" => Some(Item::Chest), - "diamond_ore" => Some(Item::DiamondOre), - "diamond_block" => Some(Item::DiamondBlock), "crafting_table" => Some(Item::CraftingTable), "farmland" => Some(Item::Farmland), "furnace" => Some(Item::Furnace), "ladder" => Some(Item::Ladder), - "rail" => Some(Item::Rail), "cobblestone_stairs" => Some(Item::CobblestoneStairs), - "lever" => Some(Item::Lever), - "stone_pressure_plate" => Some(Item::StonePressurePlate), - "oak_pressure_plate" => Some(Item::OakPressurePlate), - "spruce_pressure_plate" => Some(Item::SprucePressurePlate), - "birch_pressure_plate" => Some(Item::BirchPressurePlate), - "jungle_pressure_plate" => Some(Item::JunglePressurePlate), - "acacia_pressure_plate" => Some(Item::AcaciaPressurePlate), - "dark_oak_pressure_plate" => Some(Item::DarkOakPressurePlate), - "crimson_pressure_plate" => Some(Item::CrimsonPressurePlate), - "warped_pressure_plate" => Some(Item::WarpedPressurePlate), - "polished_blackstone_pressure_plate" => Some(Item::PolishedBlackstonePressurePlate), - "redstone_ore" => Some(Item::RedstoneOre), - "redstone_torch" => Some(Item::RedstoneTorch), "snow" => Some(Item::Snow), "ice" => Some(Item::Ice), "snow_block" => Some(Item::SnowBlock), @@ -4155,32 +5814,31 @@ impl Item { "warped_fence" => Some(Item::WarpedFence), "pumpkin" => Some(Item::Pumpkin), "carved_pumpkin" => Some(Item::CarvedPumpkin), + "jack_o_lantern" => Some(Item::JackOLantern), "netherrack" => Some(Item::Netherrack), "soul_sand" => Some(Item::SoulSand), "soul_soil" => Some(Item::SoulSoil), "basalt" => Some(Item::Basalt), "polished_basalt" => Some(Item::PolishedBasalt), + "smooth_basalt" => Some(Item::SmoothBasalt), "soul_torch" => Some(Item::SoulTorch), "glowstone" => Some(Item::Glowstone), - "jack_o_lantern" => Some(Item::JackOLantern), - "oak_trapdoor" => Some(Item::OakTrapdoor), - "spruce_trapdoor" => Some(Item::SpruceTrapdoor), - "birch_trapdoor" => Some(Item::BirchTrapdoor), - "jungle_trapdoor" => Some(Item::JungleTrapdoor), - "acacia_trapdoor" => Some(Item::AcaciaTrapdoor), - "dark_oak_trapdoor" => Some(Item::DarkOakTrapdoor), - "crimson_trapdoor" => Some(Item::CrimsonTrapdoor), - "warped_trapdoor" => Some(Item::WarpedTrapdoor), "infested_stone" => Some(Item::InfestedStone), "infested_cobblestone" => Some(Item::InfestedCobblestone), "infested_stone_bricks" => Some(Item::InfestedStoneBricks), "infested_mossy_stone_bricks" => Some(Item::InfestedMossyStoneBricks), "infested_cracked_stone_bricks" => Some(Item::InfestedCrackedStoneBricks), "infested_chiseled_stone_bricks" => Some(Item::InfestedChiseledStoneBricks), + "infested_deepslate" => Some(Item::InfestedDeepslate), "stone_bricks" => Some(Item::StoneBricks), "mossy_stone_bricks" => Some(Item::MossyStoneBricks), "cracked_stone_bricks" => Some(Item::CrackedStoneBricks), "chiseled_stone_bricks" => Some(Item::ChiseledStoneBricks), + "deepslate_bricks" => Some(Item::DeepslateBricks), + "cracked_deepslate_bricks" => Some(Item::CrackedDeepslateBricks), + "deepslate_tiles" => Some(Item::DeepslateTiles), + "cracked_deepslate_tiles" => Some(Item::CrackedDeepslateTiles), + "chiseled_deepslate" => Some(Item::ChiseledDeepslate), "brown_mushroom_block" => Some(Item::BrownMushroomBlock), "red_mushroom_block" => Some(Item::RedMushroomBlock), "mushroom_stem" => Some(Item::MushroomStem), @@ -4189,14 +5847,7 @@ impl Item { "glass_pane" => Some(Item::GlassPane), "melon" => Some(Item::Melon), "vine" => Some(Item::Vine), - "oak_fence_gate" => Some(Item::OakFenceGate), - "spruce_fence_gate" => Some(Item::SpruceFenceGate), - "birch_fence_gate" => Some(Item::BirchFenceGate), - "jungle_fence_gate" => Some(Item::JungleFenceGate), - "acacia_fence_gate" => Some(Item::AcaciaFenceGate), - "dark_oak_fence_gate" => Some(Item::DarkOakFenceGate), - "crimson_fence_gate" => Some(Item::CrimsonFenceGate), - "warped_fence_gate" => Some(Item::WarpedFenceGate), + "glow_lichen" => Some(Item::GlowLichen), "brick_stairs" => Some(Item::BrickStairs), "stone_brick_stairs" => Some(Item::StoneBrickStairs), "mycelium" => Some(Item::Mycelium), @@ -4211,11 +5862,8 @@ impl Item { "end_stone" => Some(Item::EndStone), "end_stone_bricks" => Some(Item::EndStoneBricks), "dragon_egg" => Some(Item::DragonEgg), - "redstone_lamp" => Some(Item::RedstoneLamp), "sandstone_stairs" => Some(Item::SandstoneStairs), - "emerald_ore" => Some(Item::EmeraldOre), "ender_chest" => Some(Item::EnderChest), - "tripwire_hook" => Some(Item::TripwireHook), "emerald_block" => Some(Item::EmeraldBlock), "spruce_stairs" => Some(Item::SpruceStairs), "birch_stairs" => Some(Item::BirchStairs), @@ -4241,33 +5889,18 @@ impl Item { "blackstone_wall" => Some(Item::BlackstoneWall), "polished_blackstone_wall" => Some(Item::PolishedBlackstoneWall), "polished_blackstone_brick_wall" => Some(Item::PolishedBlackstoneBrickWall), - "stone_button" => Some(Item::StoneButton), - "oak_button" => Some(Item::OakButton), - "spruce_button" => Some(Item::SpruceButton), - "birch_button" => Some(Item::BirchButton), - "jungle_button" => Some(Item::JungleButton), - "acacia_button" => Some(Item::AcaciaButton), - "dark_oak_button" => Some(Item::DarkOakButton), - "crimson_button" => Some(Item::CrimsonButton), - "warped_button" => Some(Item::WarpedButton), - "polished_blackstone_button" => Some(Item::PolishedBlackstoneButton), + "cobbled_deepslate_wall" => Some(Item::CobbledDeepslateWall), + "polished_deepslate_wall" => Some(Item::PolishedDeepslateWall), + "deepslate_brick_wall" => Some(Item::DeepslateBrickWall), + "deepslate_tile_wall" => Some(Item::DeepslateTileWall), "anvil" => Some(Item::Anvil), "chipped_anvil" => Some(Item::ChippedAnvil), "damaged_anvil" => Some(Item::DamagedAnvil), - "trapped_chest" => Some(Item::TrappedChest), - "light_weighted_pressure_plate" => Some(Item::LightWeightedPressurePlate), - "heavy_weighted_pressure_plate" => Some(Item::HeavyWeightedPressurePlate), - "daylight_detector" => Some(Item::DaylightDetector), - "redstone_block" => Some(Item::RedstoneBlock), - "nether_quartz_ore" => Some(Item::NetherQuartzOre), - "hopper" => Some(Item::Hopper), "chiseled_quartz_block" => Some(Item::ChiseledQuartzBlock), "quartz_block" => Some(Item::QuartzBlock), "quartz_bricks" => Some(Item::QuartzBricks), "quartz_pillar" => Some(Item::QuartzPillar), "quartz_stairs" => Some(Item::QuartzStairs), - "activator_rail" => Some(Item::ActivatorRail), - "dropper" => Some(Item::Dropper), "white_terracotta" => Some(Item::WhiteTerracotta), "orange_terracotta" => Some(Item::OrangeTerracotta), "magenta_terracotta" => Some(Item::MagentaTerracotta), @@ -4285,7 +5918,7 @@ impl Item { "red_terracotta" => Some(Item::RedTerracotta), "black_terracotta" => Some(Item::BlackTerracotta), "barrier" => Some(Item::Barrier), - "iron_trapdoor" => Some(Item::IronTrapdoor), + "light" => Some(Item::Light), "hay_block" => Some(Item::HayBlock), "white_carpet" => Some(Item::WhiteCarpet), "orange_carpet" => Some(Item::OrangeCarpet), @@ -4304,12 +5937,10 @@ impl Item { "red_carpet" => Some(Item::RedCarpet), "black_carpet" => Some(Item::BlackCarpet), "terracotta" => Some(Item::Terracotta), - "coal_block" => Some(Item::CoalBlock), "packed_ice" => Some(Item::PackedIce), "acacia_stairs" => Some(Item::AcaciaStairs), "dark_oak_stairs" => Some(Item::DarkOakStairs), - "slime_block" => Some(Item::SlimeBlock), - "grass_path" => Some(Item::GrassPath), + "dirt_path" => Some(Item::DirtPath), "sunflower" => Some(Item::Sunflower), "lilac" => Some(Item::Lilac), "rose_bush" => Some(Item::RoseBush), @@ -4367,7 +5998,6 @@ impl Item { "red_nether_bricks" => Some(Item::RedNetherBricks), "bone_block" => Some(Item::BoneBlock), "structure_void" => Some(Item::StructureVoid), - "observer" => Some(Item::Observer), "shulker_box" => Some(Item::ShulkerBox), "white_shulker_box" => Some(Item::WhiteShulkerBox), "orange_shulker_box" => Some(Item::OrangeShulkerBox), @@ -4480,6 +6110,10 @@ impl Item { "red_nether_brick_stairs" => Some(Item::RedNetherBrickStairs), "polished_andesite_stairs" => Some(Item::PolishedAndesiteStairs), "diorite_stairs" => Some(Item::DioriteStairs), + "cobbled_deepslate_stairs" => Some(Item::CobbledDeepslateStairs), + "polished_deepslate_stairs" => Some(Item::PolishedDeepslateStairs), + "deepslate_brick_stairs" => Some(Item::DeepslateBrickStairs), + "deepslate_tile_stairs" => Some(Item::DeepslateTileStairs), "polished_granite_slab" => Some(Item::PolishedGraniteSlab), "smooth_red_sandstone_slab" => Some(Item::SmoothRedSandstoneSlab), "mossy_stone_brick_slab" => Some(Item::MossyStoneBrickSlab), @@ -4493,7 +6127,57 @@ impl Item { "red_nether_brick_slab" => Some(Item::RedNetherBrickSlab), "polished_andesite_slab" => Some(Item::PolishedAndesiteSlab), "diorite_slab" => Some(Item::DioriteSlab), + "cobbled_deepslate_slab" => Some(Item::CobbledDeepslateSlab), + "polished_deepslate_slab" => Some(Item::PolishedDeepslateSlab), + "deepslate_brick_slab" => Some(Item::DeepslateBrickSlab), + "deepslate_tile_slab" => Some(Item::DeepslateTileSlab), "scaffolding" => Some(Item::Scaffolding), + "redstone" => Some(Item::Redstone), + "redstone_torch" => Some(Item::RedstoneTorch), + "redstone_block" => Some(Item::RedstoneBlock), + "repeater" => Some(Item::Repeater), + "comparator" => Some(Item::Comparator), + "piston" => Some(Item::Piston), + "sticky_piston" => Some(Item::StickyPiston), + "slime_block" => Some(Item::SlimeBlock), + "honey_block" => Some(Item::HoneyBlock), + "observer" => Some(Item::Observer), + "hopper" => Some(Item::Hopper), + "dispenser" => Some(Item::Dispenser), + "dropper" => Some(Item::Dropper), + "lectern" => Some(Item::Lectern), + "target" => Some(Item::Target), + "lever" => Some(Item::Lever), + "lightning_rod" => Some(Item::LightningRod), + "daylight_detector" => Some(Item::DaylightDetector), + "sculk_sensor" => Some(Item::SculkSensor), + "tripwire_hook" => Some(Item::TripwireHook), + "trapped_chest" => Some(Item::TrappedChest), + "tnt" => Some(Item::Tnt), + "redstone_lamp" => Some(Item::RedstoneLamp), + "note_block" => Some(Item::NoteBlock), + "stone_button" => Some(Item::StoneButton), + "polished_blackstone_button" => Some(Item::PolishedBlackstoneButton), + "oak_button" => Some(Item::OakButton), + "spruce_button" => Some(Item::SpruceButton), + "birch_button" => Some(Item::BirchButton), + "jungle_button" => Some(Item::JungleButton), + "acacia_button" => Some(Item::AcaciaButton), + "dark_oak_button" => Some(Item::DarkOakButton), + "crimson_button" => Some(Item::CrimsonButton), + "warped_button" => Some(Item::WarpedButton), + "stone_pressure_plate" => Some(Item::StonePressurePlate), + "polished_blackstone_pressure_plate" => Some(Item::PolishedBlackstonePressurePlate), + "light_weighted_pressure_plate" => Some(Item::LightWeightedPressurePlate), + "heavy_weighted_pressure_plate" => Some(Item::HeavyWeightedPressurePlate), + "oak_pressure_plate" => Some(Item::OakPressurePlate), + "spruce_pressure_plate" => Some(Item::SprucePressurePlate), + "birch_pressure_plate" => Some(Item::BirchPressurePlate), + "jungle_pressure_plate" => Some(Item::JunglePressurePlate), + "acacia_pressure_plate" => Some(Item::AcaciaPressurePlate), + "dark_oak_pressure_plate" => Some(Item::DarkOakPressurePlate), + "crimson_pressure_plate" => Some(Item::CrimsonPressurePlate), + "warped_pressure_plate" => Some(Item::WarpedPressurePlate), "iron_door" => Some(Item::IronDoor), "oak_door" => Some(Item::OakDoor), "spruce_door" => Some(Item::SpruceDoor), @@ -4503,8 +6187,42 @@ impl Item { "dark_oak_door" => Some(Item::DarkOakDoor), "crimson_door" => Some(Item::CrimsonDoor), "warped_door" => Some(Item::WarpedDoor), - "repeater" => Some(Item::Repeater), - "comparator" => Some(Item::Comparator), + "iron_trapdoor" => Some(Item::IronTrapdoor), + "oak_trapdoor" => Some(Item::OakTrapdoor), + "spruce_trapdoor" => Some(Item::SpruceTrapdoor), + "birch_trapdoor" => Some(Item::BirchTrapdoor), + "jungle_trapdoor" => Some(Item::JungleTrapdoor), + "acacia_trapdoor" => Some(Item::AcaciaTrapdoor), + "dark_oak_trapdoor" => Some(Item::DarkOakTrapdoor), + "crimson_trapdoor" => Some(Item::CrimsonTrapdoor), + "warped_trapdoor" => Some(Item::WarpedTrapdoor), + "oak_fence_gate" => Some(Item::OakFenceGate), + "spruce_fence_gate" => Some(Item::SpruceFenceGate), + "birch_fence_gate" => Some(Item::BirchFenceGate), + "jungle_fence_gate" => Some(Item::JungleFenceGate), + "acacia_fence_gate" => Some(Item::AcaciaFenceGate), + "dark_oak_fence_gate" => Some(Item::DarkOakFenceGate), + "crimson_fence_gate" => Some(Item::CrimsonFenceGate), + "warped_fence_gate" => Some(Item::WarpedFenceGate), + "powered_rail" => Some(Item::PoweredRail), + "detector_rail" => Some(Item::DetectorRail), + "rail" => Some(Item::Rail), + "activator_rail" => Some(Item::ActivatorRail), + "saddle" => Some(Item::Saddle), + "minecart" => Some(Item::Minecart), + "chest_minecart" => Some(Item::ChestMinecart), + "furnace_minecart" => Some(Item::FurnaceMinecart), + "tnt_minecart" => Some(Item::TntMinecart), + "hopper_minecart" => Some(Item::HopperMinecart), + "carrot_on_a_stick" => Some(Item::CarrotOnAStick), + "warped_fungus_on_a_stick" => Some(Item::WarpedFungusOnAStick), + "elytra" => Some(Item::Elytra), + "oak_boat" => Some(Item::OakBoat), + "spruce_boat" => Some(Item::SpruceBoat), + "birch_boat" => Some(Item::BirchBoat), + "jungle_boat" => Some(Item::JungleBoat), + "acacia_boat" => Some(Item::AcaciaBoat), + "dark_oak_boat" => Some(Item::DarkOakBoat), "structure_block" => Some(Item::StructureBlock), "jigsaw" => Some(Item::Jigsaw), "turtle_helmet" => Some(Item::TurtleHelmet), @@ -4516,7 +6234,15 @@ impl Item { "coal" => Some(Item::Coal), "charcoal" => Some(Item::Charcoal), "diamond" => Some(Item::Diamond), + "emerald" => Some(Item::Emerald), + "lapis_lazuli" => Some(Item::LapisLazuli), + "quartz" => Some(Item::Quartz), + "amethyst_shard" => Some(Item::AmethystShard), + "raw_iron" => Some(Item::RawIron), "iron_ingot" => Some(Item::IronIngot), + "raw_copper" => Some(Item::RawCopper), + "copper_ingot" => Some(Item::CopperIngot), + "raw_gold" => Some(Item::RawGold), "gold_ingot" => Some(Item::GoldIngot), "netherite_ingot" => Some(Item::NetheriteIngot), "netherite_scrap" => Some(Item::NetheriteScrap), @@ -4600,29 +6326,27 @@ impl Item { "bucket" => Some(Item::Bucket), "water_bucket" => Some(Item::WaterBucket), "lava_bucket" => Some(Item::LavaBucket), - "minecart" => Some(Item::Minecart), - "saddle" => Some(Item::Saddle), - "redstone" => Some(Item::Redstone), + "powder_snow_bucket" => Some(Item::PowderSnowBucket), "snowball" => Some(Item::Snowball), - "oak_boat" => Some(Item::OakBoat), "leather" => Some(Item::Leather), "milk_bucket" => Some(Item::MilkBucket), "pufferfish_bucket" => Some(Item::PufferfishBucket), "salmon_bucket" => Some(Item::SalmonBucket), "cod_bucket" => Some(Item::CodBucket), "tropical_fish_bucket" => Some(Item::TropicalFishBucket), + "axolotl_bucket" => Some(Item::AxolotlBucket), "brick" => Some(Item::Brick), "clay_ball" => Some(Item::ClayBall), "dried_kelp_block" => Some(Item::DriedKelpBlock), "paper" => Some(Item::Paper), "book" => Some(Item::Book), "slime_ball" => Some(Item::SlimeBall), - "chest_minecart" => Some(Item::ChestMinecart), - "furnace_minecart" => Some(Item::FurnaceMinecart), "egg" => Some(Item::Egg), "compass" => Some(Item::Compass), + "bundle" => Some(Item::Bundle), "fishing_rod" => Some(Item::FishingRod), "clock" => Some(Item::Clock), + "spyglass" => Some(Item::Spyglass), "glowstone_dust" => Some(Item::GlowstoneDust), "cod" => Some(Item::Cod), "salmon" => Some(Item::Salmon), @@ -4631,8 +6355,8 @@ impl Item { "cooked_cod" => Some(Item::CookedCod), "cooked_salmon" => Some(Item::CookedSalmon), "ink_sac" => Some(Item::InkSac), + "glow_ink_sac" => Some(Item::GlowInkSac), "cocoa_beans" => Some(Item::CocoaBeans), - "lapis_lazuli" => Some(Item::LapisLazuli), "white_dye" => Some(Item::WhiteDye), "orange_dye" => Some(Item::OrangeDye), "magenta_dye" => Some(Item::MagentaDye), @@ -4696,6 +6420,7 @@ impl Item { "cauldron" => Some(Item::Cauldron), "ender_eye" => Some(Item::EnderEye), "glistering_melon_slice" => Some(Item::GlisteringMelonSlice), + "axolotl_spawn_egg" => Some(Item::AxolotlSpawnEgg), "bat_spawn_egg" => Some(Item::BatSpawnEgg), "bee_spawn_egg" => Some(Item::BeeSpawnEgg), "blaze_spawn_egg" => Some(Item::BlazeSpawnEgg), @@ -4714,6 +6439,8 @@ impl Item { "evoker_spawn_egg" => Some(Item::EvokerSpawnEgg), "fox_spawn_egg" => Some(Item::FoxSpawnEgg), "ghast_spawn_egg" => Some(Item::GhastSpawnEgg), + "glow_squid_spawn_egg" => Some(Item::GlowSquidSpawnEgg), + "goat_spawn_egg" => Some(Item::GoatSpawnEgg), "guardian_spawn_egg" => Some(Item::GuardianSpawnEgg), "hoglin_spawn_egg" => Some(Item::HoglinSpawnEgg), "horse_spawn_egg" => Some(Item::HorseSpawnEgg), @@ -4764,8 +6491,8 @@ impl Item { "fire_charge" => Some(Item::FireCharge), "writable_book" => Some(Item::WritableBook), "written_book" => Some(Item::WrittenBook), - "emerald" => Some(Item::Emerald), "item_frame" => Some(Item::ItemFrame), + "glow_item_frame" => Some(Item::GlowItemFrame), "flower_pot" => Some(Item::FlowerPot), "carrot" => Some(Item::Carrot), "potato" => Some(Item::Potato), @@ -4779,17 +6506,12 @@ impl Item { "zombie_head" => Some(Item::ZombieHead), "creeper_head" => Some(Item::CreeperHead), "dragon_head" => Some(Item::DragonHead), - "carrot_on_a_stick" => Some(Item::CarrotOnAStick), - "warped_fungus_on_a_stick" => Some(Item::WarpedFungusOnAStick), "nether_star" => Some(Item::NetherStar), "pumpkin_pie" => Some(Item::PumpkinPie), "firework_rocket" => Some(Item::FireworkRocket), "firework_star" => Some(Item::FireworkStar), "enchanted_book" => Some(Item::EnchantedBook), "nether_brick" => Some(Item::NetherBrick), - "quartz" => Some(Item::Quartz), - "tnt_minecart" => Some(Item::TntMinecart), - "hopper_minecart" => Some(Item::HopperMinecart), "prismarine_shard" => Some(Item::PrismarineShard), "prismarine_crystals" => Some(Item::PrismarineCrystals), "rabbit" => Some(Item::Rabbit), @@ -4835,12 +6557,6 @@ impl Item { "tipped_arrow" => Some(Item::TippedArrow), "lingering_potion" => Some(Item::LingeringPotion), "shield" => Some(Item::Shield), - "elytra" => Some(Item::Elytra), - "spruce_boat" => Some(Item::SpruceBoat), - "birch_boat" => Some(Item::BirchBoat), - "jungle_boat" => Some(Item::JungleBoat), - "acacia_boat" => Some(Item::AcaciaBoat), - "dark_oak_boat" => Some(Item::DarkOakBoat), "totem_of_undying" => Some(Item::TotemOfUndying), "shulker_shell" => Some(Item::ShulkerShell), "iron_nugget" => Some(Item::IronNugget), @@ -4858,6 +6574,7 @@ impl Item { "music_disc_ward" => Some(Item::MusicDiscWard), "music_disc_11" => Some(Item::MusicDisc11), "music_disc_wait" => Some(Item::MusicDiscWait), + "music_disc_otherside" => Some(Item::MusicDiscOtherside), "music_disc_pigstep" => Some(Item::MusicDiscPigstep), "trident" => Some(Item::Trident), "phantom_membrane" => Some(Item::PhantomMembrane), @@ -4879,13 +6596,13 @@ impl Item { "cartography_table" => Some(Item::CartographyTable), "fletching_table" => Some(Item::FletchingTable), "grindstone" => Some(Item::Grindstone), - "lectern" => Some(Item::Lectern), "smithing_table" => Some(Item::SmithingTable), "stonecutter" => Some(Item::Stonecutter), "bell" => Some(Item::Bell), "lantern" => Some(Item::Lantern), "soul_lantern" => Some(Item::SoulLantern), "sweet_berries" => Some(Item::SweetBerries), + "glow_berries" => Some(Item::GlowBerries), "campfire" => Some(Item::Campfire), "soul_campfire" => Some(Item::SoulCampfire), "shroomlight" => Some(Item::Shroomlight), @@ -4893,12 +6610,8 @@ impl Item { "bee_nest" => Some(Item::BeeNest), "beehive" => Some(Item::Beehive), "honey_bottle" => Some(Item::HoneyBottle), - "honey_block" => Some(Item::HoneyBlock), "honeycomb_block" => Some(Item::HoneycombBlock), "lodestone" => Some(Item::Lodestone), - "netherite_block" => Some(Item::NetheriteBlock), - "ancient_debris" => Some(Item::AncientDebris), - "target" => Some(Item::Target), "crying_obsidian" => Some(Item::CryingObsidian), "blackstone" => Some(Item::Blackstone), "blackstone_slab" => Some(Item::BlackstoneSlab), @@ -4913,1987 +6626,3370 @@ impl Item { "polished_blackstone_brick_stairs" => Some(Item::PolishedBlackstoneBrickStairs), "cracked_polished_blackstone_bricks" => Some(Item::CrackedPolishedBlackstoneBricks), "respawn_anchor" => Some(Item::RespawnAnchor), + "candle" => Some(Item::Candle), + "white_candle" => Some(Item::WhiteCandle), + "orange_candle" => Some(Item::OrangeCandle), + "magenta_candle" => Some(Item::MagentaCandle), + "light_blue_candle" => Some(Item::LightBlueCandle), + "yellow_candle" => Some(Item::YellowCandle), + "lime_candle" => Some(Item::LimeCandle), + "pink_candle" => Some(Item::PinkCandle), + "gray_candle" => Some(Item::GrayCandle), + "light_gray_candle" => Some(Item::LightGrayCandle), + "cyan_candle" => Some(Item::CyanCandle), + "purple_candle" => Some(Item::PurpleCandle), + "blue_candle" => Some(Item::BlueCandle), + "brown_candle" => Some(Item::BrownCandle), + "green_candle" => Some(Item::GreenCandle), + "red_candle" => Some(Item::RedCandle), + "black_candle" => Some(Item::BlackCandle), + "small_amethyst_bud" => Some(Item::SmallAmethystBud), + "medium_amethyst_bud" => Some(Item::MediumAmethystBud), + "large_amethyst_bud" => Some(Item::LargeAmethystBud), + "amethyst_cluster" => Some(Item::AmethystCluster), + "pointed_dripstone" => Some(Item::PointedDripstone), _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl Item { - /// Returns the `display_name` property of this `Item`. - pub fn display_name(&self) -> &'static str { + #[doc = "Returns the `namespaced_id` property of this `Item`."] + #[inline] + pub fn namespaced_id(&self) -> &'static str { match self { - Item::Air => "Air", - Item::Stone => "Stone", - Item::Granite => "Granite", - Item::PolishedGranite => "Polished Granite", - Item::Diorite => "Diorite", - Item::PolishedDiorite => "Polished Diorite", - Item::Andesite => "Andesite", - Item::PolishedAndesite => "Polished Andesite", - Item::GrassBlock => "Grass Block", - Item::Dirt => "Dirt", - Item::CoarseDirt => "Coarse Dirt", - Item::Podzol => "Podzol", - Item::CrimsonNylium => "Crimson Nylium", - Item::WarpedNylium => "Warped Nylium", - Item::Cobblestone => "Cobblestone", - Item::OakPlanks => "Oak Planks", - Item::SprucePlanks => "Spruce Planks", - Item::BirchPlanks => "Birch Planks", - Item::JunglePlanks => "Jungle Planks", - Item::AcaciaPlanks => "Acacia Planks", - Item::DarkOakPlanks => "Dark Oak Planks", - Item::CrimsonPlanks => "Crimson Planks", - Item::WarpedPlanks => "Warped Planks", - Item::OakSapling => "Oak Sapling", - Item::SpruceSapling => "Spruce Sapling", - Item::BirchSapling => "Birch Sapling", - Item::JungleSapling => "Jungle Sapling", - Item::AcaciaSapling => "Acacia Sapling", - Item::DarkOakSapling => "Dark Oak Sapling", - Item::Bedrock => "Bedrock", - Item::Sand => "Sand", - Item::RedSand => "Red Sand", - Item::Gravel => "Gravel", - Item::GoldOre => "Gold Ore", - Item::IronOre => "Iron Ore", - Item::CoalOre => "Coal Ore", - Item::NetherGoldOre => "Nether Gold Ore", - Item::OakLog => "Oak Log", - Item::SpruceLog => "Spruce Log", - Item::BirchLog => "Birch Log", - Item::JungleLog => "Jungle Log", - Item::AcaciaLog => "Acacia Log", - Item::DarkOakLog => "Dark Oak Log", - Item::CrimsonStem => "Crimson Stem", - Item::WarpedStem => "Warped Stem", - Item::StrippedOakLog => "Stripped Oak Log", - Item::StrippedSpruceLog => "Stripped Spruce Log", - Item::StrippedBirchLog => "Stripped Birch Log", - Item::StrippedJungleLog => "Stripped Jungle Log", - Item::StrippedAcaciaLog => "Stripped Acacia Log", - Item::StrippedDarkOakLog => "Stripped Dark Oak Log", - Item::StrippedCrimsonStem => "Stripped Crimson Stem", - Item::StrippedWarpedStem => "Stripped Warped Stem", - Item::StrippedOakWood => "Stripped Oak Wood", - Item::StrippedSpruceWood => "Stripped Spruce Wood", - Item::StrippedBirchWood => "Stripped Birch Wood", - Item::StrippedJungleWood => "Stripped Jungle Wood", - Item::StrippedAcaciaWood => "Stripped Acacia Wood", - Item::StrippedDarkOakWood => "Stripped Dark Oak Wood", - Item::StrippedCrimsonHyphae => "Stripped Crimson Hyphae", - Item::StrippedWarpedHyphae => "Stripped Warped Hyphae", - Item::OakWood => "Oak Wood", - Item::SpruceWood => "Spruce Wood", - Item::BirchWood => "Birch Wood", - Item::JungleWood => "Jungle Wood", - Item::AcaciaWood => "Acacia Wood", - Item::DarkOakWood => "Dark Oak Wood", - Item::CrimsonHyphae => "Crimson Hyphae", - Item::WarpedHyphae => "Warped Hyphae", - Item::OakLeaves => "Oak Leaves", - Item::SpruceLeaves => "Spruce Leaves", - Item::BirchLeaves => "Birch Leaves", - Item::JungleLeaves => "Jungle Leaves", - Item::AcaciaLeaves => "Acacia Leaves", - Item::DarkOakLeaves => "Dark Oak Leaves", - Item::Sponge => "Sponge", - Item::WetSponge => "Wet Sponge", - Item::Glass => "Glass", - Item::LapisOre => "Lapis Lazuli Ore", - Item::LapisBlock => "Lapis Lazuli Block", - Item::Dispenser => "Dispenser", - Item::Sandstone => "Sandstone", - Item::ChiseledSandstone => "Chiseled Sandstone", - Item::CutSandstone => "Cut Sandstone", - Item::NoteBlock => "Note Block", - Item::PoweredRail => "Powered Rail", - Item::DetectorRail => "Detector Rail", - Item::StickyPiston => "Sticky Piston", - Item::Cobweb => "Cobweb", - Item::Grass => "Grass", - Item::Fern => "Fern", - Item::DeadBush => "Dead Bush", - Item::Seagrass => "Seagrass", - Item::SeaPickle => "Sea Pickle", - Item::Piston => "Piston", - Item::WhiteWool => "White Wool", - Item::OrangeWool => "Orange Wool", - Item::MagentaWool => "Magenta Wool", - Item::LightBlueWool => "Light Blue Wool", - Item::YellowWool => "Yellow Wool", - Item::LimeWool => "Lime Wool", - Item::PinkWool => "Pink Wool", - Item::GrayWool => "Gray Wool", - Item::LightGrayWool => "Light Gray Wool", - Item::CyanWool => "Cyan Wool", - Item::PurpleWool => "Purple Wool", - Item::BlueWool => "Blue Wool", - Item::BrownWool => "Brown Wool", - Item::GreenWool => "Green Wool", - Item::RedWool => "Red Wool", - Item::BlackWool => "Black Wool", - Item::Dandelion => "Dandelion", - Item::Poppy => "Poppy", - Item::BlueOrchid => "Blue Orchid", - Item::Allium => "Allium", - Item::AzureBluet => "Azure Bluet", - Item::RedTulip => "Red Tulip", - Item::OrangeTulip => "Orange Tulip", - Item::WhiteTulip => "White Tulip", - Item::PinkTulip => "Pink Tulip", - Item::OxeyeDaisy => "Oxeye Daisy", - Item::Cornflower => "Cornflower", - Item::LilyOfTheValley => "Lily of the Valley", - Item::WitherRose => "Wither Rose", - Item::BrownMushroom => "Brown Mushroom", - Item::RedMushroom => "Red Mushroom", - Item::CrimsonFungus => "Crimson Fungus", - Item::WarpedFungus => "Warped Fungus", - Item::CrimsonRoots => "Crimson Roots", - Item::WarpedRoots => "Warped Roots", - Item::NetherSprouts => "Nether Sprouts", - Item::WeepingVines => "Weeping Vines", - Item::TwistingVines => "Twisting Vines", - Item::SugarCane => "Sugar Cane", - Item::Kelp => "Kelp", - Item::Bamboo => "Bamboo", - Item::GoldBlock => "Block of Gold", - Item::IronBlock => "Block of Iron", - Item::OakSlab => "Oak Slab", - Item::SpruceSlab => "Spruce Slab", - Item::BirchSlab => "Birch Slab", - Item::JungleSlab => "Jungle Slab", - Item::AcaciaSlab => "Acacia Slab", - Item::DarkOakSlab => "Dark Oak Slab", - Item::CrimsonSlab => "Crimson Slab", - Item::WarpedSlab => "Warped Slab", - Item::StoneSlab => "Stone Slab", - Item::SmoothStoneSlab => "Smooth Stone Slab", - Item::SandstoneSlab => "Sandstone Slab", - Item::CutSandstoneSlab => "Cut Sandstone Slab", - Item::PetrifiedOakSlab => "Petrified Oak Slab", - Item::CobblestoneSlab => "Cobblestone Slab", - Item::BrickSlab => "Brick Slab", - Item::StoneBrickSlab => "Stone Brick Slab", - Item::NetherBrickSlab => "Nether Brick Slab", - Item::QuartzSlab => "Quartz Slab", - Item::RedSandstoneSlab => "Red Sandstone Slab", - Item::CutRedSandstoneSlab => "Cut Red Sandstone Slab", - Item::PurpurSlab => "Purpur Slab", - Item::PrismarineSlab => "Prismarine Slab", - Item::PrismarineBrickSlab => "Prismarine Brick Slab", - Item::DarkPrismarineSlab => "Dark Prismarine Slab", - Item::SmoothQuartz => "Smooth Quartz Block", - Item::SmoothRedSandstone => "Smooth Red Sandstone", - Item::SmoothSandstone => "Smooth Sandstone", - Item::SmoothStone => "Smooth Stone", - Item::Bricks => "Bricks", - Item::Tnt => "TNT", - Item::Bookshelf => "Bookshelf", - Item::MossyCobblestone => "Mossy Cobblestone", - Item::Obsidian => "Obsidian", - Item::Torch => "Torch", - Item::EndRod => "End Rod", - Item::ChorusPlant => "Chorus Plant", - Item::ChorusFlower => "Chorus Flower", - Item::PurpurBlock => "Purpur Block", - Item::PurpurPillar => "Purpur Pillar", - Item::PurpurStairs => "Purpur Stairs", - Item::Spawner => "Spawner", - Item::OakStairs => "Oak Stairs", - Item::Chest => "Chest", - Item::DiamondOre => "Diamond Ore", - Item::DiamondBlock => "Block of Diamond", - Item::CraftingTable => "Crafting Table", - Item::Farmland => "Farmland", - Item::Furnace => "Furnace", - Item::Ladder => "Ladder", - Item::Rail => "Rail", - Item::CobblestoneStairs => "Cobblestone Stairs", - Item::Lever => "Lever", - Item::StonePressurePlate => "Stone Pressure Plate", - Item::OakPressurePlate => "Oak Pressure Plate", - Item::SprucePressurePlate => "Spruce Pressure Plate", - Item::BirchPressurePlate => "Birch Pressure Plate", - Item::JunglePressurePlate => "Jungle Pressure Plate", - Item::AcaciaPressurePlate => "Acacia Pressure Plate", - Item::DarkOakPressurePlate => "Dark Oak Pressure Plate", - Item::CrimsonPressurePlate => "Crimson Pressure Plate", - Item::WarpedPressurePlate => "Warped Pressure Plate", - Item::PolishedBlackstonePressurePlate => "Polished Blackstone Pressure Plate", - Item::RedstoneOre => "Redstone Ore", - Item::RedstoneTorch => "Redstone Torch", - Item::Snow => "Snow", - Item::Ice => "Ice", - Item::SnowBlock => "Snow Block", - Item::Cactus => "Cactus", - Item::Clay => "Clay", - Item::Jukebox => "Jukebox", - Item::OakFence => "Oak Fence", - Item::SpruceFence => "Spruce Fence", - Item::BirchFence => "Birch Fence", - Item::JungleFence => "Jungle Fence", - Item::AcaciaFence => "Acacia Fence", - Item::DarkOakFence => "Dark Oak Fence", - Item::CrimsonFence => "Crimson Fence", - Item::WarpedFence => "Warped Fence", - Item::Pumpkin => "Pumpkin", - Item::CarvedPumpkin => "Carved Pumpkin", - Item::Netherrack => "Netherrack", - Item::SoulSand => "Soul Sand", - Item::SoulSoil => "Soul Soil", - Item::Basalt => "Basalt", - Item::PolishedBasalt => "Polished Basalt", - Item::SoulTorch => "Soul Torch", - Item::Glowstone => "Glowstone", - Item::JackOLantern => "Jack o'Lantern", - Item::OakTrapdoor => "Oak Trapdoor", - Item::SpruceTrapdoor => "Spruce Trapdoor", - Item::BirchTrapdoor => "Birch Trapdoor", - Item::JungleTrapdoor => "Jungle Trapdoor", - Item::AcaciaTrapdoor => "Acacia Trapdoor", - Item::DarkOakTrapdoor => "Dark Oak Trapdoor", - Item::CrimsonTrapdoor => "Crimson Trapdoor", - Item::WarpedTrapdoor => "Warped Trapdoor", - Item::InfestedStone => "Infested Stone", - Item::InfestedCobblestone => "Infested Cobblestone", - Item::InfestedStoneBricks => "Infested Stone Bricks", - Item::InfestedMossyStoneBricks => "Infested Mossy Stone Bricks", - Item::InfestedCrackedStoneBricks => "Infested Cracked Stone Bricks", - Item::InfestedChiseledStoneBricks => "Infested Chiseled Stone Bricks", - Item::StoneBricks => "Stone Bricks", - Item::MossyStoneBricks => "Mossy Stone Bricks", - Item::CrackedStoneBricks => "Cracked Stone Bricks", - Item::ChiseledStoneBricks => "Chiseled Stone Bricks", - Item::BrownMushroomBlock => "Brown Mushroom Block", - Item::RedMushroomBlock => "Red Mushroom Block", - Item::MushroomStem => "Mushroom Stem", - Item::IronBars => "Iron Bars", - Item::Chain => "Chain", - Item::GlassPane => "Glass Pane", - Item::Melon => "Melon", - Item::Vine => "Vines", - Item::OakFenceGate => "Oak Fence Gate", - Item::SpruceFenceGate => "Spruce Fence Gate", - Item::BirchFenceGate => "Birch Fence Gate", - Item::JungleFenceGate => "Jungle Fence Gate", - Item::AcaciaFenceGate => "Acacia Fence Gate", - Item::DarkOakFenceGate => "Dark Oak Fence Gate", - Item::CrimsonFenceGate => "Crimson Fence Gate", - Item::WarpedFenceGate => "Warped Fence Gate", - Item::BrickStairs => "Brick Stairs", - Item::StoneBrickStairs => "Stone Brick Stairs", - Item::Mycelium => "Mycelium", - Item::LilyPad => "Lily Pad", - Item::NetherBricks => "Nether Bricks", - Item::CrackedNetherBricks => "Cracked Nether Bricks", - Item::ChiseledNetherBricks => "Chiseled Nether Bricks", - Item::NetherBrickFence => "Nether Brick Fence", - Item::NetherBrickStairs => "Nether Brick Stairs", - Item::EnchantingTable => "Enchanting Table", - Item::EndPortalFrame => "End Portal Frame", - Item::EndStone => "End Stone", - Item::EndStoneBricks => "End Stone Bricks", - Item::DragonEgg => "Dragon Egg", - Item::RedstoneLamp => "Redstone Lamp", - Item::SandstoneStairs => "Sandstone Stairs", - Item::EmeraldOre => "Emerald Ore", - Item::EnderChest => "Ender Chest", - Item::TripwireHook => "Tripwire Hook", - Item::EmeraldBlock => "Block of Emerald", - Item::SpruceStairs => "Spruce Stairs", - Item::BirchStairs => "Birch Stairs", - Item::JungleStairs => "Jungle Stairs", - Item::CrimsonStairs => "Crimson Stairs", - Item::WarpedStairs => "Warped Stairs", - Item::CommandBlock => "Command Block", - Item::Beacon => "Beacon", - Item::CobblestoneWall => "Cobblestone Wall", - Item::MossyCobblestoneWall => "Mossy Cobblestone Wall", - Item::BrickWall => "Brick Wall", - Item::PrismarineWall => "Prismarine Wall", - Item::RedSandstoneWall => "Red Sandstone Wall", - Item::MossyStoneBrickWall => "Mossy Stone Brick Wall", - Item::GraniteWall => "Granite Wall", - Item::StoneBrickWall => "Stone Brick Wall", - Item::NetherBrickWall => "Nether Brick Wall", - Item::AndesiteWall => "Andesite Wall", - Item::RedNetherBrickWall => "Red Nether Brick Wall", - Item::SandstoneWall => "Sandstone Wall", - Item::EndStoneBrickWall => "End Stone Brick Wall", - Item::DioriteWall => "Diorite Wall", - Item::BlackstoneWall => "Blackstone Wall", - Item::PolishedBlackstoneWall => "Polished Blackstone Wall", - Item::PolishedBlackstoneBrickWall => "Polished Blackstone Brick Wall", - Item::StoneButton => "Stone Button", - Item::OakButton => "Oak Button", - Item::SpruceButton => "Spruce Button", - Item::BirchButton => "Birch Button", - Item::JungleButton => "Jungle Button", - Item::AcaciaButton => "Acacia Button", - Item::DarkOakButton => "Dark Oak Button", - Item::CrimsonButton => "Crimson Button", - Item::WarpedButton => "Warped Button", - Item::PolishedBlackstoneButton => "Polished Blackstone Button", - Item::Anvil => "Anvil", - Item::ChippedAnvil => "Chipped Anvil", - Item::DamagedAnvil => "Damaged Anvil", - Item::TrappedChest => "Trapped Chest", - Item::LightWeightedPressurePlate => "Light Weighted Pressure Plate", - Item::HeavyWeightedPressurePlate => "Heavy Weighted Pressure Plate", - Item::DaylightDetector => "Daylight Detector", - Item::RedstoneBlock => "Block of Redstone", - Item::NetherQuartzOre => "Nether Quartz Ore", - Item::Hopper => "Hopper", - Item::ChiseledQuartzBlock => "Chiseled Quartz Block", - Item::QuartzBlock => "Block of Quartz", - Item::QuartzBricks => "Quartz Bricks", - Item::QuartzPillar => "Quartz Pillar", - Item::QuartzStairs => "Quartz Stairs", - Item::ActivatorRail => "Activator Rail", - Item::Dropper => "Dropper", - Item::WhiteTerracotta => "White Terracotta", - Item::OrangeTerracotta => "Orange Terracotta", - Item::MagentaTerracotta => "Magenta Terracotta", - Item::LightBlueTerracotta => "Light Blue Terracotta", - Item::YellowTerracotta => "Yellow Terracotta", - Item::LimeTerracotta => "Lime Terracotta", - Item::PinkTerracotta => "Pink Terracotta", - Item::GrayTerracotta => "Gray Terracotta", - Item::LightGrayTerracotta => "Light Gray Terracotta", - Item::CyanTerracotta => "Cyan Terracotta", - Item::PurpleTerracotta => "Purple Terracotta", - Item::BlueTerracotta => "Blue Terracotta", - Item::BrownTerracotta => "Brown Terracotta", - Item::GreenTerracotta => "Green Terracotta", - Item::RedTerracotta => "Red Terracotta", - Item::BlackTerracotta => "Black Terracotta", - Item::Barrier => "Barrier", - Item::IronTrapdoor => "Iron Trapdoor", - Item::HayBlock => "Hay Bale", - Item::WhiteCarpet => "White Carpet", - Item::OrangeCarpet => "Orange Carpet", - Item::MagentaCarpet => "Magenta Carpet", - Item::LightBlueCarpet => "Light Blue Carpet", - Item::YellowCarpet => "Yellow Carpet", - Item::LimeCarpet => "Lime Carpet", - Item::PinkCarpet => "Pink Carpet", - Item::GrayCarpet => "Gray Carpet", - Item::LightGrayCarpet => "Light Gray Carpet", - Item::CyanCarpet => "Cyan Carpet", - Item::PurpleCarpet => "Purple Carpet", - Item::BlueCarpet => "Blue Carpet", - Item::BrownCarpet => "Brown Carpet", - Item::GreenCarpet => "Green Carpet", - Item::RedCarpet => "Red Carpet", - Item::BlackCarpet => "Black Carpet", - Item::Terracotta => "Terracotta", - Item::CoalBlock => "Block of Coal", - Item::PackedIce => "Packed Ice", - Item::AcaciaStairs => "Acacia Stairs", - Item::DarkOakStairs => "Dark Oak Stairs", - Item::SlimeBlock => "Slime Block", - Item::GrassPath => "Grass Path", - Item::Sunflower => "Sunflower", - Item::Lilac => "Lilac", - Item::RoseBush => "Rose Bush", - Item::Peony => "Peony", - Item::TallGrass => "Tall Grass", - Item::LargeFern => "Large Fern", - Item::WhiteStainedGlass => "White Stained Glass", - Item::OrangeStainedGlass => "Orange Stained Glass", - Item::MagentaStainedGlass => "Magenta Stained Glass", - Item::LightBlueStainedGlass => "Light Blue Stained Glass", - Item::YellowStainedGlass => "Yellow Stained Glass", - Item::LimeStainedGlass => "Lime Stained Glass", - Item::PinkStainedGlass => "Pink Stained Glass", - Item::GrayStainedGlass => "Gray Stained Glass", - Item::LightGrayStainedGlass => "Light Gray Stained Glass", - Item::CyanStainedGlass => "Cyan Stained Glass", - Item::PurpleStainedGlass => "Purple Stained Glass", - Item::BlueStainedGlass => "Blue Stained Glass", - Item::BrownStainedGlass => "Brown Stained Glass", - Item::GreenStainedGlass => "Green Stained Glass", - Item::RedStainedGlass => "Red Stained Glass", - Item::BlackStainedGlass => "Black Stained Glass", - Item::WhiteStainedGlassPane => "White Stained Glass Pane", - Item::OrangeStainedGlassPane => "Orange Stained Glass Pane", - Item::MagentaStainedGlassPane => "Magenta Stained Glass Pane", - Item::LightBlueStainedGlassPane => "Light Blue Stained Glass Pane", - Item::YellowStainedGlassPane => "Yellow Stained Glass Pane", - Item::LimeStainedGlassPane => "Lime Stained Glass Pane", - Item::PinkStainedGlassPane => "Pink Stained Glass Pane", - Item::GrayStainedGlassPane => "Gray Stained Glass Pane", - Item::LightGrayStainedGlassPane => "Light Gray Stained Glass Pane", - Item::CyanStainedGlassPane => "Cyan Stained Glass Pane", - Item::PurpleStainedGlassPane => "Purple Stained Glass Pane", - Item::BlueStainedGlassPane => "Blue Stained Glass Pane", - Item::BrownStainedGlassPane => "Brown Stained Glass Pane", - Item::GreenStainedGlassPane => "Green Stained Glass Pane", - Item::RedStainedGlassPane => "Red Stained Glass Pane", - Item::BlackStainedGlassPane => "Black Stained Glass Pane", - Item::Prismarine => "Prismarine", - Item::PrismarineBricks => "Prismarine Bricks", - Item::DarkPrismarine => "Dark Prismarine", - Item::PrismarineStairs => "Prismarine Stairs", - Item::PrismarineBrickStairs => "Prismarine Brick Stairs", - Item::DarkPrismarineStairs => "Dark Prismarine Stairs", - Item::SeaLantern => "Sea Lantern", - Item::RedSandstone => "Red Sandstone", - Item::ChiseledRedSandstone => "Chiseled Red Sandstone", - Item::CutRedSandstone => "Cut Red Sandstone", - Item::RedSandstoneStairs => "Red Sandstone Stairs", - Item::RepeatingCommandBlock => "Repeating Command Block", - Item::ChainCommandBlock => "Chain Command Block", - Item::MagmaBlock => "Magma Block", - Item::NetherWartBlock => "Nether Wart Block", - Item::WarpedWartBlock => "Warped Wart Block", - Item::RedNetherBricks => "Red Nether Bricks", - Item::BoneBlock => "Bone Block", - Item::StructureVoid => "Structure Void", - Item::Observer => "Observer", - Item::ShulkerBox => "Shulker Box", - Item::WhiteShulkerBox => "White Shulker Box", - Item::OrangeShulkerBox => "Orange Shulker Box", - Item::MagentaShulkerBox => "Magenta Shulker Box", - Item::LightBlueShulkerBox => "Light Blue Shulker Box", - Item::YellowShulkerBox => "Yellow Shulker Box", - Item::LimeShulkerBox => "Lime Shulker Box", - Item::PinkShulkerBox => "Pink Shulker Box", - Item::GrayShulkerBox => "Gray Shulker Box", - Item::LightGrayShulkerBox => "Light Gray Shulker Box", - Item::CyanShulkerBox => "Cyan Shulker Box", - Item::PurpleShulkerBox => "Purple Shulker Box", - Item::BlueShulkerBox => "Blue Shulker Box", - Item::BrownShulkerBox => "Brown Shulker Box", - Item::GreenShulkerBox => "Green Shulker Box", - Item::RedShulkerBox => "Red Shulker Box", - Item::BlackShulkerBox => "Black Shulker Box", - Item::WhiteGlazedTerracotta => "White Glazed Terracotta", - Item::OrangeGlazedTerracotta => "Orange Glazed Terracotta", - Item::MagentaGlazedTerracotta => "Magenta Glazed Terracotta", - Item::LightBlueGlazedTerracotta => "Light Blue Glazed Terracotta", - Item::YellowGlazedTerracotta => "Yellow Glazed Terracotta", - Item::LimeGlazedTerracotta => "Lime Glazed Terracotta", - Item::PinkGlazedTerracotta => "Pink Glazed Terracotta", - Item::GrayGlazedTerracotta => "Gray Glazed Terracotta", - Item::LightGrayGlazedTerracotta => "Light Gray Glazed Terracotta", - Item::CyanGlazedTerracotta => "Cyan Glazed Terracotta", - Item::PurpleGlazedTerracotta => "Purple Glazed Terracotta", - Item::BlueGlazedTerracotta => "Blue Glazed Terracotta", - Item::BrownGlazedTerracotta => "Brown Glazed Terracotta", - Item::GreenGlazedTerracotta => "Green Glazed Terracotta", - Item::RedGlazedTerracotta => "Red Glazed Terracotta", - Item::BlackGlazedTerracotta => "Black Glazed Terracotta", - Item::WhiteConcrete => "White Concrete", - Item::OrangeConcrete => "Orange Concrete", - Item::MagentaConcrete => "Magenta Concrete", - Item::LightBlueConcrete => "Light Blue Concrete", - Item::YellowConcrete => "Yellow Concrete", - Item::LimeConcrete => "Lime Concrete", - Item::PinkConcrete => "Pink Concrete", - Item::GrayConcrete => "Gray Concrete", - Item::LightGrayConcrete => "Light Gray Concrete", - Item::CyanConcrete => "Cyan Concrete", - Item::PurpleConcrete => "Purple Concrete", - Item::BlueConcrete => "Blue Concrete", - Item::BrownConcrete => "Brown Concrete", - Item::GreenConcrete => "Green Concrete", - Item::RedConcrete => "Red Concrete", - Item::BlackConcrete => "Black Concrete", - Item::WhiteConcretePowder => "White Concrete Powder", - Item::OrangeConcretePowder => "Orange Concrete Powder", - Item::MagentaConcretePowder => "Magenta Concrete Powder", - Item::LightBlueConcretePowder => "Light Blue Concrete Powder", - Item::YellowConcretePowder => "Yellow Concrete Powder", - Item::LimeConcretePowder => "Lime Concrete Powder", - Item::PinkConcretePowder => "Pink Concrete Powder", - Item::GrayConcretePowder => "Gray Concrete Powder", - Item::LightGrayConcretePowder => "Light Gray Concrete Powder", - Item::CyanConcretePowder => "Cyan Concrete Powder", - Item::PurpleConcretePowder => "Purple Concrete Powder", - Item::BlueConcretePowder => "Blue Concrete Powder", - Item::BrownConcretePowder => "Brown Concrete Powder", - Item::GreenConcretePowder => "Green Concrete Powder", - Item::RedConcretePowder => "Red Concrete Powder", - Item::BlackConcretePowder => "Black Concrete Powder", - Item::TurtleEgg => "Turtle Egg", - Item::DeadTubeCoralBlock => "Dead Tube Coral Block", - Item::DeadBrainCoralBlock => "Dead Brain Coral Block", - Item::DeadBubbleCoralBlock => "Dead Bubble Coral Block", - Item::DeadFireCoralBlock => "Dead Fire Coral Block", - Item::DeadHornCoralBlock => "Dead Horn Coral Block", - Item::TubeCoralBlock => "Tube Coral Block", - Item::BrainCoralBlock => "Brain Coral Block", - Item::BubbleCoralBlock => "Bubble Coral Block", - Item::FireCoralBlock => "Fire Coral Block", - Item::HornCoralBlock => "Horn Coral Block", - Item::TubeCoral => "Tube Coral", - Item::BrainCoral => "Brain Coral", - Item::BubbleCoral => "Bubble Coral", - Item::FireCoral => "Fire Coral", - Item::HornCoral => "Horn Coral", - Item::DeadBrainCoral => "Dead Brain Coral", - Item::DeadBubbleCoral => "Dead Bubble Coral", - Item::DeadFireCoral => "Dead Fire Coral", - Item::DeadHornCoral => "Dead Horn Coral", - Item::DeadTubeCoral => "Dead Tube Coral", - Item::TubeCoralFan => "Tube Coral Fan", - Item::BrainCoralFan => "Brain Coral Fan", - Item::BubbleCoralFan => "Bubble Coral Fan", - Item::FireCoralFan => "Fire Coral Fan", - Item::HornCoralFan => "Horn Coral Fan", - Item::DeadTubeCoralFan => "Dead Tube Coral Fan", - Item::DeadBrainCoralFan => "Dead Brain Coral Fan", - Item::DeadBubbleCoralFan => "Dead Bubble Coral Fan", - Item::DeadFireCoralFan => "Dead Fire Coral Fan", - Item::DeadHornCoralFan => "Dead Horn Coral Fan", - Item::BlueIce => "Blue Ice", - Item::Conduit => "Conduit", - Item::PolishedGraniteStairs => "Polished Granite Stairs", - Item::SmoothRedSandstoneStairs => "Smooth Red Sandstone Stairs", - Item::MossyStoneBrickStairs => "Mossy Stone Brick Stairs", - Item::PolishedDioriteStairs => "Polished Diorite Stairs", - Item::MossyCobblestoneStairs => "Mossy Cobblestone Stairs", - Item::EndStoneBrickStairs => "End Stone Brick Stairs", - Item::StoneStairs => "Stone Stairs", - Item::SmoothSandstoneStairs => "Smooth Sandstone Stairs", - Item::SmoothQuartzStairs => "Smooth Quartz Stairs", - Item::GraniteStairs => "Granite Stairs", - Item::AndesiteStairs => "Andesite Stairs", - Item::RedNetherBrickStairs => "Red Nether Brick Stairs", - Item::PolishedAndesiteStairs => "Polished Andesite Stairs", - Item::DioriteStairs => "Diorite Stairs", - Item::PolishedGraniteSlab => "Polished Granite Slab", - Item::SmoothRedSandstoneSlab => "Smooth Red Sandstone Slab", - Item::MossyStoneBrickSlab => "Mossy Stone Brick Slab", - Item::PolishedDioriteSlab => "Polished Diorite Slab", - Item::MossyCobblestoneSlab => "Mossy Cobblestone Slab", - Item::EndStoneBrickSlab => "End Stone Brick Slab", - Item::SmoothSandstoneSlab => "Smooth Sandstone Slab", - Item::SmoothQuartzSlab => "Smooth Quartz Slab", - Item::GraniteSlab => "Granite Slab", - Item::AndesiteSlab => "Andesite Slab", - Item::RedNetherBrickSlab => "Red Nether Brick Slab", - Item::PolishedAndesiteSlab => "Polished Andesite Slab", - Item::DioriteSlab => "Diorite Slab", - Item::Scaffolding => "Scaffolding", - Item::IronDoor => "Iron Door", - Item::OakDoor => "Oak Door", - Item::SpruceDoor => "Spruce Door", - Item::BirchDoor => "Birch Door", - Item::JungleDoor => "Jungle Door", - Item::AcaciaDoor => "Acacia Door", - Item::DarkOakDoor => "Dark Oak Door", - Item::CrimsonDoor => "Crimson Door", - Item::WarpedDoor => "Warped Door", - Item::Repeater => "Redstone Repeater", - Item::Comparator => "Redstone Comparator", - Item::StructureBlock => "Structure Block", - Item::Jigsaw => "Jigsaw Block", - Item::TurtleHelmet => "Turtle Shell", - Item::Scute => "Scute", - Item::FlintAndSteel => "Flint and Steel", - Item::Apple => "Apple", - Item::Bow => "Bow", - Item::Arrow => "Arrow", - Item::Coal => "Coal", - Item::Charcoal => "Charcoal", - Item::Diamond => "Diamond", - Item::IronIngot => "Iron Ingot", - Item::GoldIngot => "Gold Ingot", - Item::NetheriteIngot => "Netherite Ingot", - Item::NetheriteScrap => "Netherite Scrap", - Item::WoodenSword => "Wooden Sword", - Item::WoodenShovel => "Wooden Shovel", - Item::WoodenPickaxe => "Wooden Pickaxe", - Item::WoodenAxe => "Wooden Axe", - Item::WoodenHoe => "Wooden Hoe", - Item::StoneSword => "Stone Sword", - Item::StoneShovel => "Stone Shovel", - Item::StonePickaxe => "Stone Pickaxe", - Item::StoneAxe => "Stone Axe", - Item::StoneHoe => "Stone Hoe", - Item::GoldenSword => "Golden Sword", - Item::GoldenShovel => "Golden Shovel", - Item::GoldenPickaxe => "Golden Pickaxe", - Item::GoldenAxe => "Golden Axe", - Item::GoldenHoe => "Golden Hoe", - Item::IronSword => "Iron Sword", - Item::IronShovel => "Iron Shovel", - Item::IronPickaxe => "Iron Pickaxe", - Item::IronAxe => "Iron Axe", - Item::IronHoe => "Iron Hoe", - Item::DiamondSword => "Diamond Sword", - Item::DiamondShovel => "Diamond Shovel", - Item::DiamondPickaxe => "Diamond Pickaxe", - Item::DiamondAxe => "Diamond Axe", - Item::DiamondHoe => "Diamond Hoe", - Item::NetheriteSword => "Netherite Sword", - Item::NetheriteShovel => "Netherite Shovel", - Item::NetheritePickaxe => "Netherite Pickaxe", - Item::NetheriteAxe => "Netherite Axe", - Item::NetheriteHoe => "Netherite Hoe", - Item::Stick => "Stick", - Item::Bowl => "Bowl", - Item::MushroomStew => "Mushroom Stew", - Item::String => "String", - Item::Feather => "Feather", - Item::Gunpowder => "Gunpowder", - Item::WheatSeeds => "Wheat Seeds", - Item::Wheat => "Wheat", - Item::Bread => "Bread", - Item::LeatherHelmet => "Leather Cap", - Item::LeatherChestplate => "Leather Tunic", - Item::LeatherLeggings => "Leather Pants", - Item::LeatherBoots => "Leather Boots", - Item::ChainmailHelmet => "Chainmail Helmet", - Item::ChainmailChestplate => "Chainmail Chestplate", - Item::ChainmailLeggings => "Chainmail Leggings", - Item::ChainmailBoots => "Chainmail Boots", - Item::IronHelmet => "Iron Helmet", - Item::IronChestplate => "Iron Chestplate", - Item::IronLeggings => "Iron Leggings", - Item::IronBoots => "Iron Boots", - Item::DiamondHelmet => "Diamond Helmet", - Item::DiamondChestplate => "Diamond Chestplate", - Item::DiamondLeggings => "Diamond Leggings", - Item::DiamondBoots => "Diamond Boots", - Item::GoldenHelmet => "Golden Helmet", - Item::GoldenChestplate => "Golden Chestplate", - Item::GoldenLeggings => "Golden Leggings", - Item::GoldenBoots => "Golden Boots", - Item::NetheriteHelmet => "Netherite Helmet", - Item::NetheriteChestplate => "Netherite Chestplate", - Item::NetheriteLeggings => "Netherite Leggings", - Item::NetheriteBoots => "Netherite Boots", - Item::Flint => "Flint", - Item::Porkchop => "Raw Porkchop", - Item::CookedPorkchop => "Cooked Porkchop", - Item::Painting => "Painting", - Item::GoldenApple => "Golden Apple", - Item::EnchantedGoldenApple => "Enchanted Golden Apple", - Item::OakSign => "Oak Sign", - Item::SpruceSign => "Spruce Sign", - Item::BirchSign => "Birch Sign", - Item::JungleSign => "Jungle Sign", - Item::AcaciaSign => "Acacia Sign", - Item::DarkOakSign => "Dark Oak Sign", - Item::CrimsonSign => "Crimson Sign", - Item::WarpedSign => "Warped Sign", - Item::Bucket => "Bucket", - Item::WaterBucket => "Water Bucket", - Item::LavaBucket => "Lava Bucket", - Item::Minecart => "Minecart", - Item::Saddle => "Saddle", - Item::Redstone => "Redstone Dust", - Item::Snowball => "Snowball", - Item::OakBoat => "Oak Boat", - Item::Leather => "Leather", - Item::MilkBucket => "Milk Bucket", - Item::PufferfishBucket => "Bucket of Pufferfish", - Item::SalmonBucket => "Bucket of Salmon", - Item::CodBucket => "Bucket of Cod", - Item::TropicalFishBucket => "Bucket of Tropical Fish", - Item::Brick => "Brick", - Item::ClayBall => "Clay Ball", - Item::DriedKelpBlock => "Dried Kelp Block", - Item::Paper => "Paper", - Item::Book => "Book", - Item::SlimeBall => "Slimeball", - Item::ChestMinecart => "Minecart with Chest", - Item::FurnaceMinecart => "Minecart with Furnace", - Item::Egg => "Egg", - Item::Compass => "Compass", - Item::FishingRod => "Fishing Rod", - Item::Clock => "Clock", - Item::GlowstoneDust => "Glowstone Dust", - Item::Cod => "Raw Cod", - Item::Salmon => "Raw Salmon", - Item::TropicalFish => "Tropical Fish", - Item::Pufferfish => "Pufferfish", - Item::CookedCod => "Cooked Cod", - Item::CookedSalmon => "Cooked Salmon", - Item::InkSac => "Ink Sac", - Item::CocoaBeans => "Cocoa Beans", - Item::LapisLazuli => "Lapis Lazuli", - Item::WhiteDye => "White Dye", - Item::OrangeDye => "Orange Dye", - Item::MagentaDye => "Magenta Dye", - Item::LightBlueDye => "Light Blue Dye", - Item::YellowDye => "Yellow Dye", - Item::LimeDye => "Lime Dye", - Item::PinkDye => "Pink Dye", - Item::GrayDye => "Gray Dye", - Item::LightGrayDye => "Light Gray Dye", - Item::CyanDye => "Cyan Dye", - Item::PurpleDye => "Purple Dye", - Item::BlueDye => "Blue Dye", - Item::BrownDye => "Brown Dye", - Item::GreenDye => "Green Dye", - Item::RedDye => "Red Dye", - Item::BlackDye => "Black Dye", - Item::BoneMeal => "Bone Meal", - Item::Bone => "Bone", - Item::Sugar => "Sugar", - Item::Cake => "Cake", - Item::WhiteBed => "White Bed", - Item::OrangeBed => "Orange Bed", - Item::MagentaBed => "Magenta Bed", - Item::LightBlueBed => "Light Blue Bed", - Item::YellowBed => "Yellow Bed", - Item::LimeBed => "Lime Bed", - Item::PinkBed => "Pink Bed", - Item::GrayBed => "Gray Bed", - Item::LightGrayBed => "Light Gray Bed", - Item::CyanBed => "Cyan Bed", - Item::PurpleBed => "Purple Bed", - Item::BlueBed => "Blue Bed", - Item::BrownBed => "Brown Bed", - Item::GreenBed => "Green Bed", - Item::RedBed => "Red Bed", - Item::BlackBed => "Black Bed", - Item::Cookie => "Cookie", - Item::FilledMap => "Map", - Item::Shears => "Shears", - Item::MelonSlice => "Melon Slice", - Item::DriedKelp => "Dried Kelp", - Item::PumpkinSeeds => "Pumpkin Seeds", - Item::MelonSeeds => "Melon Seeds", - Item::Beef => "Raw Beef", - Item::CookedBeef => "Steak", - Item::Chicken => "Raw Chicken", - Item::CookedChicken => "Cooked Chicken", - Item::RottenFlesh => "Rotten Flesh", - Item::EnderPearl => "Ender Pearl", - Item::BlazeRod => "Blaze Rod", - Item::GhastTear => "Ghast Tear", - Item::GoldNugget => "Gold Nugget", - Item::NetherWart => "Nether Wart", - Item::Potion => "Potion", - Item::GlassBottle => "Glass Bottle", - Item::SpiderEye => "Spider Eye", - Item::FermentedSpiderEye => "Fermented Spider Eye", - Item::BlazePowder => "Blaze Powder", - Item::MagmaCream => "Magma Cream", - Item::BrewingStand => "Brewing Stand", - Item::Cauldron => "Cauldron", - Item::EnderEye => "Eye of Ender", - Item::GlisteringMelonSlice => "Glistering Melon Slice", - Item::BatSpawnEgg => "Bat Spawn Egg", - Item::BeeSpawnEgg => "Bee Spawn Egg", - Item::BlazeSpawnEgg => "Blaze Spawn Egg", - Item::CatSpawnEgg => "Cat Spawn Egg", - Item::CaveSpiderSpawnEgg => "Cave Spider Spawn Egg", - Item::ChickenSpawnEgg => "Chicken Spawn Egg", - Item::CodSpawnEgg => "Cod Spawn Egg", - Item::CowSpawnEgg => "Cow Spawn Egg", - Item::CreeperSpawnEgg => "Creeper Spawn Egg", - Item::DolphinSpawnEgg => "Dolphin Spawn Egg", - Item::DonkeySpawnEgg => "Donkey Spawn Egg", - Item::DrownedSpawnEgg => "Drowned Spawn Egg", - Item::ElderGuardianSpawnEgg => "Elder Guardian Spawn Egg", - Item::EndermanSpawnEgg => "Enderman Spawn Egg", - Item::EndermiteSpawnEgg => "Endermite Spawn Egg", - Item::EvokerSpawnEgg => "Evoker Spawn Egg", - Item::FoxSpawnEgg => "Fox Spawn Egg", - Item::GhastSpawnEgg => "Ghast Spawn Egg", - Item::GuardianSpawnEgg => "Guardian Spawn Egg", - Item::HoglinSpawnEgg => "Hoglin Spawn Egg", - Item::HorseSpawnEgg => "Horse Spawn Egg", - Item::HuskSpawnEgg => "Husk Spawn Egg", - Item::LlamaSpawnEgg => "Llama Spawn Egg", - Item::MagmaCubeSpawnEgg => "Magma Cube Spawn Egg", - Item::MooshroomSpawnEgg => "Mooshroom Spawn Egg", - Item::MuleSpawnEgg => "Mule Spawn Egg", - Item::OcelotSpawnEgg => "Ocelot Spawn Egg", - Item::PandaSpawnEgg => "Panda Spawn Egg", - Item::ParrotSpawnEgg => "Parrot Spawn Egg", - Item::PhantomSpawnEgg => "Phantom Spawn Egg", - Item::PigSpawnEgg => "Pig Spawn Egg", - Item::PiglinSpawnEgg => "Piglin Spawn Egg", - Item::PiglinBruteSpawnEgg => "Piglin Brute Spawn Egg", - Item::PillagerSpawnEgg => "Pillager Spawn Egg", - Item::PolarBearSpawnEgg => "Polar Bear Spawn Egg", - Item::PufferfishSpawnEgg => "Pufferfish Spawn Egg", - Item::RabbitSpawnEgg => "Rabbit Spawn Egg", - Item::RavagerSpawnEgg => "Ravager Spawn Egg", - Item::SalmonSpawnEgg => "Salmon Spawn Egg", - Item::SheepSpawnEgg => "Sheep Spawn Egg", - Item::ShulkerSpawnEgg => "Shulker Spawn Egg", - Item::SilverfishSpawnEgg => "Silverfish Spawn Egg", - Item::SkeletonSpawnEgg => "Skeleton Spawn Egg", - Item::SkeletonHorseSpawnEgg => "Skeleton Horse Spawn Egg", - Item::SlimeSpawnEgg => "Slime Spawn Egg", - Item::SpiderSpawnEgg => "Spider Spawn Egg", - Item::SquidSpawnEgg => "Squid Spawn Egg", - Item::StraySpawnEgg => "Stray Spawn Egg", - Item::StriderSpawnEgg => "Strider Spawn Egg", - Item::TraderLlamaSpawnEgg => "Trader Llama Spawn Egg", - Item::TropicalFishSpawnEgg => "Tropical Fish Spawn Egg", - Item::TurtleSpawnEgg => "Turtle Spawn Egg", - Item::VexSpawnEgg => "Vex Spawn Egg", - Item::VillagerSpawnEgg => "Villager Spawn Egg", - Item::VindicatorSpawnEgg => "Vindicator Spawn Egg", - Item::WanderingTraderSpawnEgg => "Wandering Trader Spawn Egg", - Item::WitchSpawnEgg => "Witch Spawn Egg", - Item::WitherSkeletonSpawnEgg => "Wither Skeleton Spawn Egg", - Item::WolfSpawnEgg => "Wolf Spawn Egg", - Item::ZoglinSpawnEgg => "Zoglin Spawn Egg", - Item::ZombieSpawnEgg => "Zombie Spawn Egg", - Item::ZombieHorseSpawnEgg => "Zombie Horse Spawn Egg", - Item::ZombieVillagerSpawnEgg => "Zombie Villager Spawn Egg", - Item::ZombifiedPiglinSpawnEgg => "Zombified Piglin Spawn Egg", - Item::ExperienceBottle => "Bottle o' Enchanting", - Item::FireCharge => "Fire Charge", - Item::WritableBook => "Book and Quill", - Item::WrittenBook => "Written Book", - Item::Emerald => "Emerald", - Item::ItemFrame => "Item Frame", - Item::FlowerPot => "Flower Pot", - Item::Carrot => "Carrot", - Item::Potato => "Potato", - Item::BakedPotato => "Baked Potato", - Item::PoisonousPotato => "Poisonous Potato", - Item::Map => "Empty Map", - Item::GoldenCarrot => "Golden Carrot", - Item::SkeletonSkull => "Skeleton Skull", - Item::WitherSkeletonSkull => "Wither Skeleton Skull", - Item::PlayerHead => "Player Head", - Item::ZombieHead => "Zombie Head", - Item::CreeperHead => "Creeper Head", - Item::DragonHead => "Dragon Head", - Item::CarrotOnAStick => "Carrot on a Stick", - Item::WarpedFungusOnAStick => "Warped Fungus on a Stick", - Item::NetherStar => "Nether Star", - Item::PumpkinPie => "Pumpkin Pie", - Item::FireworkRocket => "Firework Rocket", - Item::FireworkStar => "Firework Star", - Item::EnchantedBook => "Enchanted Book", - Item::NetherBrick => "Nether Brick", - Item::Quartz => "Nether Quartz", - Item::TntMinecart => "Minecart with TNT", - Item::HopperMinecart => "Minecart with Hopper", - Item::PrismarineShard => "Prismarine Shard", - Item::PrismarineCrystals => "Prismarine Crystals", - Item::Rabbit => "Raw Rabbit", - Item::CookedRabbit => "Cooked Rabbit", - Item::RabbitStew => "Rabbit Stew", - Item::RabbitFoot => "Rabbit's Foot", - Item::RabbitHide => "Rabbit Hide", - Item::ArmorStand => "Armor Stand", - Item::IronHorseArmor => "Iron Horse Armor", - Item::GoldenHorseArmor => "Golden Horse Armor", - Item::DiamondHorseArmor => "Diamond Horse Armor", - Item::LeatherHorseArmor => "Leather Horse Armor", - Item::Lead => "Lead", - Item::NameTag => "Name Tag", - Item::CommandBlockMinecart => "Minecart with Command Block", - Item::Mutton => "Raw Mutton", - Item::CookedMutton => "Cooked Mutton", - Item::WhiteBanner => "White Banner", - Item::OrangeBanner => "Orange Banner", - Item::MagentaBanner => "Magenta Banner", - Item::LightBlueBanner => "Light Blue Banner", - Item::YellowBanner => "Yellow Banner", - Item::LimeBanner => "Lime Banner", - Item::PinkBanner => "Pink Banner", - Item::GrayBanner => "Gray Banner", - Item::LightGrayBanner => "Light Gray Banner", - Item::CyanBanner => "Cyan Banner", - Item::PurpleBanner => "Purple Banner", - Item::BlueBanner => "Blue Banner", - Item::BrownBanner => "Brown Banner", - Item::GreenBanner => "Green Banner", - Item::RedBanner => "Red Banner", - Item::BlackBanner => "Black Banner", - Item::EndCrystal => "End Crystal", - Item::ChorusFruit => "Chorus Fruit", - Item::PoppedChorusFruit => "Popped Chorus Fruit", - Item::Beetroot => "Beetroot", - Item::BeetrootSeeds => "Beetroot Seeds", - Item::BeetrootSoup => "Beetroot Soup", - Item::DragonBreath => "Dragon's Breath", - Item::SplashPotion => "Splash Potion", - Item::SpectralArrow => "Spectral Arrow", - Item::TippedArrow => "Tipped Arrow", - Item::LingeringPotion => "Lingering Potion", - Item::Shield => "Shield", - Item::Elytra => "Elytra", - Item::SpruceBoat => "Spruce Boat", - Item::BirchBoat => "Birch Boat", - Item::JungleBoat => "Jungle Boat", - Item::AcaciaBoat => "Acacia Boat", - Item::DarkOakBoat => "Dark Oak Boat", - Item::TotemOfUndying => "Totem of Undying", - Item::ShulkerShell => "Shulker Shell", - Item::IronNugget => "Iron Nugget", - Item::KnowledgeBook => "Knowledge Book", - Item::DebugStick => "Debug Stick", - Item::MusicDisc13 => "13 Disc", - Item::MusicDiscCat => "Cat Disc", - Item::MusicDiscBlocks => "Blocks Disc", - Item::MusicDiscChirp => "Chirp Disc", - Item::MusicDiscFar => "Far Disc", - Item::MusicDiscMall => "Mall Disc", - Item::MusicDiscMellohi => "Mellohi Disc", - Item::MusicDiscStal => "Stal Disc", - Item::MusicDiscStrad => "Strad Disc", - Item::MusicDiscWard => "Ward Disc", - Item::MusicDisc11 => "11 Disc", - Item::MusicDiscWait => "Wait Disc", - Item::MusicDiscPigstep => "Music Disc", - Item::Trident => "Trident", - Item::PhantomMembrane => "Phantom Membrane", - Item::NautilusShell => "Nautilus Shell", - Item::HeartOfTheSea => "Heart of the Sea", - Item::Crossbow => "Crossbow", - Item::SuspiciousStew => "Suspicious Stew", - Item::Loom => "Loom", - Item::FlowerBannerPattern => "Banner Pattern", - Item::CreeperBannerPattern => "Banner Pattern", - Item::SkullBannerPattern => "Banner Pattern", - Item::MojangBannerPattern => "Banner Pattern", - Item::GlobeBannerPattern => "Banner Pattern", - Item::PiglinBannerPattern => "Banner Pattern", - Item::Composter => "Composter", - Item::Barrel => "Barrel", - Item::Smoker => "Smoker", - Item::BlastFurnace => "Blast Furnace", - Item::CartographyTable => "Cartography Table", - Item::FletchingTable => "Fletching Table", - Item::Grindstone => "Grindstone", - Item::Lectern => "Lectern", - Item::SmithingTable => "Smithing Table", - Item::Stonecutter => "Stonecutter", - Item::Bell => "Bell", - Item::Lantern => "Lantern", - Item::SoulLantern => "Soul Lantern", - Item::SweetBerries => "Sweet Berries", - Item::Campfire => "Campfire", - Item::SoulCampfire => "Soul Campfire", - Item::Shroomlight => "Shroomlight", - Item::Honeycomb => "Honeycomb", - Item::BeeNest => "Bee Nest", - Item::Beehive => "Beehive", - Item::HoneyBottle => "Honey Bottle", - Item::HoneyBlock => "Honey Block", - Item::HoneycombBlock => "Honeycomb Block", - Item::Lodestone => "Lodestone", - Item::NetheriteBlock => "Block of Netherite", - Item::AncientDebris => "Ancient Debris", - Item::Target => "Target", - Item::CryingObsidian => "Crying Obsidian", - Item::Blackstone => "Blackstone", - Item::BlackstoneSlab => "Blackstone Slab", - Item::BlackstoneStairs => "Blackstone Stairs", - Item::GildedBlackstone => "Gilded Blackstone", - Item::PolishedBlackstone => "Polished Blackstone", - Item::PolishedBlackstoneSlab => "Polished Blackstone Slab", - Item::PolishedBlackstoneStairs => "Polished Blackstone Stairs", - Item::ChiseledPolishedBlackstone => "Chiseled Polished Blackstone", - Item::PolishedBlackstoneBricks => "Polished Blackstone Bricks", - Item::PolishedBlackstoneBrickSlab => "Polished Blackstone Brick Slab", - Item::PolishedBlackstoneBrickStairs => "Polished Blackstone Brick Stairs", - Item::CrackedPolishedBlackstoneBricks => "Cracked Polished Blackstone Bricks", - Item::RespawnAnchor => "Respawn Anchor", + Item::Stone => "minecraft:stone", + Item::Granite => "minecraft:granite", + Item::PolishedGranite => "minecraft:polished_granite", + Item::Diorite => "minecraft:diorite", + Item::PolishedDiorite => "minecraft:polished_diorite", + Item::Andesite => "minecraft:andesite", + Item::PolishedAndesite => "minecraft:polished_andesite", + Item::Deepslate => "minecraft:deepslate", + Item::CobbledDeepslate => "minecraft:cobbled_deepslate", + Item::PolishedDeepslate => "minecraft:polished_deepslate", + Item::Calcite => "minecraft:calcite", + Item::Tuff => "minecraft:tuff", + Item::DripstoneBlock => "minecraft:dripstone_block", + Item::GrassBlock => "minecraft:grass_block", + Item::Dirt => "minecraft:dirt", + Item::CoarseDirt => "minecraft:coarse_dirt", + Item::Podzol => "minecraft:podzol", + Item::RootedDirt => "minecraft:rooted_dirt", + Item::CrimsonNylium => "minecraft:crimson_nylium", + Item::WarpedNylium => "minecraft:warped_nylium", + Item::Cobblestone => "minecraft:cobblestone", + Item::OakPlanks => "minecraft:oak_planks", + Item::SprucePlanks => "minecraft:spruce_planks", + Item::BirchPlanks => "minecraft:birch_planks", + Item::JunglePlanks => "minecraft:jungle_planks", + Item::AcaciaPlanks => "minecraft:acacia_planks", + Item::DarkOakPlanks => "minecraft:dark_oak_planks", + Item::CrimsonPlanks => "minecraft:crimson_planks", + Item::WarpedPlanks => "minecraft:warped_planks", + Item::OakSapling => "minecraft:oak_sapling", + Item::SpruceSapling => "minecraft:spruce_sapling", + Item::BirchSapling => "minecraft:birch_sapling", + Item::JungleSapling => "minecraft:jungle_sapling", + Item::AcaciaSapling => "minecraft:acacia_sapling", + Item::DarkOakSapling => "minecraft:dark_oak_sapling", + Item::Bedrock => "minecraft:bedrock", + Item::Sand => "minecraft:sand", + Item::RedSand => "minecraft:red_sand", + Item::Gravel => "minecraft:gravel", + Item::CoalOre => "minecraft:coal_ore", + Item::DeepslateCoalOre => "minecraft:deepslate_coal_ore", + Item::IronOre => "minecraft:iron_ore", + Item::DeepslateIronOre => "minecraft:deepslate_iron_ore", + Item::CopperOre => "minecraft:copper_ore", + Item::DeepslateCopperOre => "minecraft:deepslate_copper_ore", + Item::GoldOre => "minecraft:gold_ore", + Item::DeepslateGoldOre => "minecraft:deepslate_gold_ore", + Item::RedstoneOre => "minecraft:redstone_ore", + Item::DeepslateRedstoneOre => "minecraft:deepslate_redstone_ore", + Item::EmeraldOre => "minecraft:emerald_ore", + Item::DeepslateEmeraldOre => "minecraft:deepslate_emerald_ore", + Item::LapisOre => "minecraft:lapis_ore", + Item::DeepslateLapisOre => "minecraft:deepslate_lapis_ore", + Item::DiamondOre => "minecraft:diamond_ore", + Item::DeepslateDiamondOre => "minecraft:deepslate_diamond_ore", + Item::NetherGoldOre => "minecraft:nether_gold_ore", + Item::NetherQuartzOre => "minecraft:nether_quartz_ore", + Item::AncientDebris => "minecraft:ancient_debris", + Item::CoalBlock => "minecraft:coal_block", + Item::RawIronBlock => "minecraft:raw_iron_block", + Item::RawCopperBlock => "minecraft:raw_copper_block", + Item::RawGoldBlock => "minecraft:raw_gold_block", + Item::AmethystBlock => "minecraft:amethyst_block", + Item::BuddingAmethyst => "minecraft:budding_amethyst", + Item::IronBlock => "minecraft:iron_block", + Item::CopperBlock => "minecraft:copper_block", + Item::GoldBlock => "minecraft:gold_block", + Item::DiamondBlock => "minecraft:diamond_block", + Item::NetheriteBlock => "minecraft:netherite_block", + Item::ExposedCopper => "minecraft:exposed_copper", + Item::WeatheredCopper => "minecraft:weathered_copper", + Item::OxidizedCopper => "minecraft:oxidized_copper", + Item::CutCopper => "minecraft:cut_copper", + Item::ExposedCutCopper => "minecraft:exposed_cut_copper", + Item::WeatheredCutCopper => "minecraft:weathered_cut_copper", + Item::OxidizedCutCopper => "minecraft:oxidized_cut_copper", + Item::CutCopperStairs => "minecraft:cut_copper_stairs", + Item::ExposedCutCopperStairs => "minecraft:exposed_cut_copper_stairs", + Item::WeatheredCutCopperStairs => "minecraft:weathered_cut_copper_stairs", + Item::OxidizedCutCopperStairs => "minecraft:oxidized_cut_copper_stairs", + Item::CutCopperSlab => "minecraft:cut_copper_slab", + Item::ExposedCutCopperSlab => "minecraft:exposed_cut_copper_slab", + Item::WeatheredCutCopperSlab => "minecraft:weathered_cut_copper_slab", + Item::OxidizedCutCopperSlab => "minecraft:oxidized_cut_copper_slab", + Item::WaxedCopperBlock => "minecraft:waxed_copper_block", + Item::WaxedExposedCopper => "minecraft:waxed_exposed_copper", + Item::WaxedWeatheredCopper => "minecraft:waxed_weathered_copper", + Item::WaxedOxidizedCopper => "minecraft:waxed_oxidized_copper", + Item::WaxedCutCopper => "minecraft:waxed_cut_copper", + Item::WaxedExposedCutCopper => "minecraft:waxed_exposed_cut_copper", + Item::WaxedWeatheredCutCopper => "minecraft:waxed_weathered_cut_copper", + Item::WaxedOxidizedCutCopper => "minecraft:waxed_oxidized_cut_copper", + Item::WaxedCutCopperStairs => "minecraft:waxed_cut_copper_stairs", + Item::WaxedExposedCutCopperStairs => "minecraft:waxed_exposed_cut_copper_stairs", + Item::WaxedWeatheredCutCopperStairs => "minecraft:waxed_weathered_cut_copper_stairs", + Item::WaxedOxidizedCutCopperStairs => "minecraft:waxed_oxidized_cut_copper_stairs", + Item::WaxedCutCopperSlab => "minecraft:waxed_cut_copper_slab", + Item::WaxedExposedCutCopperSlab => "minecraft:waxed_exposed_cut_copper_slab", + Item::WaxedWeatheredCutCopperSlab => "minecraft:waxed_weathered_cut_copper_slab", + Item::WaxedOxidizedCutCopperSlab => "minecraft:waxed_oxidized_cut_copper_slab", + Item::OakLog => "minecraft:oak_log", + Item::SpruceLog => "minecraft:spruce_log", + Item::BirchLog => "minecraft:birch_log", + Item::JungleLog => "minecraft:jungle_log", + Item::AcaciaLog => "minecraft:acacia_log", + Item::DarkOakLog => "minecraft:dark_oak_log", + Item::CrimsonStem => "minecraft:crimson_stem", + Item::WarpedStem => "minecraft:warped_stem", + Item::StrippedOakLog => "minecraft:stripped_oak_log", + Item::StrippedSpruceLog => "minecraft:stripped_spruce_log", + Item::StrippedBirchLog => "minecraft:stripped_birch_log", + Item::StrippedJungleLog => "minecraft:stripped_jungle_log", + Item::StrippedAcaciaLog => "minecraft:stripped_acacia_log", + Item::StrippedDarkOakLog => "minecraft:stripped_dark_oak_log", + Item::StrippedCrimsonStem => "minecraft:stripped_crimson_stem", + Item::StrippedWarpedStem => "minecraft:stripped_warped_stem", + Item::StrippedOakWood => "minecraft:stripped_oak_wood", + Item::StrippedSpruceWood => "minecraft:stripped_spruce_wood", + Item::StrippedBirchWood => "minecraft:stripped_birch_wood", + Item::StrippedJungleWood => "minecraft:stripped_jungle_wood", + Item::StrippedAcaciaWood => "minecraft:stripped_acacia_wood", + Item::StrippedDarkOakWood => "minecraft:stripped_dark_oak_wood", + Item::StrippedCrimsonHyphae => "minecraft:stripped_crimson_hyphae", + Item::StrippedWarpedHyphae => "minecraft:stripped_warped_hyphae", + Item::OakWood => "minecraft:oak_wood", + Item::SpruceWood => "minecraft:spruce_wood", + Item::BirchWood => "minecraft:birch_wood", + Item::JungleWood => "minecraft:jungle_wood", + Item::AcaciaWood => "minecraft:acacia_wood", + Item::DarkOakWood => "minecraft:dark_oak_wood", + Item::CrimsonHyphae => "minecraft:crimson_hyphae", + Item::WarpedHyphae => "minecraft:warped_hyphae", + Item::OakLeaves => "minecraft:oak_leaves", + Item::SpruceLeaves => "minecraft:spruce_leaves", + Item::BirchLeaves => "minecraft:birch_leaves", + Item::JungleLeaves => "minecraft:jungle_leaves", + Item::AcaciaLeaves => "minecraft:acacia_leaves", + Item::DarkOakLeaves => "minecraft:dark_oak_leaves", + Item::AzaleaLeaves => "minecraft:azalea_leaves", + Item::FloweringAzaleaLeaves => "minecraft:flowering_azalea_leaves", + Item::Sponge => "minecraft:sponge", + Item::WetSponge => "minecraft:wet_sponge", + Item::Glass => "minecraft:glass", + Item::TintedGlass => "minecraft:tinted_glass", + Item::LapisBlock => "minecraft:lapis_block", + Item::Sandstone => "minecraft:sandstone", + Item::ChiseledSandstone => "minecraft:chiseled_sandstone", + Item::CutSandstone => "minecraft:cut_sandstone", + Item::Cobweb => "minecraft:cobweb", + Item::Grass => "minecraft:grass", + Item::Fern => "minecraft:fern", + Item::Azalea => "minecraft:azalea", + Item::FloweringAzalea => "minecraft:flowering_azalea", + Item::DeadBush => "minecraft:dead_bush", + Item::Seagrass => "minecraft:seagrass", + Item::SeaPickle => "minecraft:sea_pickle", + Item::WhiteWool => "minecraft:white_wool", + Item::OrangeWool => "minecraft:orange_wool", + Item::MagentaWool => "minecraft:magenta_wool", + Item::LightBlueWool => "minecraft:light_blue_wool", + Item::YellowWool => "minecraft:yellow_wool", + Item::LimeWool => "minecraft:lime_wool", + Item::PinkWool => "minecraft:pink_wool", + Item::GrayWool => "minecraft:gray_wool", + Item::LightGrayWool => "minecraft:light_gray_wool", + Item::CyanWool => "minecraft:cyan_wool", + Item::PurpleWool => "minecraft:purple_wool", + Item::BlueWool => "minecraft:blue_wool", + Item::BrownWool => "minecraft:brown_wool", + Item::GreenWool => "minecraft:green_wool", + Item::RedWool => "minecraft:red_wool", + Item::BlackWool => "minecraft:black_wool", + Item::Dandelion => "minecraft:dandelion", + Item::Poppy => "minecraft:poppy", + Item::BlueOrchid => "minecraft:blue_orchid", + Item::Allium => "minecraft:allium", + Item::AzureBluet => "minecraft:azure_bluet", + Item::RedTulip => "minecraft:red_tulip", + Item::OrangeTulip => "minecraft:orange_tulip", + Item::WhiteTulip => "minecraft:white_tulip", + Item::PinkTulip => "minecraft:pink_tulip", + Item::OxeyeDaisy => "minecraft:oxeye_daisy", + Item::Cornflower => "minecraft:cornflower", + Item::LilyOfTheValley => "minecraft:lily_of_the_valley", + Item::WitherRose => "minecraft:wither_rose", + Item::SporeBlossom => "minecraft:spore_blossom", + Item::BrownMushroom => "minecraft:brown_mushroom", + Item::RedMushroom => "minecraft:red_mushroom", + Item::CrimsonFungus => "minecraft:crimson_fungus", + Item::WarpedFungus => "minecraft:warped_fungus", + Item::CrimsonRoots => "minecraft:crimson_roots", + Item::WarpedRoots => "minecraft:warped_roots", + Item::NetherSprouts => "minecraft:nether_sprouts", + Item::WeepingVines => "minecraft:weeping_vines", + Item::TwistingVines => "minecraft:twisting_vines", + Item::SugarCane => "minecraft:sugar_cane", + Item::Kelp => "minecraft:kelp", + Item::MossCarpet => "minecraft:moss_carpet", + Item::MossBlock => "minecraft:moss_block", + Item::HangingRoots => "minecraft:hanging_roots", + Item::BigDripleaf => "minecraft:big_dripleaf", + Item::SmallDripleaf => "minecraft:small_dripleaf", + Item::Bamboo => "minecraft:bamboo", + Item::OakSlab => "minecraft:oak_slab", + Item::SpruceSlab => "minecraft:spruce_slab", + Item::BirchSlab => "minecraft:birch_slab", + Item::JungleSlab => "minecraft:jungle_slab", + Item::AcaciaSlab => "minecraft:acacia_slab", + Item::DarkOakSlab => "minecraft:dark_oak_slab", + Item::CrimsonSlab => "minecraft:crimson_slab", + Item::WarpedSlab => "minecraft:warped_slab", + Item::StoneSlab => "minecraft:stone_slab", + Item::SmoothStoneSlab => "minecraft:smooth_stone_slab", + Item::SandstoneSlab => "minecraft:sandstone_slab", + Item::CutSandstoneSlab => "minecraft:cut_sandstone_slab", + Item::PetrifiedOakSlab => "minecraft:petrified_oak_slab", + Item::CobblestoneSlab => "minecraft:cobblestone_slab", + Item::BrickSlab => "minecraft:brick_slab", + Item::StoneBrickSlab => "minecraft:stone_brick_slab", + Item::NetherBrickSlab => "minecraft:nether_brick_slab", + Item::QuartzSlab => "minecraft:quartz_slab", + Item::RedSandstoneSlab => "minecraft:red_sandstone_slab", + Item::CutRedSandstoneSlab => "minecraft:cut_red_sandstone_slab", + Item::PurpurSlab => "minecraft:purpur_slab", + Item::PrismarineSlab => "minecraft:prismarine_slab", + Item::PrismarineBrickSlab => "minecraft:prismarine_brick_slab", + Item::DarkPrismarineSlab => "minecraft:dark_prismarine_slab", + Item::SmoothQuartz => "minecraft:smooth_quartz", + Item::SmoothRedSandstone => "minecraft:smooth_red_sandstone", + Item::SmoothSandstone => "minecraft:smooth_sandstone", + Item::SmoothStone => "minecraft:smooth_stone", + Item::Bricks => "minecraft:bricks", + Item::Bookshelf => "minecraft:bookshelf", + Item::MossyCobblestone => "minecraft:mossy_cobblestone", + Item::Obsidian => "minecraft:obsidian", + Item::Torch => "minecraft:torch", + Item::EndRod => "minecraft:end_rod", + Item::ChorusPlant => "minecraft:chorus_plant", + Item::ChorusFlower => "minecraft:chorus_flower", + Item::PurpurBlock => "minecraft:purpur_block", + Item::PurpurPillar => "minecraft:purpur_pillar", + Item::PurpurStairs => "minecraft:purpur_stairs", + Item::Spawner => "minecraft:spawner", + Item::OakStairs => "minecraft:oak_stairs", + Item::Chest => "minecraft:chest", + Item::CraftingTable => "minecraft:crafting_table", + Item::Farmland => "minecraft:farmland", + Item::Furnace => "minecraft:furnace", + Item::Ladder => "minecraft:ladder", + Item::CobblestoneStairs => "minecraft:cobblestone_stairs", + Item::Snow => "minecraft:snow", + Item::Ice => "minecraft:ice", + Item::SnowBlock => "minecraft:snow_block", + Item::Cactus => "minecraft:cactus", + Item::Clay => "minecraft:clay", + Item::Jukebox => "minecraft:jukebox", + Item::OakFence => "minecraft:oak_fence", + Item::SpruceFence => "minecraft:spruce_fence", + Item::BirchFence => "minecraft:birch_fence", + Item::JungleFence => "minecraft:jungle_fence", + Item::AcaciaFence => "minecraft:acacia_fence", + Item::DarkOakFence => "minecraft:dark_oak_fence", + Item::CrimsonFence => "minecraft:crimson_fence", + Item::WarpedFence => "minecraft:warped_fence", + Item::Pumpkin => "minecraft:pumpkin", + Item::CarvedPumpkin => "minecraft:carved_pumpkin", + Item::JackOLantern => "minecraft:jack_o_lantern", + Item::Netherrack => "minecraft:netherrack", + Item::SoulSand => "minecraft:soul_sand", + Item::SoulSoil => "minecraft:soul_soil", + Item::Basalt => "minecraft:basalt", + Item::PolishedBasalt => "minecraft:polished_basalt", + Item::SmoothBasalt => "minecraft:smooth_basalt", + Item::SoulTorch => "minecraft:soul_torch", + Item::Glowstone => "minecraft:glowstone", + Item::InfestedStone => "minecraft:infested_stone", + Item::InfestedCobblestone => "minecraft:infested_cobblestone", + Item::InfestedStoneBricks => "minecraft:infested_stone_bricks", + Item::InfestedMossyStoneBricks => "minecraft:infested_mossy_stone_bricks", + Item::InfestedCrackedStoneBricks => "minecraft:infested_cracked_stone_bricks", + Item::InfestedChiseledStoneBricks => "minecraft:infested_chiseled_stone_bricks", + Item::InfestedDeepslate => "minecraft:infested_deepslate", + Item::StoneBricks => "minecraft:stone_bricks", + Item::MossyStoneBricks => "minecraft:mossy_stone_bricks", + Item::CrackedStoneBricks => "minecraft:cracked_stone_bricks", + Item::ChiseledStoneBricks => "minecraft:chiseled_stone_bricks", + Item::DeepslateBricks => "minecraft:deepslate_bricks", + Item::CrackedDeepslateBricks => "minecraft:cracked_deepslate_bricks", + Item::DeepslateTiles => "minecraft:deepslate_tiles", + Item::CrackedDeepslateTiles => "minecraft:cracked_deepslate_tiles", + Item::ChiseledDeepslate => "minecraft:chiseled_deepslate", + Item::BrownMushroomBlock => "minecraft:brown_mushroom_block", + Item::RedMushroomBlock => "minecraft:red_mushroom_block", + Item::MushroomStem => "minecraft:mushroom_stem", + Item::IronBars => "minecraft:iron_bars", + Item::Chain => "minecraft:chain", + Item::GlassPane => "minecraft:glass_pane", + Item::Melon => "minecraft:melon", + Item::Vine => "minecraft:vine", + Item::GlowLichen => "minecraft:glow_lichen", + Item::BrickStairs => "minecraft:brick_stairs", + Item::StoneBrickStairs => "minecraft:stone_brick_stairs", + Item::Mycelium => "minecraft:mycelium", + Item::LilyPad => "minecraft:lily_pad", + Item::NetherBricks => "minecraft:nether_bricks", + Item::CrackedNetherBricks => "minecraft:cracked_nether_bricks", + Item::ChiseledNetherBricks => "minecraft:chiseled_nether_bricks", + Item::NetherBrickFence => "minecraft:nether_brick_fence", + Item::NetherBrickStairs => "minecraft:nether_brick_stairs", + Item::EnchantingTable => "minecraft:enchanting_table", + Item::EndPortalFrame => "minecraft:end_portal_frame", + Item::EndStone => "minecraft:end_stone", + Item::EndStoneBricks => "minecraft:end_stone_bricks", + Item::DragonEgg => "minecraft:dragon_egg", + Item::SandstoneStairs => "minecraft:sandstone_stairs", + Item::EnderChest => "minecraft:ender_chest", + Item::EmeraldBlock => "minecraft:emerald_block", + Item::SpruceStairs => "minecraft:spruce_stairs", + Item::BirchStairs => "minecraft:birch_stairs", + Item::JungleStairs => "minecraft:jungle_stairs", + Item::CrimsonStairs => "minecraft:crimson_stairs", + Item::WarpedStairs => "minecraft:warped_stairs", + Item::CommandBlock => "minecraft:command_block", + Item::Beacon => "minecraft:beacon", + Item::CobblestoneWall => "minecraft:cobblestone_wall", + Item::MossyCobblestoneWall => "minecraft:mossy_cobblestone_wall", + Item::BrickWall => "minecraft:brick_wall", + Item::PrismarineWall => "minecraft:prismarine_wall", + Item::RedSandstoneWall => "minecraft:red_sandstone_wall", + Item::MossyStoneBrickWall => "minecraft:mossy_stone_brick_wall", + Item::GraniteWall => "minecraft:granite_wall", + Item::StoneBrickWall => "minecraft:stone_brick_wall", + Item::NetherBrickWall => "minecraft:nether_brick_wall", + Item::AndesiteWall => "minecraft:andesite_wall", + Item::RedNetherBrickWall => "minecraft:red_nether_brick_wall", + Item::SandstoneWall => "minecraft:sandstone_wall", + Item::EndStoneBrickWall => "minecraft:end_stone_brick_wall", + Item::DioriteWall => "minecraft:diorite_wall", + Item::BlackstoneWall => "minecraft:blackstone_wall", + Item::PolishedBlackstoneWall => "minecraft:polished_blackstone_wall", + Item::PolishedBlackstoneBrickWall => "minecraft:polished_blackstone_brick_wall", + Item::CobbledDeepslateWall => "minecraft:cobbled_deepslate_wall", + Item::PolishedDeepslateWall => "minecraft:polished_deepslate_wall", + Item::DeepslateBrickWall => "minecraft:deepslate_brick_wall", + Item::DeepslateTileWall => "minecraft:deepslate_tile_wall", + Item::Anvil => "minecraft:anvil", + Item::ChippedAnvil => "minecraft:chipped_anvil", + Item::DamagedAnvil => "minecraft:damaged_anvil", + Item::ChiseledQuartzBlock => "minecraft:chiseled_quartz_block", + Item::QuartzBlock => "minecraft:quartz_block", + Item::QuartzBricks => "minecraft:quartz_bricks", + Item::QuartzPillar => "minecraft:quartz_pillar", + Item::QuartzStairs => "minecraft:quartz_stairs", + Item::WhiteTerracotta => "minecraft:white_terracotta", + Item::OrangeTerracotta => "minecraft:orange_terracotta", + Item::MagentaTerracotta => "minecraft:magenta_terracotta", + Item::LightBlueTerracotta => "minecraft:light_blue_terracotta", + Item::YellowTerracotta => "minecraft:yellow_terracotta", + Item::LimeTerracotta => "minecraft:lime_terracotta", + Item::PinkTerracotta => "minecraft:pink_terracotta", + Item::GrayTerracotta => "minecraft:gray_terracotta", + Item::LightGrayTerracotta => "minecraft:light_gray_terracotta", + Item::CyanTerracotta => "minecraft:cyan_terracotta", + Item::PurpleTerracotta => "minecraft:purple_terracotta", + Item::BlueTerracotta => "minecraft:blue_terracotta", + Item::BrownTerracotta => "minecraft:brown_terracotta", + Item::GreenTerracotta => "minecraft:green_terracotta", + Item::RedTerracotta => "minecraft:red_terracotta", + Item::BlackTerracotta => "minecraft:black_terracotta", + Item::Barrier => "minecraft:barrier", + Item::Light => "minecraft:light", + Item::HayBlock => "minecraft:hay_block", + Item::WhiteCarpet => "minecraft:white_carpet", + Item::OrangeCarpet => "minecraft:orange_carpet", + Item::MagentaCarpet => "minecraft:magenta_carpet", + Item::LightBlueCarpet => "minecraft:light_blue_carpet", + Item::YellowCarpet => "minecraft:yellow_carpet", + Item::LimeCarpet => "minecraft:lime_carpet", + Item::PinkCarpet => "minecraft:pink_carpet", + Item::GrayCarpet => "minecraft:gray_carpet", + Item::LightGrayCarpet => "minecraft:light_gray_carpet", + Item::CyanCarpet => "minecraft:cyan_carpet", + Item::PurpleCarpet => "minecraft:purple_carpet", + Item::BlueCarpet => "minecraft:blue_carpet", + Item::BrownCarpet => "minecraft:brown_carpet", + Item::GreenCarpet => "minecraft:green_carpet", + Item::RedCarpet => "minecraft:red_carpet", + Item::BlackCarpet => "minecraft:black_carpet", + Item::Terracotta => "minecraft:terracotta", + Item::PackedIce => "minecraft:packed_ice", + Item::AcaciaStairs => "minecraft:acacia_stairs", + Item::DarkOakStairs => "minecraft:dark_oak_stairs", + Item::DirtPath => "minecraft:dirt_path", + Item::Sunflower => "minecraft:sunflower", + Item::Lilac => "minecraft:lilac", + Item::RoseBush => "minecraft:rose_bush", + Item::Peony => "minecraft:peony", + Item::TallGrass => "minecraft:tall_grass", + Item::LargeFern => "minecraft:large_fern", + Item::WhiteStainedGlass => "minecraft:white_stained_glass", + Item::OrangeStainedGlass => "minecraft:orange_stained_glass", + Item::MagentaStainedGlass => "minecraft:magenta_stained_glass", + Item::LightBlueStainedGlass => "minecraft:light_blue_stained_glass", + Item::YellowStainedGlass => "minecraft:yellow_stained_glass", + Item::LimeStainedGlass => "minecraft:lime_stained_glass", + Item::PinkStainedGlass => "minecraft:pink_stained_glass", + Item::GrayStainedGlass => "minecraft:gray_stained_glass", + Item::LightGrayStainedGlass => "minecraft:light_gray_stained_glass", + Item::CyanStainedGlass => "minecraft:cyan_stained_glass", + Item::PurpleStainedGlass => "minecraft:purple_stained_glass", + Item::BlueStainedGlass => "minecraft:blue_stained_glass", + Item::BrownStainedGlass => "minecraft:brown_stained_glass", + Item::GreenStainedGlass => "minecraft:green_stained_glass", + Item::RedStainedGlass => "minecraft:red_stained_glass", + Item::BlackStainedGlass => "minecraft:black_stained_glass", + Item::WhiteStainedGlassPane => "minecraft:white_stained_glass_pane", + Item::OrangeStainedGlassPane => "minecraft:orange_stained_glass_pane", + Item::MagentaStainedGlassPane => "minecraft:magenta_stained_glass_pane", + Item::LightBlueStainedGlassPane => "minecraft:light_blue_stained_glass_pane", + Item::YellowStainedGlassPane => "minecraft:yellow_stained_glass_pane", + Item::LimeStainedGlassPane => "minecraft:lime_stained_glass_pane", + Item::PinkStainedGlassPane => "minecraft:pink_stained_glass_pane", + Item::GrayStainedGlassPane => "minecraft:gray_stained_glass_pane", + Item::LightGrayStainedGlassPane => "minecraft:light_gray_stained_glass_pane", + Item::CyanStainedGlassPane => "minecraft:cyan_stained_glass_pane", + Item::PurpleStainedGlassPane => "minecraft:purple_stained_glass_pane", + Item::BlueStainedGlassPane => "minecraft:blue_stained_glass_pane", + Item::BrownStainedGlassPane => "minecraft:brown_stained_glass_pane", + Item::GreenStainedGlassPane => "minecraft:green_stained_glass_pane", + Item::RedStainedGlassPane => "minecraft:red_stained_glass_pane", + Item::BlackStainedGlassPane => "minecraft:black_stained_glass_pane", + Item::Prismarine => "minecraft:prismarine", + Item::PrismarineBricks => "minecraft:prismarine_bricks", + Item::DarkPrismarine => "minecraft:dark_prismarine", + Item::PrismarineStairs => "minecraft:prismarine_stairs", + Item::PrismarineBrickStairs => "minecraft:prismarine_brick_stairs", + Item::DarkPrismarineStairs => "minecraft:dark_prismarine_stairs", + Item::SeaLantern => "minecraft:sea_lantern", + Item::RedSandstone => "minecraft:red_sandstone", + Item::ChiseledRedSandstone => "minecraft:chiseled_red_sandstone", + Item::CutRedSandstone => "minecraft:cut_red_sandstone", + Item::RedSandstoneStairs => "minecraft:red_sandstone_stairs", + Item::RepeatingCommandBlock => "minecraft:repeating_command_block", + Item::ChainCommandBlock => "minecraft:chain_command_block", + Item::MagmaBlock => "minecraft:magma_block", + Item::NetherWartBlock => "minecraft:nether_wart_block", + Item::WarpedWartBlock => "minecraft:warped_wart_block", + Item::RedNetherBricks => "minecraft:red_nether_bricks", + Item::BoneBlock => "minecraft:bone_block", + Item::StructureVoid => "minecraft:structure_void", + Item::ShulkerBox => "minecraft:shulker_box", + Item::WhiteShulkerBox => "minecraft:white_shulker_box", + Item::OrangeShulkerBox => "minecraft:orange_shulker_box", + Item::MagentaShulkerBox => "minecraft:magenta_shulker_box", + Item::LightBlueShulkerBox => "minecraft:light_blue_shulker_box", + Item::YellowShulkerBox => "minecraft:yellow_shulker_box", + Item::LimeShulkerBox => "minecraft:lime_shulker_box", + Item::PinkShulkerBox => "minecraft:pink_shulker_box", + Item::GrayShulkerBox => "minecraft:gray_shulker_box", + Item::LightGrayShulkerBox => "minecraft:light_gray_shulker_box", + Item::CyanShulkerBox => "minecraft:cyan_shulker_box", + Item::PurpleShulkerBox => "minecraft:purple_shulker_box", + Item::BlueShulkerBox => "minecraft:blue_shulker_box", + Item::BrownShulkerBox => "minecraft:brown_shulker_box", + Item::GreenShulkerBox => "minecraft:green_shulker_box", + Item::RedShulkerBox => "minecraft:red_shulker_box", + Item::BlackShulkerBox => "minecraft:black_shulker_box", + Item::WhiteGlazedTerracotta => "minecraft:white_glazed_terracotta", + Item::OrangeGlazedTerracotta => "minecraft:orange_glazed_terracotta", + Item::MagentaGlazedTerracotta => "minecraft:magenta_glazed_terracotta", + Item::LightBlueGlazedTerracotta => "minecraft:light_blue_glazed_terracotta", + Item::YellowGlazedTerracotta => "minecraft:yellow_glazed_terracotta", + Item::LimeGlazedTerracotta => "minecraft:lime_glazed_terracotta", + Item::PinkGlazedTerracotta => "minecraft:pink_glazed_terracotta", + Item::GrayGlazedTerracotta => "minecraft:gray_glazed_terracotta", + Item::LightGrayGlazedTerracotta => "minecraft:light_gray_glazed_terracotta", + Item::CyanGlazedTerracotta => "minecraft:cyan_glazed_terracotta", + Item::PurpleGlazedTerracotta => "minecraft:purple_glazed_terracotta", + Item::BlueGlazedTerracotta => "minecraft:blue_glazed_terracotta", + Item::BrownGlazedTerracotta => "minecraft:brown_glazed_terracotta", + Item::GreenGlazedTerracotta => "minecraft:green_glazed_terracotta", + Item::RedGlazedTerracotta => "minecraft:red_glazed_terracotta", + Item::BlackGlazedTerracotta => "minecraft:black_glazed_terracotta", + Item::WhiteConcrete => "minecraft:white_concrete", + Item::OrangeConcrete => "minecraft:orange_concrete", + Item::MagentaConcrete => "minecraft:magenta_concrete", + Item::LightBlueConcrete => "minecraft:light_blue_concrete", + Item::YellowConcrete => "minecraft:yellow_concrete", + Item::LimeConcrete => "minecraft:lime_concrete", + Item::PinkConcrete => "minecraft:pink_concrete", + Item::GrayConcrete => "minecraft:gray_concrete", + Item::LightGrayConcrete => "minecraft:light_gray_concrete", + Item::CyanConcrete => "minecraft:cyan_concrete", + Item::PurpleConcrete => "minecraft:purple_concrete", + Item::BlueConcrete => "minecraft:blue_concrete", + Item::BrownConcrete => "minecraft:brown_concrete", + Item::GreenConcrete => "minecraft:green_concrete", + Item::RedConcrete => "minecraft:red_concrete", + Item::BlackConcrete => "minecraft:black_concrete", + Item::WhiteConcretePowder => "minecraft:white_concrete_powder", + Item::OrangeConcretePowder => "minecraft:orange_concrete_powder", + Item::MagentaConcretePowder => "minecraft:magenta_concrete_powder", + Item::LightBlueConcretePowder => "minecraft:light_blue_concrete_powder", + Item::YellowConcretePowder => "minecraft:yellow_concrete_powder", + Item::LimeConcretePowder => "minecraft:lime_concrete_powder", + Item::PinkConcretePowder => "minecraft:pink_concrete_powder", + Item::GrayConcretePowder => "minecraft:gray_concrete_powder", + Item::LightGrayConcretePowder => "minecraft:light_gray_concrete_powder", + Item::CyanConcretePowder => "minecraft:cyan_concrete_powder", + Item::PurpleConcretePowder => "minecraft:purple_concrete_powder", + Item::BlueConcretePowder => "minecraft:blue_concrete_powder", + Item::BrownConcretePowder => "minecraft:brown_concrete_powder", + Item::GreenConcretePowder => "minecraft:green_concrete_powder", + Item::RedConcretePowder => "minecraft:red_concrete_powder", + Item::BlackConcretePowder => "minecraft:black_concrete_powder", + Item::TurtleEgg => "minecraft:turtle_egg", + Item::DeadTubeCoralBlock => "minecraft:dead_tube_coral_block", + Item::DeadBrainCoralBlock => "minecraft:dead_brain_coral_block", + Item::DeadBubbleCoralBlock => "minecraft:dead_bubble_coral_block", + Item::DeadFireCoralBlock => "minecraft:dead_fire_coral_block", + Item::DeadHornCoralBlock => "minecraft:dead_horn_coral_block", + Item::TubeCoralBlock => "minecraft:tube_coral_block", + Item::BrainCoralBlock => "minecraft:brain_coral_block", + Item::BubbleCoralBlock => "minecraft:bubble_coral_block", + Item::FireCoralBlock => "minecraft:fire_coral_block", + Item::HornCoralBlock => "minecraft:horn_coral_block", + Item::TubeCoral => "minecraft:tube_coral", + Item::BrainCoral => "minecraft:brain_coral", + Item::BubbleCoral => "minecraft:bubble_coral", + Item::FireCoral => "minecraft:fire_coral", + Item::HornCoral => "minecraft:horn_coral", + Item::DeadBrainCoral => "minecraft:dead_brain_coral", + Item::DeadBubbleCoral => "minecraft:dead_bubble_coral", + Item::DeadFireCoral => "minecraft:dead_fire_coral", + Item::DeadHornCoral => "minecraft:dead_horn_coral", + Item::DeadTubeCoral => "minecraft:dead_tube_coral", + Item::TubeCoralFan => "minecraft:tube_coral_fan", + Item::BrainCoralFan => "minecraft:brain_coral_fan", + Item::BubbleCoralFan => "minecraft:bubble_coral_fan", + Item::FireCoralFan => "minecraft:fire_coral_fan", + Item::HornCoralFan => "minecraft:horn_coral_fan", + Item::DeadTubeCoralFan => "minecraft:dead_tube_coral_fan", + Item::DeadBrainCoralFan => "minecraft:dead_brain_coral_fan", + Item::DeadBubbleCoralFan => "minecraft:dead_bubble_coral_fan", + Item::DeadFireCoralFan => "minecraft:dead_fire_coral_fan", + Item::DeadHornCoralFan => "minecraft:dead_horn_coral_fan", + Item::BlueIce => "minecraft:blue_ice", + Item::Conduit => "minecraft:conduit", + Item::PolishedGraniteStairs => "minecraft:polished_granite_stairs", + Item::SmoothRedSandstoneStairs => "minecraft:smooth_red_sandstone_stairs", + Item::MossyStoneBrickStairs => "minecraft:mossy_stone_brick_stairs", + Item::PolishedDioriteStairs => "minecraft:polished_diorite_stairs", + Item::MossyCobblestoneStairs => "minecraft:mossy_cobblestone_stairs", + Item::EndStoneBrickStairs => "minecraft:end_stone_brick_stairs", + Item::StoneStairs => "minecraft:stone_stairs", + Item::SmoothSandstoneStairs => "minecraft:smooth_sandstone_stairs", + Item::SmoothQuartzStairs => "minecraft:smooth_quartz_stairs", + Item::GraniteStairs => "minecraft:granite_stairs", + Item::AndesiteStairs => "minecraft:andesite_stairs", + Item::RedNetherBrickStairs => "minecraft:red_nether_brick_stairs", + Item::PolishedAndesiteStairs => "minecraft:polished_andesite_stairs", + Item::DioriteStairs => "minecraft:diorite_stairs", + Item::CobbledDeepslateStairs => "minecraft:cobbled_deepslate_stairs", + Item::PolishedDeepslateStairs => "minecraft:polished_deepslate_stairs", + Item::DeepslateBrickStairs => "minecraft:deepslate_brick_stairs", + Item::DeepslateTileStairs => "minecraft:deepslate_tile_stairs", + Item::PolishedGraniteSlab => "minecraft:polished_granite_slab", + Item::SmoothRedSandstoneSlab => "minecraft:smooth_red_sandstone_slab", + Item::MossyStoneBrickSlab => "minecraft:mossy_stone_brick_slab", + Item::PolishedDioriteSlab => "minecraft:polished_diorite_slab", + Item::MossyCobblestoneSlab => "minecraft:mossy_cobblestone_slab", + Item::EndStoneBrickSlab => "minecraft:end_stone_brick_slab", + Item::SmoothSandstoneSlab => "minecraft:smooth_sandstone_slab", + Item::SmoothQuartzSlab => "minecraft:smooth_quartz_slab", + Item::GraniteSlab => "minecraft:granite_slab", + Item::AndesiteSlab => "minecraft:andesite_slab", + Item::RedNetherBrickSlab => "minecraft:red_nether_brick_slab", + Item::PolishedAndesiteSlab => "minecraft:polished_andesite_slab", + Item::DioriteSlab => "minecraft:diorite_slab", + Item::CobbledDeepslateSlab => "minecraft:cobbled_deepslate_slab", + Item::PolishedDeepslateSlab => "minecraft:polished_deepslate_slab", + Item::DeepslateBrickSlab => "minecraft:deepslate_brick_slab", + Item::DeepslateTileSlab => "minecraft:deepslate_tile_slab", + Item::Scaffolding => "minecraft:scaffolding", + Item::Redstone => "minecraft:redstone", + Item::RedstoneTorch => "minecraft:redstone_torch", + Item::RedstoneBlock => "minecraft:redstone_block", + Item::Repeater => "minecraft:repeater", + Item::Comparator => "minecraft:comparator", + Item::Piston => "minecraft:piston", + Item::StickyPiston => "minecraft:sticky_piston", + Item::SlimeBlock => "minecraft:slime_block", + Item::HoneyBlock => "minecraft:honey_block", + Item::Observer => "minecraft:observer", + Item::Hopper => "minecraft:hopper", + Item::Dispenser => "minecraft:dispenser", + Item::Dropper => "minecraft:dropper", + Item::Lectern => "minecraft:lectern", + Item::Target => "minecraft:target", + Item::Lever => "minecraft:lever", + Item::LightningRod => "minecraft:lightning_rod", + Item::DaylightDetector => "minecraft:daylight_detector", + Item::SculkSensor => "minecraft:sculk_sensor", + Item::TripwireHook => "minecraft:tripwire_hook", + Item::TrappedChest => "minecraft:trapped_chest", + Item::Tnt => "minecraft:tnt", + Item::RedstoneLamp => "minecraft:redstone_lamp", + Item::NoteBlock => "minecraft:note_block", + Item::StoneButton => "minecraft:stone_button", + Item::PolishedBlackstoneButton => "minecraft:polished_blackstone_button", + Item::OakButton => "minecraft:oak_button", + Item::SpruceButton => "minecraft:spruce_button", + Item::BirchButton => "minecraft:birch_button", + Item::JungleButton => "minecraft:jungle_button", + Item::AcaciaButton => "minecraft:acacia_button", + Item::DarkOakButton => "minecraft:dark_oak_button", + Item::CrimsonButton => "minecraft:crimson_button", + Item::WarpedButton => "minecraft:warped_button", + Item::StonePressurePlate => "minecraft:stone_pressure_plate", + Item::PolishedBlackstonePressurePlate => "minecraft:polished_blackstone_pressure_plate", + Item::LightWeightedPressurePlate => "minecraft:light_weighted_pressure_plate", + Item::HeavyWeightedPressurePlate => "minecraft:heavy_weighted_pressure_plate", + Item::OakPressurePlate => "minecraft:oak_pressure_plate", + Item::SprucePressurePlate => "minecraft:spruce_pressure_plate", + Item::BirchPressurePlate => "minecraft:birch_pressure_plate", + Item::JunglePressurePlate => "minecraft:jungle_pressure_plate", + Item::AcaciaPressurePlate => "minecraft:acacia_pressure_plate", + Item::DarkOakPressurePlate => "minecraft:dark_oak_pressure_plate", + Item::CrimsonPressurePlate => "minecraft:crimson_pressure_plate", + Item::WarpedPressurePlate => "minecraft:warped_pressure_plate", + Item::IronDoor => "minecraft:iron_door", + Item::OakDoor => "minecraft:oak_door", + Item::SpruceDoor => "minecraft:spruce_door", + Item::BirchDoor => "minecraft:birch_door", + Item::JungleDoor => "minecraft:jungle_door", + Item::AcaciaDoor => "minecraft:acacia_door", + Item::DarkOakDoor => "minecraft:dark_oak_door", + Item::CrimsonDoor => "minecraft:crimson_door", + Item::WarpedDoor => "minecraft:warped_door", + Item::IronTrapdoor => "minecraft:iron_trapdoor", + Item::OakTrapdoor => "minecraft:oak_trapdoor", + Item::SpruceTrapdoor => "minecraft:spruce_trapdoor", + Item::BirchTrapdoor => "minecraft:birch_trapdoor", + Item::JungleTrapdoor => "minecraft:jungle_trapdoor", + Item::AcaciaTrapdoor => "minecraft:acacia_trapdoor", + Item::DarkOakTrapdoor => "minecraft:dark_oak_trapdoor", + Item::CrimsonTrapdoor => "minecraft:crimson_trapdoor", + Item::WarpedTrapdoor => "minecraft:warped_trapdoor", + Item::OakFenceGate => "minecraft:oak_fence_gate", + Item::SpruceFenceGate => "minecraft:spruce_fence_gate", + Item::BirchFenceGate => "minecraft:birch_fence_gate", + Item::JungleFenceGate => "minecraft:jungle_fence_gate", + Item::AcaciaFenceGate => "minecraft:acacia_fence_gate", + Item::DarkOakFenceGate => "minecraft:dark_oak_fence_gate", + Item::CrimsonFenceGate => "minecraft:crimson_fence_gate", + Item::WarpedFenceGate => "minecraft:warped_fence_gate", + Item::PoweredRail => "minecraft:powered_rail", + Item::DetectorRail => "minecraft:detector_rail", + Item::Rail => "minecraft:rail", + Item::ActivatorRail => "minecraft:activator_rail", + Item::Saddle => "minecraft:saddle", + Item::Minecart => "minecraft:minecart", + Item::ChestMinecart => "minecraft:chest_minecart", + Item::FurnaceMinecart => "minecraft:furnace_minecart", + Item::TntMinecart => "minecraft:tnt_minecart", + Item::HopperMinecart => "minecraft:hopper_minecart", + Item::CarrotOnAStick => "minecraft:carrot_on_a_stick", + Item::WarpedFungusOnAStick => "minecraft:warped_fungus_on_a_stick", + Item::Elytra => "minecraft:elytra", + Item::OakBoat => "minecraft:oak_boat", + Item::SpruceBoat => "minecraft:spruce_boat", + Item::BirchBoat => "minecraft:birch_boat", + Item::JungleBoat => "minecraft:jungle_boat", + Item::AcaciaBoat => "minecraft:acacia_boat", + Item::DarkOakBoat => "minecraft:dark_oak_boat", + Item::StructureBlock => "minecraft:structure_block", + Item::Jigsaw => "minecraft:jigsaw", + Item::TurtleHelmet => "minecraft:turtle_helmet", + Item::Scute => "minecraft:scute", + Item::FlintAndSteel => "minecraft:flint_and_steel", + Item::Apple => "minecraft:apple", + Item::Bow => "minecraft:bow", + Item::Arrow => "minecraft:arrow", + Item::Coal => "minecraft:coal", + Item::Charcoal => "minecraft:charcoal", + Item::Diamond => "minecraft:diamond", + Item::Emerald => "minecraft:emerald", + Item::LapisLazuli => "minecraft:lapis_lazuli", + Item::Quartz => "minecraft:quartz", + Item::AmethystShard => "minecraft:amethyst_shard", + Item::RawIron => "minecraft:raw_iron", + Item::IronIngot => "minecraft:iron_ingot", + Item::RawCopper => "minecraft:raw_copper", + Item::CopperIngot => "minecraft:copper_ingot", + Item::RawGold => "minecraft:raw_gold", + Item::GoldIngot => "minecraft:gold_ingot", + Item::NetheriteIngot => "minecraft:netherite_ingot", + Item::NetheriteScrap => "minecraft:netherite_scrap", + Item::WoodenSword => "minecraft:wooden_sword", + Item::WoodenShovel => "minecraft:wooden_shovel", + Item::WoodenPickaxe => "minecraft:wooden_pickaxe", + Item::WoodenAxe => "minecraft:wooden_axe", + Item::WoodenHoe => "minecraft:wooden_hoe", + Item::StoneSword => "minecraft:stone_sword", + Item::StoneShovel => "minecraft:stone_shovel", + Item::StonePickaxe => "minecraft:stone_pickaxe", + Item::StoneAxe => "minecraft:stone_axe", + Item::StoneHoe => "minecraft:stone_hoe", + Item::GoldenSword => "minecraft:golden_sword", + Item::GoldenShovel => "minecraft:golden_shovel", + Item::GoldenPickaxe => "minecraft:golden_pickaxe", + Item::GoldenAxe => "minecraft:golden_axe", + Item::GoldenHoe => "minecraft:golden_hoe", + Item::IronSword => "minecraft:iron_sword", + Item::IronShovel => "minecraft:iron_shovel", + Item::IronPickaxe => "minecraft:iron_pickaxe", + Item::IronAxe => "minecraft:iron_axe", + Item::IronHoe => "minecraft:iron_hoe", + Item::DiamondSword => "minecraft:diamond_sword", + Item::DiamondShovel => "minecraft:diamond_shovel", + Item::DiamondPickaxe => "minecraft:diamond_pickaxe", + Item::DiamondAxe => "minecraft:diamond_axe", + Item::DiamondHoe => "minecraft:diamond_hoe", + Item::NetheriteSword => "minecraft:netherite_sword", + Item::NetheriteShovel => "minecraft:netherite_shovel", + Item::NetheritePickaxe => "minecraft:netherite_pickaxe", + Item::NetheriteAxe => "minecraft:netherite_axe", + Item::NetheriteHoe => "minecraft:netherite_hoe", + Item::Stick => "minecraft:stick", + Item::Bowl => "minecraft:bowl", + Item::MushroomStew => "minecraft:mushroom_stew", + Item::String => "minecraft:string", + Item::Feather => "minecraft:feather", + Item::Gunpowder => "minecraft:gunpowder", + Item::WheatSeeds => "minecraft:wheat_seeds", + Item::Wheat => "minecraft:wheat", + Item::Bread => "minecraft:bread", + Item::LeatherHelmet => "minecraft:leather_helmet", + Item::LeatherChestplate => "minecraft:leather_chestplate", + Item::LeatherLeggings => "minecraft:leather_leggings", + Item::LeatherBoots => "minecraft:leather_boots", + Item::ChainmailHelmet => "minecraft:chainmail_helmet", + Item::ChainmailChestplate => "minecraft:chainmail_chestplate", + Item::ChainmailLeggings => "minecraft:chainmail_leggings", + Item::ChainmailBoots => "minecraft:chainmail_boots", + Item::IronHelmet => "minecraft:iron_helmet", + Item::IronChestplate => "minecraft:iron_chestplate", + Item::IronLeggings => "minecraft:iron_leggings", + Item::IronBoots => "minecraft:iron_boots", + Item::DiamondHelmet => "minecraft:diamond_helmet", + Item::DiamondChestplate => "minecraft:diamond_chestplate", + Item::DiamondLeggings => "minecraft:diamond_leggings", + Item::DiamondBoots => "minecraft:diamond_boots", + Item::GoldenHelmet => "minecraft:golden_helmet", + Item::GoldenChestplate => "minecraft:golden_chestplate", + Item::GoldenLeggings => "minecraft:golden_leggings", + Item::GoldenBoots => "minecraft:golden_boots", + Item::NetheriteHelmet => "minecraft:netherite_helmet", + Item::NetheriteChestplate => "minecraft:netherite_chestplate", + Item::NetheriteLeggings => "minecraft:netherite_leggings", + Item::NetheriteBoots => "minecraft:netherite_boots", + Item::Flint => "minecraft:flint", + Item::Porkchop => "minecraft:porkchop", + Item::CookedPorkchop => "minecraft:cooked_porkchop", + Item::Painting => "minecraft:painting", + Item::GoldenApple => "minecraft:golden_apple", + Item::EnchantedGoldenApple => "minecraft:enchanted_golden_apple", + Item::OakSign => "minecraft:oak_sign", + Item::SpruceSign => "minecraft:spruce_sign", + Item::BirchSign => "minecraft:birch_sign", + Item::JungleSign => "minecraft:jungle_sign", + Item::AcaciaSign => "minecraft:acacia_sign", + Item::DarkOakSign => "minecraft:dark_oak_sign", + Item::CrimsonSign => "minecraft:crimson_sign", + Item::WarpedSign => "minecraft:warped_sign", + Item::Bucket => "minecraft:bucket", + Item::WaterBucket => "minecraft:water_bucket", + Item::LavaBucket => "minecraft:lava_bucket", + Item::PowderSnowBucket => "minecraft:powder_snow_bucket", + Item::Snowball => "minecraft:snowball", + Item::Leather => "minecraft:leather", + Item::MilkBucket => "minecraft:milk_bucket", + Item::PufferfishBucket => "minecraft:pufferfish_bucket", + Item::SalmonBucket => "minecraft:salmon_bucket", + Item::CodBucket => "minecraft:cod_bucket", + Item::TropicalFishBucket => "minecraft:tropical_fish_bucket", + Item::AxolotlBucket => "minecraft:axolotl_bucket", + Item::Brick => "minecraft:brick", + Item::ClayBall => "minecraft:clay_ball", + Item::DriedKelpBlock => "minecraft:dried_kelp_block", + Item::Paper => "minecraft:paper", + Item::Book => "minecraft:book", + Item::SlimeBall => "minecraft:slime_ball", + Item::Egg => "minecraft:egg", + Item::Compass => "minecraft:compass", + Item::Bundle => "minecraft:bundle", + Item::FishingRod => "minecraft:fishing_rod", + Item::Clock => "minecraft:clock", + Item::Spyglass => "minecraft:spyglass", + Item::GlowstoneDust => "minecraft:glowstone_dust", + Item::Cod => "minecraft:cod", + Item::Salmon => "minecraft:salmon", + Item::TropicalFish => "minecraft:tropical_fish", + Item::Pufferfish => "minecraft:pufferfish", + Item::CookedCod => "minecraft:cooked_cod", + Item::CookedSalmon => "minecraft:cooked_salmon", + Item::InkSac => "minecraft:ink_sac", + Item::GlowInkSac => "minecraft:glow_ink_sac", + Item::CocoaBeans => "minecraft:cocoa_beans", + Item::WhiteDye => "minecraft:white_dye", + Item::OrangeDye => "minecraft:orange_dye", + Item::MagentaDye => "minecraft:magenta_dye", + Item::LightBlueDye => "minecraft:light_blue_dye", + Item::YellowDye => "minecraft:yellow_dye", + Item::LimeDye => "minecraft:lime_dye", + Item::PinkDye => "minecraft:pink_dye", + Item::GrayDye => "minecraft:gray_dye", + Item::LightGrayDye => "minecraft:light_gray_dye", + Item::CyanDye => "minecraft:cyan_dye", + Item::PurpleDye => "minecraft:purple_dye", + Item::BlueDye => "minecraft:blue_dye", + Item::BrownDye => "minecraft:brown_dye", + Item::GreenDye => "minecraft:green_dye", + Item::RedDye => "minecraft:red_dye", + Item::BlackDye => "minecraft:black_dye", + Item::BoneMeal => "minecraft:bone_meal", + Item::Bone => "minecraft:bone", + Item::Sugar => "minecraft:sugar", + Item::Cake => "minecraft:cake", + Item::WhiteBed => "minecraft:white_bed", + Item::OrangeBed => "minecraft:orange_bed", + Item::MagentaBed => "minecraft:magenta_bed", + Item::LightBlueBed => "minecraft:light_blue_bed", + Item::YellowBed => "minecraft:yellow_bed", + Item::LimeBed => "minecraft:lime_bed", + Item::PinkBed => "minecraft:pink_bed", + Item::GrayBed => "minecraft:gray_bed", + Item::LightGrayBed => "minecraft:light_gray_bed", + Item::CyanBed => "minecraft:cyan_bed", + Item::PurpleBed => "minecraft:purple_bed", + Item::BlueBed => "minecraft:blue_bed", + Item::BrownBed => "minecraft:brown_bed", + Item::GreenBed => "minecraft:green_bed", + Item::RedBed => "minecraft:red_bed", + Item::BlackBed => "minecraft:black_bed", + Item::Cookie => "minecraft:cookie", + Item::FilledMap => "minecraft:filled_map", + Item::Shears => "minecraft:shears", + Item::MelonSlice => "minecraft:melon_slice", + Item::DriedKelp => "minecraft:dried_kelp", + Item::PumpkinSeeds => "minecraft:pumpkin_seeds", + Item::MelonSeeds => "minecraft:melon_seeds", + Item::Beef => "minecraft:beef", + Item::CookedBeef => "minecraft:cooked_beef", + Item::Chicken => "minecraft:chicken", + Item::CookedChicken => "minecraft:cooked_chicken", + Item::RottenFlesh => "minecraft:rotten_flesh", + Item::EnderPearl => "minecraft:ender_pearl", + Item::BlazeRod => "minecraft:blaze_rod", + Item::GhastTear => "minecraft:ghast_tear", + Item::GoldNugget => "minecraft:gold_nugget", + Item::NetherWart => "minecraft:nether_wart", + Item::Potion => "minecraft:potion", + Item::GlassBottle => "minecraft:glass_bottle", + Item::SpiderEye => "minecraft:spider_eye", + Item::FermentedSpiderEye => "minecraft:fermented_spider_eye", + Item::BlazePowder => "minecraft:blaze_powder", + Item::MagmaCream => "minecraft:magma_cream", + Item::BrewingStand => "minecraft:brewing_stand", + Item::Cauldron => "minecraft:cauldron", + Item::EnderEye => "minecraft:ender_eye", + Item::GlisteringMelonSlice => "minecraft:glistering_melon_slice", + Item::AxolotlSpawnEgg => "minecraft:axolotl_spawn_egg", + Item::BatSpawnEgg => "minecraft:bat_spawn_egg", + Item::BeeSpawnEgg => "minecraft:bee_spawn_egg", + Item::BlazeSpawnEgg => "minecraft:blaze_spawn_egg", + Item::CatSpawnEgg => "minecraft:cat_spawn_egg", + Item::CaveSpiderSpawnEgg => "minecraft:cave_spider_spawn_egg", + Item::ChickenSpawnEgg => "minecraft:chicken_spawn_egg", + Item::CodSpawnEgg => "minecraft:cod_spawn_egg", + Item::CowSpawnEgg => "minecraft:cow_spawn_egg", + Item::CreeperSpawnEgg => "minecraft:creeper_spawn_egg", + Item::DolphinSpawnEgg => "minecraft:dolphin_spawn_egg", + Item::DonkeySpawnEgg => "minecraft:donkey_spawn_egg", + Item::DrownedSpawnEgg => "minecraft:drowned_spawn_egg", + Item::ElderGuardianSpawnEgg => "minecraft:elder_guardian_spawn_egg", + Item::EndermanSpawnEgg => "minecraft:enderman_spawn_egg", + Item::EndermiteSpawnEgg => "minecraft:endermite_spawn_egg", + Item::EvokerSpawnEgg => "minecraft:evoker_spawn_egg", + Item::FoxSpawnEgg => "minecraft:fox_spawn_egg", + Item::GhastSpawnEgg => "minecraft:ghast_spawn_egg", + Item::GlowSquidSpawnEgg => "minecraft:glow_squid_spawn_egg", + Item::GoatSpawnEgg => "minecraft:goat_spawn_egg", + Item::GuardianSpawnEgg => "minecraft:guardian_spawn_egg", + Item::HoglinSpawnEgg => "minecraft:hoglin_spawn_egg", + Item::HorseSpawnEgg => "minecraft:horse_spawn_egg", + Item::HuskSpawnEgg => "minecraft:husk_spawn_egg", + Item::LlamaSpawnEgg => "minecraft:llama_spawn_egg", + Item::MagmaCubeSpawnEgg => "minecraft:magma_cube_spawn_egg", + Item::MooshroomSpawnEgg => "minecraft:mooshroom_spawn_egg", + Item::MuleSpawnEgg => "minecraft:mule_spawn_egg", + Item::OcelotSpawnEgg => "minecraft:ocelot_spawn_egg", + Item::PandaSpawnEgg => "minecraft:panda_spawn_egg", + Item::ParrotSpawnEgg => "minecraft:parrot_spawn_egg", + Item::PhantomSpawnEgg => "minecraft:phantom_spawn_egg", + Item::PigSpawnEgg => "minecraft:pig_spawn_egg", + Item::PiglinSpawnEgg => "minecraft:piglin_spawn_egg", + Item::PiglinBruteSpawnEgg => "minecraft:piglin_brute_spawn_egg", + Item::PillagerSpawnEgg => "minecraft:pillager_spawn_egg", + Item::PolarBearSpawnEgg => "minecraft:polar_bear_spawn_egg", + Item::PufferfishSpawnEgg => "minecraft:pufferfish_spawn_egg", + Item::RabbitSpawnEgg => "minecraft:rabbit_spawn_egg", + Item::RavagerSpawnEgg => "minecraft:ravager_spawn_egg", + Item::SalmonSpawnEgg => "minecraft:salmon_spawn_egg", + Item::SheepSpawnEgg => "minecraft:sheep_spawn_egg", + Item::ShulkerSpawnEgg => "minecraft:shulker_spawn_egg", + Item::SilverfishSpawnEgg => "minecraft:silverfish_spawn_egg", + Item::SkeletonSpawnEgg => "minecraft:skeleton_spawn_egg", + Item::SkeletonHorseSpawnEgg => "minecraft:skeleton_horse_spawn_egg", + Item::SlimeSpawnEgg => "minecraft:slime_spawn_egg", + Item::SpiderSpawnEgg => "minecraft:spider_spawn_egg", + Item::SquidSpawnEgg => "minecraft:squid_spawn_egg", + Item::StraySpawnEgg => "minecraft:stray_spawn_egg", + Item::StriderSpawnEgg => "minecraft:strider_spawn_egg", + Item::TraderLlamaSpawnEgg => "minecraft:trader_llama_spawn_egg", + Item::TropicalFishSpawnEgg => "minecraft:tropical_fish_spawn_egg", + Item::TurtleSpawnEgg => "minecraft:turtle_spawn_egg", + Item::VexSpawnEgg => "minecraft:vex_spawn_egg", + Item::VillagerSpawnEgg => "minecraft:villager_spawn_egg", + Item::VindicatorSpawnEgg => "minecraft:vindicator_spawn_egg", + Item::WanderingTraderSpawnEgg => "minecraft:wandering_trader_spawn_egg", + Item::WitchSpawnEgg => "minecraft:witch_spawn_egg", + Item::WitherSkeletonSpawnEgg => "minecraft:wither_skeleton_spawn_egg", + Item::WolfSpawnEgg => "minecraft:wolf_spawn_egg", + Item::ZoglinSpawnEgg => "minecraft:zoglin_spawn_egg", + Item::ZombieSpawnEgg => "minecraft:zombie_spawn_egg", + Item::ZombieHorseSpawnEgg => "minecraft:zombie_horse_spawn_egg", + Item::ZombieVillagerSpawnEgg => "minecraft:zombie_villager_spawn_egg", + Item::ZombifiedPiglinSpawnEgg => "minecraft:zombified_piglin_spawn_egg", + Item::ExperienceBottle => "minecraft:experience_bottle", + Item::FireCharge => "minecraft:fire_charge", + Item::WritableBook => "minecraft:writable_book", + Item::WrittenBook => "minecraft:written_book", + Item::ItemFrame => "minecraft:item_frame", + Item::GlowItemFrame => "minecraft:glow_item_frame", + Item::FlowerPot => "minecraft:flower_pot", + Item::Carrot => "minecraft:carrot", + Item::Potato => "minecraft:potato", + Item::BakedPotato => "minecraft:baked_potato", + Item::PoisonousPotato => "minecraft:poisonous_potato", + Item::Map => "minecraft:map", + Item::GoldenCarrot => "minecraft:golden_carrot", + Item::SkeletonSkull => "minecraft:skeleton_skull", + Item::WitherSkeletonSkull => "minecraft:wither_skeleton_skull", + Item::PlayerHead => "minecraft:player_head", + Item::ZombieHead => "minecraft:zombie_head", + Item::CreeperHead => "minecraft:creeper_head", + Item::DragonHead => "minecraft:dragon_head", + Item::NetherStar => "minecraft:nether_star", + Item::PumpkinPie => "minecraft:pumpkin_pie", + Item::FireworkRocket => "minecraft:firework_rocket", + Item::FireworkStar => "minecraft:firework_star", + Item::EnchantedBook => "minecraft:enchanted_book", + Item::NetherBrick => "minecraft:nether_brick", + Item::PrismarineShard => "minecraft:prismarine_shard", + Item::PrismarineCrystals => "minecraft:prismarine_crystals", + Item::Rabbit => "minecraft:rabbit", + Item::CookedRabbit => "minecraft:cooked_rabbit", + Item::RabbitStew => "minecraft:rabbit_stew", + Item::RabbitFoot => "minecraft:rabbit_foot", + Item::RabbitHide => "minecraft:rabbit_hide", + Item::ArmorStand => "minecraft:armor_stand", + Item::IronHorseArmor => "minecraft:iron_horse_armor", + Item::GoldenHorseArmor => "minecraft:golden_horse_armor", + Item::DiamondHorseArmor => "minecraft:diamond_horse_armor", + Item::LeatherHorseArmor => "minecraft:leather_horse_armor", + Item::Lead => "minecraft:lead", + Item::NameTag => "minecraft:name_tag", + Item::CommandBlockMinecart => "minecraft:command_block_minecart", + Item::Mutton => "minecraft:mutton", + Item::CookedMutton => "minecraft:cooked_mutton", + Item::WhiteBanner => "minecraft:white_banner", + Item::OrangeBanner => "minecraft:orange_banner", + Item::MagentaBanner => "minecraft:magenta_banner", + Item::LightBlueBanner => "minecraft:light_blue_banner", + Item::YellowBanner => "minecraft:yellow_banner", + Item::LimeBanner => "minecraft:lime_banner", + Item::PinkBanner => "minecraft:pink_banner", + Item::GrayBanner => "minecraft:gray_banner", + Item::LightGrayBanner => "minecraft:light_gray_banner", + Item::CyanBanner => "minecraft:cyan_banner", + Item::PurpleBanner => "minecraft:purple_banner", + Item::BlueBanner => "minecraft:blue_banner", + Item::BrownBanner => "minecraft:brown_banner", + Item::GreenBanner => "minecraft:green_banner", + Item::RedBanner => "minecraft:red_banner", + Item::BlackBanner => "minecraft:black_banner", + Item::EndCrystal => "minecraft:end_crystal", + Item::ChorusFruit => "minecraft:chorus_fruit", + Item::PoppedChorusFruit => "minecraft:popped_chorus_fruit", + Item::Beetroot => "minecraft:beetroot", + Item::BeetrootSeeds => "minecraft:beetroot_seeds", + Item::BeetrootSoup => "minecraft:beetroot_soup", + Item::DragonBreath => "minecraft:dragon_breath", + Item::SplashPotion => "minecraft:splash_potion", + Item::SpectralArrow => "minecraft:spectral_arrow", + Item::TippedArrow => "minecraft:tipped_arrow", + Item::LingeringPotion => "minecraft:lingering_potion", + Item::Shield => "minecraft:shield", + Item::TotemOfUndying => "minecraft:totem_of_undying", + Item::ShulkerShell => "minecraft:shulker_shell", + Item::IronNugget => "minecraft:iron_nugget", + Item::KnowledgeBook => "minecraft:knowledge_book", + Item::DebugStick => "minecraft:debug_stick", + Item::MusicDisc13 => "minecraft:music_disc_13", + Item::MusicDiscCat => "minecraft:music_disc_cat", + Item::MusicDiscBlocks => "minecraft:music_disc_blocks", + Item::MusicDiscChirp => "minecraft:music_disc_chirp", + Item::MusicDiscFar => "minecraft:music_disc_far", + Item::MusicDiscMall => "minecraft:music_disc_mall", + Item::MusicDiscMellohi => "minecraft:music_disc_mellohi", + Item::MusicDiscStal => "minecraft:music_disc_stal", + Item::MusicDiscStrad => "minecraft:music_disc_strad", + Item::MusicDiscWard => "minecraft:music_disc_ward", + Item::MusicDisc11 => "minecraft:music_disc_11", + Item::MusicDiscWait => "minecraft:music_disc_wait", + Item::MusicDiscOtherside => "minecraft:music_disc_otherside", + Item::MusicDiscPigstep => "minecraft:music_disc_pigstep", + Item::Trident => "minecraft:trident", + Item::PhantomMembrane => "minecraft:phantom_membrane", + Item::NautilusShell => "minecraft:nautilus_shell", + Item::HeartOfTheSea => "minecraft:heart_of_the_sea", + Item::Crossbow => "minecraft:crossbow", + Item::SuspiciousStew => "minecraft:suspicious_stew", + Item::Loom => "minecraft:loom", + Item::FlowerBannerPattern => "minecraft:flower_banner_pattern", + Item::CreeperBannerPattern => "minecraft:creeper_banner_pattern", + Item::SkullBannerPattern => "minecraft:skull_banner_pattern", + Item::MojangBannerPattern => "minecraft:mojang_banner_pattern", + Item::GlobeBannerPattern => "minecraft:globe_banner_pattern", + Item::PiglinBannerPattern => "minecraft:piglin_banner_pattern", + Item::Composter => "minecraft:composter", + Item::Barrel => "minecraft:barrel", + Item::Smoker => "minecraft:smoker", + Item::BlastFurnace => "minecraft:blast_furnace", + Item::CartographyTable => "minecraft:cartography_table", + Item::FletchingTable => "minecraft:fletching_table", + Item::Grindstone => "minecraft:grindstone", + Item::SmithingTable => "minecraft:smithing_table", + Item::Stonecutter => "minecraft:stonecutter", + Item::Bell => "minecraft:bell", + Item::Lantern => "minecraft:lantern", + Item::SoulLantern => "minecraft:soul_lantern", + Item::SweetBerries => "minecraft:sweet_berries", + Item::GlowBerries => "minecraft:glow_berries", + Item::Campfire => "minecraft:campfire", + Item::SoulCampfire => "minecraft:soul_campfire", + Item::Shroomlight => "minecraft:shroomlight", + Item::Honeycomb => "minecraft:honeycomb", + Item::BeeNest => "minecraft:bee_nest", + Item::Beehive => "minecraft:beehive", + Item::HoneyBottle => "minecraft:honey_bottle", + Item::HoneycombBlock => "minecraft:honeycomb_block", + Item::Lodestone => "minecraft:lodestone", + Item::CryingObsidian => "minecraft:crying_obsidian", + Item::Blackstone => "minecraft:blackstone", + Item::BlackstoneSlab => "minecraft:blackstone_slab", + Item::BlackstoneStairs => "minecraft:blackstone_stairs", + Item::GildedBlackstone => "minecraft:gilded_blackstone", + Item::PolishedBlackstone => "minecraft:polished_blackstone", + Item::PolishedBlackstoneSlab => "minecraft:polished_blackstone_slab", + Item::PolishedBlackstoneStairs => "minecraft:polished_blackstone_stairs", + Item::ChiseledPolishedBlackstone => "minecraft:chiseled_polished_blackstone", + Item::PolishedBlackstoneBricks => "minecraft:polished_blackstone_bricks", + Item::PolishedBlackstoneBrickSlab => "minecraft:polished_blackstone_brick_slab", + Item::PolishedBlackstoneBrickStairs => "minecraft:polished_blackstone_brick_stairs", + Item::CrackedPolishedBlackstoneBricks => "minecraft:cracked_polished_blackstone_bricks", + Item::RespawnAnchor => "minecraft:respawn_anchor", + Item::Candle => "minecraft:candle", + Item::WhiteCandle => "minecraft:white_candle", + Item::OrangeCandle => "minecraft:orange_candle", + Item::MagentaCandle => "minecraft:magenta_candle", + Item::LightBlueCandle => "minecraft:light_blue_candle", + Item::YellowCandle => "minecraft:yellow_candle", + Item::LimeCandle => "minecraft:lime_candle", + Item::PinkCandle => "minecraft:pink_candle", + Item::GrayCandle => "minecraft:gray_candle", + Item::LightGrayCandle => "minecraft:light_gray_candle", + Item::CyanCandle => "minecraft:cyan_candle", + Item::PurpleCandle => "minecraft:purple_candle", + Item::BlueCandle => "minecraft:blue_candle", + Item::BrownCandle => "minecraft:brown_candle", + Item::GreenCandle => "minecraft:green_candle", + Item::RedCandle => "minecraft:red_candle", + Item::BlackCandle => "minecraft:black_candle", + Item::SmallAmethystBud => "minecraft:small_amethyst_bud", + Item::MediumAmethystBud => "minecraft:medium_amethyst_bud", + Item::LargeAmethystBud => "minecraft:large_amethyst_bud", + Item::AmethystCluster => "minecraft:amethyst_cluster", + Item::PointedDripstone => "minecraft:pointed_dripstone", + } + } + #[doc = "Gets a `Item` by its `namespaced_id`."] + #[inline] + pub fn from_namespaced_id(namespaced_id: &str) -> Option { + match namespaced_id { + "minecraft:stone" => Some(Item::Stone), + "minecraft:granite" => Some(Item::Granite), + "minecraft:polished_granite" => Some(Item::PolishedGranite), + "minecraft:diorite" => Some(Item::Diorite), + "minecraft:polished_diorite" => Some(Item::PolishedDiorite), + "minecraft:andesite" => Some(Item::Andesite), + "minecraft:polished_andesite" => Some(Item::PolishedAndesite), + "minecraft:deepslate" => Some(Item::Deepslate), + "minecraft:cobbled_deepslate" => Some(Item::CobbledDeepslate), + "minecraft:polished_deepslate" => Some(Item::PolishedDeepslate), + "minecraft:calcite" => Some(Item::Calcite), + "minecraft:tuff" => Some(Item::Tuff), + "minecraft:dripstone_block" => Some(Item::DripstoneBlock), + "minecraft:grass_block" => Some(Item::GrassBlock), + "minecraft:dirt" => Some(Item::Dirt), + "minecraft:coarse_dirt" => Some(Item::CoarseDirt), + "minecraft:podzol" => Some(Item::Podzol), + "minecraft:rooted_dirt" => Some(Item::RootedDirt), + "minecraft:crimson_nylium" => Some(Item::CrimsonNylium), + "minecraft:warped_nylium" => Some(Item::WarpedNylium), + "minecraft:cobblestone" => Some(Item::Cobblestone), + "minecraft:oak_planks" => Some(Item::OakPlanks), + "minecraft:spruce_planks" => Some(Item::SprucePlanks), + "minecraft:birch_planks" => Some(Item::BirchPlanks), + "minecraft:jungle_planks" => Some(Item::JunglePlanks), + "minecraft:acacia_planks" => Some(Item::AcaciaPlanks), + "minecraft:dark_oak_planks" => Some(Item::DarkOakPlanks), + "minecraft:crimson_planks" => Some(Item::CrimsonPlanks), + "minecraft:warped_planks" => Some(Item::WarpedPlanks), + "minecraft:oak_sapling" => Some(Item::OakSapling), + "minecraft:spruce_sapling" => Some(Item::SpruceSapling), + "minecraft:birch_sapling" => Some(Item::BirchSapling), + "minecraft:jungle_sapling" => Some(Item::JungleSapling), + "minecraft:acacia_sapling" => Some(Item::AcaciaSapling), + "minecraft:dark_oak_sapling" => Some(Item::DarkOakSapling), + "minecraft:bedrock" => Some(Item::Bedrock), + "minecraft:sand" => Some(Item::Sand), + "minecraft:red_sand" => Some(Item::RedSand), + "minecraft:gravel" => Some(Item::Gravel), + "minecraft:coal_ore" => Some(Item::CoalOre), + "minecraft:deepslate_coal_ore" => Some(Item::DeepslateCoalOre), + "minecraft:iron_ore" => Some(Item::IronOre), + "minecraft:deepslate_iron_ore" => Some(Item::DeepslateIronOre), + "minecraft:copper_ore" => Some(Item::CopperOre), + "minecraft:deepslate_copper_ore" => Some(Item::DeepslateCopperOre), + "minecraft:gold_ore" => Some(Item::GoldOre), + "minecraft:deepslate_gold_ore" => Some(Item::DeepslateGoldOre), + "minecraft:redstone_ore" => Some(Item::RedstoneOre), + "minecraft:deepslate_redstone_ore" => Some(Item::DeepslateRedstoneOre), + "minecraft:emerald_ore" => Some(Item::EmeraldOre), + "minecraft:deepslate_emerald_ore" => Some(Item::DeepslateEmeraldOre), + "minecraft:lapis_ore" => Some(Item::LapisOre), + "minecraft:deepslate_lapis_ore" => Some(Item::DeepslateLapisOre), + "minecraft:diamond_ore" => Some(Item::DiamondOre), + "minecraft:deepslate_diamond_ore" => Some(Item::DeepslateDiamondOre), + "minecraft:nether_gold_ore" => Some(Item::NetherGoldOre), + "minecraft:nether_quartz_ore" => Some(Item::NetherQuartzOre), + "minecraft:ancient_debris" => Some(Item::AncientDebris), + "minecraft:coal_block" => Some(Item::CoalBlock), + "minecraft:raw_iron_block" => Some(Item::RawIronBlock), + "minecraft:raw_copper_block" => Some(Item::RawCopperBlock), + "minecraft:raw_gold_block" => Some(Item::RawGoldBlock), + "minecraft:amethyst_block" => Some(Item::AmethystBlock), + "minecraft:budding_amethyst" => Some(Item::BuddingAmethyst), + "minecraft:iron_block" => Some(Item::IronBlock), + "minecraft:copper_block" => Some(Item::CopperBlock), + "minecraft:gold_block" => Some(Item::GoldBlock), + "minecraft:diamond_block" => Some(Item::DiamondBlock), + "minecraft:netherite_block" => Some(Item::NetheriteBlock), + "minecraft:exposed_copper" => Some(Item::ExposedCopper), + "minecraft:weathered_copper" => Some(Item::WeatheredCopper), + "minecraft:oxidized_copper" => Some(Item::OxidizedCopper), + "minecraft:cut_copper" => Some(Item::CutCopper), + "minecraft:exposed_cut_copper" => Some(Item::ExposedCutCopper), + "minecraft:weathered_cut_copper" => Some(Item::WeatheredCutCopper), + "minecraft:oxidized_cut_copper" => Some(Item::OxidizedCutCopper), + "minecraft:cut_copper_stairs" => Some(Item::CutCopperStairs), + "minecraft:exposed_cut_copper_stairs" => Some(Item::ExposedCutCopperStairs), + "minecraft:weathered_cut_copper_stairs" => Some(Item::WeatheredCutCopperStairs), + "minecraft:oxidized_cut_copper_stairs" => Some(Item::OxidizedCutCopperStairs), + "minecraft:cut_copper_slab" => Some(Item::CutCopperSlab), + "minecraft:exposed_cut_copper_slab" => Some(Item::ExposedCutCopperSlab), + "minecraft:weathered_cut_copper_slab" => Some(Item::WeatheredCutCopperSlab), + "minecraft:oxidized_cut_copper_slab" => Some(Item::OxidizedCutCopperSlab), + "minecraft:waxed_copper_block" => Some(Item::WaxedCopperBlock), + "minecraft:waxed_exposed_copper" => Some(Item::WaxedExposedCopper), + "minecraft:waxed_weathered_copper" => Some(Item::WaxedWeatheredCopper), + "minecraft:waxed_oxidized_copper" => Some(Item::WaxedOxidizedCopper), + "minecraft:waxed_cut_copper" => Some(Item::WaxedCutCopper), + "minecraft:waxed_exposed_cut_copper" => Some(Item::WaxedExposedCutCopper), + "minecraft:waxed_weathered_cut_copper" => Some(Item::WaxedWeatheredCutCopper), + "minecraft:waxed_oxidized_cut_copper" => Some(Item::WaxedOxidizedCutCopper), + "minecraft:waxed_cut_copper_stairs" => Some(Item::WaxedCutCopperStairs), + "minecraft:waxed_exposed_cut_copper_stairs" => Some(Item::WaxedExposedCutCopperStairs), + "minecraft:waxed_weathered_cut_copper_stairs" => { + Some(Item::WaxedWeatheredCutCopperStairs) + } + "minecraft:waxed_oxidized_cut_copper_stairs" => { + Some(Item::WaxedOxidizedCutCopperStairs) + } + "minecraft:waxed_cut_copper_slab" => Some(Item::WaxedCutCopperSlab), + "minecraft:waxed_exposed_cut_copper_slab" => Some(Item::WaxedExposedCutCopperSlab), + "minecraft:waxed_weathered_cut_copper_slab" => Some(Item::WaxedWeatheredCutCopperSlab), + "minecraft:waxed_oxidized_cut_copper_slab" => Some(Item::WaxedOxidizedCutCopperSlab), + "minecraft:oak_log" => Some(Item::OakLog), + "minecraft:spruce_log" => Some(Item::SpruceLog), + "minecraft:birch_log" => Some(Item::BirchLog), + "minecraft:jungle_log" => Some(Item::JungleLog), + "minecraft:acacia_log" => Some(Item::AcaciaLog), + "minecraft:dark_oak_log" => Some(Item::DarkOakLog), + "minecraft:crimson_stem" => Some(Item::CrimsonStem), + "minecraft:warped_stem" => Some(Item::WarpedStem), + "minecraft:stripped_oak_log" => Some(Item::StrippedOakLog), + "minecraft:stripped_spruce_log" => Some(Item::StrippedSpruceLog), + "minecraft:stripped_birch_log" => Some(Item::StrippedBirchLog), + "minecraft:stripped_jungle_log" => Some(Item::StrippedJungleLog), + "minecraft:stripped_acacia_log" => Some(Item::StrippedAcaciaLog), + "minecraft:stripped_dark_oak_log" => Some(Item::StrippedDarkOakLog), + "minecraft:stripped_crimson_stem" => Some(Item::StrippedCrimsonStem), + "minecraft:stripped_warped_stem" => Some(Item::StrippedWarpedStem), + "minecraft:stripped_oak_wood" => Some(Item::StrippedOakWood), + "minecraft:stripped_spruce_wood" => Some(Item::StrippedSpruceWood), + "minecraft:stripped_birch_wood" => Some(Item::StrippedBirchWood), + "minecraft:stripped_jungle_wood" => Some(Item::StrippedJungleWood), + "minecraft:stripped_acacia_wood" => Some(Item::StrippedAcaciaWood), + "minecraft:stripped_dark_oak_wood" => Some(Item::StrippedDarkOakWood), + "minecraft:stripped_crimson_hyphae" => Some(Item::StrippedCrimsonHyphae), + "minecraft:stripped_warped_hyphae" => Some(Item::StrippedWarpedHyphae), + "minecraft:oak_wood" => Some(Item::OakWood), + "minecraft:spruce_wood" => Some(Item::SpruceWood), + "minecraft:birch_wood" => Some(Item::BirchWood), + "minecraft:jungle_wood" => Some(Item::JungleWood), + "minecraft:acacia_wood" => Some(Item::AcaciaWood), + "minecraft:dark_oak_wood" => Some(Item::DarkOakWood), + "minecraft:crimson_hyphae" => Some(Item::CrimsonHyphae), + "minecraft:warped_hyphae" => Some(Item::WarpedHyphae), + "minecraft:oak_leaves" => Some(Item::OakLeaves), + "minecraft:spruce_leaves" => Some(Item::SpruceLeaves), + "minecraft:birch_leaves" => Some(Item::BirchLeaves), + "minecraft:jungle_leaves" => Some(Item::JungleLeaves), + "minecraft:acacia_leaves" => Some(Item::AcaciaLeaves), + "minecraft:dark_oak_leaves" => Some(Item::DarkOakLeaves), + "minecraft:azalea_leaves" => Some(Item::AzaleaLeaves), + "minecraft:flowering_azalea_leaves" => Some(Item::FloweringAzaleaLeaves), + "minecraft:sponge" => Some(Item::Sponge), + "minecraft:wet_sponge" => Some(Item::WetSponge), + "minecraft:glass" => Some(Item::Glass), + "minecraft:tinted_glass" => Some(Item::TintedGlass), + "minecraft:lapis_block" => Some(Item::LapisBlock), + "minecraft:sandstone" => Some(Item::Sandstone), + "minecraft:chiseled_sandstone" => Some(Item::ChiseledSandstone), + "minecraft:cut_sandstone" => Some(Item::CutSandstone), + "minecraft:cobweb" => Some(Item::Cobweb), + "minecraft:grass" => Some(Item::Grass), + "minecraft:fern" => Some(Item::Fern), + "minecraft:azalea" => Some(Item::Azalea), + "minecraft:flowering_azalea" => Some(Item::FloweringAzalea), + "minecraft:dead_bush" => Some(Item::DeadBush), + "minecraft:seagrass" => Some(Item::Seagrass), + "minecraft:sea_pickle" => Some(Item::SeaPickle), + "minecraft:white_wool" => Some(Item::WhiteWool), + "minecraft:orange_wool" => Some(Item::OrangeWool), + "minecraft:magenta_wool" => Some(Item::MagentaWool), + "minecraft:light_blue_wool" => Some(Item::LightBlueWool), + "minecraft:yellow_wool" => Some(Item::YellowWool), + "minecraft:lime_wool" => Some(Item::LimeWool), + "minecraft:pink_wool" => Some(Item::PinkWool), + "minecraft:gray_wool" => Some(Item::GrayWool), + "minecraft:light_gray_wool" => Some(Item::LightGrayWool), + "minecraft:cyan_wool" => Some(Item::CyanWool), + "minecraft:purple_wool" => Some(Item::PurpleWool), + "minecraft:blue_wool" => Some(Item::BlueWool), + "minecraft:brown_wool" => Some(Item::BrownWool), + "minecraft:green_wool" => Some(Item::GreenWool), + "minecraft:red_wool" => Some(Item::RedWool), + "minecraft:black_wool" => Some(Item::BlackWool), + "minecraft:dandelion" => Some(Item::Dandelion), + "minecraft:poppy" => Some(Item::Poppy), + "minecraft:blue_orchid" => Some(Item::BlueOrchid), + "minecraft:allium" => Some(Item::Allium), + "minecraft:azure_bluet" => Some(Item::AzureBluet), + "minecraft:red_tulip" => Some(Item::RedTulip), + "minecraft:orange_tulip" => Some(Item::OrangeTulip), + "minecraft:white_tulip" => Some(Item::WhiteTulip), + "minecraft:pink_tulip" => Some(Item::PinkTulip), + "minecraft:oxeye_daisy" => Some(Item::OxeyeDaisy), + "minecraft:cornflower" => Some(Item::Cornflower), + "minecraft:lily_of_the_valley" => Some(Item::LilyOfTheValley), + "minecraft:wither_rose" => Some(Item::WitherRose), + "minecraft:spore_blossom" => Some(Item::SporeBlossom), + "minecraft:brown_mushroom" => Some(Item::BrownMushroom), + "minecraft:red_mushroom" => Some(Item::RedMushroom), + "minecraft:crimson_fungus" => Some(Item::CrimsonFungus), + "minecraft:warped_fungus" => Some(Item::WarpedFungus), + "minecraft:crimson_roots" => Some(Item::CrimsonRoots), + "minecraft:warped_roots" => Some(Item::WarpedRoots), + "minecraft:nether_sprouts" => Some(Item::NetherSprouts), + "minecraft:weeping_vines" => Some(Item::WeepingVines), + "minecraft:twisting_vines" => Some(Item::TwistingVines), + "minecraft:sugar_cane" => Some(Item::SugarCane), + "minecraft:kelp" => Some(Item::Kelp), + "minecraft:moss_carpet" => Some(Item::MossCarpet), + "minecraft:moss_block" => Some(Item::MossBlock), + "minecraft:hanging_roots" => Some(Item::HangingRoots), + "minecraft:big_dripleaf" => Some(Item::BigDripleaf), + "minecraft:small_dripleaf" => Some(Item::SmallDripleaf), + "minecraft:bamboo" => Some(Item::Bamboo), + "minecraft:oak_slab" => Some(Item::OakSlab), + "minecraft:spruce_slab" => Some(Item::SpruceSlab), + "minecraft:birch_slab" => Some(Item::BirchSlab), + "minecraft:jungle_slab" => Some(Item::JungleSlab), + "minecraft:acacia_slab" => Some(Item::AcaciaSlab), + "minecraft:dark_oak_slab" => Some(Item::DarkOakSlab), + "minecraft:crimson_slab" => Some(Item::CrimsonSlab), + "minecraft:warped_slab" => Some(Item::WarpedSlab), + "minecraft:stone_slab" => Some(Item::StoneSlab), + "minecraft:smooth_stone_slab" => Some(Item::SmoothStoneSlab), + "minecraft:sandstone_slab" => Some(Item::SandstoneSlab), + "minecraft:cut_sandstone_slab" => Some(Item::CutSandstoneSlab), + "minecraft:petrified_oak_slab" => Some(Item::PetrifiedOakSlab), + "minecraft:cobblestone_slab" => Some(Item::CobblestoneSlab), + "minecraft:brick_slab" => Some(Item::BrickSlab), + "minecraft:stone_brick_slab" => Some(Item::StoneBrickSlab), + "minecraft:nether_brick_slab" => Some(Item::NetherBrickSlab), + "minecraft:quartz_slab" => Some(Item::QuartzSlab), + "minecraft:red_sandstone_slab" => Some(Item::RedSandstoneSlab), + "minecraft:cut_red_sandstone_slab" => Some(Item::CutRedSandstoneSlab), + "minecraft:purpur_slab" => Some(Item::PurpurSlab), + "minecraft:prismarine_slab" => Some(Item::PrismarineSlab), + "minecraft:prismarine_brick_slab" => Some(Item::PrismarineBrickSlab), + "minecraft:dark_prismarine_slab" => Some(Item::DarkPrismarineSlab), + "minecraft:smooth_quartz" => Some(Item::SmoothQuartz), + "minecraft:smooth_red_sandstone" => Some(Item::SmoothRedSandstone), + "minecraft:smooth_sandstone" => Some(Item::SmoothSandstone), + "minecraft:smooth_stone" => Some(Item::SmoothStone), + "minecraft:bricks" => Some(Item::Bricks), + "minecraft:bookshelf" => Some(Item::Bookshelf), + "minecraft:mossy_cobblestone" => Some(Item::MossyCobblestone), + "minecraft:obsidian" => Some(Item::Obsidian), + "minecraft:torch" => Some(Item::Torch), + "minecraft:end_rod" => Some(Item::EndRod), + "minecraft:chorus_plant" => Some(Item::ChorusPlant), + "minecraft:chorus_flower" => Some(Item::ChorusFlower), + "minecraft:purpur_block" => Some(Item::PurpurBlock), + "minecraft:purpur_pillar" => Some(Item::PurpurPillar), + "minecraft:purpur_stairs" => Some(Item::PurpurStairs), + "minecraft:spawner" => Some(Item::Spawner), + "minecraft:oak_stairs" => Some(Item::OakStairs), + "minecraft:chest" => Some(Item::Chest), + "minecraft:crafting_table" => Some(Item::CraftingTable), + "minecraft:farmland" => Some(Item::Farmland), + "minecraft:furnace" => Some(Item::Furnace), + "minecraft:ladder" => Some(Item::Ladder), + "minecraft:cobblestone_stairs" => Some(Item::CobblestoneStairs), + "minecraft:snow" => Some(Item::Snow), + "minecraft:ice" => Some(Item::Ice), + "minecraft:snow_block" => Some(Item::SnowBlock), + "minecraft:cactus" => Some(Item::Cactus), + "minecraft:clay" => Some(Item::Clay), + "minecraft:jukebox" => Some(Item::Jukebox), + "minecraft:oak_fence" => Some(Item::OakFence), + "minecraft:spruce_fence" => Some(Item::SpruceFence), + "minecraft:birch_fence" => Some(Item::BirchFence), + "minecraft:jungle_fence" => Some(Item::JungleFence), + "minecraft:acacia_fence" => Some(Item::AcaciaFence), + "minecraft:dark_oak_fence" => Some(Item::DarkOakFence), + "minecraft:crimson_fence" => Some(Item::CrimsonFence), + "minecraft:warped_fence" => Some(Item::WarpedFence), + "minecraft:pumpkin" => Some(Item::Pumpkin), + "minecraft:carved_pumpkin" => Some(Item::CarvedPumpkin), + "minecraft:jack_o_lantern" => Some(Item::JackOLantern), + "minecraft:netherrack" => Some(Item::Netherrack), + "minecraft:soul_sand" => Some(Item::SoulSand), + "minecraft:soul_soil" => Some(Item::SoulSoil), + "minecraft:basalt" => Some(Item::Basalt), + "minecraft:polished_basalt" => Some(Item::PolishedBasalt), + "minecraft:smooth_basalt" => Some(Item::SmoothBasalt), + "minecraft:soul_torch" => Some(Item::SoulTorch), + "minecraft:glowstone" => Some(Item::Glowstone), + "minecraft:infested_stone" => Some(Item::InfestedStone), + "minecraft:infested_cobblestone" => Some(Item::InfestedCobblestone), + "minecraft:infested_stone_bricks" => Some(Item::InfestedStoneBricks), + "minecraft:infested_mossy_stone_bricks" => Some(Item::InfestedMossyStoneBricks), + "minecraft:infested_cracked_stone_bricks" => Some(Item::InfestedCrackedStoneBricks), + "minecraft:infested_chiseled_stone_bricks" => Some(Item::InfestedChiseledStoneBricks), + "minecraft:infested_deepslate" => Some(Item::InfestedDeepslate), + "minecraft:stone_bricks" => Some(Item::StoneBricks), + "minecraft:mossy_stone_bricks" => Some(Item::MossyStoneBricks), + "minecraft:cracked_stone_bricks" => Some(Item::CrackedStoneBricks), + "minecraft:chiseled_stone_bricks" => Some(Item::ChiseledStoneBricks), + "minecraft:deepslate_bricks" => Some(Item::DeepslateBricks), + "minecraft:cracked_deepslate_bricks" => Some(Item::CrackedDeepslateBricks), + "minecraft:deepslate_tiles" => Some(Item::DeepslateTiles), + "minecraft:cracked_deepslate_tiles" => Some(Item::CrackedDeepslateTiles), + "minecraft:chiseled_deepslate" => Some(Item::ChiseledDeepslate), + "minecraft:brown_mushroom_block" => Some(Item::BrownMushroomBlock), + "minecraft:red_mushroom_block" => Some(Item::RedMushroomBlock), + "minecraft:mushroom_stem" => Some(Item::MushroomStem), + "minecraft:iron_bars" => Some(Item::IronBars), + "minecraft:chain" => Some(Item::Chain), + "minecraft:glass_pane" => Some(Item::GlassPane), + "minecraft:melon" => Some(Item::Melon), + "minecraft:vine" => Some(Item::Vine), + "minecraft:glow_lichen" => Some(Item::GlowLichen), + "minecraft:brick_stairs" => Some(Item::BrickStairs), + "minecraft:stone_brick_stairs" => Some(Item::StoneBrickStairs), + "minecraft:mycelium" => Some(Item::Mycelium), + "minecraft:lily_pad" => Some(Item::LilyPad), + "minecraft:nether_bricks" => Some(Item::NetherBricks), + "minecraft:cracked_nether_bricks" => Some(Item::CrackedNetherBricks), + "minecraft:chiseled_nether_bricks" => Some(Item::ChiseledNetherBricks), + "minecraft:nether_brick_fence" => Some(Item::NetherBrickFence), + "minecraft:nether_brick_stairs" => Some(Item::NetherBrickStairs), + "minecraft:enchanting_table" => Some(Item::EnchantingTable), + "minecraft:end_portal_frame" => Some(Item::EndPortalFrame), + "minecraft:end_stone" => Some(Item::EndStone), + "minecraft:end_stone_bricks" => Some(Item::EndStoneBricks), + "minecraft:dragon_egg" => Some(Item::DragonEgg), + "minecraft:sandstone_stairs" => Some(Item::SandstoneStairs), + "minecraft:ender_chest" => Some(Item::EnderChest), + "minecraft:emerald_block" => Some(Item::EmeraldBlock), + "minecraft:spruce_stairs" => Some(Item::SpruceStairs), + "minecraft:birch_stairs" => Some(Item::BirchStairs), + "minecraft:jungle_stairs" => Some(Item::JungleStairs), + "minecraft:crimson_stairs" => Some(Item::CrimsonStairs), + "minecraft:warped_stairs" => Some(Item::WarpedStairs), + "minecraft:command_block" => Some(Item::CommandBlock), + "minecraft:beacon" => Some(Item::Beacon), + "minecraft:cobblestone_wall" => Some(Item::CobblestoneWall), + "minecraft:mossy_cobblestone_wall" => Some(Item::MossyCobblestoneWall), + "minecraft:brick_wall" => Some(Item::BrickWall), + "minecraft:prismarine_wall" => Some(Item::PrismarineWall), + "minecraft:red_sandstone_wall" => Some(Item::RedSandstoneWall), + "minecraft:mossy_stone_brick_wall" => Some(Item::MossyStoneBrickWall), + "minecraft:granite_wall" => Some(Item::GraniteWall), + "minecraft:stone_brick_wall" => Some(Item::StoneBrickWall), + "minecraft:nether_brick_wall" => Some(Item::NetherBrickWall), + "minecraft:andesite_wall" => Some(Item::AndesiteWall), + "minecraft:red_nether_brick_wall" => Some(Item::RedNetherBrickWall), + "minecraft:sandstone_wall" => Some(Item::SandstoneWall), + "minecraft:end_stone_brick_wall" => Some(Item::EndStoneBrickWall), + "minecraft:diorite_wall" => Some(Item::DioriteWall), + "minecraft:blackstone_wall" => Some(Item::BlackstoneWall), + "minecraft:polished_blackstone_wall" => Some(Item::PolishedBlackstoneWall), + "minecraft:polished_blackstone_brick_wall" => Some(Item::PolishedBlackstoneBrickWall), + "minecraft:cobbled_deepslate_wall" => Some(Item::CobbledDeepslateWall), + "minecraft:polished_deepslate_wall" => Some(Item::PolishedDeepslateWall), + "minecraft:deepslate_brick_wall" => Some(Item::DeepslateBrickWall), + "minecraft:deepslate_tile_wall" => Some(Item::DeepslateTileWall), + "minecraft:anvil" => Some(Item::Anvil), + "minecraft:chipped_anvil" => Some(Item::ChippedAnvil), + "minecraft:damaged_anvil" => Some(Item::DamagedAnvil), + "minecraft:chiseled_quartz_block" => Some(Item::ChiseledQuartzBlock), + "minecraft:quartz_block" => Some(Item::QuartzBlock), + "minecraft:quartz_bricks" => Some(Item::QuartzBricks), + "minecraft:quartz_pillar" => Some(Item::QuartzPillar), + "minecraft:quartz_stairs" => Some(Item::QuartzStairs), + "minecraft:white_terracotta" => Some(Item::WhiteTerracotta), + "minecraft:orange_terracotta" => Some(Item::OrangeTerracotta), + "minecraft:magenta_terracotta" => Some(Item::MagentaTerracotta), + "minecraft:light_blue_terracotta" => Some(Item::LightBlueTerracotta), + "minecraft:yellow_terracotta" => Some(Item::YellowTerracotta), + "minecraft:lime_terracotta" => Some(Item::LimeTerracotta), + "minecraft:pink_terracotta" => Some(Item::PinkTerracotta), + "minecraft:gray_terracotta" => Some(Item::GrayTerracotta), + "minecraft:light_gray_terracotta" => Some(Item::LightGrayTerracotta), + "minecraft:cyan_terracotta" => Some(Item::CyanTerracotta), + "minecraft:purple_terracotta" => Some(Item::PurpleTerracotta), + "minecraft:blue_terracotta" => Some(Item::BlueTerracotta), + "minecraft:brown_terracotta" => Some(Item::BrownTerracotta), + "minecraft:green_terracotta" => Some(Item::GreenTerracotta), + "minecraft:red_terracotta" => Some(Item::RedTerracotta), + "minecraft:black_terracotta" => Some(Item::BlackTerracotta), + "minecraft:barrier" => Some(Item::Barrier), + "minecraft:light" => Some(Item::Light), + "minecraft:hay_block" => Some(Item::HayBlock), + "minecraft:white_carpet" => Some(Item::WhiteCarpet), + "minecraft:orange_carpet" => Some(Item::OrangeCarpet), + "minecraft:magenta_carpet" => Some(Item::MagentaCarpet), + "minecraft:light_blue_carpet" => Some(Item::LightBlueCarpet), + "minecraft:yellow_carpet" => Some(Item::YellowCarpet), + "minecraft:lime_carpet" => Some(Item::LimeCarpet), + "minecraft:pink_carpet" => Some(Item::PinkCarpet), + "minecraft:gray_carpet" => Some(Item::GrayCarpet), + "minecraft:light_gray_carpet" => Some(Item::LightGrayCarpet), + "minecraft:cyan_carpet" => Some(Item::CyanCarpet), + "minecraft:purple_carpet" => Some(Item::PurpleCarpet), + "minecraft:blue_carpet" => Some(Item::BlueCarpet), + "minecraft:brown_carpet" => Some(Item::BrownCarpet), + "minecraft:green_carpet" => Some(Item::GreenCarpet), + "minecraft:red_carpet" => Some(Item::RedCarpet), + "minecraft:black_carpet" => Some(Item::BlackCarpet), + "minecraft:terracotta" => Some(Item::Terracotta), + "minecraft:packed_ice" => Some(Item::PackedIce), + "minecraft:acacia_stairs" => Some(Item::AcaciaStairs), + "minecraft:dark_oak_stairs" => Some(Item::DarkOakStairs), + "minecraft:dirt_path" => Some(Item::DirtPath), + "minecraft:sunflower" => Some(Item::Sunflower), + "minecraft:lilac" => Some(Item::Lilac), + "minecraft:rose_bush" => Some(Item::RoseBush), + "minecraft:peony" => Some(Item::Peony), + "minecraft:tall_grass" => Some(Item::TallGrass), + "minecraft:large_fern" => Some(Item::LargeFern), + "minecraft:white_stained_glass" => Some(Item::WhiteStainedGlass), + "minecraft:orange_stained_glass" => Some(Item::OrangeStainedGlass), + "minecraft:magenta_stained_glass" => Some(Item::MagentaStainedGlass), + "minecraft:light_blue_stained_glass" => Some(Item::LightBlueStainedGlass), + "minecraft:yellow_stained_glass" => Some(Item::YellowStainedGlass), + "minecraft:lime_stained_glass" => Some(Item::LimeStainedGlass), + "minecraft:pink_stained_glass" => Some(Item::PinkStainedGlass), + "minecraft:gray_stained_glass" => Some(Item::GrayStainedGlass), + "minecraft:light_gray_stained_glass" => Some(Item::LightGrayStainedGlass), + "minecraft:cyan_stained_glass" => Some(Item::CyanStainedGlass), + "minecraft:purple_stained_glass" => Some(Item::PurpleStainedGlass), + "minecraft:blue_stained_glass" => Some(Item::BlueStainedGlass), + "minecraft:brown_stained_glass" => Some(Item::BrownStainedGlass), + "minecraft:green_stained_glass" => Some(Item::GreenStainedGlass), + "minecraft:red_stained_glass" => Some(Item::RedStainedGlass), + "minecraft:black_stained_glass" => Some(Item::BlackStainedGlass), + "minecraft:white_stained_glass_pane" => Some(Item::WhiteStainedGlassPane), + "minecraft:orange_stained_glass_pane" => Some(Item::OrangeStainedGlassPane), + "minecraft:magenta_stained_glass_pane" => Some(Item::MagentaStainedGlassPane), + "minecraft:light_blue_stained_glass_pane" => Some(Item::LightBlueStainedGlassPane), + "minecraft:yellow_stained_glass_pane" => Some(Item::YellowStainedGlassPane), + "minecraft:lime_stained_glass_pane" => Some(Item::LimeStainedGlassPane), + "minecraft:pink_stained_glass_pane" => Some(Item::PinkStainedGlassPane), + "minecraft:gray_stained_glass_pane" => Some(Item::GrayStainedGlassPane), + "minecraft:light_gray_stained_glass_pane" => Some(Item::LightGrayStainedGlassPane), + "minecraft:cyan_stained_glass_pane" => Some(Item::CyanStainedGlassPane), + "minecraft:purple_stained_glass_pane" => Some(Item::PurpleStainedGlassPane), + "minecraft:blue_stained_glass_pane" => Some(Item::BlueStainedGlassPane), + "minecraft:brown_stained_glass_pane" => Some(Item::BrownStainedGlassPane), + "minecraft:green_stained_glass_pane" => Some(Item::GreenStainedGlassPane), + "minecraft:red_stained_glass_pane" => Some(Item::RedStainedGlassPane), + "minecraft:black_stained_glass_pane" => Some(Item::BlackStainedGlassPane), + "minecraft:prismarine" => Some(Item::Prismarine), + "minecraft:prismarine_bricks" => Some(Item::PrismarineBricks), + "minecraft:dark_prismarine" => Some(Item::DarkPrismarine), + "minecraft:prismarine_stairs" => Some(Item::PrismarineStairs), + "minecraft:prismarine_brick_stairs" => Some(Item::PrismarineBrickStairs), + "minecraft:dark_prismarine_stairs" => Some(Item::DarkPrismarineStairs), + "minecraft:sea_lantern" => Some(Item::SeaLantern), + "minecraft:red_sandstone" => Some(Item::RedSandstone), + "minecraft:chiseled_red_sandstone" => Some(Item::ChiseledRedSandstone), + "minecraft:cut_red_sandstone" => Some(Item::CutRedSandstone), + "minecraft:red_sandstone_stairs" => Some(Item::RedSandstoneStairs), + "minecraft:repeating_command_block" => Some(Item::RepeatingCommandBlock), + "minecraft:chain_command_block" => Some(Item::ChainCommandBlock), + "minecraft:magma_block" => Some(Item::MagmaBlock), + "minecraft:nether_wart_block" => Some(Item::NetherWartBlock), + "minecraft:warped_wart_block" => Some(Item::WarpedWartBlock), + "minecraft:red_nether_bricks" => Some(Item::RedNetherBricks), + "minecraft:bone_block" => Some(Item::BoneBlock), + "minecraft:structure_void" => Some(Item::StructureVoid), + "minecraft:shulker_box" => Some(Item::ShulkerBox), + "minecraft:white_shulker_box" => Some(Item::WhiteShulkerBox), + "minecraft:orange_shulker_box" => Some(Item::OrangeShulkerBox), + "minecraft:magenta_shulker_box" => Some(Item::MagentaShulkerBox), + "minecraft:light_blue_shulker_box" => Some(Item::LightBlueShulkerBox), + "minecraft:yellow_shulker_box" => Some(Item::YellowShulkerBox), + "minecraft:lime_shulker_box" => Some(Item::LimeShulkerBox), + "minecraft:pink_shulker_box" => Some(Item::PinkShulkerBox), + "minecraft:gray_shulker_box" => Some(Item::GrayShulkerBox), + "minecraft:light_gray_shulker_box" => Some(Item::LightGrayShulkerBox), + "minecraft:cyan_shulker_box" => Some(Item::CyanShulkerBox), + "minecraft:purple_shulker_box" => Some(Item::PurpleShulkerBox), + "minecraft:blue_shulker_box" => Some(Item::BlueShulkerBox), + "minecraft:brown_shulker_box" => Some(Item::BrownShulkerBox), + "minecraft:green_shulker_box" => Some(Item::GreenShulkerBox), + "minecraft:red_shulker_box" => Some(Item::RedShulkerBox), + "minecraft:black_shulker_box" => Some(Item::BlackShulkerBox), + "minecraft:white_glazed_terracotta" => Some(Item::WhiteGlazedTerracotta), + "minecraft:orange_glazed_terracotta" => Some(Item::OrangeGlazedTerracotta), + "minecraft:magenta_glazed_terracotta" => Some(Item::MagentaGlazedTerracotta), + "minecraft:light_blue_glazed_terracotta" => Some(Item::LightBlueGlazedTerracotta), + "minecraft:yellow_glazed_terracotta" => Some(Item::YellowGlazedTerracotta), + "minecraft:lime_glazed_terracotta" => Some(Item::LimeGlazedTerracotta), + "minecraft:pink_glazed_terracotta" => Some(Item::PinkGlazedTerracotta), + "minecraft:gray_glazed_terracotta" => Some(Item::GrayGlazedTerracotta), + "minecraft:light_gray_glazed_terracotta" => Some(Item::LightGrayGlazedTerracotta), + "minecraft:cyan_glazed_terracotta" => Some(Item::CyanGlazedTerracotta), + "minecraft:purple_glazed_terracotta" => Some(Item::PurpleGlazedTerracotta), + "minecraft:blue_glazed_terracotta" => Some(Item::BlueGlazedTerracotta), + "minecraft:brown_glazed_terracotta" => Some(Item::BrownGlazedTerracotta), + "minecraft:green_glazed_terracotta" => Some(Item::GreenGlazedTerracotta), + "minecraft:red_glazed_terracotta" => Some(Item::RedGlazedTerracotta), + "minecraft:black_glazed_terracotta" => Some(Item::BlackGlazedTerracotta), + "minecraft:white_concrete" => Some(Item::WhiteConcrete), + "minecraft:orange_concrete" => Some(Item::OrangeConcrete), + "minecraft:magenta_concrete" => Some(Item::MagentaConcrete), + "minecraft:light_blue_concrete" => Some(Item::LightBlueConcrete), + "minecraft:yellow_concrete" => Some(Item::YellowConcrete), + "minecraft:lime_concrete" => Some(Item::LimeConcrete), + "minecraft:pink_concrete" => Some(Item::PinkConcrete), + "minecraft:gray_concrete" => Some(Item::GrayConcrete), + "minecraft:light_gray_concrete" => Some(Item::LightGrayConcrete), + "minecraft:cyan_concrete" => Some(Item::CyanConcrete), + "minecraft:purple_concrete" => Some(Item::PurpleConcrete), + "minecraft:blue_concrete" => Some(Item::BlueConcrete), + "minecraft:brown_concrete" => Some(Item::BrownConcrete), + "minecraft:green_concrete" => Some(Item::GreenConcrete), + "minecraft:red_concrete" => Some(Item::RedConcrete), + "minecraft:black_concrete" => Some(Item::BlackConcrete), + "minecraft:white_concrete_powder" => Some(Item::WhiteConcretePowder), + "minecraft:orange_concrete_powder" => Some(Item::OrangeConcretePowder), + "minecraft:magenta_concrete_powder" => Some(Item::MagentaConcretePowder), + "minecraft:light_blue_concrete_powder" => Some(Item::LightBlueConcretePowder), + "minecraft:yellow_concrete_powder" => Some(Item::YellowConcretePowder), + "minecraft:lime_concrete_powder" => Some(Item::LimeConcretePowder), + "minecraft:pink_concrete_powder" => Some(Item::PinkConcretePowder), + "minecraft:gray_concrete_powder" => Some(Item::GrayConcretePowder), + "minecraft:light_gray_concrete_powder" => Some(Item::LightGrayConcretePowder), + "minecraft:cyan_concrete_powder" => Some(Item::CyanConcretePowder), + "minecraft:purple_concrete_powder" => Some(Item::PurpleConcretePowder), + "minecraft:blue_concrete_powder" => Some(Item::BlueConcretePowder), + "minecraft:brown_concrete_powder" => Some(Item::BrownConcretePowder), + "minecraft:green_concrete_powder" => Some(Item::GreenConcretePowder), + "minecraft:red_concrete_powder" => Some(Item::RedConcretePowder), + "minecraft:black_concrete_powder" => Some(Item::BlackConcretePowder), + "minecraft:turtle_egg" => Some(Item::TurtleEgg), + "minecraft:dead_tube_coral_block" => Some(Item::DeadTubeCoralBlock), + "minecraft:dead_brain_coral_block" => Some(Item::DeadBrainCoralBlock), + "minecraft:dead_bubble_coral_block" => Some(Item::DeadBubbleCoralBlock), + "minecraft:dead_fire_coral_block" => Some(Item::DeadFireCoralBlock), + "minecraft:dead_horn_coral_block" => Some(Item::DeadHornCoralBlock), + "minecraft:tube_coral_block" => Some(Item::TubeCoralBlock), + "minecraft:brain_coral_block" => Some(Item::BrainCoralBlock), + "minecraft:bubble_coral_block" => Some(Item::BubbleCoralBlock), + "minecraft:fire_coral_block" => Some(Item::FireCoralBlock), + "minecraft:horn_coral_block" => Some(Item::HornCoralBlock), + "minecraft:tube_coral" => Some(Item::TubeCoral), + "minecraft:brain_coral" => Some(Item::BrainCoral), + "minecraft:bubble_coral" => Some(Item::BubbleCoral), + "minecraft:fire_coral" => Some(Item::FireCoral), + "minecraft:horn_coral" => Some(Item::HornCoral), + "minecraft:dead_brain_coral" => Some(Item::DeadBrainCoral), + "minecraft:dead_bubble_coral" => Some(Item::DeadBubbleCoral), + "minecraft:dead_fire_coral" => Some(Item::DeadFireCoral), + "minecraft:dead_horn_coral" => Some(Item::DeadHornCoral), + "minecraft:dead_tube_coral" => Some(Item::DeadTubeCoral), + "minecraft:tube_coral_fan" => Some(Item::TubeCoralFan), + "minecraft:brain_coral_fan" => Some(Item::BrainCoralFan), + "minecraft:bubble_coral_fan" => Some(Item::BubbleCoralFan), + "minecraft:fire_coral_fan" => Some(Item::FireCoralFan), + "minecraft:horn_coral_fan" => Some(Item::HornCoralFan), + "minecraft:dead_tube_coral_fan" => Some(Item::DeadTubeCoralFan), + "minecraft:dead_brain_coral_fan" => Some(Item::DeadBrainCoralFan), + "minecraft:dead_bubble_coral_fan" => Some(Item::DeadBubbleCoralFan), + "minecraft:dead_fire_coral_fan" => Some(Item::DeadFireCoralFan), + "minecraft:dead_horn_coral_fan" => Some(Item::DeadHornCoralFan), + "minecraft:blue_ice" => Some(Item::BlueIce), + "minecraft:conduit" => Some(Item::Conduit), + "minecraft:polished_granite_stairs" => Some(Item::PolishedGraniteStairs), + "minecraft:smooth_red_sandstone_stairs" => Some(Item::SmoothRedSandstoneStairs), + "minecraft:mossy_stone_brick_stairs" => Some(Item::MossyStoneBrickStairs), + "minecraft:polished_diorite_stairs" => Some(Item::PolishedDioriteStairs), + "minecraft:mossy_cobblestone_stairs" => Some(Item::MossyCobblestoneStairs), + "minecraft:end_stone_brick_stairs" => Some(Item::EndStoneBrickStairs), + "minecraft:stone_stairs" => Some(Item::StoneStairs), + "minecraft:smooth_sandstone_stairs" => Some(Item::SmoothSandstoneStairs), + "minecraft:smooth_quartz_stairs" => Some(Item::SmoothQuartzStairs), + "minecraft:granite_stairs" => Some(Item::GraniteStairs), + "minecraft:andesite_stairs" => Some(Item::AndesiteStairs), + "minecraft:red_nether_brick_stairs" => Some(Item::RedNetherBrickStairs), + "minecraft:polished_andesite_stairs" => Some(Item::PolishedAndesiteStairs), + "minecraft:diorite_stairs" => Some(Item::DioriteStairs), + "minecraft:cobbled_deepslate_stairs" => Some(Item::CobbledDeepslateStairs), + "minecraft:polished_deepslate_stairs" => Some(Item::PolishedDeepslateStairs), + "minecraft:deepslate_brick_stairs" => Some(Item::DeepslateBrickStairs), + "minecraft:deepslate_tile_stairs" => Some(Item::DeepslateTileStairs), + "minecraft:polished_granite_slab" => Some(Item::PolishedGraniteSlab), + "minecraft:smooth_red_sandstone_slab" => Some(Item::SmoothRedSandstoneSlab), + "minecraft:mossy_stone_brick_slab" => Some(Item::MossyStoneBrickSlab), + "minecraft:polished_diorite_slab" => Some(Item::PolishedDioriteSlab), + "minecraft:mossy_cobblestone_slab" => Some(Item::MossyCobblestoneSlab), + "minecraft:end_stone_brick_slab" => Some(Item::EndStoneBrickSlab), + "minecraft:smooth_sandstone_slab" => Some(Item::SmoothSandstoneSlab), + "minecraft:smooth_quartz_slab" => Some(Item::SmoothQuartzSlab), + "minecraft:granite_slab" => Some(Item::GraniteSlab), + "minecraft:andesite_slab" => Some(Item::AndesiteSlab), + "minecraft:red_nether_brick_slab" => Some(Item::RedNetherBrickSlab), + "minecraft:polished_andesite_slab" => Some(Item::PolishedAndesiteSlab), + "minecraft:diorite_slab" => Some(Item::DioriteSlab), + "minecraft:cobbled_deepslate_slab" => Some(Item::CobbledDeepslateSlab), + "minecraft:polished_deepslate_slab" => Some(Item::PolishedDeepslateSlab), + "minecraft:deepslate_brick_slab" => Some(Item::DeepslateBrickSlab), + "minecraft:deepslate_tile_slab" => Some(Item::DeepslateTileSlab), + "minecraft:scaffolding" => Some(Item::Scaffolding), + "minecraft:redstone" => Some(Item::Redstone), + "minecraft:redstone_torch" => Some(Item::RedstoneTorch), + "minecraft:redstone_block" => Some(Item::RedstoneBlock), + "minecraft:repeater" => Some(Item::Repeater), + "minecraft:comparator" => Some(Item::Comparator), + "minecraft:piston" => Some(Item::Piston), + "minecraft:sticky_piston" => Some(Item::StickyPiston), + "minecraft:slime_block" => Some(Item::SlimeBlock), + "minecraft:honey_block" => Some(Item::HoneyBlock), + "minecraft:observer" => Some(Item::Observer), + "minecraft:hopper" => Some(Item::Hopper), + "minecraft:dispenser" => Some(Item::Dispenser), + "minecraft:dropper" => Some(Item::Dropper), + "minecraft:lectern" => Some(Item::Lectern), + "minecraft:target" => Some(Item::Target), + "minecraft:lever" => Some(Item::Lever), + "minecraft:lightning_rod" => Some(Item::LightningRod), + "minecraft:daylight_detector" => Some(Item::DaylightDetector), + "minecraft:sculk_sensor" => Some(Item::SculkSensor), + "minecraft:tripwire_hook" => Some(Item::TripwireHook), + "minecraft:trapped_chest" => Some(Item::TrappedChest), + "minecraft:tnt" => Some(Item::Tnt), + "minecraft:redstone_lamp" => Some(Item::RedstoneLamp), + "minecraft:note_block" => Some(Item::NoteBlock), + "minecraft:stone_button" => Some(Item::StoneButton), + "minecraft:polished_blackstone_button" => Some(Item::PolishedBlackstoneButton), + "minecraft:oak_button" => Some(Item::OakButton), + "minecraft:spruce_button" => Some(Item::SpruceButton), + "minecraft:birch_button" => Some(Item::BirchButton), + "minecraft:jungle_button" => Some(Item::JungleButton), + "minecraft:acacia_button" => Some(Item::AcaciaButton), + "minecraft:dark_oak_button" => Some(Item::DarkOakButton), + "minecraft:crimson_button" => Some(Item::CrimsonButton), + "minecraft:warped_button" => Some(Item::WarpedButton), + "minecraft:stone_pressure_plate" => Some(Item::StonePressurePlate), + "minecraft:polished_blackstone_pressure_plate" => { + Some(Item::PolishedBlackstonePressurePlate) + } + "minecraft:light_weighted_pressure_plate" => Some(Item::LightWeightedPressurePlate), + "minecraft:heavy_weighted_pressure_plate" => Some(Item::HeavyWeightedPressurePlate), + "minecraft:oak_pressure_plate" => Some(Item::OakPressurePlate), + "minecraft:spruce_pressure_plate" => Some(Item::SprucePressurePlate), + "minecraft:birch_pressure_plate" => Some(Item::BirchPressurePlate), + "minecraft:jungle_pressure_plate" => Some(Item::JunglePressurePlate), + "minecraft:acacia_pressure_plate" => Some(Item::AcaciaPressurePlate), + "minecraft:dark_oak_pressure_plate" => Some(Item::DarkOakPressurePlate), + "minecraft:crimson_pressure_plate" => Some(Item::CrimsonPressurePlate), + "minecraft:warped_pressure_plate" => Some(Item::WarpedPressurePlate), + "minecraft:iron_door" => Some(Item::IronDoor), + "minecraft:oak_door" => Some(Item::OakDoor), + "minecraft:spruce_door" => Some(Item::SpruceDoor), + "minecraft:birch_door" => Some(Item::BirchDoor), + "minecraft:jungle_door" => Some(Item::JungleDoor), + "minecraft:acacia_door" => Some(Item::AcaciaDoor), + "minecraft:dark_oak_door" => Some(Item::DarkOakDoor), + "minecraft:crimson_door" => Some(Item::CrimsonDoor), + "minecraft:warped_door" => Some(Item::WarpedDoor), + "minecraft:iron_trapdoor" => Some(Item::IronTrapdoor), + "minecraft:oak_trapdoor" => Some(Item::OakTrapdoor), + "minecraft:spruce_trapdoor" => Some(Item::SpruceTrapdoor), + "minecraft:birch_trapdoor" => Some(Item::BirchTrapdoor), + "minecraft:jungle_trapdoor" => Some(Item::JungleTrapdoor), + "minecraft:acacia_trapdoor" => Some(Item::AcaciaTrapdoor), + "minecraft:dark_oak_trapdoor" => Some(Item::DarkOakTrapdoor), + "minecraft:crimson_trapdoor" => Some(Item::CrimsonTrapdoor), + "minecraft:warped_trapdoor" => Some(Item::WarpedTrapdoor), + "minecraft:oak_fence_gate" => Some(Item::OakFenceGate), + "minecraft:spruce_fence_gate" => Some(Item::SpruceFenceGate), + "minecraft:birch_fence_gate" => Some(Item::BirchFenceGate), + "minecraft:jungle_fence_gate" => Some(Item::JungleFenceGate), + "minecraft:acacia_fence_gate" => Some(Item::AcaciaFenceGate), + "minecraft:dark_oak_fence_gate" => Some(Item::DarkOakFenceGate), + "minecraft:crimson_fence_gate" => Some(Item::CrimsonFenceGate), + "minecraft:warped_fence_gate" => Some(Item::WarpedFenceGate), + "minecraft:powered_rail" => Some(Item::PoweredRail), + "minecraft:detector_rail" => Some(Item::DetectorRail), + "minecraft:rail" => Some(Item::Rail), + "minecraft:activator_rail" => Some(Item::ActivatorRail), + "minecraft:saddle" => Some(Item::Saddle), + "minecraft:minecart" => Some(Item::Minecart), + "minecraft:chest_minecart" => Some(Item::ChestMinecart), + "minecraft:furnace_minecart" => Some(Item::FurnaceMinecart), + "minecraft:tnt_minecart" => Some(Item::TntMinecart), + "minecraft:hopper_minecart" => Some(Item::HopperMinecart), + "minecraft:carrot_on_a_stick" => Some(Item::CarrotOnAStick), + "minecraft:warped_fungus_on_a_stick" => Some(Item::WarpedFungusOnAStick), + "minecraft:elytra" => Some(Item::Elytra), + "minecraft:oak_boat" => Some(Item::OakBoat), + "minecraft:spruce_boat" => Some(Item::SpruceBoat), + "minecraft:birch_boat" => Some(Item::BirchBoat), + "minecraft:jungle_boat" => Some(Item::JungleBoat), + "minecraft:acacia_boat" => Some(Item::AcaciaBoat), + "minecraft:dark_oak_boat" => Some(Item::DarkOakBoat), + "minecraft:structure_block" => Some(Item::StructureBlock), + "minecraft:jigsaw" => Some(Item::Jigsaw), + "minecraft:turtle_helmet" => Some(Item::TurtleHelmet), + "minecraft:scute" => Some(Item::Scute), + "minecraft:flint_and_steel" => Some(Item::FlintAndSteel), + "minecraft:apple" => Some(Item::Apple), + "minecraft:bow" => Some(Item::Bow), + "minecraft:arrow" => Some(Item::Arrow), + "minecraft:coal" => Some(Item::Coal), + "minecraft:charcoal" => Some(Item::Charcoal), + "minecraft:diamond" => Some(Item::Diamond), + "minecraft:emerald" => Some(Item::Emerald), + "minecraft:lapis_lazuli" => Some(Item::LapisLazuli), + "minecraft:quartz" => Some(Item::Quartz), + "minecraft:amethyst_shard" => Some(Item::AmethystShard), + "minecraft:raw_iron" => Some(Item::RawIron), + "minecraft:iron_ingot" => Some(Item::IronIngot), + "minecraft:raw_copper" => Some(Item::RawCopper), + "minecraft:copper_ingot" => Some(Item::CopperIngot), + "minecraft:raw_gold" => Some(Item::RawGold), + "minecraft:gold_ingot" => Some(Item::GoldIngot), + "minecraft:netherite_ingot" => Some(Item::NetheriteIngot), + "minecraft:netherite_scrap" => Some(Item::NetheriteScrap), + "minecraft:wooden_sword" => Some(Item::WoodenSword), + "minecraft:wooden_shovel" => Some(Item::WoodenShovel), + "minecraft:wooden_pickaxe" => Some(Item::WoodenPickaxe), + "minecraft:wooden_axe" => Some(Item::WoodenAxe), + "minecraft:wooden_hoe" => Some(Item::WoodenHoe), + "minecraft:stone_sword" => Some(Item::StoneSword), + "minecraft:stone_shovel" => Some(Item::StoneShovel), + "minecraft:stone_pickaxe" => Some(Item::StonePickaxe), + "minecraft:stone_axe" => Some(Item::StoneAxe), + "minecraft:stone_hoe" => Some(Item::StoneHoe), + "minecraft:golden_sword" => Some(Item::GoldenSword), + "minecraft:golden_shovel" => Some(Item::GoldenShovel), + "minecraft:golden_pickaxe" => Some(Item::GoldenPickaxe), + "minecraft:golden_axe" => Some(Item::GoldenAxe), + "minecraft:golden_hoe" => Some(Item::GoldenHoe), + "minecraft:iron_sword" => Some(Item::IronSword), + "minecraft:iron_shovel" => Some(Item::IronShovel), + "minecraft:iron_pickaxe" => Some(Item::IronPickaxe), + "minecraft:iron_axe" => Some(Item::IronAxe), + "minecraft:iron_hoe" => Some(Item::IronHoe), + "minecraft:diamond_sword" => Some(Item::DiamondSword), + "minecraft:diamond_shovel" => Some(Item::DiamondShovel), + "minecraft:diamond_pickaxe" => Some(Item::DiamondPickaxe), + "minecraft:diamond_axe" => Some(Item::DiamondAxe), + "minecraft:diamond_hoe" => Some(Item::DiamondHoe), + "minecraft:netherite_sword" => Some(Item::NetheriteSword), + "minecraft:netherite_shovel" => Some(Item::NetheriteShovel), + "minecraft:netherite_pickaxe" => Some(Item::NetheritePickaxe), + "minecraft:netherite_axe" => Some(Item::NetheriteAxe), + "minecraft:netherite_hoe" => Some(Item::NetheriteHoe), + "minecraft:stick" => Some(Item::Stick), + "minecraft:bowl" => Some(Item::Bowl), + "minecraft:mushroom_stew" => Some(Item::MushroomStew), + "minecraft:string" => Some(Item::String), + "minecraft:feather" => Some(Item::Feather), + "minecraft:gunpowder" => Some(Item::Gunpowder), + "minecraft:wheat_seeds" => Some(Item::WheatSeeds), + "minecraft:wheat" => Some(Item::Wheat), + "minecraft:bread" => Some(Item::Bread), + "minecraft:leather_helmet" => Some(Item::LeatherHelmet), + "minecraft:leather_chestplate" => Some(Item::LeatherChestplate), + "minecraft:leather_leggings" => Some(Item::LeatherLeggings), + "minecraft:leather_boots" => Some(Item::LeatherBoots), + "minecraft:chainmail_helmet" => Some(Item::ChainmailHelmet), + "minecraft:chainmail_chestplate" => Some(Item::ChainmailChestplate), + "minecraft:chainmail_leggings" => Some(Item::ChainmailLeggings), + "minecraft:chainmail_boots" => Some(Item::ChainmailBoots), + "minecraft:iron_helmet" => Some(Item::IronHelmet), + "minecraft:iron_chestplate" => Some(Item::IronChestplate), + "minecraft:iron_leggings" => Some(Item::IronLeggings), + "minecraft:iron_boots" => Some(Item::IronBoots), + "minecraft:diamond_helmet" => Some(Item::DiamondHelmet), + "minecraft:diamond_chestplate" => Some(Item::DiamondChestplate), + "minecraft:diamond_leggings" => Some(Item::DiamondLeggings), + "minecraft:diamond_boots" => Some(Item::DiamondBoots), + "minecraft:golden_helmet" => Some(Item::GoldenHelmet), + "minecraft:golden_chestplate" => Some(Item::GoldenChestplate), + "minecraft:golden_leggings" => Some(Item::GoldenLeggings), + "minecraft:golden_boots" => Some(Item::GoldenBoots), + "minecraft:netherite_helmet" => Some(Item::NetheriteHelmet), + "minecraft:netherite_chestplate" => Some(Item::NetheriteChestplate), + "minecraft:netherite_leggings" => Some(Item::NetheriteLeggings), + "minecraft:netherite_boots" => Some(Item::NetheriteBoots), + "minecraft:flint" => Some(Item::Flint), + "minecraft:porkchop" => Some(Item::Porkchop), + "minecraft:cooked_porkchop" => Some(Item::CookedPorkchop), + "minecraft:painting" => Some(Item::Painting), + "minecraft:golden_apple" => Some(Item::GoldenApple), + "minecraft:enchanted_golden_apple" => Some(Item::EnchantedGoldenApple), + "minecraft:oak_sign" => Some(Item::OakSign), + "minecraft:spruce_sign" => Some(Item::SpruceSign), + "minecraft:birch_sign" => Some(Item::BirchSign), + "minecraft:jungle_sign" => Some(Item::JungleSign), + "minecraft:acacia_sign" => Some(Item::AcaciaSign), + "minecraft:dark_oak_sign" => Some(Item::DarkOakSign), + "minecraft:crimson_sign" => Some(Item::CrimsonSign), + "minecraft:warped_sign" => Some(Item::WarpedSign), + "minecraft:bucket" => Some(Item::Bucket), + "minecraft:water_bucket" => Some(Item::WaterBucket), + "minecraft:lava_bucket" => Some(Item::LavaBucket), + "minecraft:powder_snow_bucket" => Some(Item::PowderSnowBucket), + "minecraft:snowball" => Some(Item::Snowball), + "minecraft:leather" => Some(Item::Leather), + "minecraft:milk_bucket" => Some(Item::MilkBucket), + "minecraft:pufferfish_bucket" => Some(Item::PufferfishBucket), + "minecraft:salmon_bucket" => Some(Item::SalmonBucket), + "minecraft:cod_bucket" => Some(Item::CodBucket), + "minecraft:tropical_fish_bucket" => Some(Item::TropicalFishBucket), + "minecraft:axolotl_bucket" => Some(Item::AxolotlBucket), + "minecraft:brick" => Some(Item::Brick), + "minecraft:clay_ball" => Some(Item::ClayBall), + "minecraft:dried_kelp_block" => Some(Item::DriedKelpBlock), + "minecraft:paper" => Some(Item::Paper), + "minecraft:book" => Some(Item::Book), + "minecraft:slime_ball" => Some(Item::SlimeBall), + "minecraft:egg" => Some(Item::Egg), + "minecraft:compass" => Some(Item::Compass), + "minecraft:bundle" => Some(Item::Bundle), + "minecraft:fishing_rod" => Some(Item::FishingRod), + "minecraft:clock" => Some(Item::Clock), + "minecraft:spyglass" => Some(Item::Spyglass), + "minecraft:glowstone_dust" => Some(Item::GlowstoneDust), + "minecraft:cod" => Some(Item::Cod), + "minecraft:salmon" => Some(Item::Salmon), + "minecraft:tropical_fish" => Some(Item::TropicalFish), + "minecraft:pufferfish" => Some(Item::Pufferfish), + "minecraft:cooked_cod" => Some(Item::CookedCod), + "minecraft:cooked_salmon" => Some(Item::CookedSalmon), + "minecraft:ink_sac" => Some(Item::InkSac), + "minecraft:glow_ink_sac" => Some(Item::GlowInkSac), + "minecraft:cocoa_beans" => Some(Item::CocoaBeans), + "minecraft:white_dye" => Some(Item::WhiteDye), + "minecraft:orange_dye" => Some(Item::OrangeDye), + "minecraft:magenta_dye" => Some(Item::MagentaDye), + "minecraft:light_blue_dye" => Some(Item::LightBlueDye), + "minecraft:yellow_dye" => Some(Item::YellowDye), + "minecraft:lime_dye" => Some(Item::LimeDye), + "minecraft:pink_dye" => Some(Item::PinkDye), + "minecraft:gray_dye" => Some(Item::GrayDye), + "minecraft:light_gray_dye" => Some(Item::LightGrayDye), + "minecraft:cyan_dye" => Some(Item::CyanDye), + "minecraft:purple_dye" => Some(Item::PurpleDye), + "minecraft:blue_dye" => Some(Item::BlueDye), + "minecraft:brown_dye" => Some(Item::BrownDye), + "minecraft:green_dye" => Some(Item::GreenDye), + "minecraft:red_dye" => Some(Item::RedDye), + "minecraft:black_dye" => Some(Item::BlackDye), + "minecraft:bone_meal" => Some(Item::BoneMeal), + "minecraft:bone" => Some(Item::Bone), + "minecraft:sugar" => Some(Item::Sugar), + "minecraft:cake" => Some(Item::Cake), + "minecraft:white_bed" => Some(Item::WhiteBed), + "minecraft:orange_bed" => Some(Item::OrangeBed), + "minecraft:magenta_bed" => Some(Item::MagentaBed), + "minecraft:light_blue_bed" => Some(Item::LightBlueBed), + "minecraft:yellow_bed" => Some(Item::YellowBed), + "minecraft:lime_bed" => Some(Item::LimeBed), + "minecraft:pink_bed" => Some(Item::PinkBed), + "minecraft:gray_bed" => Some(Item::GrayBed), + "minecraft:light_gray_bed" => Some(Item::LightGrayBed), + "minecraft:cyan_bed" => Some(Item::CyanBed), + "minecraft:purple_bed" => Some(Item::PurpleBed), + "minecraft:blue_bed" => Some(Item::BlueBed), + "minecraft:brown_bed" => Some(Item::BrownBed), + "minecraft:green_bed" => Some(Item::GreenBed), + "minecraft:red_bed" => Some(Item::RedBed), + "minecraft:black_bed" => Some(Item::BlackBed), + "minecraft:cookie" => Some(Item::Cookie), + "minecraft:filled_map" => Some(Item::FilledMap), + "minecraft:shears" => Some(Item::Shears), + "minecraft:melon_slice" => Some(Item::MelonSlice), + "minecraft:dried_kelp" => Some(Item::DriedKelp), + "minecraft:pumpkin_seeds" => Some(Item::PumpkinSeeds), + "minecraft:melon_seeds" => Some(Item::MelonSeeds), + "minecraft:beef" => Some(Item::Beef), + "minecraft:cooked_beef" => Some(Item::CookedBeef), + "minecraft:chicken" => Some(Item::Chicken), + "minecraft:cooked_chicken" => Some(Item::CookedChicken), + "minecraft:rotten_flesh" => Some(Item::RottenFlesh), + "minecraft:ender_pearl" => Some(Item::EnderPearl), + "minecraft:blaze_rod" => Some(Item::BlazeRod), + "minecraft:ghast_tear" => Some(Item::GhastTear), + "minecraft:gold_nugget" => Some(Item::GoldNugget), + "minecraft:nether_wart" => Some(Item::NetherWart), + "minecraft:potion" => Some(Item::Potion), + "minecraft:glass_bottle" => Some(Item::GlassBottle), + "minecraft:spider_eye" => Some(Item::SpiderEye), + "minecraft:fermented_spider_eye" => Some(Item::FermentedSpiderEye), + "minecraft:blaze_powder" => Some(Item::BlazePowder), + "minecraft:magma_cream" => Some(Item::MagmaCream), + "minecraft:brewing_stand" => Some(Item::BrewingStand), + "minecraft:cauldron" => Some(Item::Cauldron), + "minecraft:ender_eye" => Some(Item::EnderEye), + "minecraft:glistering_melon_slice" => Some(Item::GlisteringMelonSlice), + "minecraft:axolotl_spawn_egg" => Some(Item::AxolotlSpawnEgg), + "minecraft:bat_spawn_egg" => Some(Item::BatSpawnEgg), + "minecraft:bee_spawn_egg" => Some(Item::BeeSpawnEgg), + "minecraft:blaze_spawn_egg" => Some(Item::BlazeSpawnEgg), + "minecraft:cat_spawn_egg" => Some(Item::CatSpawnEgg), + "minecraft:cave_spider_spawn_egg" => Some(Item::CaveSpiderSpawnEgg), + "minecraft:chicken_spawn_egg" => Some(Item::ChickenSpawnEgg), + "minecraft:cod_spawn_egg" => Some(Item::CodSpawnEgg), + "minecraft:cow_spawn_egg" => Some(Item::CowSpawnEgg), + "minecraft:creeper_spawn_egg" => Some(Item::CreeperSpawnEgg), + "minecraft:dolphin_spawn_egg" => Some(Item::DolphinSpawnEgg), + "minecraft:donkey_spawn_egg" => Some(Item::DonkeySpawnEgg), + "minecraft:drowned_spawn_egg" => Some(Item::DrownedSpawnEgg), + "minecraft:elder_guardian_spawn_egg" => Some(Item::ElderGuardianSpawnEgg), + "minecraft:enderman_spawn_egg" => Some(Item::EndermanSpawnEgg), + "minecraft:endermite_spawn_egg" => Some(Item::EndermiteSpawnEgg), + "minecraft:evoker_spawn_egg" => Some(Item::EvokerSpawnEgg), + "minecraft:fox_spawn_egg" => Some(Item::FoxSpawnEgg), + "minecraft:ghast_spawn_egg" => Some(Item::GhastSpawnEgg), + "minecraft:glow_squid_spawn_egg" => Some(Item::GlowSquidSpawnEgg), + "minecraft:goat_spawn_egg" => Some(Item::GoatSpawnEgg), + "minecraft:guardian_spawn_egg" => Some(Item::GuardianSpawnEgg), + "minecraft:hoglin_spawn_egg" => Some(Item::HoglinSpawnEgg), + "minecraft:horse_spawn_egg" => Some(Item::HorseSpawnEgg), + "minecraft:husk_spawn_egg" => Some(Item::HuskSpawnEgg), + "minecraft:llama_spawn_egg" => Some(Item::LlamaSpawnEgg), + "minecraft:magma_cube_spawn_egg" => Some(Item::MagmaCubeSpawnEgg), + "minecraft:mooshroom_spawn_egg" => Some(Item::MooshroomSpawnEgg), + "minecraft:mule_spawn_egg" => Some(Item::MuleSpawnEgg), + "minecraft:ocelot_spawn_egg" => Some(Item::OcelotSpawnEgg), + "minecraft:panda_spawn_egg" => Some(Item::PandaSpawnEgg), + "minecraft:parrot_spawn_egg" => Some(Item::ParrotSpawnEgg), + "minecraft:phantom_spawn_egg" => Some(Item::PhantomSpawnEgg), + "minecraft:pig_spawn_egg" => Some(Item::PigSpawnEgg), + "minecraft:piglin_spawn_egg" => Some(Item::PiglinSpawnEgg), + "minecraft:piglin_brute_spawn_egg" => Some(Item::PiglinBruteSpawnEgg), + "minecraft:pillager_spawn_egg" => Some(Item::PillagerSpawnEgg), + "minecraft:polar_bear_spawn_egg" => Some(Item::PolarBearSpawnEgg), + "minecraft:pufferfish_spawn_egg" => Some(Item::PufferfishSpawnEgg), + "minecraft:rabbit_spawn_egg" => Some(Item::RabbitSpawnEgg), + "minecraft:ravager_spawn_egg" => Some(Item::RavagerSpawnEgg), + "minecraft:salmon_spawn_egg" => Some(Item::SalmonSpawnEgg), + "minecraft:sheep_spawn_egg" => Some(Item::SheepSpawnEgg), + "minecraft:shulker_spawn_egg" => Some(Item::ShulkerSpawnEgg), + "minecraft:silverfish_spawn_egg" => Some(Item::SilverfishSpawnEgg), + "minecraft:skeleton_spawn_egg" => Some(Item::SkeletonSpawnEgg), + "minecraft:skeleton_horse_spawn_egg" => Some(Item::SkeletonHorseSpawnEgg), + "minecraft:slime_spawn_egg" => Some(Item::SlimeSpawnEgg), + "minecraft:spider_spawn_egg" => Some(Item::SpiderSpawnEgg), + "minecraft:squid_spawn_egg" => Some(Item::SquidSpawnEgg), + "minecraft:stray_spawn_egg" => Some(Item::StraySpawnEgg), + "minecraft:strider_spawn_egg" => Some(Item::StriderSpawnEgg), + "minecraft:trader_llama_spawn_egg" => Some(Item::TraderLlamaSpawnEgg), + "minecraft:tropical_fish_spawn_egg" => Some(Item::TropicalFishSpawnEgg), + "minecraft:turtle_spawn_egg" => Some(Item::TurtleSpawnEgg), + "minecraft:vex_spawn_egg" => Some(Item::VexSpawnEgg), + "minecraft:villager_spawn_egg" => Some(Item::VillagerSpawnEgg), + "minecraft:vindicator_spawn_egg" => Some(Item::VindicatorSpawnEgg), + "minecraft:wandering_trader_spawn_egg" => Some(Item::WanderingTraderSpawnEgg), + "minecraft:witch_spawn_egg" => Some(Item::WitchSpawnEgg), + "minecraft:wither_skeleton_spawn_egg" => Some(Item::WitherSkeletonSpawnEgg), + "minecraft:wolf_spawn_egg" => Some(Item::WolfSpawnEgg), + "minecraft:zoglin_spawn_egg" => Some(Item::ZoglinSpawnEgg), + "minecraft:zombie_spawn_egg" => Some(Item::ZombieSpawnEgg), + "minecraft:zombie_horse_spawn_egg" => Some(Item::ZombieHorseSpawnEgg), + "minecraft:zombie_villager_spawn_egg" => Some(Item::ZombieVillagerSpawnEgg), + "minecraft:zombified_piglin_spawn_egg" => Some(Item::ZombifiedPiglinSpawnEgg), + "minecraft:experience_bottle" => Some(Item::ExperienceBottle), + "minecraft:fire_charge" => Some(Item::FireCharge), + "minecraft:writable_book" => Some(Item::WritableBook), + "minecraft:written_book" => Some(Item::WrittenBook), + "minecraft:item_frame" => Some(Item::ItemFrame), + "minecraft:glow_item_frame" => Some(Item::GlowItemFrame), + "minecraft:flower_pot" => Some(Item::FlowerPot), + "minecraft:carrot" => Some(Item::Carrot), + "minecraft:potato" => Some(Item::Potato), + "minecraft:baked_potato" => Some(Item::BakedPotato), + "minecraft:poisonous_potato" => Some(Item::PoisonousPotato), + "minecraft:map" => Some(Item::Map), + "minecraft:golden_carrot" => Some(Item::GoldenCarrot), + "minecraft:skeleton_skull" => Some(Item::SkeletonSkull), + "minecraft:wither_skeleton_skull" => Some(Item::WitherSkeletonSkull), + "minecraft:player_head" => Some(Item::PlayerHead), + "minecraft:zombie_head" => Some(Item::ZombieHead), + "minecraft:creeper_head" => Some(Item::CreeperHead), + "minecraft:dragon_head" => Some(Item::DragonHead), + "minecraft:nether_star" => Some(Item::NetherStar), + "minecraft:pumpkin_pie" => Some(Item::PumpkinPie), + "minecraft:firework_rocket" => Some(Item::FireworkRocket), + "minecraft:firework_star" => Some(Item::FireworkStar), + "minecraft:enchanted_book" => Some(Item::EnchantedBook), + "minecraft:nether_brick" => Some(Item::NetherBrick), + "minecraft:prismarine_shard" => Some(Item::PrismarineShard), + "minecraft:prismarine_crystals" => Some(Item::PrismarineCrystals), + "minecraft:rabbit" => Some(Item::Rabbit), + "minecraft:cooked_rabbit" => Some(Item::CookedRabbit), + "minecraft:rabbit_stew" => Some(Item::RabbitStew), + "minecraft:rabbit_foot" => Some(Item::RabbitFoot), + "minecraft:rabbit_hide" => Some(Item::RabbitHide), + "minecraft:armor_stand" => Some(Item::ArmorStand), + "minecraft:iron_horse_armor" => Some(Item::IronHorseArmor), + "minecraft:golden_horse_armor" => Some(Item::GoldenHorseArmor), + "minecraft:diamond_horse_armor" => Some(Item::DiamondHorseArmor), + "minecraft:leather_horse_armor" => Some(Item::LeatherHorseArmor), + "minecraft:lead" => Some(Item::Lead), + "minecraft:name_tag" => Some(Item::NameTag), + "minecraft:command_block_minecart" => Some(Item::CommandBlockMinecart), + "minecraft:mutton" => Some(Item::Mutton), + "minecraft:cooked_mutton" => Some(Item::CookedMutton), + "minecraft:white_banner" => Some(Item::WhiteBanner), + "minecraft:orange_banner" => Some(Item::OrangeBanner), + "minecraft:magenta_banner" => Some(Item::MagentaBanner), + "minecraft:light_blue_banner" => Some(Item::LightBlueBanner), + "minecraft:yellow_banner" => Some(Item::YellowBanner), + "minecraft:lime_banner" => Some(Item::LimeBanner), + "minecraft:pink_banner" => Some(Item::PinkBanner), + "minecraft:gray_banner" => Some(Item::GrayBanner), + "minecraft:light_gray_banner" => Some(Item::LightGrayBanner), + "minecraft:cyan_banner" => Some(Item::CyanBanner), + "minecraft:purple_banner" => Some(Item::PurpleBanner), + "minecraft:blue_banner" => Some(Item::BlueBanner), + "minecraft:brown_banner" => Some(Item::BrownBanner), + "minecraft:green_banner" => Some(Item::GreenBanner), + "minecraft:red_banner" => Some(Item::RedBanner), + "minecraft:black_banner" => Some(Item::BlackBanner), + "minecraft:end_crystal" => Some(Item::EndCrystal), + "minecraft:chorus_fruit" => Some(Item::ChorusFruit), + "minecraft:popped_chorus_fruit" => Some(Item::PoppedChorusFruit), + "minecraft:beetroot" => Some(Item::Beetroot), + "minecraft:beetroot_seeds" => Some(Item::BeetrootSeeds), + "minecraft:beetroot_soup" => Some(Item::BeetrootSoup), + "minecraft:dragon_breath" => Some(Item::DragonBreath), + "minecraft:splash_potion" => Some(Item::SplashPotion), + "minecraft:spectral_arrow" => Some(Item::SpectralArrow), + "minecraft:tipped_arrow" => Some(Item::TippedArrow), + "minecraft:lingering_potion" => Some(Item::LingeringPotion), + "minecraft:shield" => Some(Item::Shield), + "minecraft:totem_of_undying" => Some(Item::TotemOfUndying), + "minecraft:shulker_shell" => Some(Item::ShulkerShell), + "minecraft:iron_nugget" => Some(Item::IronNugget), + "minecraft:knowledge_book" => Some(Item::KnowledgeBook), + "minecraft:debug_stick" => Some(Item::DebugStick), + "minecraft:music_disc_13" => Some(Item::MusicDisc13), + "minecraft:music_disc_cat" => Some(Item::MusicDiscCat), + "minecraft:music_disc_blocks" => Some(Item::MusicDiscBlocks), + "minecraft:music_disc_chirp" => Some(Item::MusicDiscChirp), + "minecraft:music_disc_far" => Some(Item::MusicDiscFar), + "minecraft:music_disc_mall" => Some(Item::MusicDiscMall), + "minecraft:music_disc_mellohi" => Some(Item::MusicDiscMellohi), + "minecraft:music_disc_stal" => Some(Item::MusicDiscStal), + "minecraft:music_disc_strad" => Some(Item::MusicDiscStrad), + "minecraft:music_disc_ward" => Some(Item::MusicDiscWard), + "minecraft:music_disc_11" => Some(Item::MusicDisc11), + "minecraft:music_disc_wait" => Some(Item::MusicDiscWait), + "minecraft:music_disc_otherside" => Some(Item::MusicDiscOtherside), + "minecraft:music_disc_pigstep" => Some(Item::MusicDiscPigstep), + "minecraft:trident" => Some(Item::Trident), + "minecraft:phantom_membrane" => Some(Item::PhantomMembrane), + "minecraft:nautilus_shell" => Some(Item::NautilusShell), + "minecraft:heart_of_the_sea" => Some(Item::HeartOfTheSea), + "minecraft:crossbow" => Some(Item::Crossbow), + "minecraft:suspicious_stew" => Some(Item::SuspiciousStew), + "minecraft:loom" => Some(Item::Loom), + "minecraft:flower_banner_pattern" => Some(Item::FlowerBannerPattern), + "minecraft:creeper_banner_pattern" => Some(Item::CreeperBannerPattern), + "minecraft:skull_banner_pattern" => Some(Item::SkullBannerPattern), + "minecraft:mojang_banner_pattern" => Some(Item::MojangBannerPattern), + "minecraft:globe_banner_pattern" => Some(Item::GlobeBannerPattern), + "minecraft:piglin_banner_pattern" => Some(Item::PiglinBannerPattern), + "minecraft:composter" => Some(Item::Composter), + "minecraft:barrel" => Some(Item::Barrel), + "minecraft:smoker" => Some(Item::Smoker), + "minecraft:blast_furnace" => Some(Item::BlastFurnace), + "minecraft:cartography_table" => Some(Item::CartographyTable), + "minecraft:fletching_table" => Some(Item::FletchingTable), + "minecraft:grindstone" => Some(Item::Grindstone), + "minecraft:smithing_table" => Some(Item::SmithingTable), + "minecraft:stonecutter" => Some(Item::Stonecutter), + "minecraft:bell" => Some(Item::Bell), + "minecraft:lantern" => Some(Item::Lantern), + "minecraft:soul_lantern" => Some(Item::SoulLantern), + "minecraft:sweet_berries" => Some(Item::SweetBerries), + "minecraft:glow_berries" => Some(Item::GlowBerries), + "minecraft:campfire" => Some(Item::Campfire), + "minecraft:soul_campfire" => Some(Item::SoulCampfire), + "minecraft:shroomlight" => Some(Item::Shroomlight), + "minecraft:honeycomb" => Some(Item::Honeycomb), + "minecraft:bee_nest" => Some(Item::BeeNest), + "minecraft:beehive" => Some(Item::Beehive), + "minecraft:honey_bottle" => Some(Item::HoneyBottle), + "minecraft:honeycomb_block" => Some(Item::HoneycombBlock), + "minecraft:lodestone" => Some(Item::Lodestone), + "minecraft:crying_obsidian" => Some(Item::CryingObsidian), + "minecraft:blackstone" => Some(Item::Blackstone), + "minecraft:blackstone_slab" => Some(Item::BlackstoneSlab), + "minecraft:blackstone_stairs" => Some(Item::BlackstoneStairs), + "minecraft:gilded_blackstone" => Some(Item::GildedBlackstone), + "minecraft:polished_blackstone" => Some(Item::PolishedBlackstone), + "minecraft:polished_blackstone_slab" => Some(Item::PolishedBlackstoneSlab), + "minecraft:polished_blackstone_stairs" => Some(Item::PolishedBlackstoneStairs), + "minecraft:chiseled_polished_blackstone" => Some(Item::ChiseledPolishedBlackstone), + "minecraft:polished_blackstone_bricks" => Some(Item::PolishedBlackstoneBricks), + "minecraft:polished_blackstone_brick_slab" => Some(Item::PolishedBlackstoneBrickSlab), + "minecraft:polished_blackstone_brick_stairs" => { + Some(Item::PolishedBlackstoneBrickStairs) + } + "minecraft:cracked_polished_blackstone_bricks" => { + Some(Item::CrackedPolishedBlackstoneBricks) + } + "minecraft:respawn_anchor" => Some(Item::RespawnAnchor), + "minecraft:candle" => Some(Item::Candle), + "minecraft:white_candle" => Some(Item::WhiteCandle), + "minecraft:orange_candle" => Some(Item::OrangeCandle), + "minecraft:magenta_candle" => Some(Item::MagentaCandle), + "minecraft:light_blue_candle" => Some(Item::LightBlueCandle), + "minecraft:yellow_candle" => Some(Item::YellowCandle), + "minecraft:lime_candle" => Some(Item::LimeCandle), + "minecraft:pink_candle" => Some(Item::PinkCandle), + "minecraft:gray_candle" => Some(Item::GrayCandle), + "minecraft:light_gray_candle" => Some(Item::LightGrayCandle), + "minecraft:cyan_candle" => Some(Item::CyanCandle), + "minecraft:purple_candle" => Some(Item::PurpleCandle), + "minecraft:blue_candle" => Some(Item::BlueCandle), + "minecraft:brown_candle" => Some(Item::BrownCandle), + "minecraft:green_candle" => Some(Item::GreenCandle), + "minecraft:red_candle" => Some(Item::RedCandle), + "minecraft:black_candle" => Some(Item::BlackCandle), + "minecraft:small_amethyst_bud" => Some(Item::SmallAmethystBud), + "minecraft:medium_amethyst_bud" => Some(Item::MediumAmethystBud), + "minecraft:large_amethyst_bud" => Some(Item::LargeAmethystBud), + "minecraft:amethyst_cluster" => Some(Item::AmethystCluster), + "minecraft:pointed_dripstone" => Some(Item::PointedDripstone), + _ => None, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl Item { - /// Returns the `stack_size` property of this `Item`. + #[doc = "Returns the `stack_size` property of this `Item`."] + #[inline] pub fn stack_size(&self) -> u32 { match self { - Item::Air => 0, - Item::Stone => 64, - Item::Granite => 64, - Item::PolishedGranite => 64, - Item::Diorite => 64, - Item::PolishedDiorite => 64, - Item::Andesite => 64, - Item::PolishedAndesite => 64, - Item::GrassBlock => 64, - Item::Dirt => 64, - Item::CoarseDirt => 64, - Item::Podzol => 64, - Item::CrimsonNylium => 64, - Item::WarpedNylium => 64, - Item::Cobblestone => 64, - Item::OakPlanks => 64, - Item::SprucePlanks => 64, - Item::BirchPlanks => 64, - Item::JunglePlanks => 64, - Item::AcaciaPlanks => 64, - Item::DarkOakPlanks => 64, - Item::CrimsonPlanks => 64, - Item::WarpedPlanks => 64, - Item::OakSapling => 64, - Item::SpruceSapling => 64, - Item::BirchSapling => 64, - Item::JungleSapling => 64, - Item::AcaciaSapling => 64, - Item::DarkOakSapling => 64, - Item::Bedrock => 64, - Item::Sand => 64, - Item::RedSand => 64, - Item::Gravel => 64, - Item::GoldOre => 64, - Item::IronOre => 64, - Item::CoalOre => 64, - Item::NetherGoldOre => 64, - Item::OakLog => 64, - Item::SpruceLog => 64, - Item::BirchLog => 64, - Item::JungleLog => 64, - Item::AcaciaLog => 64, - Item::DarkOakLog => 64, - Item::CrimsonStem => 64, - Item::WarpedStem => 64, - Item::StrippedOakLog => 64, - Item::StrippedSpruceLog => 64, - Item::StrippedBirchLog => 64, - Item::StrippedJungleLog => 64, - Item::StrippedAcaciaLog => 64, - Item::StrippedDarkOakLog => 64, - Item::StrippedCrimsonStem => 64, - Item::StrippedWarpedStem => 64, - Item::StrippedOakWood => 64, - Item::StrippedSpruceWood => 64, - Item::StrippedBirchWood => 64, - Item::StrippedJungleWood => 64, - Item::StrippedAcaciaWood => 64, - Item::StrippedDarkOakWood => 64, - Item::StrippedCrimsonHyphae => 64, - Item::StrippedWarpedHyphae => 64, - Item::OakWood => 64, - Item::SpruceWood => 64, - Item::BirchWood => 64, - Item::JungleWood => 64, - Item::AcaciaWood => 64, - Item::DarkOakWood => 64, - Item::CrimsonHyphae => 64, - Item::WarpedHyphae => 64, - Item::OakLeaves => 64, - Item::SpruceLeaves => 64, - Item::BirchLeaves => 64, - Item::JungleLeaves => 64, - Item::AcaciaLeaves => 64, - Item::DarkOakLeaves => 64, - Item::Sponge => 64, - Item::WetSponge => 64, - Item::Glass => 64, - Item::LapisOre => 64, - Item::LapisBlock => 64, - Item::Dispenser => 64, - Item::Sandstone => 64, - Item::ChiseledSandstone => 64, - Item::CutSandstone => 64, - Item::NoteBlock => 64, - Item::PoweredRail => 64, - Item::DetectorRail => 64, - Item::StickyPiston => 64, - Item::Cobweb => 64, - Item::Grass => 64, - Item::Fern => 64, - Item::DeadBush => 64, - Item::Seagrass => 64, - Item::SeaPickle => 64, - Item::Piston => 64, - Item::WhiteWool => 64, - Item::OrangeWool => 64, - Item::MagentaWool => 64, - Item::LightBlueWool => 64, - Item::YellowWool => 64, - Item::LimeWool => 64, - Item::PinkWool => 64, - Item::GrayWool => 64, - Item::LightGrayWool => 64, - Item::CyanWool => 64, - Item::PurpleWool => 64, - Item::BlueWool => 64, - Item::BrownWool => 64, - Item::GreenWool => 64, - Item::RedWool => 64, - Item::BlackWool => 64, - Item::Dandelion => 64, - Item::Poppy => 64, - Item::BlueOrchid => 64, - Item::Allium => 64, - Item::AzureBluet => 64, - Item::RedTulip => 64, - Item::OrangeTulip => 64, - Item::WhiteTulip => 64, - Item::PinkTulip => 64, - Item::OxeyeDaisy => 64, - Item::Cornflower => 64, - Item::LilyOfTheValley => 64, - Item::WitherRose => 64, - Item::BrownMushroom => 64, - Item::RedMushroom => 64, - Item::CrimsonFungus => 64, - Item::WarpedFungus => 64, - Item::CrimsonRoots => 64, - Item::WarpedRoots => 64, - Item::NetherSprouts => 64, - Item::WeepingVines => 64, - Item::TwistingVines => 64, - Item::SugarCane => 64, - Item::Kelp => 64, - Item::Bamboo => 64, - Item::GoldBlock => 64, - Item::IronBlock => 64, - Item::OakSlab => 64, - Item::SpruceSlab => 64, - Item::BirchSlab => 64, - Item::JungleSlab => 64, - Item::AcaciaSlab => 64, - Item::DarkOakSlab => 64, - Item::CrimsonSlab => 64, - Item::WarpedSlab => 64, - Item::StoneSlab => 64, - Item::SmoothStoneSlab => 64, - Item::SandstoneSlab => 64, - Item::CutSandstoneSlab => 64, - Item::PetrifiedOakSlab => 64, - Item::CobblestoneSlab => 64, - Item::BrickSlab => 64, - Item::StoneBrickSlab => 64, - Item::NetherBrickSlab => 64, - Item::QuartzSlab => 64, - Item::RedSandstoneSlab => 64, - Item::CutRedSandstoneSlab => 64, - Item::PurpurSlab => 64, - Item::PrismarineSlab => 64, - Item::PrismarineBrickSlab => 64, - Item::DarkPrismarineSlab => 64, - Item::SmoothQuartz => 64, - Item::SmoothRedSandstone => 64, - Item::SmoothSandstone => 64, - Item::SmoothStone => 64, - Item::Bricks => 64, - Item::Tnt => 64, - Item::Bookshelf => 64, - Item::MossyCobblestone => 64, - Item::Obsidian => 64, - Item::Torch => 64, - Item::EndRod => 64, - Item::ChorusPlant => 64, - Item::ChorusFlower => 64, - Item::PurpurBlock => 64, - Item::PurpurPillar => 64, - Item::PurpurStairs => 64, - Item::Spawner => 64, - Item::OakStairs => 64, - Item::Chest => 64, - Item::DiamondOre => 64, - Item::DiamondBlock => 64, - Item::CraftingTable => 64, - Item::Farmland => 64, - Item::Furnace => 64, - Item::Ladder => 64, - Item::Rail => 64, - Item::CobblestoneStairs => 64, - Item::Lever => 64, - Item::StonePressurePlate => 64, - Item::OakPressurePlate => 64, - Item::SprucePressurePlate => 64, - Item::BirchPressurePlate => 64, - Item::JunglePressurePlate => 64, - Item::AcaciaPressurePlate => 64, - Item::DarkOakPressurePlate => 64, - Item::CrimsonPressurePlate => 64, - Item::WarpedPressurePlate => 64, - Item::PolishedBlackstonePressurePlate => 64, - Item::RedstoneOre => 64, - Item::RedstoneTorch => 64, - Item::Snow => 64, - Item::Ice => 64, - Item::SnowBlock => 64, - Item::Cactus => 64, - Item::Clay => 64, - Item::Jukebox => 64, - Item::OakFence => 64, - Item::SpruceFence => 64, - Item::BirchFence => 64, - Item::JungleFence => 64, - Item::AcaciaFence => 64, - Item::DarkOakFence => 64, - Item::CrimsonFence => 64, - Item::WarpedFence => 64, - Item::Pumpkin => 64, - Item::CarvedPumpkin => 64, - Item::Netherrack => 64, - Item::SoulSand => 64, - Item::SoulSoil => 64, - Item::Basalt => 64, - Item::PolishedBasalt => 64, - Item::SoulTorch => 64, - Item::Glowstone => 64, - Item::JackOLantern => 64, - Item::OakTrapdoor => 64, - Item::SpruceTrapdoor => 64, - Item::BirchTrapdoor => 64, - Item::JungleTrapdoor => 64, - Item::AcaciaTrapdoor => 64, - Item::DarkOakTrapdoor => 64, - Item::CrimsonTrapdoor => 64, - Item::WarpedTrapdoor => 64, - Item::InfestedStone => 64, - Item::InfestedCobblestone => 64, - Item::InfestedStoneBricks => 64, - Item::InfestedMossyStoneBricks => 64, - Item::InfestedCrackedStoneBricks => 64, - Item::InfestedChiseledStoneBricks => 64, - Item::StoneBricks => 64, - Item::MossyStoneBricks => 64, - Item::CrackedStoneBricks => 64, - Item::ChiseledStoneBricks => 64, - Item::BrownMushroomBlock => 64, - Item::RedMushroomBlock => 64, - Item::MushroomStem => 64, - Item::IronBars => 64, - Item::Chain => 64, - Item::GlassPane => 64, - Item::Melon => 64, - Item::Vine => 64, - Item::OakFenceGate => 64, - Item::SpruceFenceGate => 64, - Item::BirchFenceGate => 64, - Item::JungleFenceGate => 64, - Item::AcaciaFenceGate => 64, - Item::DarkOakFenceGate => 64, - Item::CrimsonFenceGate => 64, - Item::WarpedFenceGate => 64, - Item::BrickStairs => 64, - Item::StoneBrickStairs => 64, - Item::Mycelium => 64, - Item::LilyPad => 64, - Item::NetherBricks => 64, - Item::CrackedNetherBricks => 64, - Item::ChiseledNetherBricks => 64, - Item::NetherBrickFence => 64, - Item::NetherBrickStairs => 64, - Item::EnchantingTable => 64, - Item::EndPortalFrame => 64, - Item::EndStone => 64, - Item::EndStoneBricks => 64, - Item::DragonEgg => 64, - Item::RedstoneLamp => 64, - Item::SandstoneStairs => 64, - Item::EmeraldOre => 64, - Item::EnderChest => 64, - Item::TripwireHook => 64, - Item::EmeraldBlock => 64, - Item::SpruceStairs => 64, - Item::BirchStairs => 64, - Item::JungleStairs => 64, - Item::CrimsonStairs => 64, - Item::WarpedStairs => 64, - Item::CommandBlock => 64, - Item::Beacon => 64, - Item::CobblestoneWall => 64, - Item::MossyCobblestoneWall => 64, - Item::BrickWall => 64, - Item::PrismarineWall => 64, - Item::RedSandstoneWall => 64, - Item::MossyStoneBrickWall => 64, - Item::GraniteWall => 64, - Item::StoneBrickWall => 64, - Item::NetherBrickWall => 64, - Item::AndesiteWall => 64, - Item::RedNetherBrickWall => 64, - Item::SandstoneWall => 64, - Item::EndStoneBrickWall => 64, - Item::DioriteWall => 64, - Item::BlackstoneWall => 64, - Item::PolishedBlackstoneWall => 64, - Item::PolishedBlackstoneBrickWall => 64, - Item::StoneButton => 64, - Item::OakButton => 64, - Item::SpruceButton => 64, - Item::BirchButton => 64, - Item::JungleButton => 64, - Item::AcaciaButton => 64, - Item::DarkOakButton => 64, - Item::CrimsonButton => 64, - Item::WarpedButton => 64, - Item::PolishedBlackstoneButton => 64, - Item::Anvil => 64, - Item::ChippedAnvil => 64, - Item::DamagedAnvil => 64, - Item::TrappedChest => 64, - Item::LightWeightedPressurePlate => 64, - Item::HeavyWeightedPressurePlate => 64, - Item::DaylightDetector => 64, - Item::RedstoneBlock => 64, - Item::NetherQuartzOre => 64, - Item::Hopper => 64, - Item::ChiseledQuartzBlock => 64, - Item::QuartzBlock => 64, - Item::QuartzBricks => 64, - Item::QuartzPillar => 64, - Item::QuartzStairs => 64, - Item::ActivatorRail => 64, - Item::Dropper => 64, - Item::WhiteTerracotta => 64, - Item::OrangeTerracotta => 64, - Item::MagentaTerracotta => 64, - Item::LightBlueTerracotta => 64, - Item::YellowTerracotta => 64, - Item::LimeTerracotta => 64, - Item::PinkTerracotta => 64, - Item::GrayTerracotta => 64, - Item::LightGrayTerracotta => 64, - Item::CyanTerracotta => 64, - Item::PurpleTerracotta => 64, - Item::BlueTerracotta => 64, - Item::BrownTerracotta => 64, - Item::GreenTerracotta => 64, - Item::RedTerracotta => 64, - Item::BlackTerracotta => 64, - Item::Barrier => 64, - Item::IronTrapdoor => 64, - Item::HayBlock => 64, - Item::WhiteCarpet => 64, - Item::OrangeCarpet => 64, - Item::MagentaCarpet => 64, - Item::LightBlueCarpet => 64, - Item::YellowCarpet => 64, - Item::LimeCarpet => 64, - Item::PinkCarpet => 64, - Item::GrayCarpet => 64, - Item::LightGrayCarpet => 64, - Item::CyanCarpet => 64, - Item::PurpleCarpet => 64, - Item::BlueCarpet => 64, - Item::BrownCarpet => 64, - Item::GreenCarpet => 64, - Item::RedCarpet => 64, - Item::BlackCarpet => 64, - Item::Terracotta => 64, - Item::CoalBlock => 64, - Item::PackedIce => 64, - Item::AcaciaStairs => 64, - Item::DarkOakStairs => 64, - Item::SlimeBlock => 64, - Item::GrassPath => 64, - Item::Sunflower => 64, - Item::Lilac => 64, - Item::RoseBush => 64, - Item::Peony => 64, - Item::TallGrass => 64, - Item::LargeFern => 64, - Item::WhiteStainedGlass => 64, - Item::OrangeStainedGlass => 64, - Item::MagentaStainedGlass => 64, - Item::LightBlueStainedGlass => 64, - Item::YellowStainedGlass => 64, - Item::LimeStainedGlass => 64, - Item::PinkStainedGlass => 64, - Item::GrayStainedGlass => 64, - Item::LightGrayStainedGlass => 64, - Item::CyanStainedGlass => 64, - Item::PurpleStainedGlass => 64, - Item::BlueStainedGlass => 64, - Item::BrownStainedGlass => 64, - Item::GreenStainedGlass => 64, - Item::RedStainedGlass => 64, - Item::BlackStainedGlass => 64, - Item::WhiteStainedGlassPane => 64, - Item::OrangeStainedGlassPane => 64, - Item::MagentaStainedGlassPane => 64, - Item::LightBlueStainedGlassPane => 64, - Item::YellowStainedGlassPane => 64, - Item::LimeStainedGlassPane => 64, - Item::PinkStainedGlassPane => 64, - Item::GrayStainedGlassPane => 64, - Item::LightGrayStainedGlassPane => 64, - Item::CyanStainedGlassPane => 64, - Item::PurpleStainedGlassPane => 64, - Item::BlueStainedGlassPane => 64, - Item::BrownStainedGlassPane => 64, - Item::GreenStainedGlassPane => 64, - Item::RedStainedGlassPane => 64, - Item::BlackStainedGlassPane => 64, - Item::Prismarine => 64, - Item::PrismarineBricks => 64, - Item::DarkPrismarine => 64, - Item::PrismarineStairs => 64, - Item::PrismarineBrickStairs => 64, - Item::DarkPrismarineStairs => 64, - Item::SeaLantern => 64, - Item::RedSandstone => 64, - Item::ChiseledRedSandstone => 64, - Item::CutRedSandstone => 64, - Item::RedSandstoneStairs => 64, - Item::RepeatingCommandBlock => 64, - Item::ChainCommandBlock => 64, - Item::MagmaBlock => 64, - Item::NetherWartBlock => 64, - Item::WarpedWartBlock => 64, - Item::RedNetherBricks => 64, - Item::BoneBlock => 64, - Item::StructureVoid => 64, - Item::Observer => 64, - Item::ShulkerBox => 1, - Item::WhiteShulkerBox => 1, - Item::OrangeShulkerBox => 1, - Item::MagentaShulkerBox => 1, - Item::LightBlueShulkerBox => 1, - Item::YellowShulkerBox => 1, - Item::LimeShulkerBox => 1, - Item::PinkShulkerBox => 1, - Item::GrayShulkerBox => 1, - Item::LightGrayShulkerBox => 1, - Item::CyanShulkerBox => 1, - Item::PurpleShulkerBox => 1, - Item::BlueShulkerBox => 1, - Item::BrownShulkerBox => 1, - Item::GreenShulkerBox => 1, - Item::RedShulkerBox => 1, - Item::BlackShulkerBox => 1, - Item::WhiteGlazedTerracotta => 64, - Item::OrangeGlazedTerracotta => 64, - Item::MagentaGlazedTerracotta => 64, - Item::LightBlueGlazedTerracotta => 64, - Item::YellowGlazedTerracotta => 64, - Item::LimeGlazedTerracotta => 64, - Item::PinkGlazedTerracotta => 64, - Item::GrayGlazedTerracotta => 64, - Item::LightGrayGlazedTerracotta => 64, - Item::CyanGlazedTerracotta => 64, - Item::PurpleGlazedTerracotta => 64, - Item::BlueGlazedTerracotta => 64, - Item::BrownGlazedTerracotta => 64, - Item::GreenGlazedTerracotta => 64, - Item::RedGlazedTerracotta => 64, - Item::BlackGlazedTerracotta => 64, - Item::WhiteConcrete => 64, - Item::OrangeConcrete => 64, - Item::MagentaConcrete => 64, - Item::LightBlueConcrete => 64, - Item::YellowConcrete => 64, - Item::LimeConcrete => 64, - Item::PinkConcrete => 64, - Item::GrayConcrete => 64, - Item::LightGrayConcrete => 64, - Item::CyanConcrete => 64, - Item::PurpleConcrete => 64, - Item::BlueConcrete => 64, - Item::BrownConcrete => 64, - Item::GreenConcrete => 64, - Item::RedConcrete => 64, - Item::BlackConcrete => 64, - Item::WhiteConcretePowder => 64, - Item::OrangeConcretePowder => 64, - Item::MagentaConcretePowder => 64, - Item::LightBlueConcretePowder => 64, - Item::YellowConcretePowder => 64, - Item::LimeConcretePowder => 64, - Item::PinkConcretePowder => 64, - Item::GrayConcretePowder => 64, - Item::LightGrayConcretePowder => 64, - Item::CyanConcretePowder => 64, - Item::PurpleConcretePowder => 64, - Item::BlueConcretePowder => 64, - Item::BrownConcretePowder => 64, - Item::GreenConcretePowder => 64, - Item::RedConcretePowder => 64, - Item::BlackConcretePowder => 64, - Item::TurtleEgg => 64, - Item::DeadTubeCoralBlock => 64, - Item::DeadBrainCoralBlock => 64, - Item::DeadBubbleCoralBlock => 64, - Item::DeadFireCoralBlock => 64, - Item::DeadHornCoralBlock => 64, - Item::TubeCoralBlock => 64, - Item::BrainCoralBlock => 64, - Item::BubbleCoralBlock => 64, - Item::FireCoralBlock => 64, - Item::HornCoralBlock => 64, - Item::TubeCoral => 64, - Item::BrainCoral => 64, - Item::BubbleCoral => 64, - Item::FireCoral => 64, - Item::HornCoral => 64, - Item::DeadBrainCoral => 64, - Item::DeadBubbleCoral => 64, - Item::DeadFireCoral => 64, - Item::DeadHornCoral => 64, - Item::DeadTubeCoral => 64, - Item::TubeCoralFan => 64, - Item::BrainCoralFan => 64, - Item::BubbleCoralFan => 64, - Item::FireCoralFan => 64, - Item::HornCoralFan => 64, - Item::DeadTubeCoralFan => 64, - Item::DeadBrainCoralFan => 64, - Item::DeadBubbleCoralFan => 64, - Item::DeadFireCoralFan => 64, - Item::DeadHornCoralFan => 64, - Item::BlueIce => 64, - Item::Conduit => 64, - Item::PolishedGraniteStairs => 64, - Item::SmoothRedSandstoneStairs => 64, - Item::MossyStoneBrickStairs => 64, - Item::PolishedDioriteStairs => 64, - Item::MossyCobblestoneStairs => 64, - Item::EndStoneBrickStairs => 64, - Item::StoneStairs => 64, - Item::SmoothSandstoneStairs => 64, - Item::SmoothQuartzStairs => 64, - Item::GraniteStairs => 64, - Item::AndesiteStairs => 64, - Item::RedNetherBrickStairs => 64, - Item::PolishedAndesiteStairs => 64, - Item::DioriteStairs => 64, - Item::PolishedGraniteSlab => 64, - Item::SmoothRedSandstoneSlab => 64, - Item::MossyStoneBrickSlab => 64, - Item::PolishedDioriteSlab => 64, - Item::MossyCobblestoneSlab => 64, - Item::EndStoneBrickSlab => 64, - Item::SmoothSandstoneSlab => 64, - Item::SmoothQuartzSlab => 64, - Item::GraniteSlab => 64, - Item::AndesiteSlab => 64, - Item::RedNetherBrickSlab => 64, - Item::PolishedAndesiteSlab => 64, - Item::DioriteSlab => 64, - Item::Scaffolding => 64, - Item::IronDoor => 64, - Item::OakDoor => 64, - Item::SpruceDoor => 64, - Item::BirchDoor => 64, - Item::JungleDoor => 64, - Item::AcaciaDoor => 64, - Item::DarkOakDoor => 64, - Item::CrimsonDoor => 64, - Item::WarpedDoor => 64, - Item::Repeater => 64, - Item::Comparator => 64, - Item::StructureBlock => 64, - Item::Jigsaw => 64, - Item::TurtleHelmet => 1, - Item::Scute => 64, - Item::FlintAndSteel => 1, - Item::Apple => 64, - Item::Bow => 1, - Item::Arrow => 64, - Item::Coal => 64, - Item::Charcoal => 64, - Item::Diamond => 64, - Item::IronIngot => 64, - Item::GoldIngot => 64, - Item::NetheriteIngot => 64, - Item::NetheriteScrap => 64, - Item::WoodenSword => 1, - Item::WoodenShovel => 1, - Item::WoodenPickaxe => 1, - Item::WoodenAxe => 1, - Item::WoodenHoe => 1, - Item::StoneSword => 1, - Item::StoneShovel => 1, - Item::StonePickaxe => 1, - Item::StoneAxe => 1, - Item::StoneHoe => 1, - Item::GoldenSword => 1, - Item::GoldenShovel => 1, - Item::GoldenPickaxe => 1, - Item::GoldenAxe => 1, - Item::GoldenHoe => 1, - Item::IronSword => 1, - Item::IronShovel => 1, - Item::IronPickaxe => 1, - Item::IronAxe => 1, - Item::IronHoe => 1, - Item::DiamondSword => 1, - Item::DiamondShovel => 1, - Item::DiamondPickaxe => 1, - Item::DiamondAxe => 1, - Item::DiamondHoe => 1, - Item::NetheriteSword => 1, - Item::NetheriteShovel => 1, - Item::NetheritePickaxe => 1, - Item::NetheriteAxe => 1, - Item::NetheriteHoe => 1, - Item::Stick => 64, - Item::Bowl => 64, - Item::MushroomStew => 1, - Item::String => 64, - Item::Feather => 64, - Item::Gunpowder => 64, - Item::WheatSeeds => 64, - Item::Wheat => 64, - Item::Bread => 64, - Item::LeatherHelmet => 1, - Item::LeatherChestplate => 1, - Item::LeatherLeggings => 1, - Item::LeatherBoots => 1, - Item::ChainmailHelmet => 1, - Item::ChainmailChestplate => 1, - Item::ChainmailLeggings => 1, - Item::ChainmailBoots => 1, - Item::IronHelmet => 1, - Item::IronChestplate => 1, - Item::IronLeggings => 1, - Item::IronBoots => 1, - Item::DiamondHelmet => 1, - Item::DiamondChestplate => 1, - Item::DiamondLeggings => 1, - Item::DiamondBoots => 1, - Item::GoldenHelmet => 1, - Item::GoldenChestplate => 1, - Item::GoldenLeggings => 1, - Item::GoldenBoots => 1, - Item::NetheriteHelmet => 1, - Item::NetheriteChestplate => 1, - Item::NetheriteLeggings => 1, - Item::NetheriteBoots => 1, - Item::Flint => 64, - Item::Porkchop => 64, - Item::CookedPorkchop => 64, - Item::Painting => 64, - Item::GoldenApple => 64, - Item::EnchantedGoldenApple => 64, - Item::OakSign => 16, - Item::SpruceSign => 16, - Item::BirchSign => 16, - Item::JungleSign => 16, - Item::AcaciaSign => 16, - Item::DarkOakSign => 16, - Item::CrimsonSign => 16, - Item::WarpedSign => 16, - Item::Bucket => 16, - Item::WaterBucket => 1, - Item::LavaBucket => 1, - Item::Minecart => 1, - Item::Saddle => 1, - Item::Redstone => 64, - Item::Snowball => 16, - Item::OakBoat => 1, - Item::Leather => 64, - Item::MilkBucket => 1, - Item::PufferfishBucket => 1, - Item::SalmonBucket => 1, - Item::CodBucket => 1, - Item::TropicalFishBucket => 1, - Item::Brick => 64, - Item::ClayBall => 64, - Item::DriedKelpBlock => 64, - Item::Paper => 64, - Item::Book => 64, - Item::SlimeBall => 64, - Item::ChestMinecart => 1, - Item::FurnaceMinecart => 1, - Item::Egg => 16, - Item::Compass => 64, - Item::FishingRod => 1, - Item::Clock => 64, - Item::GlowstoneDust => 64, - Item::Cod => 64, - Item::Salmon => 64, - Item::TropicalFish => 64, - Item::Pufferfish => 64, - Item::CookedCod => 64, - Item::CookedSalmon => 64, - Item::InkSac => 64, - Item::CocoaBeans => 64, - Item::LapisLazuli => 64, - Item::WhiteDye => 64, - Item::OrangeDye => 64, - Item::MagentaDye => 64, - Item::LightBlueDye => 64, - Item::YellowDye => 64, - Item::LimeDye => 64, - Item::PinkDye => 64, - Item::GrayDye => 64, - Item::LightGrayDye => 64, - Item::CyanDye => 64, - Item::PurpleDye => 64, - Item::BlueDye => 64, - Item::BrownDye => 64, - Item::GreenDye => 64, - Item::RedDye => 64, - Item::BlackDye => 64, - Item::BoneMeal => 64, - Item::Bone => 64, - Item::Sugar => 64, - Item::Cake => 1, - Item::WhiteBed => 1, - Item::OrangeBed => 1, - Item::MagentaBed => 1, - Item::LightBlueBed => 1, - Item::YellowBed => 1, - Item::LimeBed => 1, - Item::PinkBed => 1, - Item::GrayBed => 1, - Item::LightGrayBed => 1, - Item::CyanBed => 1, - Item::PurpleBed => 1, - Item::BlueBed => 1, - Item::BrownBed => 1, - Item::GreenBed => 1, - Item::RedBed => 1, - Item::BlackBed => 1, - Item::Cookie => 64, - Item::FilledMap => 64, - Item::Shears => 1, - Item::MelonSlice => 64, - Item::DriedKelp => 64, - Item::PumpkinSeeds => 64, - Item::MelonSeeds => 64, - Item::Beef => 64, - Item::CookedBeef => 64, - Item::Chicken => 64, - Item::CookedChicken => 64, - Item::RottenFlesh => 64, - Item::EnderPearl => 16, - Item::BlazeRod => 64, - Item::GhastTear => 64, - Item::GoldNugget => 64, - Item::NetherWart => 64, - Item::Potion => 1, - Item::GlassBottle => 64, - Item::SpiderEye => 64, - Item::FermentedSpiderEye => 64, - Item::BlazePowder => 64, - Item::MagmaCream => 64, - Item::BrewingStand => 64, - Item::Cauldron => 64, - Item::EnderEye => 64, - Item::GlisteringMelonSlice => 64, - Item::BatSpawnEgg => 64, - Item::BeeSpawnEgg => 64, - Item::BlazeSpawnEgg => 64, - Item::CatSpawnEgg => 64, - Item::CaveSpiderSpawnEgg => 64, - Item::ChickenSpawnEgg => 64, - Item::CodSpawnEgg => 64, - Item::CowSpawnEgg => 64, - Item::CreeperSpawnEgg => 64, - Item::DolphinSpawnEgg => 64, - Item::DonkeySpawnEgg => 64, - Item::DrownedSpawnEgg => 64, - Item::ElderGuardianSpawnEgg => 64, - Item::EndermanSpawnEgg => 64, - Item::EndermiteSpawnEgg => 64, - Item::EvokerSpawnEgg => 64, - Item::FoxSpawnEgg => 64, - Item::GhastSpawnEgg => 64, - Item::GuardianSpawnEgg => 64, - Item::HoglinSpawnEgg => 64, - Item::HorseSpawnEgg => 64, - Item::HuskSpawnEgg => 64, - Item::LlamaSpawnEgg => 64, - Item::MagmaCubeSpawnEgg => 64, - Item::MooshroomSpawnEgg => 64, - Item::MuleSpawnEgg => 64, - Item::OcelotSpawnEgg => 64, - Item::PandaSpawnEgg => 64, - Item::ParrotSpawnEgg => 64, - Item::PhantomSpawnEgg => 64, - Item::PigSpawnEgg => 64, - Item::PiglinSpawnEgg => 64, - Item::PiglinBruteSpawnEgg => 64, - Item::PillagerSpawnEgg => 64, - Item::PolarBearSpawnEgg => 64, - Item::PufferfishSpawnEgg => 64, - Item::RabbitSpawnEgg => 64, - Item::RavagerSpawnEgg => 64, - Item::SalmonSpawnEgg => 64, - Item::SheepSpawnEgg => 64, - Item::ShulkerSpawnEgg => 64, - Item::SilverfishSpawnEgg => 64, - Item::SkeletonSpawnEgg => 64, - Item::SkeletonHorseSpawnEgg => 64, - Item::SlimeSpawnEgg => 64, - Item::SpiderSpawnEgg => 64, - Item::SquidSpawnEgg => 64, - Item::StraySpawnEgg => 64, - Item::StriderSpawnEgg => 64, - Item::TraderLlamaSpawnEgg => 64, - Item::TropicalFishSpawnEgg => 64, - Item::TurtleSpawnEgg => 64, - Item::VexSpawnEgg => 64, - Item::VillagerSpawnEgg => 64, - Item::VindicatorSpawnEgg => 64, - Item::WanderingTraderSpawnEgg => 64, - Item::WitchSpawnEgg => 64, - Item::WitherSkeletonSpawnEgg => 64, - Item::WolfSpawnEgg => 64, - Item::ZoglinSpawnEgg => 64, - Item::ZombieSpawnEgg => 64, - Item::ZombieHorseSpawnEgg => 64, - Item::ZombieVillagerSpawnEgg => 64, - Item::ZombifiedPiglinSpawnEgg => 64, - Item::ExperienceBottle => 64, - Item::FireCharge => 64, - Item::WritableBook => 1, - Item::WrittenBook => 16, - Item::Emerald => 64, - Item::ItemFrame => 64, - Item::FlowerPot => 64, - Item::Carrot => 64, - Item::Potato => 64, - Item::BakedPotato => 64, - Item::PoisonousPotato => 64, - Item::Map => 64, - Item::GoldenCarrot => 64, - Item::SkeletonSkull => 64, - Item::WitherSkeletonSkull => 64, - Item::PlayerHead => 64, - Item::ZombieHead => 64, - Item::CreeperHead => 64, - Item::DragonHead => 64, - Item::CarrotOnAStick => 1, - Item::WarpedFungusOnAStick => 64, - Item::NetherStar => 64, - Item::PumpkinPie => 64, - Item::FireworkRocket => 64, - Item::FireworkStar => 64, - Item::EnchantedBook => 1, - Item::NetherBrick => 64, - Item::Quartz => 64, - Item::TntMinecart => 1, - Item::HopperMinecart => 1, - Item::PrismarineShard => 64, - Item::PrismarineCrystals => 64, - Item::Rabbit => 64, - Item::CookedRabbit => 64, - Item::RabbitStew => 1, - Item::RabbitFoot => 64, - Item::RabbitHide => 64, - Item::ArmorStand => 16, - Item::IronHorseArmor => 1, - Item::GoldenHorseArmor => 1, - Item::DiamondHorseArmor => 1, - Item::LeatherHorseArmor => 1, - Item::Lead => 64, - Item::NameTag => 64, - Item::CommandBlockMinecart => 1, - Item::Mutton => 64, - Item::CookedMutton => 64, - Item::WhiteBanner => 16, - Item::OrangeBanner => 16, - Item::MagentaBanner => 16, - Item::LightBlueBanner => 16, - Item::YellowBanner => 16, - Item::LimeBanner => 16, - Item::PinkBanner => 16, - Item::GrayBanner => 16, - Item::LightGrayBanner => 16, - Item::CyanBanner => 16, - Item::PurpleBanner => 16, - Item::BlueBanner => 16, - Item::BrownBanner => 16, - Item::GreenBanner => 16, - Item::RedBanner => 16, - Item::BlackBanner => 16, - Item::EndCrystal => 64, - Item::ChorusFruit => 64, - Item::PoppedChorusFruit => 64, - Item::Beetroot => 64, - Item::BeetrootSeeds => 64, - Item::BeetrootSoup => 1, - Item::DragonBreath => 64, - Item::SplashPotion => 1, - Item::SpectralArrow => 64, - Item::TippedArrow => 64, - Item::LingeringPotion => 1, - Item::Shield => 1, - Item::Elytra => 1, - Item::SpruceBoat => 1, - Item::BirchBoat => 1, - Item::JungleBoat => 1, - Item::AcaciaBoat => 1, - Item::DarkOakBoat => 1, - Item::TotemOfUndying => 1, - Item::ShulkerShell => 64, - Item::IronNugget => 64, - Item::KnowledgeBook => 1, - Item::DebugStick => 1, - Item::MusicDisc13 => 1, - Item::MusicDiscCat => 1, - Item::MusicDiscBlocks => 1, - Item::MusicDiscChirp => 1, - Item::MusicDiscFar => 1, - Item::MusicDiscMall => 1, - Item::MusicDiscMellohi => 1, - Item::MusicDiscStal => 1, - Item::MusicDiscStrad => 1, - Item::MusicDiscWard => 1, - Item::MusicDisc11 => 1, - Item::MusicDiscWait => 1, - Item::MusicDiscPigstep => 1, - Item::Trident => 1, - Item::PhantomMembrane => 64, - Item::NautilusShell => 64, - Item::HeartOfTheSea => 64, - Item::Crossbow => 1, - Item::SuspiciousStew => 1, - Item::Loom => 64, - Item::FlowerBannerPattern => 1, - Item::CreeperBannerPattern => 1, - Item::SkullBannerPattern => 1, - Item::MojangBannerPattern => 1, - Item::GlobeBannerPattern => 1, - Item::PiglinBannerPattern => 1, - Item::Composter => 64, - Item::Barrel => 64, - Item::Smoker => 64, - Item::BlastFurnace => 64, - Item::CartographyTable => 64, - Item::FletchingTable => 64, - Item::Grindstone => 64, - Item::Lectern => 64, - Item::SmithingTable => 64, - Item::Stonecutter => 64, - Item::Bell => 64, - Item::Lantern => 64, - Item::SoulLantern => 64, - Item::SweetBerries => 64, - Item::Campfire => 64, - Item::SoulCampfire => 64, - Item::Shroomlight => 64, - Item::Honeycomb => 64, - Item::BeeNest => 64, - Item::Beehive => 64, - Item::HoneyBottle => 16, - Item::HoneyBlock => 64, - Item::HoneycombBlock => 64, - Item::Lodestone => 64, - Item::NetheriteBlock => 64, - Item::AncientDebris => 64, - Item::Target => 64, - Item::CryingObsidian => 64, - Item::Blackstone => 64, - Item::BlackstoneSlab => 64, - Item::BlackstoneStairs => 64, - Item::GildedBlackstone => 64, - Item::PolishedBlackstone => 64, - Item::PolishedBlackstoneSlab => 64, - Item::PolishedBlackstoneStairs => 64, - Item::ChiseledPolishedBlackstone => 64, - Item::PolishedBlackstoneBricks => 64, - Item::PolishedBlackstoneBrickSlab => 64, - Item::PolishedBlackstoneBrickStairs => 64, - Item::CrackedPolishedBlackstoneBricks => 64, - Item::RespawnAnchor => 64, + Item::Stone => 64u32, + Item::Granite => 64u32, + Item::PolishedGranite => 64u32, + Item::Diorite => 64u32, + Item::PolishedDiorite => 64u32, + Item::Andesite => 64u32, + Item::PolishedAndesite => 64u32, + Item::Deepslate => 64u32, + Item::CobbledDeepslate => 64u32, + Item::PolishedDeepslate => 64u32, + Item::Calcite => 64u32, + Item::Tuff => 64u32, + Item::DripstoneBlock => 64u32, + Item::GrassBlock => 64u32, + Item::Dirt => 64u32, + Item::CoarseDirt => 64u32, + Item::Podzol => 64u32, + Item::RootedDirt => 64u32, + Item::CrimsonNylium => 64u32, + Item::WarpedNylium => 64u32, + Item::Cobblestone => 64u32, + Item::OakPlanks => 64u32, + Item::SprucePlanks => 64u32, + Item::BirchPlanks => 64u32, + Item::JunglePlanks => 64u32, + Item::AcaciaPlanks => 64u32, + Item::DarkOakPlanks => 64u32, + Item::CrimsonPlanks => 64u32, + Item::WarpedPlanks => 64u32, + Item::OakSapling => 64u32, + Item::SpruceSapling => 64u32, + Item::BirchSapling => 64u32, + Item::JungleSapling => 64u32, + Item::AcaciaSapling => 64u32, + Item::DarkOakSapling => 64u32, + Item::Bedrock => 64u32, + Item::Sand => 64u32, + Item::RedSand => 64u32, + Item::Gravel => 64u32, + Item::CoalOre => 64u32, + Item::DeepslateCoalOre => 64u32, + Item::IronOre => 64u32, + Item::DeepslateIronOre => 64u32, + Item::CopperOre => 64u32, + Item::DeepslateCopperOre => 64u32, + Item::GoldOre => 64u32, + Item::DeepslateGoldOre => 64u32, + Item::RedstoneOre => 64u32, + Item::DeepslateRedstoneOre => 64u32, + Item::EmeraldOre => 64u32, + Item::DeepslateEmeraldOre => 64u32, + Item::LapisOre => 64u32, + Item::DeepslateLapisOre => 64u32, + Item::DiamondOre => 64u32, + Item::DeepslateDiamondOre => 64u32, + Item::NetherGoldOre => 64u32, + Item::NetherQuartzOre => 64u32, + Item::AncientDebris => 64u32, + Item::CoalBlock => 64u32, + Item::RawIronBlock => 64u32, + Item::RawCopperBlock => 64u32, + Item::RawGoldBlock => 64u32, + Item::AmethystBlock => 64u32, + Item::BuddingAmethyst => 64u32, + Item::IronBlock => 64u32, + Item::CopperBlock => 64u32, + Item::GoldBlock => 64u32, + Item::DiamondBlock => 64u32, + Item::NetheriteBlock => 64u32, + Item::ExposedCopper => 64u32, + Item::WeatheredCopper => 64u32, + Item::OxidizedCopper => 64u32, + Item::CutCopper => 64u32, + Item::ExposedCutCopper => 64u32, + Item::WeatheredCutCopper => 64u32, + Item::OxidizedCutCopper => 64u32, + Item::CutCopperStairs => 64u32, + Item::ExposedCutCopperStairs => 64u32, + Item::WeatheredCutCopperStairs => 64u32, + Item::OxidizedCutCopperStairs => 64u32, + Item::CutCopperSlab => 64u32, + Item::ExposedCutCopperSlab => 64u32, + Item::WeatheredCutCopperSlab => 64u32, + Item::OxidizedCutCopperSlab => 64u32, + Item::WaxedCopperBlock => 64u32, + Item::WaxedExposedCopper => 64u32, + Item::WaxedWeatheredCopper => 64u32, + Item::WaxedOxidizedCopper => 64u32, + Item::WaxedCutCopper => 64u32, + Item::WaxedExposedCutCopper => 64u32, + Item::WaxedWeatheredCutCopper => 64u32, + Item::WaxedOxidizedCutCopper => 64u32, + Item::WaxedCutCopperStairs => 64u32, + Item::WaxedExposedCutCopperStairs => 64u32, + Item::WaxedWeatheredCutCopperStairs => 64u32, + Item::WaxedOxidizedCutCopperStairs => 64u32, + Item::WaxedCutCopperSlab => 64u32, + Item::WaxedExposedCutCopperSlab => 64u32, + Item::WaxedWeatheredCutCopperSlab => 64u32, + Item::WaxedOxidizedCutCopperSlab => 64u32, + Item::OakLog => 64u32, + Item::SpruceLog => 64u32, + Item::BirchLog => 64u32, + Item::JungleLog => 64u32, + Item::AcaciaLog => 64u32, + Item::DarkOakLog => 64u32, + Item::CrimsonStem => 64u32, + Item::WarpedStem => 64u32, + Item::StrippedOakLog => 64u32, + Item::StrippedSpruceLog => 64u32, + Item::StrippedBirchLog => 64u32, + Item::StrippedJungleLog => 64u32, + Item::StrippedAcaciaLog => 64u32, + Item::StrippedDarkOakLog => 64u32, + Item::StrippedCrimsonStem => 64u32, + Item::StrippedWarpedStem => 64u32, + Item::StrippedOakWood => 64u32, + Item::StrippedSpruceWood => 64u32, + Item::StrippedBirchWood => 64u32, + Item::StrippedJungleWood => 64u32, + Item::StrippedAcaciaWood => 64u32, + Item::StrippedDarkOakWood => 64u32, + Item::StrippedCrimsonHyphae => 64u32, + Item::StrippedWarpedHyphae => 64u32, + Item::OakWood => 64u32, + Item::SpruceWood => 64u32, + Item::BirchWood => 64u32, + Item::JungleWood => 64u32, + Item::AcaciaWood => 64u32, + Item::DarkOakWood => 64u32, + Item::CrimsonHyphae => 64u32, + Item::WarpedHyphae => 64u32, + Item::OakLeaves => 64u32, + Item::SpruceLeaves => 64u32, + Item::BirchLeaves => 64u32, + Item::JungleLeaves => 64u32, + Item::AcaciaLeaves => 64u32, + Item::DarkOakLeaves => 64u32, + Item::AzaleaLeaves => 64u32, + Item::FloweringAzaleaLeaves => 64u32, + Item::Sponge => 64u32, + Item::WetSponge => 64u32, + Item::Glass => 64u32, + Item::TintedGlass => 64u32, + Item::LapisBlock => 64u32, + Item::Sandstone => 64u32, + Item::ChiseledSandstone => 64u32, + Item::CutSandstone => 64u32, + Item::Cobweb => 64u32, + Item::Grass => 64u32, + Item::Fern => 64u32, + Item::Azalea => 64u32, + Item::FloweringAzalea => 64u32, + Item::DeadBush => 64u32, + Item::Seagrass => 64u32, + Item::SeaPickle => 64u32, + Item::WhiteWool => 64u32, + Item::OrangeWool => 64u32, + Item::MagentaWool => 64u32, + Item::LightBlueWool => 64u32, + Item::YellowWool => 64u32, + Item::LimeWool => 64u32, + Item::PinkWool => 64u32, + Item::GrayWool => 64u32, + Item::LightGrayWool => 64u32, + Item::CyanWool => 64u32, + Item::PurpleWool => 64u32, + Item::BlueWool => 64u32, + Item::BrownWool => 64u32, + Item::GreenWool => 64u32, + Item::RedWool => 64u32, + Item::BlackWool => 64u32, + Item::Dandelion => 64u32, + Item::Poppy => 64u32, + Item::BlueOrchid => 64u32, + Item::Allium => 64u32, + Item::AzureBluet => 64u32, + Item::RedTulip => 64u32, + Item::OrangeTulip => 64u32, + Item::WhiteTulip => 64u32, + Item::PinkTulip => 64u32, + Item::OxeyeDaisy => 64u32, + Item::Cornflower => 64u32, + Item::LilyOfTheValley => 64u32, + Item::WitherRose => 64u32, + Item::SporeBlossom => 64u32, + Item::BrownMushroom => 64u32, + Item::RedMushroom => 64u32, + Item::CrimsonFungus => 64u32, + Item::WarpedFungus => 64u32, + Item::CrimsonRoots => 64u32, + Item::WarpedRoots => 64u32, + Item::NetherSprouts => 64u32, + Item::WeepingVines => 64u32, + Item::TwistingVines => 64u32, + Item::SugarCane => 64u32, + Item::Kelp => 64u32, + Item::MossCarpet => 64u32, + Item::MossBlock => 64u32, + Item::HangingRoots => 64u32, + Item::BigDripleaf => 64u32, + Item::SmallDripleaf => 64u32, + Item::Bamboo => 64u32, + Item::OakSlab => 64u32, + Item::SpruceSlab => 64u32, + Item::BirchSlab => 64u32, + Item::JungleSlab => 64u32, + Item::AcaciaSlab => 64u32, + Item::DarkOakSlab => 64u32, + Item::CrimsonSlab => 64u32, + Item::WarpedSlab => 64u32, + Item::StoneSlab => 64u32, + Item::SmoothStoneSlab => 64u32, + Item::SandstoneSlab => 64u32, + Item::CutSandstoneSlab => 64u32, + Item::PetrifiedOakSlab => 64u32, + Item::CobblestoneSlab => 64u32, + Item::BrickSlab => 64u32, + Item::StoneBrickSlab => 64u32, + Item::NetherBrickSlab => 64u32, + Item::QuartzSlab => 64u32, + Item::RedSandstoneSlab => 64u32, + Item::CutRedSandstoneSlab => 64u32, + Item::PurpurSlab => 64u32, + Item::PrismarineSlab => 64u32, + Item::PrismarineBrickSlab => 64u32, + Item::DarkPrismarineSlab => 64u32, + Item::SmoothQuartz => 64u32, + Item::SmoothRedSandstone => 64u32, + Item::SmoothSandstone => 64u32, + Item::SmoothStone => 64u32, + Item::Bricks => 64u32, + Item::Bookshelf => 64u32, + Item::MossyCobblestone => 64u32, + Item::Obsidian => 64u32, + Item::Torch => 64u32, + Item::EndRod => 64u32, + Item::ChorusPlant => 64u32, + Item::ChorusFlower => 64u32, + Item::PurpurBlock => 64u32, + Item::PurpurPillar => 64u32, + Item::PurpurStairs => 64u32, + Item::Spawner => 64u32, + Item::OakStairs => 64u32, + Item::Chest => 64u32, + Item::CraftingTable => 64u32, + Item::Farmland => 64u32, + Item::Furnace => 64u32, + Item::Ladder => 64u32, + Item::CobblestoneStairs => 64u32, + Item::Snow => 64u32, + Item::Ice => 64u32, + Item::SnowBlock => 64u32, + Item::Cactus => 64u32, + Item::Clay => 64u32, + Item::Jukebox => 64u32, + Item::OakFence => 64u32, + Item::SpruceFence => 64u32, + Item::BirchFence => 64u32, + Item::JungleFence => 64u32, + Item::AcaciaFence => 64u32, + Item::DarkOakFence => 64u32, + Item::CrimsonFence => 64u32, + Item::WarpedFence => 64u32, + Item::Pumpkin => 64u32, + Item::CarvedPumpkin => 64u32, + Item::JackOLantern => 64u32, + Item::Netherrack => 64u32, + Item::SoulSand => 64u32, + Item::SoulSoil => 64u32, + Item::Basalt => 64u32, + Item::PolishedBasalt => 64u32, + Item::SmoothBasalt => 64u32, + Item::SoulTorch => 64u32, + Item::Glowstone => 64u32, + Item::InfestedStone => 64u32, + Item::InfestedCobblestone => 64u32, + Item::InfestedStoneBricks => 64u32, + Item::InfestedMossyStoneBricks => 64u32, + Item::InfestedCrackedStoneBricks => 64u32, + Item::InfestedChiseledStoneBricks => 64u32, + Item::InfestedDeepslate => 64u32, + Item::StoneBricks => 64u32, + Item::MossyStoneBricks => 64u32, + Item::CrackedStoneBricks => 64u32, + Item::ChiseledStoneBricks => 64u32, + Item::DeepslateBricks => 64u32, + Item::CrackedDeepslateBricks => 64u32, + Item::DeepslateTiles => 64u32, + Item::CrackedDeepslateTiles => 64u32, + Item::ChiseledDeepslate => 64u32, + Item::BrownMushroomBlock => 64u32, + Item::RedMushroomBlock => 64u32, + Item::MushroomStem => 64u32, + Item::IronBars => 64u32, + Item::Chain => 64u32, + Item::GlassPane => 64u32, + Item::Melon => 64u32, + Item::Vine => 64u32, + Item::GlowLichen => 64u32, + Item::BrickStairs => 64u32, + Item::StoneBrickStairs => 64u32, + Item::Mycelium => 64u32, + Item::LilyPad => 64u32, + Item::NetherBricks => 64u32, + Item::CrackedNetherBricks => 64u32, + Item::ChiseledNetherBricks => 64u32, + Item::NetherBrickFence => 64u32, + Item::NetherBrickStairs => 64u32, + Item::EnchantingTable => 64u32, + Item::EndPortalFrame => 64u32, + Item::EndStone => 64u32, + Item::EndStoneBricks => 64u32, + Item::DragonEgg => 64u32, + Item::SandstoneStairs => 64u32, + Item::EnderChest => 64u32, + Item::EmeraldBlock => 64u32, + Item::SpruceStairs => 64u32, + Item::BirchStairs => 64u32, + Item::JungleStairs => 64u32, + Item::CrimsonStairs => 64u32, + Item::WarpedStairs => 64u32, + Item::CommandBlock => 64u32, + Item::Beacon => 64u32, + Item::CobblestoneWall => 64u32, + Item::MossyCobblestoneWall => 64u32, + Item::BrickWall => 64u32, + Item::PrismarineWall => 64u32, + Item::RedSandstoneWall => 64u32, + Item::MossyStoneBrickWall => 64u32, + Item::GraniteWall => 64u32, + Item::StoneBrickWall => 64u32, + Item::NetherBrickWall => 64u32, + Item::AndesiteWall => 64u32, + Item::RedNetherBrickWall => 64u32, + Item::SandstoneWall => 64u32, + Item::EndStoneBrickWall => 64u32, + Item::DioriteWall => 64u32, + Item::BlackstoneWall => 64u32, + Item::PolishedBlackstoneWall => 64u32, + Item::PolishedBlackstoneBrickWall => 64u32, + Item::CobbledDeepslateWall => 64u32, + Item::PolishedDeepslateWall => 64u32, + Item::DeepslateBrickWall => 64u32, + Item::DeepslateTileWall => 64u32, + Item::Anvil => 64u32, + Item::ChippedAnvil => 64u32, + Item::DamagedAnvil => 64u32, + Item::ChiseledQuartzBlock => 64u32, + Item::QuartzBlock => 64u32, + Item::QuartzBricks => 64u32, + Item::QuartzPillar => 64u32, + Item::QuartzStairs => 64u32, + Item::WhiteTerracotta => 64u32, + Item::OrangeTerracotta => 64u32, + Item::MagentaTerracotta => 64u32, + Item::LightBlueTerracotta => 64u32, + Item::YellowTerracotta => 64u32, + Item::LimeTerracotta => 64u32, + Item::PinkTerracotta => 64u32, + Item::GrayTerracotta => 64u32, + Item::LightGrayTerracotta => 64u32, + Item::CyanTerracotta => 64u32, + Item::PurpleTerracotta => 64u32, + Item::BlueTerracotta => 64u32, + Item::BrownTerracotta => 64u32, + Item::GreenTerracotta => 64u32, + Item::RedTerracotta => 64u32, + Item::BlackTerracotta => 64u32, + Item::Barrier => 64u32, + Item::Light => 64u32, + Item::HayBlock => 64u32, + Item::WhiteCarpet => 64u32, + Item::OrangeCarpet => 64u32, + Item::MagentaCarpet => 64u32, + Item::LightBlueCarpet => 64u32, + Item::YellowCarpet => 64u32, + Item::LimeCarpet => 64u32, + Item::PinkCarpet => 64u32, + Item::GrayCarpet => 64u32, + Item::LightGrayCarpet => 64u32, + Item::CyanCarpet => 64u32, + Item::PurpleCarpet => 64u32, + Item::BlueCarpet => 64u32, + Item::BrownCarpet => 64u32, + Item::GreenCarpet => 64u32, + Item::RedCarpet => 64u32, + Item::BlackCarpet => 64u32, + Item::Terracotta => 64u32, + Item::PackedIce => 64u32, + Item::AcaciaStairs => 64u32, + Item::DarkOakStairs => 64u32, + Item::DirtPath => 64u32, + Item::Sunflower => 64u32, + Item::Lilac => 64u32, + Item::RoseBush => 64u32, + Item::Peony => 64u32, + Item::TallGrass => 64u32, + Item::LargeFern => 64u32, + Item::WhiteStainedGlass => 64u32, + Item::OrangeStainedGlass => 64u32, + Item::MagentaStainedGlass => 64u32, + Item::LightBlueStainedGlass => 64u32, + Item::YellowStainedGlass => 64u32, + Item::LimeStainedGlass => 64u32, + Item::PinkStainedGlass => 64u32, + Item::GrayStainedGlass => 64u32, + Item::LightGrayStainedGlass => 64u32, + Item::CyanStainedGlass => 64u32, + Item::PurpleStainedGlass => 64u32, + Item::BlueStainedGlass => 64u32, + Item::BrownStainedGlass => 64u32, + Item::GreenStainedGlass => 64u32, + Item::RedStainedGlass => 64u32, + Item::BlackStainedGlass => 64u32, + Item::WhiteStainedGlassPane => 64u32, + Item::OrangeStainedGlassPane => 64u32, + Item::MagentaStainedGlassPane => 64u32, + Item::LightBlueStainedGlassPane => 64u32, + Item::YellowStainedGlassPane => 64u32, + Item::LimeStainedGlassPane => 64u32, + Item::PinkStainedGlassPane => 64u32, + Item::GrayStainedGlassPane => 64u32, + Item::LightGrayStainedGlassPane => 64u32, + Item::CyanStainedGlassPane => 64u32, + Item::PurpleStainedGlassPane => 64u32, + Item::BlueStainedGlassPane => 64u32, + Item::BrownStainedGlassPane => 64u32, + Item::GreenStainedGlassPane => 64u32, + Item::RedStainedGlassPane => 64u32, + Item::BlackStainedGlassPane => 64u32, + Item::Prismarine => 64u32, + Item::PrismarineBricks => 64u32, + Item::DarkPrismarine => 64u32, + Item::PrismarineStairs => 64u32, + Item::PrismarineBrickStairs => 64u32, + Item::DarkPrismarineStairs => 64u32, + Item::SeaLantern => 64u32, + Item::RedSandstone => 64u32, + Item::ChiseledRedSandstone => 64u32, + Item::CutRedSandstone => 64u32, + Item::RedSandstoneStairs => 64u32, + Item::RepeatingCommandBlock => 64u32, + Item::ChainCommandBlock => 64u32, + Item::MagmaBlock => 64u32, + Item::NetherWartBlock => 64u32, + Item::WarpedWartBlock => 64u32, + Item::RedNetherBricks => 64u32, + Item::BoneBlock => 64u32, + Item::StructureVoid => 64u32, + Item::ShulkerBox => 1u32, + Item::WhiteShulkerBox => 1u32, + Item::OrangeShulkerBox => 1u32, + Item::MagentaShulkerBox => 1u32, + Item::LightBlueShulkerBox => 1u32, + Item::YellowShulkerBox => 1u32, + Item::LimeShulkerBox => 1u32, + Item::PinkShulkerBox => 1u32, + Item::GrayShulkerBox => 1u32, + Item::LightGrayShulkerBox => 1u32, + Item::CyanShulkerBox => 1u32, + Item::PurpleShulkerBox => 1u32, + Item::BlueShulkerBox => 1u32, + Item::BrownShulkerBox => 1u32, + Item::GreenShulkerBox => 1u32, + Item::RedShulkerBox => 1u32, + Item::BlackShulkerBox => 1u32, + Item::WhiteGlazedTerracotta => 64u32, + Item::OrangeGlazedTerracotta => 64u32, + Item::MagentaGlazedTerracotta => 64u32, + Item::LightBlueGlazedTerracotta => 64u32, + Item::YellowGlazedTerracotta => 64u32, + Item::LimeGlazedTerracotta => 64u32, + Item::PinkGlazedTerracotta => 64u32, + Item::GrayGlazedTerracotta => 64u32, + Item::LightGrayGlazedTerracotta => 64u32, + Item::CyanGlazedTerracotta => 64u32, + Item::PurpleGlazedTerracotta => 64u32, + Item::BlueGlazedTerracotta => 64u32, + Item::BrownGlazedTerracotta => 64u32, + Item::GreenGlazedTerracotta => 64u32, + Item::RedGlazedTerracotta => 64u32, + Item::BlackGlazedTerracotta => 64u32, + Item::WhiteConcrete => 64u32, + Item::OrangeConcrete => 64u32, + Item::MagentaConcrete => 64u32, + Item::LightBlueConcrete => 64u32, + Item::YellowConcrete => 64u32, + Item::LimeConcrete => 64u32, + Item::PinkConcrete => 64u32, + Item::GrayConcrete => 64u32, + Item::LightGrayConcrete => 64u32, + Item::CyanConcrete => 64u32, + Item::PurpleConcrete => 64u32, + Item::BlueConcrete => 64u32, + Item::BrownConcrete => 64u32, + Item::GreenConcrete => 64u32, + Item::RedConcrete => 64u32, + Item::BlackConcrete => 64u32, + Item::WhiteConcretePowder => 64u32, + Item::OrangeConcretePowder => 64u32, + Item::MagentaConcretePowder => 64u32, + Item::LightBlueConcretePowder => 64u32, + Item::YellowConcretePowder => 64u32, + Item::LimeConcretePowder => 64u32, + Item::PinkConcretePowder => 64u32, + Item::GrayConcretePowder => 64u32, + Item::LightGrayConcretePowder => 64u32, + Item::CyanConcretePowder => 64u32, + Item::PurpleConcretePowder => 64u32, + Item::BlueConcretePowder => 64u32, + Item::BrownConcretePowder => 64u32, + Item::GreenConcretePowder => 64u32, + Item::RedConcretePowder => 64u32, + Item::BlackConcretePowder => 64u32, + Item::TurtleEgg => 64u32, + Item::DeadTubeCoralBlock => 64u32, + Item::DeadBrainCoralBlock => 64u32, + Item::DeadBubbleCoralBlock => 64u32, + Item::DeadFireCoralBlock => 64u32, + Item::DeadHornCoralBlock => 64u32, + Item::TubeCoralBlock => 64u32, + Item::BrainCoralBlock => 64u32, + Item::BubbleCoralBlock => 64u32, + Item::FireCoralBlock => 64u32, + Item::HornCoralBlock => 64u32, + Item::TubeCoral => 64u32, + Item::BrainCoral => 64u32, + Item::BubbleCoral => 64u32, + Item::FireCoral => 64u32, + Item::HornCoral => 64u32, + Item::DeadBrainCoral => 64u32, + Item::DeadBubbleCoral => 64u32, + Item::DeadFireCoral => 64u32, + Item::DeadHornCoral => 64u32, + Item::DeadTubeCoral => 64u32, + Item::TubeCoralFan => 64u32, + Item::BrainCoralFan => 64u32, + Item::BubbleCoralFan => 64u32, + Item::FireCoralFan => 64u32, + Item::HornCoralFan => 64u32, + Item::DeadTubeCoralFan => 64u32, + Item::DeadBrainCoralFan => 64u32, + Item::DeadBubbleCoralFan => 64u32, + Item::DeadFireCoralFan => 64u32, + Item::DeadHornCoralFan => 64u32, + Item::BlueIce => 64u32, + Item::Conduit => 64u32, + Item::PolishedGraniteStairs => 64u32, + Item::SmoothRedSandstoneStairs => 64u32, + Item::MossyStoneBrickStairs => 64u32, + Item::PolishedDioriteStairs => 64u32, + Item::MossyCobblestoneStairs => 64u32, + Item::EndStoneBrickStairs => 64u32, + Item::StoneStairs => 64u32, + Item::SmoothSandstoneStairs => 64u32, + Item::SmoothQuartzStairs => 64u32, + Item::GraniteStairs => 64u32, + Item::AndesiteStairs => 64u32, + Item::RedNetherBrickStairs => 64u32, + Item::PolishedAndesiteStairs => 64u32, + Item::DioriteStairs => 64u32, + Item::CobbledDeepslateStairs => 64u32, + Item::PolishedDeepslateStairs => 64u32, + Item::DeepslateBrickStairs => 64u32, + Item::DeepslateTileStairs => 64u32, + Item::PolishedGraniteSlab => 64u32, + Item::SmoothRedSandstoneSlab => 64u32, + Item::MossyStoneBrickSlab => 64u32, + Item::PolishedDioriteSlab => 64u32, + Item::MossyCobblestoneSlab => 64u32, + Item::EndStoneBrickSlab => 64u32, + Item::SmoothSandstoneSlab => 64u32, + Item::SmoothQuartzSlab => 64u32, + Item::GraniteSlab => 64u32, + Item::AndesiteSlab => 64u32, + Item::RedNetherBrickSlab => 64u32, + Item::PolishedAndesiteSlab => 64u32, + Item::DioriteSlab => 64u32, + Item::CobbledDeepslateSlab => 64u32, + Item::PolishedDeepslateSlab => 64u32, + Item::DeepslateBrickSlab => 64u32, + Item::DeepslateTileSlab => 64u32, + Item::Scaffolding => 64u32, + Item::Redstone => 64u32, + Item::RedstoneTorch => 64u32, + Item::RedstoneBlock => 64u32, + Item::Repeater => 64u32, + Item::Comparator => 64u32, + Item::Piston => 64u32, + Item::StickyPiston => 64u32, + Item::SlimeBlock => 64u32, + Item::HoneyBlock => 64u32, + Item::Observer => 64u32, + Item::Hopper => 64u32, + Item::Dispenser => 64u32, + Item::Dropper => 64u32, + Item::Lectern => 64u32, + Item::Target => 64u32, + Item::Lever => 64u32, + Item::LightningRod => 64u32, + Item::DaylightDetector => 64u32, + Item::SculkSensor => 64u32, + Item::TripwireHook => 64u32, + Item::TrappedChest => 64u32, + Item::Tnt => 64u32, + Item::RedstoneLamp => 64u32, + Item::NoteBlock => 64u32, + Item::StoneButton => 64u32, + Item::PolishedBlackstoneButton => 64u32, + Item::OakButton => 64u32, + Item::SpruceButton => 64u32, + Item::BirchButton => 64u32, + Item::JungleButton => 64u32, + Item::AcaciaButton => 64u32, + Item::DarkOakButton => 64u32, + Item::CrimsonButton => 64u32, + Item::WarpedButton => 64u32, + Item::StonePressurePlate => 64u32, + Item::PolishedBlackstonePressurePlate => 64u32, + Item::LightWeightedPressurePlate => 64u32, + Item::HeavyWeightedPressurePlate => 64u32, + Item::OakPressurePlate => 64u32, + Item::SprucePressurePlate => 64u32, + Item::BirchPressurePlate => 64u32, + Item::JunglePressurePlate => 64u32, + Item::AcaciaPressurePlate => 64u32, + Item::DarkOakPressurePlate => 64u32, + Item::CrimsonPressurePlate => 64u32, + Item::WarpedPressurePlate => 64u32, + Item::IronDoor => 64u32, + Item::OakDoor => 64u32, + Item::SpruceDoor => 64u32, + Item::BirchDoor => 64u32, + Item::JungleDoor => 64u32, + Item::AcaciaDoor => 64u32, + Item::DarkOakDoor => 64u32, + Item::CrimsonDoor => 64u32, + Item::WarpedDoor => 64u32, + Item::IronTrapdoor => 64u32, + Item::OakTrapdoor => 64u32, + Item::SpruceTrapdoor => 64u32, + Item::BirchTrapdoor => 64u32, + Item::JungleTrapdoor => 64u32, + Item::AcaciaTrapdoor => 64u32, + Item::DarkOakTrapdoor => 64u32, + Item::CrimsonTrapdoor => 64u32, + Item::WarpedTrapdoor => 64u32, + Item::OakFenceGate => 64u32, + Item::SpruceFenceGate => 64u32, + Item::BirchFenceGate => 64u32, + Item::JungleFenceGate => 64u32, + Item::AcaciaFenceGate => 64u32, + Item::DarkOakFenceGate => 64u32, + Item::CrimsonFenceGate => 64u32, + Item::WarpedFenceGate => 64u32, + Item::PoweredRail => 64u32, + Item::DetectorRail => 64u32, + Item::Rail => 64u32, + Item::ActivatorRail => 64u32, + Item::Saddle => 1u32, + Item::Minecart => 1u32, + Item::ChestMinecart => 1u32, + Item::FurnaceMinecart => 1u32, + Item::TntMinecart => 1u32, + Item::HopperMinecart => 1u32, + Item::CarrotOnAStick => 1u32, + Item::WarpedFungusOnAStick => 64u32, + Item::Elytra => 1u32, + Item::OakBoat => 1u32, + Item::SpruceBoat => 1u32, + Item::BirchBoat => 1u32, + Item::JungleBoat => 1u32, + Item::AcaciaBoat => 1u32, + Item::DarkOakBoat => 1u32, + Item::StructureBlock => 64u32, + Item::Jigsaw => 64u32, + Item::TurtleHelmet => 1u32, + Item::Scute => 64u32, + Item::FlintAndSteel => 1u32, + Item::Apple => 64u32, + Item::Bow => 1u32, + Item::Arrow => 64u32, + Item::Coal => 64u32, + Item::Charcoal => 64u32, + Item::Diamond => 64u32, + Item::Emerald => 64u32, + Item::LapisLazuli => 64u32, + Item::Quartz => 64u32, + Item::AmethystShard => 64u32, + Item::RawIron => 64u32, + Item::IronIngot => 64u32, + Item::RawCopper => 64u32, + Item::CopperIngot => 64u32, + Item::RawGold => 64u32, + Item::GoldIngot => 64u32, + Item::NetheriteIngot => 64u32, + Item::NetheriteScrap => 64u32, + Item::WoodenSword => 1u32, + Item::WoodenShovel => 1u32, + Item::WoodenPickaxe => 1u32, + Item::WoodenAxe => 1u32, + Item::WoodenHoe => 1u32, + Item::StoneSword => 1u32, + Item::StoneShovel => 1u32, + Item::StonePickaxe => 1u32, + Item::StoneAxe => 1u32, + Item::StoneHoe => 1u32, + Item::GoldenSword => 1u32, + Item::GoldenShovel => 1u32, + Item::GoldenPickaxe => 1u32, + Item::GoldenAxe => 1u32, + Item::GoldenHoe => 1u32, + Item::IronSword => 1u32, + Item::IronShovel => 1u32, + Item::IronPickaxe => 1u32, + Item::IronAxe => 1u32, + Item::IronHoe => 1u32, + Item::DiamondSword => 1u32, + Item::DiamondShovel => 1u32, + Item::DiamondPickaxe => 1u32, + Item::DiamondAxe => 1u32, + Item::DiamondHoe => 1u32, + Item::NetheriteSword => 1u32, + Item::NetheriteShovel => 1u32, + Item::NetheritePickaxe => 1u32, + Item::NetheriteAxe => 1u32, + Item::NetheriteHoe => 1u32, + Item::Stick => 64u32, + Item::Bowl => 64u32, + Item::MushroomStew => 1u32, + Item::String => 64u32, + Item::Feather => 64u32, + Item::Gunpowder => 64u32, + Item::WheatSeeds => 64u32, + Item::Wheat => 64u32, + Item::Bread => 64u32, + Item::LeatherHelmet => 1u32, + Item::LeatherChestplate => 1u32, + Item::LeatherLeggings => 1u32, + Item::LeatherBoots => 1u32, + Item::ChainmailHelmet => 1u32, + Item::ChainmailChestplate => 1u32, + Item::ChainmailLeggings => 1u32, + Item::ChainmailBoots => 1u32, + Item::IronHelmet => 1u32, + Item::IronChestplate => 1u32, + Item::IronLeggings => 1u32, + Item::IronBoots => 1u32, + Item::DiamondHelmet => 1u32, + Item::DiamondChestplate => 1u32, + Item::DiamondLeggings => 1u32, + Item::DiamondBoots => 1u32, + Item::GoldenHelmet => 1u32, + Item::GoldenChestplate => 1u32, + Item::GoldenLeggings => 1u32, + Item::GoldenBoots => 1u32, + Item::NetheriteHelmet => 1u32, + Item::NetheriteChestplate => 1u32, + Item::NetheriteLeggings => 1u32, + Item::NetheriteBoots => 1u32, + Item::Flint => 64u32, + Item::Porkchop => 64u32, + Item::CookedPorkchop => 64u32, + Item::Painting => 64u32, + Item::GoldenApple => 64u32, + Item::EnchantedGoldenApple => 64u32, + Item::OakSign => 16u32, + Item::SpruceSign => 16u32, + Item::BirchSign => 16u32, + Item::JungleSign => 16u32, + Item::AcaciaSign => 16u32, + Item::DarkOakSign => 16u32, + Item::CrimsonSign => 16u32, + Item::WarpedSign => 16u32, + Item::Bucket => 16u32, + Item::WaterBucket => 1u32, + Item::LavaBucket => 1u32, + Item::PowderSnowBucket => 1u32, + Item::Snowball => 16u32, + Item::Leather => 64u32, + Item::MilkBucket => 1u32, + Item::PufferfishBucket => 1u32, + Item::SalmonBucket => 1u32, + Item::CodBucket => 1u32, + Item::TropicalFishBucket => 1u32, + Item::AxolotlBucket => 1u32, + Item::Brick => 64u32, + Item::ClayBall => 64u32, + Item::DriedKelpBlock => 64u32, + Item::Paper => 64u32, + Item::Book => 64u32, + Item::SlimeBall => 64u32, + Item::Egg => 16u32, + Item::Compass => 64u32, + Item::Bundle => 1u32, + Item::FishingRod => 1u32, + Item::Clock => 64u32, + Item::Spyglass => 1u32, + Item::GlowstoneDust => 64u32, + Item::Cod => 64u32, + Item::Salmon => 64u32, + Item::TropicalFish => 64u32, + Item::Pufferfish => 64u32, + Item::CookedCod => 64u32, + Item::CookedSalmon => 64u32, + Item::InkSac => 64u32, + Item::GlowInkSac => 64u32, + Item::CocoaBeans => 64u32, + Item::WhiteDye => 64u32, + Item::OrangeDye => 64u32, + Item::MagentaDye => 64u32, + Item::LightBlueDye => 64u32, + Item::YellowDye => 64u32, + Item::LimeDye => 64u32, + Item::PinkDye => 64u32, + Item::GrayDye => 64u32, + Item::LightGrayDye => 64u32, + Item::CyanDye => 64u32, + Item::PurpleDye => 64u32, + Item::BlueDye => 64u32, + Item::BrownDye => 64u32, + Item::GreenDye => 64u32, + Item::RedDye => 64u32, + Item::BlackDye => 64u32, + Item::BoneMeal => 64u32, + Item::Bone => 64u32, + Item::Sugar => 64u32, + Item::Cake => 1u32, + Item::WhiteBed => 1u32, + Item::OrangeBed => 1u32, + Item::MagentaBed => 1u32, + Item::LightBlueBed => 1u32, + Item::YellowBed => 1u32, + Item::LimeBed => 1u32, + Item::PinkBed => 1u32, + Item::GrayBed => 1u32, + Item::LightGrayBed => 1u32, + Item::CyanBed => 1u32, + Item::PurpleBed => 1u32, + Item::BlueBed => 1u32, + Item::BrownBed => 1u32, + Item::GreenBed => 1u32, + Item::RedBed => 1u32, + Item::BlackBed => 1u32, + Item::Cookie => 64u32, + Item::FilledMap => 64u32, + Item::Shears => 1u32, + Item::MelonSlice => 64u32, + Item::DriedKelp => 64u32, + Item::PumpkinSeeds => 64u32, + Item::MelonSeeds => 64u32, + Item::Beef => 64u32, + Item::CookedBeef => 64u32, + Item::Chicken => 64u32, + Item::CookedChicken => 64u32, + Item::RottenFlesh => 64u32, + Item::EnderPearl => 16u32, + Item::BlazeRod => 64u32, + Item::GhastTear => 64u32, + Item::GoldNugget => 64u32, + Item::NetherWart => 64u32, + Item::Potion => 1u32, + Item::GlassBottle => 64u32, + Item::SpiderEye => 64u32, + Item::FermentedSpiderEye => 64u32, + Item::BlazePowder => 64u32, + Item::MagmaCream => 64u32, + Item::BrewingStand => 64u32, + Item::Cauldron => 64u32, + Item::EnderEye => 64u32, + Item::GlisteringMelonSlice => 64u32, + Item::AxolotlSpawnEgg => 64u32, + Item::BatSpawnEgg => 64u32, + Item::BeeSpawnEgg => 64u32, + Item::BlazeSpawnEgg => 64u32, + Item::CatSpawnEgg => 64u32, + Item::CaveSpiderSpawnEgg => 64u32, + Item::ChickenSpawnEgg => 64u32, + Item::CodSpawnEgg => 64u32, + Item::CowSpawnEgg => 64u32, + Item::CreeperSpawnEgg => 64u32, + Item::DolphinSpawnEgg => 64u32, + Item::DonkeySpawnEgg => 64u32, + Item::DrownedSpawnEgg => 64u32, + Item::ElderGuardianSpawnEgg => 64u32, + Item::EndermanSpawnEgg => 64u32, + Item::EndermiteSpawnEgg => 64u32, + Item::EvokerSpawnEgg => 64u32, + Item::FoxSpawnEgg => 64u32, + Item::GhastSpawnEgg => 64u32, + Item::GlowSquidSpawnEgg => 64u32, + Item::GoatSpawnEgg => 64u32, + Item::GuardianSpawnEgg => 64u32, + Item::HoglinSpawnEgg => 64u32, + Item::HorseSpawnEgg => 64u32, + Item::HuskSpawnEgg => 64u32, + Item::LlamaSpawnEgg => 64u32, + Item::MagmaCubeSpawnEgg => 64u32, + Item::MooshroomSpawnEgg => 64u32, + Item::MuleSpawnEgg => 64u32, + Item::OcelotSpawnEgg => 64u32, + Item::PandaSpawnEgg => 64u32, + Item::ParrotSpawnEgg => 64u32, + Item::PhantomSpawnEgg => 64u32, + Item::PigSpawnEgg => 64u32, + Item::PiglinSpawnEgg => 64u32, + Item::PiglinBruteSpawnEgg => 64u32, + Item::PillagerSpawnEgg => 64u32, + Item::PolarBearSpawnEgg => 64u32, + Item::PufferfishSpawnEgg => 64u32, + Item::RabbitSpawnEgg => 64u32, + Item::RavagerSpawnEgg => 64u32, + Item::SalmonSpawnEgg => 64u32, + Item::SheepSpawnEgg => 64u32, + Item::ShulkerSpawnEgg => 64u32, + Item::SilverfishSpawnEgg => 64u32, + Item::SkeletonSpawnEgg => 64u32, + Item::SkeletonHorseSpawnEgg => 64u32, + Item::SlimeSpawnEgg => 64u32, + Item::SpiderSpawnEgg => 64u32, + Item::SquidSpawnEgg => 64u32, + Item::StraySpawnEgg => 64u32, + Item::StriderSpawnEgg => 64u32, + Item::TraderLlamaSpawnEgg => 64u32, + Item::TropicalFishSpawnEgg => 64u32, + Item::TurtleSpawnEgg => 64u32, + Item::VexSpawnEgg => 64u32, + Item::VillagerSpawnEgg => 64u32, + Item::VindicatorSpawnEgg => 64u32, + Item::WanderingTraderSpawnEgg => 64u32, + Item::WitchSpawnEgg => 64u32, + Item::WitherSkeletonSpawnEgg => 64u32, + Item::WolfSpawnEgg => 64u32, + Item::ZoglinSpawnEgg => 64u32, + Item::ZombieSpawnEgg => 64u32, + Item::ZombieHorseSpawnEgg => 64u32, + Item::ZombieVillagerSpawnEgg => 64u32, + Item::ZombifiedPiglinSpawnEgg => 64u32, + Item::ExperienceBottle => 64u32, + Item::FireCharge => 64u32, + Item::WritableBook => 1u32, + Item::WrittenBook => 16u32, + Item::ItemFrame => 64u32, + Item::GlowItemFrame => 64u32, + Item::FlowerPot => 64u32, + Item::Carrot => 64u32, + Item::Potato => 64u32, + Item::BakedPotato => 64u32, + Item::PoisonousPotato => 64u32, + Item::Map => 64u32, + Item::GoldenCarrot => 64u32, + Item::SkeletonSkull => 64u32, + Item::WitherSkeletonSkull => 64u32, + Item::PlayerHead => 64u32, + Item::ZombieHead => 64u32, + Item::CreeperHead => 64u32, + Item::DragonHead => 64u32, + Item::NetherStar => 64u32, + Item::PumpkinPie => 64u32, + Item::FireworkRocket => 64u32, + Item::FireworkStar => 64u32, + Item::EnchantedBook => 1u32, + Item::NetherBrick => 64u32, + Item::PrismarineShard => 64u32, + Item::PrismarineCrystals => 64u32, + Item::Rabbit => 64u32, + Item::CookedRabbit => 64u32, + Item::RabbitStew => 1u32, + Item::RabbitFoot => 64u32, + Item::RabbitHide => 64u32, + Item::ArmorStand => 16u32, + Item::IronHorseArmor => 1u32, + Item::GoldenHorseArmor => 1u32, + Item::DiamondHorseArmor => 1u32, + Item::LeatherHorseArmor => 1u32, + Item::Lead => 64u32, + Item::NameTag => 64u32, + Item::CommandBlockMinecart => 1u32, + Item::Mutton => 64u32, + Item::CookedMutton => 64u32, + Item::WhiteBanner => 16u32, + Item::OrangeBanner => 16u32, + Item::MagentaBanner => 16u32, + Item::LightBlueBanner => 16u32, + Item::YellowBanner => 16u32, + Item::LimeBanner => 16u32, + Item::PinkBanner => 16u32, + Item::GrayBanner => 16u32, + Item::LightGrayBanner => 16u32, + Item::CyanBanner => 16u32, + Item::PurpleBanner => 16u32, + Item::BlueBanner => 16u32, + Item::BrownBanner => 16u32, + Item::GreenBanner => 16u32, + Item::RedBanner => 16u32, + Item::BlackBanner => 16u32, + Item::EndCrystal => 64u32, + Item::ChorusFruit => 64u32, + Item::PoppedChorusFruit => 64u32, + Item::Beetroot => 64u32, + Item::BeetrootSeeds => 64u32, + Item::BeetrootSoup => 1u32, + Item::DragonBreath => 64u32, + Item::SplashPotion => 1u32, + Item::SpectralArrow => 64u32, + Item::TippedArrow => 64u32, + Item::LingeringPotion => 1u32, + Item::Shield => 1u32, + Item::TotemOfUndying => 1u32, + Item::ShulkerShell => 64u32, + Item::IronNugget => 64u32, + Item::KnowledgeBook => 1u32, + Item::DebugStick => 1u32, + Item::MusicDisc13 => 1u32, + Item::MusicDiscCat => 1u32, + Item::MusicDiscBlocks => 1u32, + Item::MusicDiscChirp => 1u32, + Item::MusicDiscFar => 1u32, + Item::MusicDiscMall => 1u32, + Item::MusicDiscMellohi => 1u32, + Item::MusicDiscStal => 1u32, + Item::MusicDiscStrad => 1u32, + Item::MusicDiscWard => 1u32, + Item::MusicDisc11 => 1u32, + Item::MusicDiscWait => 1u32, + Item::MusicDiscOtherside => 1u32, + Item::MusicDiscPigstep => 1u32, + Item::Trident => 1u32, + Item::PhantomMembrane => 64u32, + Item::NautilusShell => 64u32, + Item::HeartOfTheSea => 64u32, + Item::Crossbow => 1u32, + Item::SuspiciousStew => 1u32, + Item::Loom => 64u32, + Item::FlowerBannerPattern => 1u32, + Item::CreeperBannerPattern => 1u32, + Item::SkullBannerPattern => 1u32, + Item::MojangBannerPattern => 1u32, + Item::GlobeBannerPattern => 1u32, + Item::PiglinBannerPattern => 1u32, + Item::Composter => 64u32, + Item::Barrel => 64u32, + Item::Smoker => 64u32, + Item::BlastFurnace => 64u32, + Item::CartographyTable => 64u32, + Item::FletchingTable => 64u32, + Item::Grindstone => 64u32, + Item::SmithingTable => 64u32, + Item::Stonecutter => 64u32, + Item::Bell => 64u32, + Item::Lantern => 64u32, + Item::SoulLantern => 64u32, + Item::SweetBerries => 64u32, + Item::GlowBerries => 64u32, + Item::Campfire => 64u32, + Item::SoulCampfire => 64u32, + Item::Shroomlight => 64u32, + Item::Honeycomb => 64u32, + Item::BeeNest => 64u32, + Item::Beehive => 64u32, + Item::HoneyBottle => 16u32, + Item::HoneycombBlock => 64u32, + Item::Lodestone => 64u32, + Item::CryingObsidian => 64u32, + Item::Blackstone => 64u32, + Item::BlackstoneSlab => 64u32, + Item::BlackstoneStairs => 64u32, + Item::GildedBlackstone => 64u32, + Item::PolishedBlackstone => 64u32, + Item::PolishedBlackstoneSlab => 64u32, + Item::PolishedBlackstoneStairs => 64u32, + Item::ChiseledPolishedBlackstone => 64u32, + Item::PolishedBlackstoneBricks => 64u32, + Item::PolishedBlackstoneBrickSlab => 64u32, + Item::PolishedBlackstoneBrickStairs => 64u32, + Item::CrackedPolishedBlackstoneBricks => 64u32, + Item::RespawnAnchor => 64u32, + Item::Candle => 64u32, + Item::WhiteCandle => 64u32, + Item::OrangeCandle => 64u32, + Item::MagentaCandle => 64u32, + Item::LightBlueCandle => 64u32, + Item::YellowCandle => 64u32, + Item::LimeCandle => 64u32, + Item::PinkCandle => 64u32, + Item::GrayCandle => 64u32, + Item::LightGrayCandle => 64u32, + Item::CyanCandle => 64u32, + Item::PurpleCandle => 64u32, + Item::BlueCandle => 64u32, + Item::BrownCandle => 64u32, + Item::GreenCandle => 64u32, + Item::RedCandle => 64u32, + Item::BlackCandle => 64u32, + Item::SmallAmethystBud => 64u32, + Item::MediumAmethystBud => 64u32, + Item::LargeAmethystBud => 64u32, + Item::AmethystCluster => 64u32, + Item::PointedDripstone => 64u32, } } } -#[allow(warnings)] -#[allow(clippy::all)] impl Item { - /// Returns the `durability` property of this `Item`. - pub fn durability(&self) -> Option { + #[doc = "Returns the `max_durability` property of this `Item`."] + #[inline] + pub fn max_durability(&self) -> Option { match self { - Item::Air => None, Item::Stone => None, Item::Granite => None, Item::PolishedGranite => None, @@ -6901,10 +9997,17 @@ impl Item { Item::PolishedDiorite => None, Item::Andesite => None, Item::PolishedAndesite => None, + Item::Deepslate => None, + Item::CobbledDeepslate => None, + Item::PolishedDeepslate => None, + Item::Calcite => None, + Item::Tuff => None, + Item::DripstoneBlock => None, Item::GrassBlock => None, Item::Dirt => None, Item::CoarseDirt => None, Item::Podzol => None, + Item::RootedDirt => None, Item::CrimsonNylium => None, Item::WarpedNylium => None, Item::Cobblestone => None, @@ -6926,10 +10029,67 @@ impl Item { Item::Sand => None, Item::RedSand => None, Item::Gravel => None, - Item::GoldOre => None, - Item::IronOre => None, Item::CoalOre => None, + Item::DeepslateCoalOre => None, + Item::IronOre => None, + Item::DeepslateIronOre => None, + Item::CopperOre => None, + Item::DeepslateCopperOre => None, + Item::GoldOre => None, + Item::DeepslateGoldOre => None, + Item::RedstoneOre => None, + Item::DeepslateRedstoneOre => None, + Item::EmeraldOre => None, + Item::DeepslateEmeraldOre => None, + Item::LapisOre => None, + Item::DeepslateLapisOre => None, + Item::DiamondOre => None, + Item::DeepslateDiamondOre => None, Item::NetherGoldOre => None, + Item::NetherQuartzOre => None, + Item::AncientDebris => None, + Item::CoalBlock => None, + Item::RawIronBlock => None, + Item::RawCopperBlock => None, + Item::RawGoldBlock => None, + Item::AmethystBlock => None, + Item::BuddingAmethyst => None, + Item::IronBlock => None, + Item::CopperBlock => None, + Item::GoldBlock => None, + Item::DiamondBlock => None, + Item::NetheriteBlock => None, + Item::ExposedCopper => None, + Item::WeatheredCopper => None, + Item::OxidizedCopper => None, + Item::CutCopper => None, + Item::ExposedCutCopper => None, + Item::WeatheredCutCopper => None, + Item::OxidizedCutCopper => None, + Item::CutCopperStairs => None, + Item::ExposedCutCopperStairs => None, + Item::WeatheredCutCopperStairs => None, + Item::OxidizedCutCopperStairs => None, + Item::CutCopperSlab => None, + Item::ExposedCutCopperSlab => None, + Item::WeatheredCutCopperSlab => None, + Item::OxidizedCutCopperSlab => None, + Item::WaxedCopperBlock => None, + Item::WaxedExposedCopper => None, + Item::WaxedWeatheredCopper => None, + Item::WaxedOxidizedCopper => None, + Item::WaxedCutCopper => None, + Item::WaxedExposedCutCopper => None, + Item::WaxedWeatheredCutCopper => None, + Item::WaxedOxidizedCutCopper => None, + Item::WaxedCutCopperStairs => None, + Item::WaxedExposedCutCopperStairs => None, + Item::WaxedWeatheredCutCopperStairs => None, + Item::WaxedOxidizedCutCopperStairs => None, + Item::WaxedCutCopperSlab => None, + Item::WaxedExposedCutCopperSlab => None, + Item::WaxedWeatheredCutCopperSlab => None, + Item::WaxedOxidizedCutCopperSlab => None, Item::OakLog => None, Item::SpruceLog => None, Item::BirchLog => None, @@ -6968,26 +10128,24 @@ impl Item { Item::JungleLeaves => None, Item::AcaciaLeaves => None, Item::DarkOakLeaves => None, + Item::AzaleaLeaves => None, + Item::FloweringAzaleaLeaves => None, Item::Sponge => None, Item::WetSponge => None, Item::Glass => None, - Item::LapisOre => None, + Item::TintedGlass => None, Item::LapisBlock => None, - Item::Dispenser => None, Item::Sandstone => None, Item::ChiseledSandstone => None, Item::CutSandstone => None, - Item::NoteBlock => None, - Item::PoweredRail => None, - Item::DetectorRail => None, - Item::StickyPiston => None, Item::Cobweb => None, Item::Grass => None, Item::Fern => None, + Item::Azalea => None, + Item::FloweringAzalea => None, Item::DeadBush => None, Item::Seagrass => None, Item::SeaPickle => None, - Item::Piston => None, Item::WhiteWool => None, Item::OrangeWool => None, Item::MagentaWool => None, @@ -7017,6 +10175,7 @@ impl Item { Item::Cornflower => None, Item::LilyOfTheValley => None, Item::WitherRose => None, + Item::SporeBlossom => None, Item::BrownMushroom => None, Item::RedMushroom => None, Item::CrimsonFungus => None, @@ -7028,9 +10187,12 @@ impl Item { Item::TwistingVines => None, Item::SugarCane => None, Item::Kelp => None, + Item::MossCarpet => None, + Item::MossBlock => None, + Item::HangingRoots => None, + Item::BigDripleaf => None, + Item::SmallDripleaf => None, Item::Bamboo => None, - Item::GoldBlock => None, - Item::IronBlock => None, Item::OakSlab => None, Item::SpruceSlab => None, Item::BirchSlab => None, @@ -7060,7 +10222,6 @@ impl Item { Item::SmoothSandstone => None, Item::SmoothStone => None, Item::Bricks => None, - Item::Tnt => None, Item::Bookshelf => None, Item::MossyCobblestone => None, Item::Obsidian => None, @@ -7074,27 +10235,11 @@ impl Item { Item::Spawner => None, Item::OakStairs => None, Item::Chest => None, - Item::DiamondOre => None, - Item::DiamondBlock => None, Item::CraftingTable => None, Item::Farmland => None, Item::Furnace => None, Item::Ladder => None, - Item::Rail => None, Item::CobblestoneStairs => None, - Item::Lever => None, - Item::StonePressurePlate => None, - Item::OakPressurePlate => None, - Item::SprucePressurePlate => None, - Item::BirchPressurePlate => None, - Item::JunglePressurePlate => None, - Item::AcaciaPressurePlate => None, - Item::DarkOakPressurePlate => None, - Item::CrimsonPressurePlate => None, - Item::WarpedPressurePlate => None, - Item::PolishedBlackstonePressurePlate => None, - Item::RedstoneOre => None, - Item::RedstoneTorch => None, Item::Snow => None, Item::Ice => None, Item::SnowBlock => None, @@ -7111,32 +10256,31 @@ impl Item { Item::WarpedFence => None, Item::Pumpkin => None, Item::CarvedPumpkin => None, + Item::JackOLantern => None, Item::Netherrack => None, Item::SoulSand => None, Item::SoulSoil => None, Item::Basalt => None, Item::PolishedBasalt => None, + Item::SmoothBasalt => None, Item::SoulTorch => None, Item::Glowstone => None, - Item::JackOLantern => None, - Item::OakTrapdoor => None, - Item::SpruceTrapdoor => None, - Item::BirchTrapdoor => None, - Item::JungleTrapdoor => None, - Item::AcaciaTrapdoor => None, - Item::DarkOakTrapdoor => None, - Item::CrimsonTrapdoor => None, - Item::WarpedTrapdoor => None, Item::InfestedStone => None, Item::InfestedCobblestone => None, Item::InfestedStoneBricks => None, Item::InfestedMossyStoneBricks => None, Item::InfestedCrackedStoneBricks => None, Item::InfestedChiseledStoneBricks => None, + Item::InfestedDeepslate => None, Item::StoneBricks => None, Item::MossyStoneBricks => None, Item::CrackedStoneBricks => None, Item::ChiseledStoneBricks => None, + Item::DeepslateBricks => None, + Item::CrackedDeepslateBricks => None, + Item::DeepslateTiles => None, + Item::CrackedDeepslateTiles => None, + Item::ChiseledDeepslate => None, Item::BrownMushroomBlock => None, Item::RedMushroomBlock => None, Item::MushroomStem => None, @@ -7145,14 +10289,7 @@ impl Item { Item::GlassPane => None, Item::Melon => None, Item::Vine => None, - Item::OakFenceGate => None, - Item::SpruceFenceGate => None, - Item::BirchFenceGate => None, - Item::JungleFenceGate => None, - Item::AcaciaFenceGate => None, - Item::DarkOakFenceGate => None, - Item::CrimsonFenceGate => None, - Item::WarpedFenceGate => None, + Item::GlowLichen => None, Item::BrickStairs => None, Item::StoneBrickStairs => None, Item::Mycelium => None, @@ -7167,11 +10304,8 @@ impl Item { Item::EndStone => None, Item::EndStoneBricks => None, Item::DragonEgg => None, - Item::RedstoneLamp => None, Item::SandstoneStairs => None, - Item::EmeraldOre => None, Item::EnderChest => None, - Item::TripwireHook => None, Item::EmeraldBlock => None, Item::SpruceStairs => None, Item::BirchStairs => None, @@ -7197,33 +10331,18 @@ impl Item { Item::BlackstoneWall => None, Item::PolishedBlackstoneWall => None, Item::PolishedBlackstoneBrickWall => None, - Item::StoneButton => None, - Item::OakButton => None, - Item::SpruceButton => None, - Item::BirchButton => None, - Item::JungleButton => None, - Item::AcaciaButton => None, - Item::DarkOakButton => None, - Item::CrimsonButton => None, - Item::WarpedButton => None, - Item::PolishedBlackstoneButton => None, + Item::CobbledDeepslateWall => None, + Item::PolishedDeepslateWall => None, + Item::DeepslateBrickWall => None, + Item::DeepslateTileWall => None, Item::Anvil => None, Item::ChippedAnvil => None, Item::DamagedAnvil => None, - Item::TrappedChest => None, - Item::LightWeightedPressurePlate => None, - Item::HeavyWeightedPressurePlate => None, - Item::DaylightDetector => None, - Item::RedstoneBlock => None, - Item::NetherQuartzOre => None, - Item::Hopper => None, Item::ChiseledQuartzBlock => None, Item::QuartzBlock => None, Item::QuartzBricks => None, Item::QuartzPillar => None, Item::QuartzStairs => None, - Item::ActivatorRail => None, - Item::Dropper => None, Item::WhiteTerracotta => None, Item::OrangeTerracotta => None, Item::MagentaTerracotta => None, @@ -7241,7 +10360,7 @@ impl Item { Item::RedTerracotta => None, Item::BlackTerracotta => None, Item::Barrier => None, - Item::IronTrapdoor => None, + Item::Light => None, Item::HayBlock => None, Item::WhiteCarpet => None, Item::OrangeCarpet => None, @@ -7260,12 +10379,10 @@ impl Item { Item::RedCarpet => None, Item::BlackCarpet => None, Item::Terracotta => None, - Item::CoalBlock => None, Item::PackedIce => None, Item::AcaciaStairs => None, Item::DarkOakStairs => None, - Item::SlimeBlock => None, - Item::GrassPath => None, + Item::DirtPath => None, Item::Sunflower => None, Item::Lilac => None, Item::RoseBush => None, @@ -7323,7 +10440,6 @@ impl Item { Item::RedNetherBricks => None, Item::BoneBlock => None, Item::StructureVoid => None, - Item::Observer => None, Item::ShulkerBox => None, Item::WhiteShulkerBox => None, Item::OrangeShulkerBox => None, @@ -7436,6 +10552,10 @@ impl Item { Item::RedNetherBrickStairs => None, Item::PolishedAndesiteStairs => None, Item::DioriteStairs => None, + Item::CobbledDeepslateStairs => None, + Item::PolishedDeepslateStairs => None, + Item::DeepslateBrickStairs => None, + Item::DeepslateTileStairs => None, Item::PolishedGraniteSlab => None, Item::SmoothRedSandstoneSlab => None, Item::MossyStoneBrickSlab => None, @@ -7449,7 +10569,57 @@ impl Item { Item::RedNetherBrickSlab => None, Item::PolishedAndesiteSlab => None, Item::DioriteSlab => None, + Item::CobbledDeepslateSlab => None, + Item::PolishedDeepslateSlab => None, + Item::DeepslateBrickSlab => None, + Item::DeepslateTileSlab => None, Item::Scaffolding => None, + Item::Redstone => None, + Item::RedstoneTorch => None, + Item::RedstoneBlock => None, + Item::Repeater => None, + Item::Comparator => None, + Item::Piston => None, + Item::StickyPiston => None, + Item::SlimeBlock => None, + Item::HoneyBlock => None, + Item::Observer => None, + Item::Hopper => None, + Item::Dispenser => None, + Item::Dropper => None, + Item::Lectern => None, + Item::Target => None, + Item::Lever => None, + Item::LightningRod => None, + Item::DaylightDetector => None, + Item::SculkSensor => None, + Item::TripwireHook => None, + Item::TrappedChest => None, + Item::Tnt => None, + Item::RedstoneLamp => None, + Item::NoteBlock => None, + Item::StoneButton => None, + Item::PolishedBlackstoneButton => None, + Item::OakButton => None, + Item::SpruceButton => None, + Item::BirchButton => None, + Item::JungleButton => None, + Item::AcaciaButton => None, + Item::DarkOakButton => None, + Item::CrimsonButton => None, + Item::WarpedButton => None, + Item::StonePressurePlate => None, + Item::PolishedBlackstonePressurePlate => None, + Item::LightWeightedPressurePlate => None, + Item::HeavyWeightedPressurePlate => None, + Item::OakPressurePlate => None, + Item::SprucePressurePlate => None, + Item::BirchPressurePlate => None, + Item::JunglePressurePlate => None, + Item::AcaciaPressurePlate => None, + Item::DarkOakPressurePlate => None, + Item::CrimsonPressurePlate => None, + Item::WarpedPressurePlate => None, Item::IronDoor => None, Item::OakDoor => None, Item::SpruceDoor => None, @@ -7459,53 +10629,95 @@ impl Item { Item::DarkOakDoor => None, Item::CrimsonDoor => None, Item::WarpedDoor => None, - Item::Repeater => None, - Item::Comparator => None, + Item::IronTrapdoor => None, + Item::OakTrapdoor => None, + Item::SpruceTrapdoor => None, + Item::BirchTrapdoor => None, + Item::JungleTrapdoor => None, + Item::AcaciaTrapdoor => None, + Item::DarkOakTrapdoor => None, + Item::CrimsonTrapdoor => None, + Item::WarpedTrapdoor => None, + Item::OakFenceGate => None, + Item::SpruceFenceGate => None, + Item::BirchFenceGate => None, + Item::JungleFenceGate => None, + Item::AcaciaFenceGate => None, + Item::DarkOakFenceGate => None, + Item::CrimsonFenceGate => None, + Item::WarpedFenceGate => None, + Item::PoweredRail => None, + Item::DetectorRail => None, + Item::Rail => None, + Item::ActivatorRail => None, + Item::Saddle => None, + Item::Minecart => None, + Item::ChestMinecart => None, + Item::FurnaceMinecart => None, + Item::TntMinecart => None, + Item::HopperMinecart => None, + Item::CarrotOnAStick => Some(25u32), + Item::WarpedFungusOnAStick => Some(100u32), + Item::Elytra => Some(432u32), + Item::OakBoat => None, + Item::SpruceBoat => None, + Item::BirchBoat => None, + Item::JungleBoat => None, + Item::AcaciaBoat => None, + Item::DarkOakBoat => None, Item::StructureBlock => None, Item::Jigsaw => None, - Item::TurtleHelmet => None, + Item::TurtleHelmet => Some(275u32), Item::Scute => None, - Item::FlintAndSteel => None, + Item::FlintAndSteel => Some(64u32), Item::Apple => None, - Item::Bow => None, + Item::Bow => Some(384u32), Item::Arrow => None, Item::Coal => None, Item::Charcoal => None, Item::Diamond => None, + Item::Emerald => None, + Item::LapisLazuli => None, + Item::Quartz => None, + Item::AmethystShard => None, + Item::RawIron => None, Item::IronIngot => None, + Item::RawCopper => None, + Item::CopperIngot => None, + Item::RawGold => None, Item::GoldIngot => None, Item::NetheriteIngot => None, Item::NetheriteScrap => None, - Item::WoodenSword => None, - Item::WoodenShovel => None, - Item::WoodenPickaxe => None, - Item::WoodenAxe => None, - Item::WoodenHoe => None, - Item::StoneSword => None, - Item::StoneShovel => None, - Item::StonePickaxe => None, - Item::StoneAxe => None, - Item::StoneHoe => None, - Item::GoldenSword => None, - Item::GoldenShovel => None, - Item::GoldenPickaxe => None, - Item::GoldenAxe => None, - Item::GoldenHoe => None, - Item::IronSword => None, - Item::IronShovel => None, - Item::IronPickaxe => None, - Item::IronAxe => None, - Item::IronHoe => None, - Item::DiamondSword => None, - Item::DiamondShovel => None, - Item::DiamondPickaxe => None, - Item::DiamondAxe => None, - Item::DiamondHoe => None, - Item::NetheriteSword => None, - Item::NetheriteShovel => None, - Item::NetheritePickaxe => None, - Item::NetheriteAxe => None, - Item::NetheriteHoe => None, + Item::WoodenSword => Some(59u32), + Item::WoodenShovel => Some(59u32), + Item::WoodenPickaxe => Some(59u32), + Item::WoodenAxe => Some(59u32), + Item::WoodenHoe => Some(59u32), + Item::StoneSword => Some(131u32), + Item::StoneShovel => Some(131u32), + Item::StonePickaxe => Some(131u32), + Item::StoneAxe => Some(131u32), + Item::StoneHoe => Some(131u32), + Item::GoldenSword => Some(32u32), + Item::GoldenShovel => Some(32u32), + Item::GoldenPickaxe => Some(32u32), + Item::GoldenAxe => Some(32u32), + Item::GoldenHoe => Some(32u32), + Item::IronSword => Some(250u32), + Item::IronShovel => Some(250u32), + Item::IronPickaxe => Some(250u32), + Item::IronAxe => Some(250u32), + Item::IronHoe => Some(250u32), + Item::DiamondSword => Some(1561u32), + Item::DiamondShovel => Some(1561u32), + Item::DiamondPickaxe => Some(1561u32), + Item::DiamondAxe => Some(1561u32), + Item::DiamondHoe => Some(1561u32), + Item::NetheriteSword => Some(2031u32), + Item::NetheriteShovel => Some(2031u32), + Item::NetheritePickaxe => Some(2031u32), + Item::NetheriteAxe => Some(2031u32), + Item::NetheriteHoe => Some(2031u32), Item::Stick => None, Item::Bowl => None, Item::MushroomStew => None, @@ -7515,30 +10727,30 @@ impl Item { Item::WheatSeeds => None, Item::Wheat => None, Item::Bread => None, - Item::LeatherHelmet => None, - Item::LeatherChestplate => None, - Item::LeatherLeggings => None, - Item::LeatherBoots => None, - Item::ChainmailHelmet => None, - Item::ChainmailChestplate => None, - Item::ChainmailLeggings => None, - Item::ChainmailBoots => None, - Item::IronHelmet => None, - Item::IronChestplate => None, - Item::IronLeggings => None, - Item::IronBoots => None, - Item::DiamondHelmet => None, - Item::DiamondChestplate => None, - Item::DiamondLeggings => None, - Item::DiamondBoots => None, - Item::GoldenHelmet => None, - Item::GoldenChestplate => None, - Item::GoldenLeggings => None, - Item::GoldenBoots => None, - Item::NetheriteHelmet => None, - Item::NetheriteChestplate => None, - Item::NetheriteLeggings => None, - Item::NetheriteBoots => None, + Item::LeatherHelmet => Some(55u32), + Item::LeatherChestplate => Some(80u32), + Item::LeatherLeggings => Some(75u32), + Item::LeatherBoots => Some(65u32), + Item::ChainmailHelmet => Some(165u32), + Item::ChainmailChestplate => Some(240u32), + Item::ChainmailLeggings => Some(225u32), + Item::ChainmailBoots => Some(195u32), + Item::IronHelmet => Some(165u32), + Item::IronChestplate => Some(240u32), + Item::IronLeggings => Some(225u32), + Item::IronBoots => Some(195u32), + Item::DiamondHelmet => Some(363u32), + Item::DiamondChestplate => Some(528u32), + Item::DiamondLeggings => Some(495u32), + Item::DiamondBoots => Some(429u32), + Item::GoldenHelmet => Some(77u32), + Item::GoldenChestplate => Some(112u32), + Item::GoldenLeggings => Some(105u32), + Item::GoldenBoots => Some(91u32), + Item::NetheriteHelmet => Some(407u32), + Item::NetheriteChestplate => Some(592u32), + Item::NetheriteLeggings => Some(555u32), + Item::NetheriteBoots => Some(481u32), Item::Flint => None, Item::Porkchop => None, Item::CookedPorkchop => None, @@ -7556,29 +10768,27 @@ impl Item { Item::Bucket => None, Item::WaterBucket => None, Item::LavaBucket => None, - Item::Minecart => None, - Item::Saddle => None, - Item::Redstone => None, + Item::PowderSnowBucket => None, Item::Snowball => None, - Item::OakBoat => None, Item::Leather => None, Item::MilkBucket => None, Item::PufferfishBucket => None, Item::SalmonBucket => None, Item::CodBucket => None, Item::TropicalFishBucket => None, + Item::AxolotlBucket => None, Item::Brick => None, Item::ClayBall => None, Item::DriedKelpBlock => None, Item::Paper => None, Item::Book => None, Item::SlimeBall => None, - Item::ChestMinecart => None, - Item::FurnaceMinecart => None, Item::Egg => None, Item::Compass => None, - Item::FishingRod => None, + Item::Bundle => None, + Item::FishingRod => Some(64u32), Item::Clock => None, + Item::Spyglass => None, Item::GlowstoneDust => None, Item::Cod => None, Item::Salmon => None, @@ -7587,8 +10797,8 @@ impl Item { Item::CookedCod => None, Item::CookedSalmon => None, Item::InkSac => None, + Item::GlowInkSac => None, Item::CocoaBeans => None, - Item::LapisLazuli => None, Item::WhiteDye => None, Item::OrangeDye => None, Item::MagentaDye => None, @@ -7627,7 +10837,7 @@ impl Item { Item::BlackBed => None, Item::Cookie => None, Item::FilledMap => None, - Item::Shears => None, + Item::Shears => Some(238u32), Item::MelonSlice => None, Item::DriedKelp => None, Item::PumpkinSeeds => None, @@ -7652,6 +10862,7 @@ impl Item { Item::Cauldron => None, Item::EnderEye => None, Item::GlisteringMelonSlice => None, + Item::AxolotlSpawnEgg => None, Item::BatSpawnEgg => None, Item::BeeSpawnEgg => None, Item::BlazeSpawnEgg => None, @@ -7670,6 +10881,8 @@ impl Item { Item::EvokerSpawnEgg => None, Item::FoxSpawnEgg => None, Item::GhastSpawnEgg => None, + Item::GlowSquidSpawnEgg => None, + Item::GoatSpawnEgg => None, Item::GuardianSpawnEgg => None, Item::HoglinSpawnEgg => None, Item::HorseSpawnEgg => None, @@ -7720,8 +10933,8 @@ impl Item { Item::FireCharge => None, Item::WritableBook => None, Item::WrittenBook => None, - Item::Emerald => None, Item::ItemFrame => None, + Item::GlowItemFrame => None, Item::FlowerPot => None, Item::Carrot => None, Item::Potato => None, @@ -7735,17 +10948,12 @@ impl Item { Item::ZombieHead => None, Item::CreeperHead => None, Item::DragonHead => None, - Item::CarrotOnAStick => None, - Item::WarpedFungusOnAStick => None, Item::NetherStar => None, Item::PumpkinPie => None, Item::FireworkRocket => None, Item::FireworkStar => None, Item::EnchantedBook => None, Item::NetherBrick => None, - Item::Quartz => None, - Item::TntMinecart => None, - Item::HopperMinecart => None, Item::PrismarineShard => None, Item::PrismarineCrystals => None, Item::Rabbit => None, @@ -7790,13 +10998,7 @@ impl Item { Item::SpectralArrow => None, Item::TippedArrow => None, Item::LingeringPotion => None, - Item::Shield => None, - Item::Elytra => None, - Item::SpruceBoat => None, - Item::BirchBoat => None, - Item::JungleBoat => None, - Item::AcaciaBoat => None, - Item::DarkOakBoat => None, + Item::Shield => Some(336u32), Item::TotemOfUndying => None, Item::ShulkerShell => None, Item::IronNugget => None, @@ -7814,12 +11016,13 @@ impl Item { Item::MusicDiscWard => None, Item::MusicDisc11 => None, Item::MusicDiscWait => None, + Item::MusicDiscOtherside => None, Item::MusicDiscPigstep => None, - Item::Trident => None, + Item::Trident => Some(250u32), Item::PhantomMembrane => None, Item::NautilusShell => None, Item::HeartOfTheSea => None, - Item::Crossbow => None, + Item::Crossbow => Some(326u32), Item::SuspiciousStew => None, Item::Loom => None, Item::FlowerBannerPattern => None, @@ -7835,13 +11038,13 @@ impl Item { Item::CartographyTable => None, Item::FletchingTable => None, Item::Grindstone => None, - Item::Lectern => None, Item::SmithingTable => None, Item::Stonecutter => None, Item::Bell => None, Item::Lantern => None, Item::SoulLantern => None, Item::SweetBerries => None, + Item::GlowBerries => None, Item::Campfire => None, Item::SoulCampfire => None, Item::Shroomlight => None, @@ -7849,12 +11052,8 @@ impl Item { Item::BeeNest => None, Item::Beehive => None, Item::HoneyBottle => None, - Item::HoneyBlock => None, Item::HoneycombBlock => None, Item::Lodestone => None, - Item::NetheriteBlock => None, - Item::AncientDebris => None, - Item::Target => None, Item::CryingObsidian => None, Item::Blackstone => None, Item::BlackstoneSlab => None, @@ -7869,39 +11068,3363 @@ impl Item { Item::PolishedBlackstoneBrickStairs => None, Item::CrackedPolishedBlackstoneBricks => None, Item::RespawnAnchor => None, + Item::Candle => None, + Item::WhiteCandle => None, + Item::OrangeCandle => None, + Item::MagentaCandle => None, + Item::LightBlueCandle => None, + Item::YellowCandle => None, + Item::LimeCandle => None, + Item::PinkCandle => None, + Item::GrayCandle => None, + Item::LightGrayCandle => None, + Item::CyanCandle => None, + Item::PurpleCandle => None, + Item::BlueCandle => None, + Item::BrownCandle => None, + Item::GreenCandle => None, + Item::RedCandle => None, + Item::BlackCandle => None, + Item::SmallAmethystBud => None, + Item::MediumAmethystBud => None, + Item::LargeAmethystBud => None, + Item::AmethystCluster => None, + Item::PointedDripstone => None, + } + } +} +impl Item { + #[doc = "Returns the `fixed_with` property of this `Item`."] + #[inline] + pub fn fixed_with(&self) -> Vec<&'static str> { + match self { + Item::Stone => { + vec![] + } + Item::Granite => { + vec![] + } + Item::PolishedGranite => { + vec![] + } + Item::Diorite => { + vec![] + } + Item::PolishedDiorite => { + vec![] + } + Item::Andesite => { + vec![] + } + Item::PolishedAndesite => { + vec![] + } + Item::Deepslate => { + vec![] + } + Item::CobbledDeepslate => { + vec![] + } + Item::PolishedDeepslate => { + vec![] + } + Item::Calcite => { + vec![] + } + Item::Tuff => { + vec![] + } + Item::DripstoneBlock => { + vec![] + } + Item::GrassBlock => { + vec![] + } + Item::Dirt => { + vec![] + } + Item::CoarseDirt => { + vec![] + } + Item::Podzol => { + vec![] + } + Item::RootedDirt => { + vec![] + } + Item::CrimsonNylium => { + vec![] + } + Item::WarpedNylium => { + vec![] + } + Item::Cobblestone => { + vec![] + } + Item::OakPlanks => { + vec![] + } + Item::SprucePlanks => { + vec![] + } + Item::BirchPlanks => { + vec![] + } + Item::JunglePlanks => { + vec![] + } + Item::AcaciaPlanks => { + vec![] + } + Item::DarkOakPlanks => { + vec![] + } + Item::CrimsonPlanks => { + vec![] + } + Item::WarpedPlanks => { + vec![] + } + Item::OakSapling => { + vec![] + } + Item::SpruceSapling => { + vec![] + } + Item::BirchSapling => { + vec![] + } + Item::JungleSapling => { + vec![] + } + Item::AcaciaSapling => { + vec![] + } + Item::DarkOakSapling => { + vec![] + } + Item::Bedrock => { + vec![] + } + Item::Sand => { + vec![] + } + Item::RedSand => { + vec![] + } + Item::Gravel => { + vec![] + } + Item::CoalOre => { + vec![] + } + Item::DeepslateCoalOre => { + vec![] + } + Item::IronOre => { + vec![] + } + Item::DeepslateIronOre => { + vec![] + } + Item::CopperOre => { + vec![] + } + Item::DeepslateCopperOre => { + vec![] + } + Item::GoldOre => { + vec![] + } + Item::DeepslateGoldOre => { + vec![] + } + Item::RedstoneOre => { + vec![] + } + Item::DeepslateRedstoneOre => { + vec![] + } + Item::EmeraldOre => { + vec![] + } + Item::DeepslateEmeraldOre => { + vec![] + } + Item::LapisOre => { + vec![] + } + Item::DeepslateLapisOre => { + vec![] + } + Item::DiamondOre => { + vec![] + } + Item::DeepslateDiamondOre => { + vec![] + } + Item::NetherGoldOre => { + vec![] + } + Item::NetherQuartzOre => { + vec![] + } + Item::AncientDebris => { + vec![] + } + Item::CoalBlock => { + vec![] + } + Item::RawIronBlock => { + vec![] + } + Item::RawCopperBlock => { + vec![] + } + Item::RawGoldBlock => { + vec![] + } + Item::AmethystBlock => { + vec![] + } + Item::BuddingAmethyst => { + vec![] + } + Item::IronBlock => { + vec![] + } + Item::CopperBlock => { + vec![] + } + Item::GoldBlock => { + vec![] + } + Item::DiamondBlock => { + vec![] + } + Item::NetheriteBlock => { + vec![] + } + Item::ExposedCopper => { + vec![] + } + Item::WeatheredCopper => { + vec![] + } + Item::OxidizedCopper => { + vec![] + } + Item::CutCopper => { + vec![] + } + Item::ExposedCutCopper => { + vec![] + } + Item::WeatheredCutCopper => { + vec![] + } + Item::OxidizedCutCopper => { + vec![] + } + Item::CutCopperStairs => { + vec![] + } + Item::ExposedCutCopperStairs => { + vec![] + } + Item::WeatheredCutCopperStairs => { + vec![] + } + Item::OxidizedCutCopperStairs => { + vec![] + } + Item::CutCopperSlab => { + vec![] + } + Item::ExposedCutCopperSlab => { + vec![] + } + Item::WeatheredCutCopperSlab => { + vec![] + } + Item::OxidizedCutCopperSlab => { + vec![] + } + Item::WaxedCopperBlock => { + vec![] + } + Item::WaxedExposedCopper => { + vec![] + } + Item::WaxedWeatheredCopper => { + vec![] + } + Item::WaxedOxidizedCopper => { + vec![] + } + Item::WaxedCutCopper => { + vec![] + } + Item::WaxedExposedCutCopper => { + vec![] + } + Item::WaxedWeatheredCutCopper => { + vec![] + } + Item::WaxedOxidizedCutCopper => { + vec![] + } + Item::WaxedCutCopperStairs => { + vec![] + } + Item::WaxedExposedCutCopperStairs => { + vec![] + } + Item::WaxedWeatheredCutCopperStairs => { + vec![] + } + Item::WaxedOxidizedCutCopperStairs => { + vec![] + } + Item::WaxedCutCopperSlab => { + vec![] + } + Item::WaxedExposedCutCopperSlab => { + vec![] + } + Item::WaxedWeatheredCutCopperSlab => { + vec![] + } + Item::WaxedOxidizedCutCopperSlab => { + vec![] + } + Item::OakLog => { + vec![] + } + Item::SpruceLog => { + vec![] + } + Item::BirchLog => { + vec![] + } + Item::JungleLog => { + vec![] + } + Item::AcaciaLog => { + vec![] + } + Item::DarkOakLog => { + vec![] + } + Item::CrimsonStem => { + vec![] + } + Item::WarpedStem => { + vec![] + } + Item::StrippedOakLog => { + vec![] + } + Item::StrippedSpruceLog => { + vec![] + } + Item::StrippedBirchLog => { + vec![] + } + Item::StrippedJungleLog => { + vec![] + } + Item::StrippedAcaciaLog => { + vec![] + } + Item::StrippedDarkOakLog => { + vec![] + } + Item::StrippedCrimsonStem => { + vec![] + } + Item::StrippedWarpedStem => { + vec![] + } + Item::StrippedOakWood => { + vec![] + } + Item::StrippedSpruceWood => { + vec![] + } + Item::StrippedBirchWood => { + vec![] + } + Item::StrippedJungleWood => { + vec![] + } + Item::StrippedAcaciaWood => { + vec![] + } + Item::StrippedDarkOakWood => { + vec![] + } + Item::StrippedCrimsonHyphae => { + vec![] + } + Item::StrippedWarpedHyphae => { + vec![] + } + Item::OakWood => { + vec![] + } + Item::SpruceWood => { + vec![] + } + Item::BirchWood => { + vec![] + } + Item::JungleWood => { + vec![] + } + Item::AcaciaWood => { + vec![] + } + Item::DarkOakWood => { + vec![] + } + Item::CrimsonHyphae => { + vec![] + } + Item::WarpedHyphae => { + vec![] + } + Item::OakLeaves => { + vec![] + } + Item::SpruceLeaves => { + vec![] + } + Item::BirchLeaves => { + vec![] + } + Item::JungleLeaves => { + vec![] + } + Item::AcaciaLeaves => { + vec![] + } + Item::DarkOakLeaves => { + vec![] + } + Item::AzaleaLeaves => { + vec![] + } + Item::FloweringAzaleaLeaves => { + vec![] + } + Item::Sponge => { + vec![] + } + Item::WetSponge => { + vec![] + } + Item::Glass => { + vec![] + } + Item::TintedGlass => { + vec![] + } + Item::LapisBlock => { + vec![] + } + Item::Sandstone => { + vec![] + } + Item::ChiseledSandstone => { + vec![] + } + Item::CutSandstone => { + vec![] + } + Item::Cobweb => { + vec![] + } + Item::Grass => { + vec![] + } + Item::Fern => { + vec![] + } + Item::Azalea => { + vec![] + } + Item::FloweringAzalea => { + vec![] + } + Item::DeadBush => { + vec![] + } + Item::Seagrass => { + vec![] + } + Item::SeaPickle => { + vec![] + } + Item::WhiteWool => { + vec![] + } + Item::OrangeWool => { + vec![] + } + Item::MagentaWool => { + vec![] + } + Item::LightBlueWool => { + vec![] + } + Item::YellowWool => { + vec![] + } + Item::LimeWool => { + vec![] + } + Item::PinkWool => { + vec![] + } + Item::GrayWool => { + vec![] + } + Item::LightGrayWool => { + vec![] + } + Item::CyanWool => { + vec![] + } + Item::PurpleWool => { + vec![] + } + Item::BlueWool => { + vec![] + } + Item::BrownWool => { + vec![] + } + Item::GreenWool => { + vec![] + } + Item::RedWool => { + vec![] + } + Item::BlackWool => { + vec![] + } + Item::Dandelion => { + vec![] + } + Item::Poppy => { + vec![] + } + Item::BlueOrchid => { + vec![] + } + Item::Allium => { + vec![] + } + Item::AzureBluet => { + vec![] + } + Item::RedTulip => { + vec![] + } + Item::OrangeTulip => { + vec![] + } + Item::WhiteTulip => { + vec![] + } + Item::PinkTulip => { + vec![] + } + Item::OxeyeDaisy => { + vec![] + } + Item::Cornflower => { + vec![] + } + Item::LilyOfTheValley => { + vec![] + } + Item::WitherRose => { + vec![] + } + Item::SporeBlossom => { + vec![] + } + Item::BrownMushroom => { + vec![] + } + Item::RedMushroom => { + vec![] + } + Item::CrimsonFungus => { + vec![] + } + Item::WarpedFungus => { + vec![] + } + Item::CrimsonRoots => { + vec![] + } + Item::WarpedRoots => { + vec![] + } + Item::NetherSprouts => { + vec![] + } + Item::WeepingVines => { + vec![] + } + Item::TwistingVines => { + vec![] + } + Item::SugarCane => { + vec![] + } + Item::Kelp => { + vec![] + } + Item::MossCarpet => { + vec![] + } + Item::MossBlock => { + vec![] + } + Item::HangingRoots => { + vec![] + } + Item::BigDripleaf => { + vec![] + } + Item::SmallDripleaf => { + vec![] + } + Item::Bamboo => { + vec![] + } + Item::OakSlab => { + vec![] + } + Item::SpruceSlab => { + vec![] + } + Item::BirchSlab => { + vec![] + } + Item::JungleSlab => { + vec![] + } + Item::AcaciaSlab => { + vec![] + } + Item::DarkOakSlab => { + vec![] + } + Item::CrimsonSlab => { + vec![] + } + Item::WarpedSlab => { + vec![] + } + Item::StoneSlab => { + vec![] + } + Item::SmoothStoneSlab => { + vec![] + } + Item::SandstoneSlab => { + vec![] + } + Item::CutSandstoneSlab => { + vec![] + } + Item::PetrifiedOakSlab => { + vec![] + } + Item::CobblestoneSlab => { + vec![] + } + Item::BrickSlab => { + vec![] + } + Item::StoneBrickSlab => { + vec![] + } + Item::NetherBrickSlab => { + vec![] + } + Item::QuartzSlab => { + vec![] + } + Item::RedSandstoneSlab => { + vec![] + } + Item::CutRedSandstoneSlab => { + vec![] + } + Item::PurpurSlab => { + vec![] + } + Item::PrismarineSlab => { + vec![] + } + Item::PrismarineBrickSlab => { + vec![] + } + Item::DarkPrismarineSlab => { + vec![] + } + Item::SmoothQuartz => { + vec![] + } + Item::SmoothRedSandstone => { + vec![] + } + Item::SmoothSandstone => { + vec![] + } + Item::SmoothStone => { + vec![] + } + Item::Bricks => { + vec![] + } + Item::Bookshelf => { + vec![] + } + Item::MossyCobblestone => { + vec![] + } + Item::Obsidian => { + vec![] + } + Item::Torch => { + vec![] + } + Item::EndRod => { + vec![] + } + Item::ChorusPlant => { + vec![] + } + Item::ChorusFlower => { + vec![] + } + Item::PurpurBlock => { + vec![] + } + Item::PurpurPillar => { + vec![] + } + Item::PurpurStairs => { + vec![] + } + Item::Spawner => { + vec![] + } + Item::OakStairs => { + vec![] + } + Item::Chest => { + vec![] + } + Item::CraftingTable => { + vec![] + } + Item::Farmland => { + vec![] + } + Item::Furnace => { + vec![] + } + Item::Ladder => { + vec![] + } + Item::CobblestoneStairs => { + vec![] + } + Item::Snow => { + vec![] + } + Item::Ice => { + vec![] + } + Item::SnowBlock => { + vec![] + } + Item::Cactus => { + vec![] + } + Item::Clay => { + vec![] + } + Item::Jukebox => { + vec![] + } + Item::OakFence => { + vec![] + } + Item::SpruceFence => { + vec![] + } + Item::BirchFence => { + vec![] + } + Item::JungleFence => { + vec![] + } + Item::AcaciaFence => { + vec![] + } + Item::DarkOakFence => { + vec![] + } + Item::CrimsonFence => { + vec![] + } + Item::WarpedFence => { + vec![] + } + Item::Pumpkin => { + vec![] + } + Item::CarvedPumpkin => { + vec![] + } + Item::JackOLantern => { + vec![] + } + Item::Netherrack => { + vec![] + } + Item::SoulSand => { + vec![] + } + Item::SoulSoil => { + vec![] + } + Item::Basalt => { + vec![] + } + Item::PolishedBasalt => { + vec![] + } + Item::SmoothBasalt => { + vec![] + } + Item::SoulTorch => { + vec![] + } + Item::Glowstone => { + vec![] + } + Item::InfestedStone => { + vec![] + } + Item::InfestedCobblestone => { + vec![] + } + Item::InfestedStoneBricks => { + vec![] + } + Item::InfestedMossyStoneBricks => { + vec![] + } + Item::InfestedCrackedStoneBricks => { + vec![] + } + Item::InfestedChiseledStoneBricks => { + vec![] + } + Item::InfestedDeepslate => { + vec![] + } + Item::StoneBricks => { + vec![] + } + Item::MossyStoneBricks => { + vec![] + } + Item::CrackedStoneBricks => { + vec![] + } + Item::ChiseledStoneBricks => { + vec![] + } + Item::DeepslateBricks => { + vec![] + } + Item::CrackedDeepslateBricks => { + vec![] + } + Item::DeepslateTiles => { + vec![] + } + Item::CrackedDeepslateTiles => { + vec![] + } + Item::ChiseledDeepslate => { + vec![] + } + Item::BrownMushroomBlock => { + vec![] + } + Item::RedMushroomBlock => { + vec![] + } + Item::MushroomStem => { + vec![] + } + Item::IronBars => { + vec![] + } + Item::Chain => { + vec![] + } + Item::GlassPane => { + vec![] + } + Item::Melon => { + vec![] + } + Item::Vine => { + vec![] + } + Item::GlowLichen => { + vec![] + } + Item::BrickStairs => { + vec![] + } + Item::StoneBrickStairs => { + vec![] + } + Item::Mycelium => { + vec![] + } + Item::LilyPad => { + vec![] + } + Item::NetherBricks => { + vec![] + } + Item::CrackedNetherBricks => { + vec![] + } + Item::ChiseledNetherBricks => { + vec![] + } + Item::NetherBrickFence => { + vec![] + } + Item::NetherBrickStairs => { + vec![] + } + Item::EnchantingTable => { + vec![] + } + Item::EndPortalFrame => { + vec![] + } + Item::EndStone => { + vec![] + } + Item::EndStoneBricks => { + vec![] + } + Item::DragonEgg => { + vec![] + } + Item::SandstoneStairs => { + vec![] + } + Item::EnderChest => { + vec![] + } + Item::EmeraldBlock => { + vec![] + } + Item::SpruceStairs => { + vec![] + } + Item::BirchStairs => { + vec![] + } + Item::JungleStairs => { + vec![] + } + Item::CrimsonStairs => { + vec![] + } + Item::WarpedStairs => { + vec![] + } + Item::CommandBlock => { + vec![] + } + Item::Beacon => { + vec![] + } + Item::CobblestoneWall => { + vec![] + } + Item::MossyCobblestoneWall => { + vec![] + } + Item::BrickWall => { + vec![] + } + Item::PrismarineWall => { + vec![] + } + Item::RedSandstoneWall => { + vec![] + } + Item::MossyStoneBrickWall => { + vec![] + } + Item::GraniteWall => { + vec![] + } + Item::StoneBrickWall => { + vec![] + } + Item::NetherBrickWall => { + vec![] + } + Item::AndesiteWall => { + vec![] + } + Item::RedNetherBrickWall => { + vec![] + } + Item::SandstoneWall => { + vec![] + } + Item::EndStoneBrickWall => { + vec![] + } + Item::DioriteWall => { + vec![] + } + Item::BlackstoneWall => { + vec![] + } + Item::PolishedBlackstoneWall => { + vec![] + } + Item::PolishedBlackstoneBrickWall => { + vec![] + } + Item::CobbledDeepslateWall => { + vec![] + } + Item::PolishedDeepslateWall => { + vec![] + } + Item::DeepslateBrickWall => { + vec![] + } + Item::DeepslateTileWall => { + vec![] + } + Item::Anvil => { + vec![] + } + Item::ChippedAnvil => { + vec![] + } + Item::DamagedAnvil => { + vec![] + } + Item::ChiseledQuartzBlock => { + vec![] + } + Item::QuartzBlock => { + vec![] + } + Item::QuartzBricks => { + vec![] + } + Item::QuartzPillar => { + vec![] + } + Item::QuartzStairs => { + vec![] + } + Item::WhiteTerracotta => { + vec![] + } + Item::OrangeTerracotta => { + vec![] + } + Item::MagentaTerracotta => { + vec![] + } + Item::LightBlueTerracotta => { + vec![] + } + Item::YellowTerracotta => { + vec![] + } + Item::LimeTerracotta => { + vec![] + } + Item::PinkTerracotta => { + vec![] + } + Item::GrayTerracotta => { + vec![] + } + Item::LightGrayTerracotta => { + vec![] + } + Item::CyanTerracotta => { + vec![] + } + Item::PurpleTerracotta => { + vec![] + } + Item::BlueTerracotta => { + vec![] + } + Item::BrownTerracotta => { + vec![] + } + Item::GreenTerracotta => { + vec![] + } + Item::RedTerracotta => { + vec![] + } + Item::BlackTerracotta => { + vec![] + } + Item::Barrier => { + vec![] + } + Item::Light => { + vec![] + } + Item::HayBlock => { + vec![] + } + Item::WhiteCarpet => { + vec![] + } + Item::OrangeCarpet => { + vec![] + } + Item::MagentaCarpet => { + vec![] + } + Item::LightBlueCarpet => { + vec![] + } + Item::YellowCarpet => { + vec![] + } + Item::LimeCarpet => { + vec![] + } + Item::PinkCarpet => { + vec![] + } + Item::GrayCarpet => { + vec![] + } + Item::LightGrayCarpet => { + vec![] + } + Item::CyanCarpet => { + vec![] + } + Item::PurpleCarpet => { + vec![] + } + Item::BlueCarpet => { + vec![] + } + Item::BrownCarpet => { + vec![] + } + Item::GreenCarpet => { + vec![] + } + Item::RedCarpet => { + vec![] + } + Item::BlackCarpet => { + vec![] + } + Item::Terracotta => { + vec![] + } + Item::PackedIce => { + vec![] + } + Item::AcaciaStairs => { + vec![] + } + Item::DarkOakStairs => { + vec![] + } + Item::DirtPath => { + vec![] + } + Item::Sunflower => { + vec![] + } + Item::Lilac => { + vec![] + } + Item::RoseBush => { + vec![] + } + Item::Peony => { + vec![] + } + Item::TallGrass => { + vec![] + } + Item::LargeFern => { + vec![] + } + Item::WhiteStainedGlass => { + vec![] + } + Item::OrangeStainedGlass => { + vec![] + } + Item::MagentaStainedGlass => { + vec![] + } + Item::LightBlueStainedGlass => { + vec![] + } + Item::YellowStainedGlass => { + vec![] + } + Item::LimeStainedGlass => { + vec![] + } + Item::PinkStainedGlass => { + vec![] + } + Item::GrayStainedGlass => { + vec![] + } + Item::LightGrayStainedGlass => { + vec![] + } + Item::CyanStainedGlass => { + vec![] + } + Item::PurpleStainedGlass => { + vec![] + } + Item::BlueStainedGlass => { + vec![] + } + Item::BrownStainedGlass => { + vec![] + } + Item::GreenStainedGlass => { + vec![] + } + Item::RedStainedGlass => { + vec![] + } + Item::BlackStainedGlass => { + vec![] + } + Item::WhiteStainedGlassPane => { + vec![] + } + Item::OrangeStainedGlassPane => { + vec![] + } + Item::MagentaStainedGlassPane => { + vec![] + } + Item::LightBlueStainedGlassPane => { + vec![] + } + Item::YellowStainedGlassPane => { + vec![] + } + Item::LimeStainedGlassPane => { + vec![] + } + Item::PinkStainedGlassPane => { + vec![] + } + Item::GrayStainedGlassPane => { + vec![] + } + Item::LightGrayStainedGlassPane => { + vec![] + } + Item::CyanStainedGlassPane => { + vec![] + } + Item::PurpleStainedGlassPane => { + vec![] + } + Item::BlueStainedGlassPane => { + vec![] + } + Item::BrownStainedGlassPane => { + vec![] + } + Item::GreenStainedGlassPane => { + vec![] + } + Item::RedStainedGlassPane => { + vec![] + } + Item::BlackStainedGlassPane => { + vec![] + } + Item::Prismarine => { + vec![] + } + Item::PrismarineBricks => { + vec![] + } + Item::DarkPrismarine => { + vec![] + } + Item::PrismarineStairs => { + vec![] + } + Item::PrismarineBrickStairs => { + vec![] + } + Item::DarkPrismarineStairs => { + vec![] + } + Item::SeaLantern => { + vec![] + } + Item::RedSandstone => { + vec![] + } + Item::ChiseledRedSandstone => { + vec![] + } + Item::CutRedSandstone => { + vec![] + } + Item::RedSandstoneStairs => { + vec![] + } + Item::RepeatingCommandBlock => { + vec![] + } + Item::ChainCommandBlock => { + vec![] + } + Item::MagmaBlock => { + vec![] + } + Item::NetherWartBlock => { + vec![] + } + Item::WarpedWartBlock => { + vec![] + } + Item::RedNetherBricks => { + vec![] + } + Item::BoneBlock => { + vec![] + } + Item::StructureVoid => { + vec![] + } + Item::ShulkerBox => { + vec![] + } + Item::WhiteShulkerBox => { + vec![] + } + Item::OrangeShulkerBox => { + vec![] + } + Item::MagentaShulkerBox => { + vec![] + } + Item::LightBlueShulkerBox => { + vec![] + } + Item::YellowShulkerBox => { + vec![] + } + Item::LimeShulkerBox => { + vec![] + } + Item::PinkShulkerBox => { + vec![] + } + Item::GrayShulkerBox => { + vec![] + } + Item::LightGrayShulkerBox => { + vec![] + } + Item::CyanShulkerBox => { + vec![] + } + Item::PurpleShulkerBox => { + vec![] + } + Item::BlueShulkerBox => { + vec![] + } + Item::BrownShulkerBox => { + vec![] + } + Item::GreenShulkerBox => { + vec![] + } + Item::RedShulkerBox => { + vec![] + } + Item::BlackShulkerBox => { + vec![] + } + Item::WhiteGlazedTerracotta => { + vec![] + } + Item::OrangeGlazedTerracotta => { + vec![] + } + Item::MagentaGlazedTerracotta => { + vec![] + } + Item::LightBlueGlazedTerracotta => { + vec![] + } + Item::YellowGlazedTerracotta => { + vec![] + } + Item::LimeGlazedTerracotta => { + vec![] + } + Item::PinkGlazedTerracotta => { + vec![] + } + Item::GrayGlazedTerracotta => { + vec![] + } + Item::LightGrayGlazedTerracotta => { + vec![] + } + Item::CyanGlazedTerracotta => { + vec![] + } + Item::PurpleGlazedTerracotta => { + vec![] + } + Item::BlueGlazedTerracotta => { + vec![] + } + Item::BrownGlazedTerracotta => { + vec![] + } + Item::GreenGlazedTerracotta => { + vec![] + } + Item::RedGlazedTerracotta => { + vec![] + } + Item::BlackGlazedTerracotta => { + vec![] + } + Item::WhiteConcrete => { + vec![] + } + Item::OrangeConcrete => { + vec![] + } + Item::MagentaConcrete => { + vec![] + } + Item::LightBlueConcrete => { + vec![] + } + Item::YellowConcrete => { + vec![] + } + Item::LimeConcrete => { + vec![] + } + Item::PinkConcrete => { + vec![] + } + Item::GrayConcrete => { + vec![] + } + Item::LightGrayConcrete => { + vec![] + } + Item::CyanConcrete => { + vec![] + } + Item::PurpleConcrete => { + vec![] + } + Item::BlueConcrete => { + vec![] + } + Item::BrownConcrete => { + vec![] + } + Item::GreenConcrete => { + vec![] + } + Item::RedConcrete => { + vec![] + } + Item::BlackConcrete => { + vec![] + } + Item::WhiteConcretePowder => { + vec![] + } + Item::OrangeConcretePowder => { + vec![] + } + Item::MagentaConcretePowder => { + vec![] + } + Item::LightBlueConcretePowder => { + vec![] + } + Item::YellowConcretePowder => { + vec![] + } + Item::LimeConcretePowder => { + vec![] + } + Item::PinkConcretePowder => { + vec![] + } + Item::GrayConcretePowder => { + vec![] + } + Item::LightGrayConcretePowder => { + vec![] + } + Item::CyanConcretePowder => { + vec![] + } + Item::PurpleConcretePowder => { + vec![] + } + Item::BlueConcretePowder => { + vec![] + } + Item::BrownConcretePowder => { + vec![] + } + Item::GreenConcretePowder => { + vec![] + } + Item::RedConcretePowder => { + vec![] + } + Item::BlackConcretePowder => { + vec![] + } + Item::TurtleEgg => { + vec![] + } + Item::DeadTubeCoralBlock => { + vec![] + } + Item::DeadBrainCoralBlock => { + vec![] + } + Item::DeadBubbleCoralBlock => { + vec![] + } + Item::DeadFireCoralBlock => { + vec![] + } + Item::DeadHornCoralBlock => { + vec![] + } + Item::TubeCoralBlock => { + vec![] + } + Item::BrainCoralBlock => { + vec![] + } + Item::BubbleCoralBlock => { + vec![] + } + Item::FireCoralBlock => { + vec![] + } + Item::HornCoralBlock => { + vec![] + } + Item::TubeCoral => { + vec![] + } + Item::BrainCoral => { + vec![] + } + Item::BubbleCoral => { + vec![] + } + Item::FireCoral => { + vec![] + } + Item::HornCoral => { + vec![] + } + Item::DeadBrainCoral => { + vec![] + } + Item::DeadBubbleCoral => { + vec![] + } + Item::DeadFireCoral => { + vec![] + } + Item::DeadHornCoral => { + vec![] + } + Item::DeadTubeCoral => { + vec![] + } + Item::TubeCoralFan => { + vec![] + } + Item::BrainCoralFan => { + vec![] + } + Item::BubbleCoralFan => { + vec![] + } + Item::FireCoralFan => { + vec![] + } + Item::HornCoralFan => { + vec![] + } + Item::DeadTubeCoralFan => { + vec![] + } + Item::DeadBrainCoralFan => { + vec![] + } + Item::DeadBubbleCoralFan => { + vec![] + } + Item::DeadFireCoralFan => { + vec![] + } + Item::DeadHornCoralFan => { + vec![] + } + Item::BlueIce => { + vec![] + } + Item::Conduit => { + vec![] + } + Item::PolishedGraniteStairs => { + vec![] + } + Item::SmoothRedSandstoneStairs => { + vec![] + } + Item::MossyStoneBrickStairs => { + vec![] + } + Item::PolishedDioriteStairs => { + vec![] + } + Item::MossyCobblestoneStairs => { + vec![] + } + Item::EndStoneBrickStairs => { + vec![] + } + Item::StoneStairs => { + vec![] + } + Item::SmoothSandstoneStairs => { + vec![] + } + Item::SmoothQuartzStairs => { + vec![] + } + Item::GraniteStairs => { + vec![] + } + Item::AndesiteStairs => { + vec![] + } + Item::RedNetherBrickStairs => { + vec![] + } + Item::PolishedAndesiteStairs => { + vec![] + } + Item::DioriteStairs => { + vec![] + } + Item::CobbledDeepslateStairs => { + vec![] + } + Item::PolishedDeepslateStairs => { + vec![] + } + Item::DeepslateBrickStairs => { + vec![] + } + Item::DeepslateTileStairs => { + vec![] + } + Item::PolishedGraniteSlab => { + vec![] + } + Item::SmoothRedSandstoneSlab => { + vec![] + } + Item::MossyStoneBrickSlab => { + vec![] + } + Item::PolishedDioriteSlab => { + vec![] + } + Item::MossyCobblestoneSlab => { + vec![] + } + Item::EndStoneBrickSlab => { + vec![] + } + Item::SmoothSandstoneSlab => { + vec![] + } + Item::SmoothQuartzSlab => { + vec![] + } + Item::GraniteSlab => { + vec![] + } + Item::AndesiteSlab => { + vec![] + } + Item::RedNetherBrickSlab => { + vec![] + } + Item::PolishedAndesiteSlab => { + vec![] + } + Item::DioriteSlab => { + vec![] + } + Item::CobbledDeepslateSlab => { + vec![] + } + Item::PolishedDeepslateSlab => { + vec![] + } + Item::DeepslateBrickSlab => { + vec![] + } + Item::DeepslateTileSlab => { + vec![] + } + Item::Scaffolding => { + vec![] + } + Item::Redstone => { + vec![] + } + Item::RedstoneTorch => { + vec![] + } + Item::RedstoneBlock => { + vec![] + } + Item::Repeater => { + vec![] + } + Item::Comparator => { + vec![] + } + Item::Piston => { + vec![] + } + Item::StickyPiston => { + vec![] + } + Item::SlimeBlock => { + vec![] + } + Item::HoneyBlock => { + vec![] + } + Item::Observer => { + vec![] + } + Item::Hopper => { + vec![] + } + Item::Dispenser => { + vec![] + } + Item::Dropper => { + vec![] + } + Item::Lectern => { + vec![] + } + Item::Target => { + vec![] + } + Item::Lever => { + vec![] + } + Item::LightningRod => { + vec![] + } + Item::DaylightDetector => { + vec![] + } + Item::SculkSensor => { + vec![] + } + Item::TripwireHook => { + vec![] + } + Item::TrappedChest => { + vec![] + } + Item::Tnt => { + vec![] + } + Item::RedstoneLamp => { + vec![] + } + Item::NoteBlock => { + vec![] + } + Item::StoneButton => { + vec![] + } + Item::PolishedBlackstoneButton => { + vec![] + } + Item::OakButton => { + vec![] + } + Item::SpruceButton => { + vec![] + } + Item::BirchButton => { + vec![] + } + Item::JungleButton => { + vec![] + } + Item::AcaciaButton => { + vec![] + } + Item::DarkOakButton => { + vec![] + } + Item::CrimsonButton => { + vec![] + } + Item::WarpedButton => { + vec![] + } + Item::StonePressurePlate => { + vec![] + } + Item::PolishedBlackstonePressurePlate => { + vec![] + } + Item::LightWeightedPressurePlate => { + vec![] + } + Item::HeavyWeightedPressurePlate => { + vec![] + } + Item::OakPressurePlate => { + vec![] + } + Item::SprucePressurePlate => { + vec![] + } + Item::BirchPressurePlate => { + vec![] + } + Item::JunglePressurePlate => { + vec![] + } + Item::AcaciaPressurePlate => { + vec![] + } + Item::DarkOakPressurePlate => { + vec![] + } + Item::CrimsonPressurePlate => { + vec![] + } + Item::WarpedPressurePlate => { + vec![] + } + Item::IronDoor => { + vec![] + } + Item::OakDoor => { + vec![] + } + Item::SpruceDoor => { + vec![] + } + Item::BirchDoor => { + vec![] + } + Item::JungleDoor => { + vec![] + } + Item::AcaciaDoor => { + vec![] + } + Item::DarkOakDoor => { + vec![] + } + Item::CrimsonDoor => { + vec![] + } + Item::WarpedDoor => { + vec![] + } + Item::IronTrapdoor => { + vec![] + } + Item::OakTrapdoor => { + vec![] + } + Item::SpruceTrapdoor => { + vec![] + } + Item::BirchTrapdoor => { + vec![] + } + Item::JungleTrapdoor => { + vec![] + } + Item::AcaciaTrapdoor => { + vec![] + } + Item::DarkOakTrapdoor => { + vec![] + } + Item::CrimsonTrapdoor => { + vec![] + } + Item::WarpedTrapdoor => { + vec![] + } + Item::OakFenceGate => { + vec![] + } + Item::SpruceFenceGate => { + vec![] + } + Item::BirchFenceGate => { + vec![] + } + Item::JungleFenceGate => { + vec![] + } + Item::AcaciaFenceGate => { + vec![] + } + Item::DarkOakFenceGate => { + vec![] + } + Item::CrimsonFenceGate => { + vec![] + } + Item::WarpedFenceGate => { + vec![] + } + Item::PoweredRail => { + vec![] + } + Item::DetectorRail => { + vec![] + } + Item::Rail => { + vec![] + } + Item::ActivatorRail => { + vec![] + } + Item::Saddle => { + vec![] + } + Item::Minecart => { + vec![] + } + Item::ChestMinecart => { + vec![] + } + Item::FurnaceMinecart => { + vec![] + } + Item::TntMinecart => { + vec![] + } + Item::HopperMinecart => { + vec![] + } + Item::CarrotOnAStick => { + vec![] + } + Item::WarpedFungusOnAStick => { + vec![] + } + Item::Elytra => { + vec![] + } + Item::OakBoat => { + vec![] + } + Item::SpruceBoat => { + vec![] + } + Item::BirchBoat => { + vec![] + } + Item::JungleBoat => { + vec![] + } + Item::AcaciaBoat => { + vec![] + } + Item::DarkOakBoat => { + vec![] + } + Item::StructureBlock => { + vec![] + } + Item::Jigsaw => { + vec![] + } + Item::TurtleHelmet => { + vec![] + } + Item::Scute => { + vec![] + } + Item::FlintAndSteel => { + vec![] + } + Item::Apple => { + vec![] + } + Item::Bow => { + vec![] + } + Item::Arrow => { + vec![] + } + Item::Coal => { + vec![] + } + Item::Charcoal => { + vec![] + } + Item::Diamond => { + vec![] + } + Item::Emerald => { + vec![] + } + Item::LapisLazuli => { + vec![] + } + Item::Quartz => { + vec![] + } + Item::AmethystShard => { + vec![] + } + Item::RawIron => { + vec![] + } + Item::IronIngot => { + vec![] + } + Item::RawCopper => { + vec![] + } + Item::CopperIngot => { + vec![] + } + Item::RawGold => { + vec![] + } + Item::GoldIngot => { + vec![] + } + Item::NetheriteIngot => { + vec![] + } + Item::NetheriteScrap => { + vec![] + } + Item::WoodenSword => { + vec![] + } + Item::WoodenShovel => { + vec![] + } + Item::WoodenPickaxe => { + vec![] + } + Item::WoodenAxe => { + vec![] + } + Item::WoodenHoe => { + vec![] + } + Item::StoneSword => { + vec![] + } + Item::StoneShovel => { + vec![] + } + Item::StonePickaxe => { + vec![] + } + Item::StoneAxe => { + vec![] + } + Item::StoneHoe => { + vec![] + } + Item::GoldenSword => { + vec![] + } + Item::GoldenShovel => { + vec![] + } + Item::GoldenPickaxe => { + vec![] + } + Item::GoldenAxe => { + vec![] + } + Item::GoldenHoe => { + vec![] + } + Item::IronSword => { + vec![] + } + Item::IronShovel => { + vec![] + } + Item::IronPickaxe => { + vec![] + } + Item::IronAxe => { + vec![] + } + Item::IronHoe => { + vec![] + } + Item::DiamondSword => { + vec![] + } + Item::DiamondShovel => { + vec![] + } + Item::DiamondPickaxe => { + vec![] + } + Item::DiamondAxe => { + vec![] + } + Item::DiamondHoe => { + vec![] + } + Item::NetheriteSword => { + vec![] + } + Item::NetheriteShovel => { + vec![] + } + Item::NetheritePickaxe => { + vec![] + } + Item::NetheriteAxe => { + vec![] + } + Item::NetheriteHoe => { + vec![] + } + Item::Stick => { + vec![] + } + Item::Bowl => { + vec![] + } + Item::MushroomStew => { + vec![] + } + Item::String => { + vec![] + } + Item::Feather => { + vec![] + } + Item::Gunpowder => { + vec![] + } + Item::WheatSeeds => { + vec![] + } + Item::Wheat => { + vec![] + } + Item::Bread => { + vec![] + } + Item::LeatherHelmet => { + vec![] + } + Item::LeatherChestplate => { + vec![] + } + Item::LeatherLeggings => { + vec![] + } + Item::LeatherBoots => { + vec![] + } + Item::ChainmailHelmet => { + vec![] + } + Item::ChainmailChestplate => { + vec![] + } + Item::ChainmailLeggings => { + vec![] + } + Item::ChainmailBoots => { + vec![] + } + Item::IronHelmet => { + vec![] + } + Item::IronChestplate => { + vec![] + } + Item::IronLeggings => { + vec![] + } + Item::IronBoots => { + vec![] + } + Item::DiamondHelmet => { + vec![] + } + Item::DiamondChestplate => { + vec![] + } + Item::DiamondLeggings => { + vec![] + } + Item::DiamondBoots => { + vec![] + } + Item::GoldenHelmet => { + vec![] + } + Item::GoldenChestplate => { + vec![] + } + Item::GoldenLeggings => { + vec![] + } + Item::GoldenBoots => { + vec![] + } + Item::NetheriteHelmet => { + vec![] + } + Item::NetheriteChestplate => { + vec![] + } + Item::NetheriteLeggings => { + vec![] + } + Item::NetheriteBoots => { + vec![] + } + Item::Flint => { + vec![] + } + Item::Porkchop => { + vec![] + } + Item::CookedPorkchop => { + vec![] + } + Item::Painting => { + vec![] + } + Item::GoldenApple => { + vec![] + } + Item::EnchantedGoldenApple => { + vec![] + } + Item::OakSign => { + vec![] + } + Item::SpruceSign => { + vec![] + } + Item::BirchSign => { + vec![] + } + Item::JungleSign => { + vec![] + } + Item::AcaciaSign => { + vec![] + } + Item::DarkOakSign => { + vec![] + } + Item::CrimsonSign => { + vec![] + } + Item::WarpedSign => { + vec![] + } + Item::Bucket => { + vec![] + } + Item::WaterBucket => { + vec![] + } + Item::LavaBucket => { + vec![] + } + Item::PowderSnowBucket => { + vec![] + } + Item::Snowball => { + vec![] + } + Item::Leather => { + vec![] + } + Item::MilkBucket => { + vec![] + } + Item::PufferfishBucket => { + vec![] + } + Item::SalmonBucket => { + vec![] + } + Item::CodBucket => { + vec![] + } + Item::TropicalFishBucket => { + vec![] + } + Item::AxolotlBucket => { + vec![] + } + Item::Brick => { + vec![] + } + Item::ClayBall => { + vec![] + } + Item::DriedKelpBlock => { + vec![] + } + Item::Paper => { + vec![] + } + Item::Book => { + vec![] + } + Item::SlimeBall => { + vec![] + } + Item::Egg => { + vec![] + } + Item::Compass => { + vec![] + } + Item::Bundle => { + vec![] + } + Item::FishingRod => { + vec![] + } + Item::Clock => { + vec![] + } + Item::Spyglass => { + vec![] + } + Item::GlowstoneDust => { + vec![] + } + Item::Cod => { + vec![] + } + Item::Salmon => { + vec![] + } + Item::TropicalFish => { + vec![] + } + Item::Pufferfish => { + vec![] + } + Item::CookedCod => { + vec![] + } + Item::CookedSalmon => { + vec![] + } + Item::InkSac => { + vec![] + } + Item::GlowInkSac => { + vec![] + } + Item::CocoaBeans => { + vec![] + } + Item::WhiteDye => { + vec![] + } + Item::OrangeDye => { + vec![] + } + Item::MagentaDye => { + vec![] + } + Item::LightBlueDye => { + vec![] + } + Item::YellowDye => { + vec![] + } + Item::LimeDye => { + vec![] + } + Item::PinkDye => { + vec![] + } + Item::GrayDye => { + vec![] + } + Item::LightGrayDye => { + vec![] + } + Item::CyanDye => { + vec![] + } + Item::PurpleDye => { + vec![] + } + Item::BlueDye => { + vec![] + } + Item::BrownDye => { + vec![] + } + Item::GreenDye => { + vec![] + } + Item::RedDye => { + vec![] + } + Item::BlackDye => { + vec![] + } + Item::BoneMeal => { + vec![] + } + Item::Bone => { + vec![] + } + Item::Sugar => { + vec![] + } + Item::Cake => { + vec![] + } + Item::WhiteBed => { + vec![] + } + Item::OrangeBed => { + vec![] + } + Item::MagentaBed => { + vec![] + } + Item::LightBlueBed => { + vec![] + } + Item::YellowBed => { + vec![] + } + Item::LimeBed => { + vec![] + } + Item::PinkBed => { + vec![] + } + Item::GrayBed => { + vec![] + } + Item::LightGrayBed => { + vec![] + } + Item::CyanBed => { + vec![] + } + Item::PurpleBed => { + vec![] + } + Item::BlueBed => { + vec![] + } + Item::BrownBed => { + vec![] + } + Item::GreenBed => { + vec![] + } + Item::RedBed => { + vec![] + } + Item::BlackBed => { + vec![] + } + Item::Cookie => { + vec![] + } + Item::FilledMap => { + vec![] + } + Item::Shears => { + vec![] + } + Item::MelonSlice => { + vec![] + } + Item::DriedKelp => { + vec![] + } + Item::PumpkinSeeds => { + vec![] + } + Item::MelonSeeds => { + vec![] + } + Item::Beef => { + vec![] + } + Item::CookedBeef => { + vec![] + } + Item::Chicken => { + vec![] + } + Item::CookedChicken => { + vec![] + } + Item::RottenFlesh => { + vec![] + } + Item::EnderPearl => { + vec![] + } + Item::BlazeRod => { + vec![] + } + Item::GhastTear => { + vec![] + } + Item::GoldNugget => { + vec![] + } + Item::NetherWart => { + vec![] + } + Item::Potion => { + vec![] + } + Item::GlassBottle => { + vec![] + } + Item::SpiderEye => { + vec![] + } + Item::FermentedSpiderEye => { + vec![] + } + Item::BlazePowder => { + vec![] + } + Item::MagmaCream => { + vec![] + } + Item::BrewingStand => { + vec![] + } + Item::Cauldron => { + vec![] + } + Item::EnderEye => { + vec![] + } + Item::GlisteringMelonSlice => { + vec![] + } + Item::AxolotlSpawnEgg => { + vec![] + } + Item::BatSpawnEgg => { + vec![] + } + Item::BeeSpawnEgg => { + vec![] + } + Item::BlazeSpawnEgg => { + vec![] + } + Item::CatSpawnEgg => { + vec![] + } + Item::CaveSpiderSpawnEgg => { + vec![] + } + Item::ChickenSpawnEgg => { + vec![] + } + Item::CodSpawnEgg => { + vec![] + } + Item::CowSpawnEgg => { + vec![] + } + Item::CreeperSpawnEgg => { + vec![] + } + Item::DolphinSpawnEgg => { + vec![] + } + Item::DonkeySpawnEgg => { + vec![] + } + Item::DrownedSpawnEgg => { + vec![] + } + Item::ElderGuardianSpawnEgg => { + vec![] + } + Item::EndermanSpawnEgg => { + vec![] + } + Item::EndermiteSpawnEgg => { + vec![] + } + Item::EvokerSpawnEgg => { + vec![] + } + Item::FoxSpawnEgg => { + vec![] + } + Item::GhastSpawnEgg => { + vec![] + } + Item::GlowSquidSpawnEgg => { + vec![] + } + Item::GoatSpawnEgg => { + vec![] + } + Item::GuardianSpawnEgg => { + vec![] + } + Item::HoglinSpawnEgg => { + vec![] + } + Item::HorseSpawnEgg => { + vec![] + } + Item::HuskSpawnEgg => { + vec![] + } + Item::LlamaSpawnEgg => { + vec![] + } + Item::MagmaCubeSpawnEgg => { + vec![] + } + Item::MooshroomSpawnEgg => { + vec![] + } + Item::MuleSpawnEgg => { + vec![] + } + Item::OcelotSpawnEgg => { + vec![] + } + Item::PandaSpawnEgg => { + vec![] + } + Item::ParrotSpawnEgg => { + vec![] + } + Item::PhantomSpawnEgg => { + vec![] + } + Item::PigSpawnEgg => { + vec![] + } + Item::PiglinSpawnEgg => { + vec![] + } + Item::PiglinBruteSpawnEgg => { + vec![] + } + Item::PillagerSpawnEgg => { + vec![] + } + Item::PolarBearSpawnEgg => { + vec![] + } + Item::PufferfishSpawnEgg => { + vec![] + } + Item::RabbitSpawnEgg => { + vec![] + } + Item::RavagerSpawnEgg => { + vec![] + } + Item::SalmonSpawnEgg => { + vec![] + } + Item::SheepSpawnEgg => { + vec![] + } + Item::ShulkerSpawnEgg => { + vec![] + } + Item::SilverfishSpawnEgg => { + vec![] + } + Item::SkeletonSpawnEgg => { + vec![] + } + Item::SkeletonHorseSpawnEgg => { + vec![] + } + Item::SlimeSpawnEgg => { + vec![] + } + Item::SpiderSpawnEgg => { + vec![] + } + Item::SquidSpawnEgg => { + vec![] + } + Item::StraySpawnEgg => { + vec![] + } + Item::StriderSpawnEgg => { + vec![] + } + Item::TraderLlamaSpawnEgg => { + vec![] + } + Item::TropicalFishSpawnEgg => { + vec![] + } + Item::TurtleSpawnEgg => { + vec![] + } + Item::VexSpawnEgg => { + vec![] + } + Item::VillagerSpawnEgg => { + vec![] + } + Item::VindicatorSpawnEgg => { + vec![] + } + Item::WanderingTraderSpawnEgg => { + vec![] + } + Item::WitchSpawnEgg => { + vec![] + } + Item::WitherSkeletonSpawnEgg => { + vec![] + } + Item::WolfSpawnEgg => { + vec![] + } + Item::ZoglinSpawnEgg => { + vec![] + } + Item::ZombieSpawnEgg => { + vec![] + } + Item::ZombieHorseSpawnEgg => { + vec![] + } + Item::ZombieVillagerSpawnEgg => { + vec![] + } + Item::ZombifiedPiglinSpawnEgg => { + vec![] + } + Item::ExperienceBottle => { + vec![] + } + Item::FireCharge => { + vec![] + } + Item::WritableBook => { + vec![] + } + Item::WrittenBook => { + vec![] + } + Item::ItemFrame => { + vec![] + } + Item::GlowItemFrame => { + vec![] + } + Item::FlowerPot => { + vec![] + } + Item::Carrot => { + vec![] + } + Item::Potato => { + vec![] + } + Item::BakedPotato => { + vec![] + } + Item::PoisonousPotato => { + vec![] + } + Item::Map => { + vec![] + } + Item::GoldenCarrot => { + vec![] + } + Item::SkeletonSkull => { + vec![] + } + Item::WitherSkeletonSkull => { + vec![] + } + Item::PlayerHead => { + vec![] + } + Item::ZombieHead => { + vec![] + } + Item::CreeperHead => { + vec![] + } + Item::DragonHead => { + vec![] + } + Item::NetherStar => { + vec![] + } + Item::PumpkinPie => { + vec![] + } + Item::FireworkRocket => { + vec![] + } + Item::FireworkStar => { + vec![] + } + Item::EnchantedBook => { + vec![] + } + Item::NetherBrick => { + vec![] + } + Item::PrismarineShard => { + vec![] + } + Item::PrismarineCrystals => { + vec![] + } + Item::Rabbit => { + vec![] + } + Item::CookedRabbit => { + vec![] + } + Item::RabbitStew => { + vec![] + } + Item::RabbitFoot => { + vec![] + } + Item::RabbitHide => { + vec![] + } + Item::ArmorStand => { + vec![] + } + Item::IronHorseArmor => { + vec![] + } + Item::GoldenHorseArmor => { + vec![] + } + Item::DiamondHorseArmor => { + vec![] + } + Item::LeatherHorseArmor => { + vec![] + } + Item::Lead => { + vec![] + } + Item::NameTag => { + vec![] + } + Item::CommandBlockMinecart => { + vec![] + } + Item::Mutton => { + vec![] + } + Item::CookedMutton => { + vec![] + } + Item::WhiteBanner => { + vec![] + } + Item::OrangeBanner => { + vec![] + } + Item::MagentaBanner => { + vec![] + } + Item::LightBlueBanner => { + vec![] + } + Item::YellowBanner => { + vec![] + } + Item::LimeBanner => { + vec![] + } + Item::PinkBanner => { + vec![] + } + Item::GrayBanner => { + vec![] + } + Item::LightGrayBanner => { + vec![] + } + Item::CyanBanner => { + vec![] + } + Item::PurpleBanner => { + vec![] + } + Item::BlueBanner => { + vec![] + } + Item::BrownBanner => { + vec![] + } + Item::GreenBanner => { + vec![] + } + Item::RedBanner => { + vec![] + } + Item::BlackBanner => { + vec![] + } + Item::EndCrystal => { + vec![] + } + Item::ChorusFruit => { + vec![] + } + Item::PoppedChorusFruit => { + vec![] + } + Item::Beetroot => { + vec![] + } + Item::BeetrootSeeds => { + vec![] + } + Item::BeetrootSoup => { + vec![] + } + Item::DragonBreath => { + vec![] + } + Item::SplashPotion => { + vec![] + } + Item::SpectralArrow => { + vec![] + } + Item::TippedArrow => { + vec![] + } + Item::LingeringPotion => { + vec![] + } + Item::Shield => { + vec![] + } + Item::TotemOfUndying => { + vec![] + } + Item::ShulkerShell => { + vec![] + } + Item::IronNugget => { + vec![] + } + Item::KnowledgeBook => { + vec![] + } + Item::DebugStick => { + vec![] + } + Item::MusicDisc13 => { + vec![] + } + Item::MusicDiscCat => { + vec![] + } + Item::MusicDiscBlocks => { + vec![] + } + Item::MusicDiscChirp => { + vec![] + } + Item::MusicDiscFar => { + vec![] + } + Item::MusicDiscMall => { + vec![] + } + Item::MusicDiscMellohi => { + vec![] + } + Item::MusicDiscStal => { + vec![] + } + Item::MusicDiscStrad => { + vec![] + } + Item::MusicDiscWard => { + vec![] + } + Item::MusicDisc11 => { + vec![] + } + Item::MusicDiscWait => { + vec![] + } + Item::MusicDiscOtherside => { + vec![] + } + Item::MusicDiscPigstep => { + vec![] + } + Item::Trident => { + vec![] + } + Item::PhantomMembrane => { + vec![] + } + Item::NautilusShell => { + vec![] + } + Item::HeartOfTheSea => { + vec![] + } + Item::Crossbow => { + vec![] + } + Item::SuspiciousStew => { + vec![] + } + Item::Loom => { + vec![] + } + Item::FlowerBannerPattern => { + vec![] + } + Item::CreeperBannerPattern => { + vec![] + } + Item::SkullBannerPattern => { + vec![] + } + Item::MojangBannerPattern => { + vec![] + } + Item::GlobeBannerPattern => { + vec![] + } + Item::PiglinBannerPattern => { + vec![] + } + Item::Composter => { + vec![] + } + Item::Barrel => { + vec![] + } + Item::Smoker => { + vec![] + } + Item::BlastFurnace => { + vec![] + } + Item::CartographyTable => { + vec![] + } + Item::FletchingTable => { + vec![] + } + Item::Grindstone => { + vec![] + } + Item::SmithingTable => { + vec![] + } + Item::Stonecutter => { + vec![] + } + Item::Bell => { + vec![] + } + Item::Lantern => { + vec![] + } + Item::SoulLantern => { + vec![] + } + Item::SweetBerries => { + vec![] + } + Item::GlowBerries => { + vec![] + } + Item::Campfire => { + vec![] + } + Item::SoulCampfire => { + vec![] + } + Item::Shroomlight => { + vec![] + } + Item::Honeycomb => { + vec![] + } + Item::BeeNest => { + vec![] + } + Item::Beehive => { + vec![] + } + Item::HoneyBottle => { + vec![] + } + Item::HoneycombBlock => { + vec![] + } + Item::Lodestone => { + vec![] + } + Item::CryingObsidian => { + vec![] + } + Item::Blackstone => { + vec![] + } + Item::BlackstoneSlab => { + vec![] + } + Item::BlackstoneStairs => { + vec![] + } + Item::GildedBlackstone => { + vec![] + } + Item::PolishedBlackstone => { + vec![] + } + Item::PolishedBlackstoneSlab => { + vec![] + } + Item::PolishedBlackstoneStairs => { + vec![] + } + Item::ChiseledPolishedBlackstone => { + vec![] + } + Item::PolishedBlackstoneBricks => { + vec![] + } + Item::PolishedBlackstoneBrickSlab => { + vec![] + } + Item::PolishedBlackstoneBrickStairs => { + vec![] + } + Item::CrackedPolishedBlackstoneBricks => { + vec![] + } + Item::RespawnAnchor => { + vec![] + } + Item::Candle => { + vec![] + } + Item::WhiteCandle => { + vec![] + } + Item::OrangeCandle => { + vec![] + } + Item::MagentaCandle => { + vec![] + } + Item::LightBlueCandle => { + vec![] + } + Item::YellowCandle => { + vec![] + } + Item::LimeCandle => { + vec![] + } + Item::PinkCandle => { + vec![] + } + Item::GrayCandle => { + vec![] + } + Item::LightGrayCandle => { + vec![] + } + Item::CyanCandle => { + vec![] + } + Item::PurpleCandle => { + vec![] + } + Item::BlueCandle => { + vec![] + } + Item::BrownCandle => { + vec![] + } + Item::GreenCandle => { + vec![] + } + Item::RedCandle => { + vec![] + } + Item::BlackCandle => { + vec![] + } + Item::SmallAmethystBud => { + vec![] + } + Item::MediumAmethystBud => { + vec![] + } + Item::LargeAmethystBud => { + vec![] + } + Item::AmethystCluster => { + vec![] + } + Item::PointedDripstone => { + vec![] + } } } } use std::convert::TryFrom; - +use std::str::FromStr; impl TryFrom for Item { type Error = &'static str; - fn try_from(value: String) -> Result { if let Some(item) = Item::from_name(value.as_str()) { Ok(item) } else { - Err("Unknown item name.") + Err("Unknown item name") } } } - impl From for &'static str { fn from(i: Item) -> Self { i.name() } } - -use std::str::FromStr; - impl FromStr for Item { type Err = &'static str; - fn from_str(s: &str) -> Result { if let Some(item) = Item::from_name(s) { Ok(item) } else { - Err("Unknown item name.") + Err("Unknown item name") } } } diff --git a/libcraft/items/src/item_stack.rs b/libcraft/items/src/item_stack.rs index 067e0ac16..5aaf002b2 100644 --- a/libcraft/items/src/item_stack.rs +++ b/libcraft/items/src/item_stack.rs @@ -315,9 +315,10 @@ impl ItemStack { match &mut self.meta.clone().unwrap().damage { Some(damage) => { *damage += amount; - if let Some(durability) = self.item.durability() { - // Convert to a larger type for a safe conversion - i64::from(*damage) >= i64::from(durability) + if let Some(durability) = self.item.max_durability() { + // This unwrap would only fail if our generated file contains an erroneous + // default damage value. + *damage >= durability.try_into().unwrap() } else { false } @@ -376,7 +377,7 @@ impl ItemStackMeta { #[must_use] pub fn new(item: Item) -> Self { Self { - title: item.display_name().to_owned(), + title: item.name().to_owned(), lore: "".to_owned(), damage: None, repair_cost: None, @@ -511,7 +512,7 @@ impl ItemStackBuilder { s } else { self.meta = Some(ItemStackMeta { - title: self.item.display_name().to_owned(), + title: self.item.name().to_owned(), ..ItemStackMeta::default() }); self.meta.as_mut().unwrap() diff --git a/libcraft/macros/Cargo.toml b/libcraft/macros/Cargo.toml index 697ada416..57d9163d6 100644 --- a/libcraft/macros/Cargo.toml +++ b/libcraft/macros/Cargo.toml @@ -2,12 +2,12 @@ name = "libcraft-macros" version = "0.1.0" authors = ["Kalle Kankaanpää"] -edition = "2018" +edition = "2021" [lib] proc-macro = true [dependencies] -syn = "1.0" -quote = "1.0" -proc-macro2 = "1.0" +proc-macro2 = "1" +quote = "1" +syn = "1" diff --git a/libcraft/macros/src/lib.rs b/libcraft/macros/src/lib.rs index 58ac67a3f..ce6efac1a 100644 --- a/libcraft/macros/src/lib.rs +++ b/libcraft/macros/src/lib.rs @@ -90,6 +90,7 @@ fn impl_getters_and_setters(name: &Ident, fields: &[Field]) -> TokenStream2 { let ty = field.ty; let set_ident = format_ident!("set_{}", ident); let valid_ident = format_ident!("valid_{}", ident); + let with_ident = format_ident!("with_{}", ident); getters_setters.push(quote! { pub fn #ident (&self) -> #ty { self.#ident @@ -107,6 +108,11 @@ fn impl_getters_and_setters(name: &Ident, fields: &[Field]) -> TokenStream2 { pub fn #valid_ident (&self) -> &[#ty] { &self.valid_properties.#ident } + + pub fn #with_ident (mut self, value: #ty) -> Self { + self.#set_ident(value); + self + } }) } diff --git a/libcraft/particles/Cargo.toml b/libcraft/particles/Cargo.toml index 070038b74..89a96f9b9 100644 --- a/libcraft/particles/Cargo.toml +++ b/libcraft/particles/Cargo.toml @@ -2,14 +2,13 @@ name = "libcraft-particles" version = "0.1.0" authors = ["Gijs de Jong "] -edition = "2018" +edition = "2021" [dependencies] - -libcraft-blocks = { path = "../blocks"} -libcraft-items = { path = "../items" } -ordinalizer = "0.1.0" bytemuck = { version = "1", features = ["derive"] } +libcraft-blocks = { path = "../blocks" } +libcraft-items = { path = "../items" } num-derive = "0.3" num-traits = "0.2" -serde = { version = "1", features = ["derive"] } \ No newline at end of file +ordinalizer = "0.1" +serde = { version = "1", features = ["derive"] } diff --git a/libcraft/particles/src/particle.rs b/libcraft/particles/src/particle.rs index 4e514fd4f..5672c51cf 100644 --- a/libcraft/particles/src/particle.rs +++ b/libcraft/particles/src/particle.rs @@ -1,9 +1,9 @@ -use libcraft_blocks::BlockState; +use libcraft_blocks::{BlockKind, BlockState}; use libcraft_items::Item; use ordinalizer::Ordinal; use serde::{Deserialize, Serialize}; -#[derive(Copy, Clone, Debug, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] #[repr(C)] pub struct Particle { pub kind: ParticleKind, @@ -189,7 +189,7 @@ impl ParticleKind { 0 => Some(ParticleKind::AmbientEntityEffect), 1 => Some(ParticleKind::AngryVillager), 2 => Some(ParticleKind::Barrier), - 3 => Some(ParticleKind::Block(BlockState::from_id(0).unwrap())), + 3 => Some(ParticleKind::Block(BlockState::new(BlockKind::Stone))), 4 => Some(ParticleKind::Bubble), 5 => Some(ParticleKind::Cloud), 6 => Some(ParticleKind::Crit), @@ -214,7 +214,7 @@ impl ParticleKind { 20 => Some(ParticleKind::EntityEffect), 21 => Some(ParticleKind::ExplosionEmitter), 22 => Some(ParticleKind::Explosion), - 23 => Some(ParticleKind::FallingDust(BlockState::from_id(0).unwrap())), + 23 => Some(ParticleKind::FallingDust(BlockState::new(BlockKind::Stone))), 24 => Some(ParticleKind::Firework), 25 => Some(ParticleKind::Fishing), 26 => Some(ParticleKind::Flame), diff --git a/libcraft/src/dimension.rs b/libcraft/src/dimension.rs new file mode 100644 index 000000000..fec6e16eb --- /dev/null +++ b/libcraft/src/dimension.rs @@ -0,0 +1,120 @@ +use std::io::Cursor; + +use bincode::{Decode, Encode}; +use serde::{Deserialize, Serialize}; + +/// Loads the vanilla dimensions from a precomputed data set. +pub fn vanilla_dimensions() -> Vec { + static DATA: &[u8] = include_bytes!("../assets/vanilla_dimensions.bc.gz"); + + let mut decoder = flate2::read::GzDecoder::new(Cursor::new(DATA)); + + bincode::decode_from_std_read(&mut decoder, bincode::config::standard()) + .expect("malformed dimension data ") +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub struct DimensionInfo { + pub r#type: String, + #[serde(default)] + pub info: DimensionTypeInfo, + pub generator: DimensionGeneratorInfo, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default, Encode, Decode)] +pub struct DimensionTypeInfo { + pub logical_height: i32, + pub infiniburn: String, + pub effects: String, + pub ambient_light: f32, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub respawn_anchor_works: bool, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub has_raids: bool, + pub min_y: i32, + pub height: i32, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub natural: bool, + pub coordinate_scale: f32, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub piglin_safe: bool, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub bed_works: bool, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub has_skylight: bool, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub has_ceiling: bool, + #[serde(deserialize_with = "libcraft_core::deserialize_bool")] + pub ultrawarm: bool, + pub fixed_time: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub struct DimensionGeneratorInfo { + pub biome_source: BiomeSource, + pub seed: u64, + pub settings: DimensionSettings, + pub r#type: GeneratorRandomSource, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +#[serde(tag = "type")] +pub enum BiomeSource { + #[serde(rename = "minecraft:multi_noise")] + MultiNoise { biomes: Vec }, + #[serde(rename = "minecraft:the_end")] + TheEnd, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub struct Biome { + pub parameters: BiomeParams, + pub biome: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub struct BiomeParams { + pub erosion: ValueOrRange, + pub depth: ValueOrRange, + pub weirdness: ValueOrRange, + pub offset: ValueOrRange, + pub temperature: ValueOrRange, + pub humidity: ValueOrRange, + pub continentalness: ValueOrRange, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +#[serde(untagged)] +pub enum ValueOrRange { + Value(f64), + Range([f64; 2]), +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub enum GeneratorRandomSource { + #[serde(rename = "minecraft:noise")] + Noise, + #[serde(rename = "minecraft:multi_noise")] + MultiNoise, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)] +pub enum DimensionSettings { + #[serde(rename = "minecraft:overworld")] + Overworld, + #[serde(rename = "minecraft:nether")] + Nether, + #[serde(rename = "minecraft:end")] + End, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn vanilla_dimensions_load() { + let dimensions = vanilla_dimensions(); + assert!(!dimensions.is_empty()); + } +} diff --git a/feather/base/src/metadata.rs b/libcraft/src/entity_metadata.rs similarity index 83% rename from feather/base/src/metadata.rs rename to libcraft/src/entity_metadata.rs index 92b62b852..2e2d3d9ea 100644 --- a/feather/base/src/metadata.rs +++ b/libcraft/src/entity_metadata.rs @@ -13,16 +13,14 @@ pub type OptChat = Option; pub type OptVarInt = Option; // Meta index constants. -pub const META_INDEX_ENTITY_BITMASK: u8 = 0; -pub const META_INDEX_AIR: u8 = 1; -pub const META_INDEX_CUSTOM_NAME: u8 = 2; -pub const META_INDEX_IS_CUSTOM_NAME_VISIBLE: u8 = 3; -pub const META_INDEX_IS_SILENT: u8 = 4; -pub const META_INDEX_NO_GRAVITY: u8 = 5; - -pub const META_INDEX_POSE: u8 = 6; - -pub const META_INDEX_FALLING_BLOCK_SPAWN_POSITION: u8 = 7; +pub const META_INDEX_ENTITY_BITMASK: i8 = 0; +pub const META_INDEX_AIR: i8 = 1; +pub const META_INDEX_CUSTOM_NAME: i8 = 2; +pub const META_INDEX_IS_CUSTOM_NAME_VISIBLE: i8 = 3; +pub const META_INDEX_IS_SILENT: i8 = 4; +pub const META_INDEX_NO_GRAVITY: i8 = 5; +pub const META_INDEX_POSE: i8 = 6; +pub const META_INDEX_TICK_FROZEN_IN_POWDER_SNOW: i8 = 7; bitflags! { pub struct EntityBitMask: u8 { @@ -51,8 +49,8 @@ pub enum MetaEntry { OptPosition(Option), Direction(Direction), OptUuid(OptUuid), - OptBlockId(Option), - Nbt(nbt::Blob), + OptBlockState(Option), + Nbt(nbt::Value), Particle, VillagerData(i32, i32, i32), OptVarInt(OptVarInt), @@ -75,7 +73,7 @@ impl MetaEntry { MetaEntry::OptPosition(_) => 10, MetaEntry::Direction(_) => 11, MetaEntry::OptUuid(_) => 12, - MetaEntry::OptBlockId(_) => 13, + MetaEntry::OptBlockState(_) => 13, MetaEntry::Nbt(_) => 14, MetaEntry::Particle => 15, MetaEntry::VillagerData(_, _, _) => 16, @@ -175,7 +173,7 @@ impl ToMetaEntry for OptVarInt { #[derive(Clone, Debug)] pub struct EntityMetadata { - pub values: BTreeMap, + pub values: BTreeMap, } impl EntityMetadata { @@ -189,14 +187,16 @@ impl EntityMetadata { pub fn entity_base() -> Self { Self::new() .with(META_INDEX_ENTITY_BITMASK, EntityBitMask::empty().bits()) - .with(META_INDEX_AIR, 0i32) + .with(META_INDEX_AIR, 300i32) .with(META_INDEX_CUSTOM_NAME, OptChat::None) .with(META_INDEX_IS_CUSTOM_NAME_VISIBLE, false) .with(META_INDEX_IS_SILENT, false) .with(META_INDEX_NO_GRAVITY, false) + .with(META_INDEX_POSE, Pose::Standing) + .with(META_INDEX_TICK_FROZEN_IN_POWDER_SNOW, 0i32) } - pub fn with_many(mut self, values: &[(u8, MetaEntry)]) -> Self { + pub fn with_many(mut self, values: &[(i8, MetaEntry)]) -> Self { for val in values { self.values.insert(val.0, val.1.clone()); } @@ -204,20 +204,20 @@ impl EntityMetadata { self } - pub fn set(&mut self, index: u8, entry: impl ToMetaEntry) { + pub fn set(&mut self, index: i8, entry: impl ToMetaEntry) { self.values.insert(index, entry.to_meta_entry()); } - pub fn with(mut self, index: u8, entry: impl ToMetaEntry) -> Self { + pub fn with(mut self, index: i8, entry: impl ToMetaEntry) -> Self { self.set(index, entry); self } - pub fn get(&self, index: u8) -> Option { + pub fn get(&self, index: i8) -> Option { self.values.get(&index).cloned() } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator { self.values.iter().map(|(key, entry)| (*key, entry)) } } diff --git a/libcraft/src/lib.rs b/libcraft/src/lib.rs new file mode 100644 index 000000000..3c30e495e --- /dev/null +++ b/libcraft/src/lib.rs @@ -0,0 +1,38 @@ +#[doc(inline)] +pub use libcraft_anvil as anvil; +#[doc(inline)] +pub use libcraft_blocks as blocks; +#[doc(inline)] +pub use libcraft_chunk as chunk; +#[doc(inline)] +pub use libcraft_core::*; +#[doc(inline)] +pub use libcraft_inventory as inventory; +#[doc(inline)] +pub use libcraft_items as items; +#[doc(inline)] +pub use libcraft_particles as particles; +#[doc(inline)] +pub use libcraft_text as text; + +pub mod dimension; +pub mod entity_metadata; + +#[doc(inline)] +pub use entity_metadata::{EntityMetadata, MetaEntry}; + +#[doc(inline)] +pub use libcraft_blocks::{BlockKind, BlockState}; +#[doc(inline)] +pub use libcraft_chunk::{ + biome::{self, BiomeId}, + Chunk, ChunkSection, +}; +#[doc(inline)] +pub use libcraft_inventory::{Area, Inventory, Window}; +#[doc(inline)] +pub use libcraft_items::{Item, ItemStack, ItemStackBuilder, ItemStackMeta}; +#[doc(inline)] +pub use libcraft_particles::{particle, Particle, ParticleKind}; +#[doc(inline)] +pub use libcraft_text::{Text, TextComponentBuilder, Title}; diff --git a/libcraft/text/Cargo.toml b/libcraft/text/Cargo.toml index b99bd785c..67330de80 100644 --- a/libcraft/text/Cargo.toml +++ b/libcraft/text/Cargo.toml @@ -2,7 +2,7 @@ name = "libcraft-text" version = "0.1.0" authors = ["Gijs de Jong ", "caelunshun "] -edition = "2018" +edition = "2021" [dependencies] hematite-nbt = { git = "https://github.com/PistonDevelopers/hematite_nbt" } @@ -11,5 +11,5 @@ nom_locate = "2" serde = { version = "1", features = [ "derive" ] } serde_json = "1" serde_with = "1" -uuid = { version = "0.8", features = [ "serde" ] } thiserror = "1" +uuid = { version = "0.8", features = [ "serde" ] } diff --git a/minecraft-data b/minecraft-data index a4fde646c..2ae82e0d7 160000 --- a/minecraft-data +++ b/minecraft-data @@ -1 +1 @@ -Subproject commit a4fde646c6571e97ec77a57662ca3470718bfa41 +Subproject commit 2ae82e0d75f3288f99d0a47232e52208144da973 diff --git a/proxy/Cargo.toml b/proxy/Cargo.toml index e739e7555..d84085110 100644 --- a/proxy/Cargo.toml +++ b/proxy/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -feather-protocol = { path = "../feather/protocol" } -clap = { version = "3.0.5", features = ["derive"] } -pretty-hex = "0.2.1" -log = "0.4.14" -fern = "0.6.0" anyhow = "1.0.52" +clap = { version = "3.0.5", features = ["derive"] } colored = "2.0.0" +feather-protocol = { path = "../feather/protocol" } +fern = "0.6.0" +log = "0.4.14" +pretty-hex = "0.2.1" time = { version = "0.3", features = ["local-offset", "formatting", "macros"] } diff --git a/proxy/src/main.rs b/proxy/src/main.rs index 161e747c5..0f87126e1 100644 --- a/proxy/src/main.rs +++ b/proxy/src/main.rs @@ -1,4 +1,4 @@ -use std::fmt::{Display, Formatter}; +use std::fmt::{Debug, Display, Formatter}; use std::io::{Read, Write}; use std::net::SocketAddr; use std::net::{TcpListener, TcpStream}; @@ -19,6 +19,8 @@ use feather_protocol::{ ServerPacket, ServerPacketCodec, VarInt, }; +const MAX_PACKET_DISPLAY_LENGTH: usize = 1000; + /// A simple proxy server that logs transmitted packets #[derive(Parser)] #[clap(about, version)] @@ -252,39 +254,41 @@ fn handle_client( } let mut connection = connection.lock().unwrap(); - if let Some(packet) = connection - .client_codec - .decode(&vec) - .context("failed to decode client packet")? - { - if log && !hide(packet.id(), blacklist.as_ref(), whitelist.as_ref()) { - log::info!( - "{} -> #{:02X}", - connection.username.clone().unwrap_or_default(), - packet.id() - ); - log::debug!( - "{} -> {:?}", - connection.username.clone().unwrap_or_default(), - packet - ); - log::trace!("{}", pretty_hex::pretty_hex(&&vec)); - } + let res = connection.client_codec.decode(&vec); - // Detect state switches. - if let ClientPacket::Handshake(packet) = packet { - let state = match packet { - ClientHandshakePacket::Handshake(packet) => match packet.next_state { - HandshakeState::Login => ProtocolState::Login, - HandshakeState::Status => ProtocolState::Status, - }, - }; - connection.set_state(state) - } + match res { + Ok(Some(packet)) => { + if log && !hide(packet.id(), blacklist.as_ref(), whitelist.as_ref()) { + log::info!( + "{} -> #{:02X}", + connection.username.clone().unwrap_or_default(), + packet.id() + ); + log::debug!( + "{} -> {}", + connection.username.clone().unwrap_or_default(), + fmt_max_length(&packet) + ); + log::trace!("{}", pretty_hex::pretty_hex(&&vec)); + } - drop(connection); - // Forward the packet to the server. - server_write.write_all(&vec)?; + // Detect state switches. + if let ClientPacket::Handshake(packet) = packet { + let state = match packet { + ClientHandshakePacket::Handshake(packet) => match packet.next_state { + HandshakeState::Login => ProtocolState::Login, + HandshakeState::Status => ProtocolState::Status, + }, + }; + connection.set_state(state) + } + + drop(connection); + // Forward the packet to the server. + server_write.write_all(&vec)?; + } + Ok(None) => {} + Err(e) => log::error!("Failed to decode client packet: {:?}", e), } } Ok(()) @@ -315,43 +319,46 @@ fn handle_server( } let mut connection = connection.lock().unwrap(); - if let Some(packet) = connection - .server_codec - .decode(&vec) - .context("failed to decode client packet")? - { - if log && !hide(packet.id(), blacklist.as_ref(), whitelist.as_ref()) { - log::info!( - "{} <- #{:02X}", - connection.username.clone().unwrap_or_default(), - packet.id() - ); - log::debug!( - "{} <- {:?}", - connection.username.clone().unwrap_or_default(), - packet - ); - log::trace!("{}", pretty_hex::pretty_hex(&&vec)); - } - - match packet { - // Detect state switches - ServerPacket::Login(ServerLoginPacket::LoginSuccess(packet)) => { - connection.username = Some(PlayerName(packet.username)); - connection.set_state(ProtocolState::Play); + let res = connection.server_codec.decode(&vec); + match res { + Ok(Some(packet)) => { + if log && !hide(packet.id(), blacklist.as_ref(), whitelist.as_ref()) { + log::info!( + "{} <- #{:02X}", + connection.username.clone().unwrap_or_default(), + packet.id() + ); + log::debug!( + "{} <- {}", + connection.username.clone().unwrap_or_default(), + fmt_max_length(&packet) + ); + log::trace!("{}", pretty_hex::pretty_hex(&&vec)); } - // Detect SetCompression - ServerPacket::Login(ServerLoginPacket::SetCompression(packet)) => { - connection.set_compression(packet.threshold as CompressionThreshold) + + match packet { + // Detect state switches + ServerPacket::Login(ServerLoginPacket::LoginSuccess(packet)) => { + connection.username = Some(PlayerName(packet.username)); + connection.set_state(ProtocolState::Play); + } + // Detect SetCompression + ServerPacket::Login(ServerLoginPacket::SetCompression(packet)) => { + connection.set_compression(packet.threshold as CompressionThreshold) + } + _ => (), } - _ => (), + + drop(connection); + // Forward the packet to the server. + client_write.write_all(&vec)?; } - drop(connection); - // Forward the packet to the server. - client_write.write_all(&vec)?; + Ok(None) => {} + Err(e) => log::error!("Failed to decode server packet: {:?}", e), } } + Ok(()) } @@ -364,3 +371,8 @@ fn hide(packet_id: u32, blacklist: Option<&Vec>, whitelist: Option<&Vec String { + let s = format!("{:?}", packet); + s.chars().take(MAX_PACKET_DISPLAY_LENGTH).collect() +} diff --git a/quill/Cargo.toml b/quill/Cargo.toml new file mode 100644 index 000000000..3f092dfb6 --- /dev/null +++ b/quill/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "quill" +version = "0.1.0" +authors = ["caelunshun "] +edition = "2021" + +[dependencies] +ahash = "0.7" +anyhow = "1" +derive_more = "0.99" +flume = "0.10" +libcraft = { path = "../libcraft" } +log = "0.4" +parking_lot = "0.12" +serde = { version = "1", features = ["derive"] } +smartstring = { version = "1", features = ["serde"] } +thiserror = "1" +tokio = { version = "1", features = ["full"] } +toml = "0.5" +uuid = { version = "0.8", features = ["serde", "v4"] } +vane = { path = "../vane" } diff --git a/quill/api/Cargo.toml b/quill/api/Cargo.toml deleted file mode 100644 index 33dfdc59c..000000000 --- a/quill/api/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "quill" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -plugin-macro = { path = "./plugin-macro" } -libcraft-core = { path = "../../libcraft/core" } -libcraft-particles = { path = "../../libcraft/particles" } -libcraft-blocks = { path = "../../libcraft/blocks" } -libcraft-text = { path = "../../libcraft/text" } -bincode = "1" -bytemuck = "1" -quill-sys = { path = "../sys" } -quill-common = { path = "../common" } -thiserror = "1" -uuid = "0.8" -itertools = "0.10.0" -serde_json = "1" - diff --git a/quill/api/plugin-macro/Cargo.toml b/quill/api/plugin-macro/Cargo.toml deleted file mode 100644 index b16c64f64..000000000 --- a/quill/api/plugin-macro/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "plugin-macro" -version = "0.1.0" -edition = "2021" - -[lib] -proc-macro = true - -[dependencies] -syn = { version = "1.0.86", features = ["full"] } -quote = "1.0.14" \ No newline at end of file diff --git a/quill/api/plugin-macro/src/lib.rs b/quill/api/plugin-macro/src/lib.rs deleted file mode 100644 index 15ef5b4ed..000000000 --- a/quill/api/plugin-macro/src/lib.rs +++ /dev/null @@ -1,108 +0,0 @@ -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, Item}; - -/// Invoke this macro in your plugin's main.rs. -/// -/// Give it the name of your struct implementing `Plugin`. -/// -/// # Example -/// ```ignore -/// // main.rs -/// use quill::{Plugin, Setup, Game}; -/// -/// #[quill::plugin] -/// pub struct MyPlugin { -/// // plugin state goes here -/// } -/// -/// impl Plugin for MyPlugin { -/// fn enable(game: &mut Game, setup: &mut Setup) -> Self { -/// // Initialize plugin state... -/// Self {} -/// } -/// -/// fn disable(self, game: &mut Game) { -/// // Clean up... -/// } -/// } -/// ``` -#[proc_macro_attribute] -pub fn plugin(_attr: TokenStream, mut item: TokenStream) -> TokenStream { - let cloned_item = item.clone(); - let input = parse_macro_input!(cloned_item as Item); - - let name = match input { - Item::Enum(itm_enum) => itm_enum.ident, - Item::Struct(itm_str) => itm_str.ident, - _ => panic!("Only structs or enums can be #[quill::plugin]!"), - }; - let res = quote! { - // `static mut` can be used without synchronization because the host - // guarantees it will not invoke plugin systems outside of the main thread. - static mut PLUGIN: Option<#name> = None; - - // Exports to the host required for all plugins - #[no_mangle] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - pub unsafe extern "C" fn quill_setup() { - let plugin: #name = - quill::Plugin::enable(&mut ::quill::Game::new(), &mut ::quill::Setup::new()); - PLUGIN = Some(plugin); - } - - #[no_mangle] - #[doc(hidden)] - #[cfg(not(target_arch = "wasm32"))] - pub unsafe extern "C" fn quill_setup( - context: *const (), - vtable_ptr: *const u8, - vtable_len: usize, - ) { - // Set up vtable and host context for quill_sys. - let vtable_bytes = ::std::slice::from_raw_parts(vtable_ptr, vtable_len); - let vtable: ::std::collections::HashMap<&str, usize> = - ::quill::bincode::deserialize(vtable_bytes).expect("invalid vtable"); - - ::quill::sys::init_host_context(context); - ::quill::sys::init_host_vtable(&vtable) - .expect("invalid vtable (check that the plugin and host are up to date)"); - - let plugin: #name = - quill::Plugin::enable(&mut ::quill::Game::new(), &mut ::quill::Setup::new()); - PLUGIN = Some(plugin); - } - - #[no_mangle] - #[doc(hidden)] - pub unsafe extern "C" fn quill_allocate(size: usize, align: usize) -> *mut u8 { - std::alloc::alloc(std::alloc::Layout::from_size_align_unchecked(size, align)) - } - - #[no_mangle] - #[doc(hidden)] - pub unsafe extern "C" fn quill_deallocate(ptr: *mut u8, size: usize, align: usize) { - std::alloc::dealloc( - ptr, - std::alloc::Layout::from_size_align_unchecked(size, align), - ) - } - - #[no_mangle] - #[doc(hidden)] - pub unsafe extern "C" fn quill_run_system(data: *mut u8) { - let system = &mut *data.cast::>(); - let plugin = PLUGIN.as_mut().expect("quill_setup never called"); - system(plugin, &mut ::quill::Game::new()); - } - - /// Never called by Quill, but this is needed - /// to avoid linker errors with WASI. - #[doc(hidden)] - fn main() {} - }; - item.extend(TokenStream::from(res)); - - item -} diff --git a/quill/api/src/entities.rs b/quill/api/src/entities.rs deleted file mode 100644 index ec0cf6126..000000000 --- a/quill/api/src/entities.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! Defines components for all Minecraft entities. -//! -//! # Marker components -//! Each entity has a "marker component": -//! just a struct (often with no fields) -//! that signifies the type of an entity. -//! -//! For example, all horse entities have the [`Horse`] -//! marker component. -//! -//! For certain entities, these components also -//! contain data. For example, the [`Item`] marker -//! component (for item entities) has an `ItemStack` -//! field that indicates the type of the item. - -#[doc(inline)] -pub use quill_common::entities::*; diff --git a/quill/api/src/entity.rs b/quill/api/src/entity.rs deleted file mode 100644 index 5d2ddcaa7..000000000 --- a/quill/api/src/entity.rs +++ /dev/null @@ -1,143 +0,0 @@ -use libcraft_text::Text; -use std::{marker::PhantomData, ptr}; - -use quill_common::{Component, Pointer, PointerMut}; - -/// Unique internal ID of an entity. -/// -/// Can be passed to [`crate::Game::entity`] to get an [`Entity`] -/// handle. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[repr(transparent)] -pub struct EntityId(pub(crate) quill_common::EntityId); - -/// Error returned by [`Entity::get`] when -/// the entity is missing a component. -#[derive(Debug, thiserror::Error)] -#[error("entity does not have component of type {0}")] -pub struct MissingComponent(&'static str); - -/// A handle to an entity. -/// -/// Allows access to the entity's components, like -/// position and UUID. -/// -/// Use [`crate::Game::entity`] to get an `Entity` instance. -/// -/// An `Entity` be sent or shared between threads. However, -/// an [`EntityId`] can. -#[derive(Debug)] -#[repr(C)] -pub struct Entity { - id: EntityId, - _not_send_sync: PhantomData<*mut ()>, -} - -impl Entity { - pub(crate) fn new(id: EntityId) -> Self { - Self { - id, - _not_send_sync: PhantomData, - } - } - - /// Gets a component of this entity. Returns - /// `Err(MissingComponent)` if the entity does not have this component. - /// - /// # Examples - /// ```no_run - /// use quill::{Position, Entity}; - /// # let entity: Entity = unreachable!(); - /// let position = entity.get::().expect("entity has no position component"); - /// ``` - pub fn get(&self) -> Result { - let host_component = T::host_component(); - unsafe { - let mut bytes_ptr = Pointer::new(ptr::null()); - let mut bytes_len = 0u32; - quill_sys::entity_get_component( - self.id.0, - host_component, - PointerMut::new(&mut bytes_ptr), - PointerMut::new(&mut bytes_len), - ); - - if bytes_ptr.as_ptr().is_null() { - return Err(MissingComponent(std::any::type_name::())); - } - - let bytes = std::slice::from_raw_parts(bytes_ptr.as_ptr(), bytes_len as usize); - Ok(T::from_bytes_unchecked(bytes).0) - } - } - - /// Inserts or replaces a component of this entity. - /// - /// If the entity already has this component, - /// the component is overwritten. - pub fn insert(&self, component: T) { - let host_component = T::host_component(); - let bytes = component.to_cow_bytes(); - - unsafe { - quill_sys::entity_set_component( - self.id.0, - host_component, - bytes.as_ptr().into(), - bytes.len() as u32, - ); - } - } - - /// Inserts an event to the entity. - /// - /// If the entity already has this event, - /// the event is overwritten. - pub fn insert_event(&self, event: T) { - let host_component = T::host_component(); - let bytes = event.to_cow_bytes(); - - unsafe { - quill_sys::entity_add_event( - self.id.0, - host_component, - bytes.as_ptr().into(), - bytes.len() as u32, - ); - } - } - - /// Sends the given message to this entity. - /// - /// The message sends as a "system" message. - /// See [the wiki](https://wiki.vg/Chat) for more details. - pub fn send_message(&self, message: impl Into) { - let message = message.into().to_string(); - unsafe { - quill_sys::entity_send_message(self.id.0, message.as_ptr().into(), message.len() as u32) - } - } - - /// Sends the given title to this entity. - pub fn send_title(&self, title: &libcraft_text::Title) { - let title = serde_json::to_string(title).expect("failed to serialize Title"); - unsafe { - quill_sys::entity_send_title(self.id.0, title.as_ptr().into(), title.len() as u32); - } - } - - /// Hides the currently visible title for this entity, will do nothing if the there's no title - pub fn hide_title(&self) { - self.send_title(&libcraft_text::title::Title::HIDE); - } - - /// Resets the currently visible title for this entity, will do nothing if there's no title - pub fn reset_title(&self) { - self.send_title(&libcraft_text::title::Title::RESET) - } - - /// Gets the unique ID of this entity. - pub fn id(&self) -> EntityId { - self.id - } -} diff --git a/quill/api/src/entity_builder.rs b/quill/api/src/entity_builder.rs deleted file mode 100644 index 7bafbe909..000000000 --- a/quill/api/src/entity_builder.rs +++ /dev/null @@ -1,62 +0,0 @@ -use std::marker::PhantomData; - -use quill_common::Component; - -use crate::{Entity, EntityId}; - -/// Builder for an entity. -/// -/// Created via [`Game::create_entity_builder`](crate::Game::create_entity_builder). -/// -/// Add components to the entity with [`EntityBuilder::add`]. -/// Finish building the entity with [`EntityBuilder::finish`]. -#[derive(Debug)] -pub struct EntityBuilder { - id: u32, - _not_send_sync: PhantomData<*mut ()>, -} - -impl EntityBuilder { - pub(crate) fn new(id: u32) -> Self { - Self { - id, - _not_send_sync: PhantomData, - } - } - - /// Adds a component to the entity. - /// - /// If the builder already has this component, - /// it is overriden. - pub fn add(&mut self, component: T) -> &mut Self { - let host_component = T::host_component(); - let bytes = component.to_cow_bytes(); - unsafe { - quill_sys::entity_builder_add_component( - self.id, - host_component, - bytes.as_ptr().into(), - bytes.len() as u32, - ); - } - self - } - - /// Adds a component to the entity and returns - /// `self` for method chaining. - /// - /// If the builder already has this component, - /// it is override. - pub fn with(mut self, component: T) -> Self { - self.add(component); - self - } - - /// Finishes building the entity and spawns it. - /// - /// Returns the built entity. - pub fn finish(self) -> Entity { - let id = unsafe { quill_sys::entity_builder_finish(self.id) }; - Entity::new(EntityId(id)) - } -} diff --git a/quill/api/src/game.rs b/quill/api/src/game.rs deleted file mode 100644 index 7fd5657c8..000000000 --- a/quill/api/src/game.rs +++ /dev/null @@ -1,289 +0,0 @@ -use std::marker::PhantomData; - -use libcraft_blocks::BlockState; -use libcraft_core::{BlockPosition, ChunkPosition, Position, CHUNK_HEIGHT}; -use libcraft_particles::Particle; -use quill_common::entity_init::EntityInit; -use quill_common::Component; - -use crate::{ - query::{Query, QueryIter}, - EntityBuilder, -}; -use crate::{Entity, EntityId}; - -/// Error returned when getting or setting a block fails. -#[derive(Debug, thiserror::Error)] -pub enum BlockAccessError { - #[error("the block's Y coordinate is outside the range [0, 256)")] - YOutOfBounds, - #[error("the block's chunk is not loaded")] - ChunkNotLoaded, -} - -/// Error returned from [`Game::entity`] if the entity -/// did not exist. -#[derive(Debug, thiserror::Error)] -#[error("entity no longer exists - they either died or were unloaded")] -pub struct EntityRemoved; - -/// Provides access to the server's game state for a single world. -/// -/// Includes entities, blocks, chunks, etc. All interaction with -/// the game happens through this struct. -/// -/// A `Game` is passed to systems when they run. -#[derive(Debug)] -pub struct Game { - _not_send_sync: PhantomData<*mut ()>, -} - -impl Game { - /// For Quill internal use only. Do not call. - #[doc(hidden)] - #[allow(clippy::new_without_default)] - pub fn new() -> Self { - Self { - _not_send_sync: PhantomData, - } - } - - /// Gets an [`Entity`] from its [`EntityId`]. - /// - /// Returns `None` if the entity no longer exists. This - /// could be the case if: - /// * The entity has been unloaded (and possibly saved to disk) - /// * The entity has died - pub fn entity(&self, id: EntityId) -> Result { - unsafe { - if !quill_sys::entity_exists(id.0) { - return Err(EntityRemoved); - } - } - Ok(Entity::new(id)) - } - - /// Creates an empty [`EntityBuilder`](crate::EntityBuilder) - /// to add entities to the ecs. - /// - /// The builder isn initialised without any components. - pub fn create_empty_entity_builder(&self) -> EntityBuilder { - let id = unsafe { quill_sys::entity_builder_new_empty() }; - - EntityBuilder::new(id) - } - - /// Creates an [`EntityBuilder`](crate::EntityBuilder) - /// to spawn an entity at the given position. - /// - /// The builder is initialized with the default components - /// for the given `EntityInit`. The default components - /// include (at least): - /// * Position` - /// * `Uuid` - /// * `EntityType` - /// * `Velocity` (set to zero) - /// * the marker component for this entity - #[must_use = "call `finish` on an EntityBuilder to spawn the entity"] - pub fn create_entity_builder(&self, position: Position, entity: EntityInit) -> EntityBuilder { - let entity_init = bincode::serialize(&entity).expect("failed to serialize EntityInit"); - let position: &[u8] = bytemuck::cast_slice(std::slice::from_ref(&position)); - let id = unsafe { - quill_sys::entity_builder_new( - position.as_ptr().into(), - entity_init.as_ptr().into(), - entity_init.len() as u32, - ) - }; - EntityBuilder::new(id) - } - - /// Returns an iterator over all entities - /// with the given components. - /// - /// # Example - /// Iterate over all entities with positions and UUIDs: - /// ```no_run - /// use quill::{Position, Uuid}; - /// # let game: quill::Game = todo!(); - /// for (entity, (position, uuid)) in game.query::<(&Position, &Uuid)>() { - /// println!("Found an entity with position {:?} and UUID {}", position, uuid); - /// } - /// ``` - pub fn query(&mut self) -> QueryIter { - QueryIter::new() - } - - /// Spawn a particle effect at the position - /// - /// # Example - /// Spawn a flame particle at 0, 0, 0: - /// ```no_run - /// # let game: quill::Game = unreachable!(); - /// use quill::{Position, Particle, ParticleKind}; - /// - /// let position = Position {x: 0.0, y: 0.0, z: 0.0, pitch: 0.0, yaw: 0.0}; - /// let particle = Particle { - /// kind: ParticleKind::Flame, - /// offset_x: 0.0, - /// offset_y: 0.0, - /// offset_z: 0.0, - /// count: 1, - /// }; - /// - /// game.spawn_particle(position, particle); - /// ``` - pub fn spawn_particle(&self, position: Position, particle: Particle) { - let mut entity_builder = self.create_empty_entity_builder(); - - entity_builder.add(position); - entity_builder.add(particle); - entity_builder.finish(); - } - - /// Gets the block at `pos`. - /// - /// This function returns an error if the block's - /// chunk is not loaded. Unlike in Bukkit, calling this method - /// will not cause chunks to be loaded. - /// - /// Mutating the returned [`BlockState`](libcraft_blocks::BlockState) - /// will _not_ cause the block to be modified in the world. In other - /// words, the `BlockState` is a copy, not a reference. To update - /// the block, call [`Game::set_block`]. - pub fn block(&self, pos: BlockPosition) -> Result { - check_y_bound(pos)?; - - let result = unsafe { quill_sys::block_get(pos.x, pos.y, pos.z) }; - - result - .get() - .ok_or(BlockAccessError::ChunkNotLoaded) - .map(|block_id| BlockState::from_id(block_id).expect("host gave invalid block ID")) - } - - /// Sets the block at `pos`. - /// - /// This function returns an error if the block's - /// chunk is not loaded. Unlike in Bukkit, calling this method - /// will not cause chunks to be loaded. - pub fn set_block(&self, pos: BlockPosition, block: BlockState) -> Result<(), BlockAccessError> { - check_y_bound(pos)?; - - let was_successful = unsafe { quill_sys::block_set(pos.x, pos.y, pos.z, block.id()) }; - - if was_successful { - Ok(()) - } else { - Err(BlockAccessError::ChunkNotLoaded) - } - } - - /// Efficiently overwrites all blocks in the given chunk section (16x16x16 blocks). - /// - /// All blocks in the chunk section are replaced with `block`. - /// - /// This function returns an error if the block's - /// chunk is not loaded. Unlike in Bukkit, calling this method - /// will not cause chunks to be loaded. - pub fn fill_chunk_section( - &self, - chunk: ChunkPosition, - section_y: u32, - block: BlockState, - ) -> Result<(), BlockAccessError> { - check_section_y(section_y)?; - - let block_id = block.id(); - let was_successful = - unsafe { quill_sys::block_fill_chunk_section(chunk.x, section_y, chunk.z, block_id) }; - - if was_successful { - Ok(()) - } else { - Err(BlockAccessError::ChunkNotLoaded) - } - } - - /// Sends a custom packet to an entity. - pub fn send_plugin_message(entity: EntityId, channel: &str, data: &[u8]) { - let channel_ptr = channel.as_ptr().into(); - let data_ptr = data.as_ptr().into(); - unsafe { - quill_sys::plugin_message_send( - entity.0, - channel_ptr, - channel.len() as u32, - data_ptr, - data.len() as u32, - ) - } - } - - /// Inserts an event to the world. - pub fn insert_event(&self, event: T) { - let host_component = T::host_component(); - let bytes = event.to_cow_bytes(); - - unsafe { - quill_sys::add_event(host_component, bytes.as_ptr().into(), bytes.len() as u32); - } - } -} - -fn check_y_bound(pos: BlockPosition) -> Result<(), BlockAccessError> { - if pos.y < 0 || pos.y >= CHUNK_HEIGHT as i32 { - Err(BlockAccessError::YOutOfBounds) - } else { - Ok(()) - } -} - -fn check_section_y(section_y: u32) -> Result<(), BlockAccessError> { - if section_y >= 16 { - Err(BlockAccessError::YOutOfBounds) - } else { - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn check_y_bound_in_bounds() { - assert!(check_y_bound(BlockPosition::new(0, 0, 0)).is_ok()); - assert!(check_y_bound(BlockPosition::new(0, 255, 0)).is_ok()); - } - - #[test] - fn check_y_bound_out_of_bounds() { - assert!(matches!( - check_y_bound(BlockPosition::new(0, -1, 0)), - Err(BlockAccessError::YOutOfBounds) - )); - assert!(matches!( - check_y_bound(BlockPosition::new(0, 256, 0)), - Err(BlockAccessError::YOutOfBounds) - )); - } - - #[test] - fn check_section_y_in_bounds() { - assert!(check_section_y(0).is_ok()); - assert!(check_section_y(15).is_ok()); - } - - #[test] - fn check_section_y_out_of_bounds() { - assert!(matches!( - check_section_y(16), - Err(BlockAccessError::YOutOfBounds) - )); - assert!(matches!( - check_section_y(u32::MAX), - Err(BlockAccessError::YOutOfBounds) - )); - } -} diff --git a/quill/api/src/lib.rs b/quill/api/src/lib.rs deleted file mode 100644 index 3334382ad..000000000 --- a/quill/api/src/lib.rs +++ /dev/null @@ -1,59 +0,0 @@ -//! A WebAssembly-based plugin API for Minecraft servers. - -pub mod entities; -mod entity; -mod entity_builder; -mod game; -pub mod query; -mod setup; - -pub use entity::{Entity, EntityId}; -pub use entity_builder::EntityBuilder; -pub use game::Game; -pub use setup::Setup; - -#[doc(inline)] -pub use libcraft_blocks::{BlockKind, BlockState}; -#[doc(inline)] -pub use libcraft_core::{BlockPosition, ChunkPosition, Gamemode, Position}; -#[doc(inline)] -pub use libcraft_particles::{Particle, ParticleKind}; -#[doc(inline)] -pub use libcraft_text::*; - -#[doc(inline)] -pub use quill_common::{components, entity_init::EntityInit, events, Component}; -#[doc(inline)] -pub use uuid::Uuid; - -// Needed for macros -#[doc(hidden)] -pub extern crate bincode; -#[doc(hidden)] -pub extern crate quill_sys as sys; - -pub use plugin_macro::plugin; - -/// Implement this trait for your plugin's struct. -pub trait Plugin: Sized { - /// Invoked when the plugin is enabled. - /// - /// Here, you should register systems and initialize - /// any plugin state. - /// - /// # Warning - /// This function is called when your plugin _enabled_. That - /// is not guaranteed to coincide with the time the server starts - /// up. Do not assume that the server has just started when - /// this method is called. - fn enable(game: &mut Game, setup: &mut Setup) -> Self; - - /// Invoked before the plugin is disabled. - /// - /// # Warning - /// Like [`Plugin::enable`], this method is not necessarily called - /// when the server shuts down. Users may choose to disable - /// plugins at another time. Therefore, do not assume that - /// the server is shutting down when this method is called. - fn disable(self, game: &mut Game); -} diff --git a/quill/api/src/query.rs b/quill/api/src/query.rs deleted file mode 100644 index 3602c25cc..000000000 --- a/quill/api/src/query.rs +++ /dev/null @@ -1,271 +0,0 @@ -//! Query for all entities with a certain set of components. - -use std::{ - marker::PhantomData, - mem::MaybeUninit, - ops::{Deref, DerefMut}, -}; - -use quill_common::{entity::QueryData, Component, HostComponent, PointerMut}; - -use itertools::Itertools; - -use crate::{Entity, EntityId}; - -/// A type that can be used for a query. -/// -/// Implemented for tuples of `Query`s as well. -pub trait Query { - type Item; - type Target; - - fn add_component_types(types: &mut Vec); - - fn borrowed_mut(ty: HostComponent) -> bool; - - /// # Safety - /// `component_index` must be a valid index less - /// than the number of entities in the query data. - /// - /// `component_offsets` must contain the proper byte offset - /// of the current component index. - unsafe fn get_unchecked( - data: &QueryData, - component_index: &mut usize, - component_offsets: &mut [usize], - entity: Entity, - ) -> Self::Target; -} - -impl<'a, T> Query for &'a T -where - T: Component, - [T]: ToOwned, -{ - type Item = T; - type Target = T; - - fn add_component_types(types: &mut Vec) { - types.push(T::host_component()); - } - - fn borrowed_mut(_: HostComponent) -> bool { - false - } - - unsafe fn get_unchecked( - data: &QueryData, - component_index: &mut usize, - component_offsets: &mut [usize], - _: Entity, - ) -> Self::Target { - let component_len = *((data.component_lens.as_mut_ptr()).add(*component_index)) as usize; - let component_ptr = - (*(data.component_ptrs.as_mut_ptr().add(*component_index))).as_mut_ptr(); - - let offset = component_offsets[*component_index]; - let component_ptr = component_ptr.add(offset); - let component_len = component_len - offset; - - let component_bytes = std::slice::from_raw_parts(component_ptr, component_len); - let (value, advance) = T::from_bytes_unchecked(component_bytes); - - component_offsets[*component_index] += advance; - - *component_index += 1; - - value - } -} - -impl<'a, T> Query for &'a mut T -where - T: Component, - [T]: ToOwned, -{ - type Item = T; - type Target = Mut; - - fn add_component_types(types: &mut Vec) { - types.push(T::host_component()); - } - - fn borrowed_mut(ty: HostComponent) -> bool { - ty == T::host_component() - } - - unsafe fn get_unchecked( - data: &QueryData, - component_index: &mut usize, - component_offsets: &mut [usize], - entity: Entity, - ) -> Self::Target { - let component_len = *((data.component_lens.as_mut_ptr()).add(*component_index)) as usize; - let component_ptr = - (*(data.component_ptrs.as_mut_ptr().add(*component_index))).as_mut_ptr(); - - let offset = component_offsets[*component_index]; - let component_ptr = component_ptr.add(offset); - let component_len = component_len - offset; - - let component_bytes = std::slice::from_raw_parts(component_ptr, component_len); - let (value, advance) = T::from_bytes_unchecked(component_bytes); - - component_offsets[*component_index] += advance; - - *component_index += 1; - - Mut(value, entity) - } -} - -macro_rules! impl_query_tuple { - ($($query:ident),* $(,)?) => { - impl <$($query: Query),*> Query for ($($query,)*) { - type Item = ($($query::Item),*); - type Target = ($($query::Target),*); - - fn borrowed_mut(ty: HostComponent) -> bool { - $(if $query::borrowed_mut(ty) { return true; })* - - return false; - } - - fn add_component_types(types: &mut Vec) { - $( - $query::add_component_types(types); - )* - } - - unsafe fn get_unchecked(data: &QueryData, component_index: &mut usize, component_offsets: &mut [usize], entity: Entity) -> Self::Target { - ( - $( - $query::get_unchecked(data, component_index, component_offsets, Entity::new(entity.id())) - ),* - ) - } - } - } -} - -impl_query_tuple!(A, B); -impl_query_tuple!(A, B, C); -impl_query_tuple!(A, B, C, D); -impl_query_tuple!(A, B, C, D, E); -impl_query_tuple!(A, B, C, D, E, F); -impl_query_tuple!(A, B, C, D, E, F, G); -impl_query_tuple!(A, B, C, D, E, F, G, H); -impl_query_tuple!(A, B, C, D, E, F, G, H, I); -impl_query_tuple!(A, B, C, D, E, F, G, H, I, J); -impl_query_tuple!(A, B, C, D, E, F, G, H, I, J, K); -impl_query_tuple!(A, B, C, D, E, F, G, H, I, J, K, L); -impl_query_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M); - -/// An iterator over all entities matching a query. -pub struct QueryIter { - data: QueryData, - entity_index: usize, - component_offsets: Vec, - _marker: PhantomData, -} - -impl QueryIter -where - Q: Query, -{ - pub(crate) fn new() -> Self { - let mut component_types = Vec::new(); - Q::add_component_types(&mut component_types); - - for (component_type, count) in component_types.clone().into_iter().counts() { - if count > 1 && Q::borrowed_mut(component_type) { - panic!( - "{:?} was borrowed mutably and immutably at the same time", - component_type - ) - } - } - - let mut data = MaybeUninit::uninit(); - let data = unsafe { - quill_sys::entity_query( - component_types.as_ptr().into(), - component_types.len() as u32, - PointerMut::new(&mut data), - ); - // SAFETY: `entity_query` initializes `query_data`. - data.assume_init() - }; - - let component_offsets = vec![0; component_types.len()]; - - Self { - data, - entity_index: 0, - component_offsets, - _marker: PhantomData, - } - } -} - -impl Iterator for QueryIter -where - Q: Query, -{ - type Item = (Entity, Q::Target); - - fn next(&mut self) -> Option { - if self.entity_index >= self.data.num_entities as usize { - return None; - } - - let entity_id = unsafe { *(self.data.entities_ptr.as_mut_ptr()).add(self.entity_index) }; - let entity = Entity::new(EntityId(entity_id)); - - let components = unsafe { - let mut component_index = 0; - Q::get_unchecked( - &self.data, - &mut component_index, - &mut self.component_offsets, - Entity::new(entity.id()), - ) - }; - - self.entity_index += 1; - - Some((entity, components)) - } -} - -pub struct Mut(T, Entity); - -impl Deref for Mut { - type Target = T; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for Mut { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl std::ops::Drop for Mut { - fn drop(&mut self) { - let host_component = T::host_component(); - let bytes = self.0.to_cow_bytes(); - - unsafe { - quill_sys::entity_set_component( - self.1.id().0, - host_component, - bytes.as_ptr().into(), - bytes.len() as u32, - ); - } - } -} diff --git a/quill/api/src/setup.rs b/quill/api/src/setup.rs deleted file mode 100644 index 0b555b25f..000000000 --- a/quill/api/src/setup.rs +++ /dev/null @@ -1,39 +0,0 @@ -use std::marker::PhantomData; - -use crate::Game; - -/// Struct passed to your plugin's `enable()` function. -/// -/// Allows you to register systems, etc. -pub struct Setup { - _marker: PhantomData, -} - -impl Setup { - /// For Quill internal use only. Do not call. - #[doc(hidden)] - #[allow(clippy::new_without_default)] - pub fn new() -> Self { - Self { - _marker: PhantomData, - } - } - - /// Registers a function as system to be invoked - /// every tick. - /// - /// The function should take as parameters your - /// plugin instance and an `&mut Game` and return nothing. - pub fn add_system(&mut self, system: T) -> &mut Self { - let system: Box = Box::new(system); - let system_data = Box::leak(Box::new(system)) as *mut Box<_> as *mut u8; - - let name = std::any::type_name::(); - - unsafe { - quill_sys::register_system(system_data.into(), name.as_ptr().into(), name.len() as u32); - } - - self - } -} diff --git a/quill/cargo-quill/Cargo.toml b/quill/cargo-quill/Cargo.toml deleted file mode 100644 index c2c0ff565..000000000 --- a/quill/cargo-quill/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "cargo-quill" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -quill-plugin-format = { path = "../plugin-format" } -cargo_metadata = "0.12" -anyhow = "1" -argh = "0.1" -heck = "0.3" diff --git a/quill/cargo-quill/src/main.rs b/quill/cargo-quill/src/main.rs deleted file mode 100644 index 404c76118..000000000 --- a/quill/cargo-quill/src/main.rs +++ /dev/null @@ -1,185 +0,0 @@ -use anyhow::{bail, Context}; -use argh::FromArgs; -use cargo_metadata::Metadata; -use heck::CamelCase; -use quill_plugin_format::{PluginFile, PluginMetadata, PluginTarget, Triple}; -use std::{ - fs, - path::PathBuf, - process::{Command, Stdio}, -}; - -const WASM_TARGET_FEATURES: &str = "target-feature=+bulk-memory,+mutable-globals,+simd128"; -const WASM_TARGET: &str = "wasm32-wasi"; - -#[derive(Debug, FromArgs)] -/// Cargo subcommand to build and test Quill/Feather plugins. -struct CargoQuill { - #[argh(subcommand)] - subcommand: Subcommand, -} - -#[derive(Debug, FromArgs)] -#[argh(subcommand)] -enum Subcommand { - Build(Build), -} - -#[derive(Debug, FromArgs)] -#[argh(subcommand, name = "build")] -/// Build a Quill plugin. -struct Build { - #[argh(switch)] - /// whether to build in release mode - release: bool, - #[argh(switch)] - /// whether to compile to a native shared library - /// instead of a WebAssembly module - native: bool, - #[argh(option, default = "6")] - /// the compression level to compress the plugin - /// binary. 0 is worst and 9 is best. - compression_level: u32, -} - -impl Build { - pub fn module_extension(&self) -> &'static str { - if !self.native { - "wasm" - } else if cfg!(windows) { - "dll" - } else if cfg!(target_vendor = "apple") { - "dylib" - } else { - // assume Linux / other Unix - "so" - } - } - - pub fn target_dir(&self, cargo_meta: &Metadata) -> PathBuf { - let mut target_dir = cargo_meta.target_directory.clone(); - if !self.native { - target_dir.push(WASM_TARGET); - } - - if self.release { - target_dir.push("release"); - } else { - target_dir.push("debug"); - } - - target_dir - } - - pub fn module_path(&self, cargo_meta: &Metadata, plugin_meta: &PluginMetadata) -> PathBuf { - let target_dir = self.target_dir(cargo_meta); - let module_filename = plugin_meta.identifier.replace('-', "_"); - - let module_extension = self.module_extension(); - let lib_prefix = if self.native && cfg!(unix) { "lib" } else { "" }; - - target_dir.join(format!( - "{}{}.{}", - lib_prefix, module_filename, module_extension - )) - } -} - -fn main() -> anyhow::Result<()> { - let args: CargoQuill = argh::from_env(); - match args.subcommand { - Subcommand::Build(args) => build(args), - } -} - -fn build(args: Build) -> anyhow::Result<()> { - let cargo_meta = get_cargo_metadata()?; - validate_cargo_metadata(&cargo_meta)?; - - let mut command = cargo_build_command(&args); - let status = command.spawn()?.wait()?; - if !status.success() { - bail!("build failed"); - } - - let meta = find_metadata(&cargo_meta, &args)?; - let module_path = args.module_path(&cargo_meta, &meta); - let module = fs::read(&module_path) - .with_context(|| format!("failed to read {}", module_path.display()))?; - - let file = PluginFile::new(module, meta.clone()); - let target_path = module_path - .parent() - .unwrap() - .join(format!("{}.plugin", meta.identifier)); - fs::write(&target_path, file.encode(args.compression_level))?; - - println!("Wrote plugin file to {}", target_path.display()); - Ok(()) -} - -fn cargo_build_command(args: &Build) -> Command { - let mut cmd = Command::new("cargo"); - cmd.arg("rustc"); - if args.release { - cmd.arg("--release"); - } - - if !args.native { - cmd.args(&["--target", WASM_TARGET]); - cmd.args(&["--", "-C", WASM_TARGET_FEATURES]); - } - - cmd.stdout(Stdio::piped()); - - cmd -} - -fn get_cargo_metadata() -> anyhow::Result { - let cmd = cargo_metadata::MetadataCommand::new(); - let cargo_meta = cmd.exec()?; - Ok(cargo_meta) -} - -fn validate_cargo_metadata(cargo_meta: &Metadata) -> anyhow::Result<()> { - let package = cargo_meta.root_package().context("missing root package")?; - if !package - .targets - .iter() - .any(|t| t.crate_types.contains(&"cdylib".to_owned())) - { - bail!("crate-type = [\"cdylib\"] must be set in the plugin Cargo.toml"); - } - - Ok(()) -} - -fn find_metadata(cargo_meta: &Metadata, args: &Build) -> anyhow::Result { - let package = cargo_meta.root_package().context("missing root package")?; - - let quill_dependency = package - .dependencies - .iter() - .find(|d| d.name == "quill") - .context("plugin does not depend on the `quill` crate")?; - - let target = if args.native { - PluginTarget::Native { - target_triple: Triple::host(), - } - } else { - PluginTarget::Wasm - }; - - let plugin_meta = PluginMetadata { - name: package.name.to_camel_case(), - identifier: package.name.clone(), - version: package.version.to_string(), - api_version: quill_dependency.req.to_string(), - description: package.description.clone(), - authors: package.authors.clone(), - target, - }; - - Ok(plugin_meta) -} diff --git a/quill/common/Cargo.toml b/quill/common/Cargo.toml deleted file mode 100644 index a01736a76..000000000 --- a/quill/common/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "quill-common" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -bincode = "1" -bytemuck = { version = "1", features = ["derive"] } -derive_more = "0.99.16" -libcraft-core = { path = "../../libcraft/core" } -libcraft-particles = { path = "../../libcraft/particles" } -libcraft-text = { path = "../../libcraft/text" } -serde = { version = "1", features = ["derive"] } -smartstring = { version = "0.2", features = ["serde"] } -uuid = { version = "0.8", features = ["serde"] } - -[dev-dependencies] -quill = { path = "../api" } diff --git a/quill/common/src/block.rs b/quill/common/src/block.rs deleted file mode 100644 index b997ff5e8..000000000 --- a/quill/common/src/block.rs +++ /dev/null @@ -1,49 +0,0 @@ -/// Returned from `block_get`. -/// -/// This is an FFI-safe representation of `Option`. -#[repr(transparent)] -pub struct BlockGetResult(u32); - -impl BlockGetResult { - pub fn new(block_id: Option) -> Self { - let tag = block_id.is_some() as u32; - let value = (tag << 16) | block_id.unwrap_or_default() as u32; - Self(value) - } - - /// Gets the ID of the block. - pub fn get(self) -> Option { - if self.0 >> 16 == 0 { - None - } else { - Some(self.0 as u16) - } - } - - pub fn to_u32(&self) -> u32 { - self.0 - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn block_get_result_some() { - let result = BlockGetResult::new(Some(311)); - assert_eq!(result.get(), Some(311)); - } - - #[test] - fn block_get_result_some_all_bits_set() { - let result = BlockGetResult::new(Some(u16::MAX)); - assert_eq!(result.get(), Some(u16::MAX)); - } - - #[test] - fn block_get_result_none() { - let result = BlockGetResult::new(None); - assert_eq!(result.get(), None); - } -} diff --git a/quill/common/src/component.rs b/quill/common/src/component.rs deleted file mode 100644 index 11e4c4651..000000000 --- a/quill/common/src/component.rs +++ /dev/null @@ -1,379 +0,0 @@ -//! Defines the components available to Quill plugins. - -use std::{any::TypeId, borrow::Cow as CloneOnWrite}; - -use libcraft_core::{Gamemode, Position}; -use libcraft_particles::Particle; -use uuid::Uuid; - -use crate::components::*; -use crate::entities::*; -use crate::events::*; - -/// Used to convert dynamic `HostComponent`s to -/// statically-typed generic `T`s. -/// -/// Use with [`HostComponent::visit`]. -pub trait ComponentVisitor { - fn visit(self) -> R; -} - -/// Generates the [`HostComponent`] enum. -/// -/// Adds a method `type_id` that returns the TypeId -/// of the component's type. This is used on the -/// host to construct queries. -macro_rules! host_component_enum { - ( - $(#[$outer:meta])* - pub enum $ident:ident { - $( - $component:ident = $x:literal - ),* $(,)? - } - ) => { - c_enum! { - $(#[$outer])* - pub enum $ident { - $($component = $x,)* - } - } - - impl $ident { - pub fn type_id(self) -> TypeId { - match self { - $(Self::$component => TypeId::of::<$component>(),)* - } - } - - /// Invokes a `ComponentVisitor`'s `visit` - /// method where the type `T` is the type of this component. - pub fn visit(self, visitor: impl ComponentVisitor) -> R { - match self { - $(Self::$component => visitor.visit::<$component>(),)* - } - } - } - } -} - -host_component_enum! { - /// A component that is stored on the host - /// and accessible from plugins. - pub enum HostComponent { - // `Pod` components - Position = 0, - - // Entity marker components - AreaEffectCloud = 100, - ArmorStand = 101, - Arrow = 102, - Bat = 103, - Bee = 104, - Blaze = 105, - Boat = 106, - Cat = 107, - CaveSpider = 108, - Chicken = 109, - Cod = 110, - Cow = 111, - Creeper = 112, - Dolphin = 113, - Donkey = 114, - DragonFireball = 115, - Drowned = 116, - ElderGuardian = 117, - EndCrystal = 118, - EnderDragon = 119, - Enderman = 120, - Endermite = 121, - Evoker = 122, - EvokerFangs = 123, - ExperienceOrb = 124, - EyeOfEnder = 125, - FallingBlock = 126, - FireworkRocket = 127, - Fox = 128, - Ghast = 129, - Giant = 130, - Guardian = 131, - Hoglin = 132, - Horse = 133, - Husk = 134, - Illusioner = 135, - IronGolem = 136, - Item = 137, - ItemFrame = 138, - Fireball = 139, - LeashKnot = 140, - LightningBolt = 141, - Llama = 142, - LlamaSpit = 143, - MagmaCube = 144, - Minecart = 145, - ChestMinecart = 146, - CommandBlockMinecart = 147, - FurnaceMinecart = 148, - HopperMinecart = 149, - SpawnerMinecart = 150, - TntMinecart = 151, - Mule = 152, - Mooshroom = 153, - Ocelot = 154, - Painting = 155, - Panda = 156, - Parrot = 157, - Phantom = 158, - Pig = 159, - Piglin = 160, - Pillager = 161, - PolarBear = 162, - Tnt = 163, - Pufferfish = 164, - Rabbit = 165, - Ravager = 166, - Salmon = 167, - Sheep = 168, - Shulker = 169, - ShulkerBullet = 170, - Silverfish = 171, - Skeleton = 172, - SkeletonHorse = 173, - Slime = 174, - SmallFireball = 175, - SnowGolem = 176, - Snowball = 177, - SpectralArrow = 178, - Spider = 179, - Squid = 180, - Stray = 181, - Strider = 182, - Egg = 183, - EnderPearl = 184, - ExperienceBottle = 185, - Potion = 186, - Trident = 187, - TraderLlama = 188, - TropicalFish = 189, - Turtle = 190, - Vex = 191, - Villager = 192, - Vindicator = 193, - WanderingTrader = 194, - Witch = 195, - Wither = 196, - WitherSkeleton = 197, - WitherSkull = 198, - Wolf = 199, - Zoglin = 200, - Zombie = 201, - ZombieHorse = 202, - ZombieVillager = 203, - ZombifiedPiglin = 204, - Player = 205, - FishingBobber = 206, - PiglinBrute = 207, - - // `bincode` components - Gamemode = 1000, - Uuid = 1001, - OnGround = 1002, - Name = 1003, - CustomName = 1004, - Particle = 1005, - InteractEntityEvent = 1006, - BlockPlacementEvent = 1007, - BlockInteractEvent = 1008, - CreativeFlying = 1009, - CreativeFlyingEvent = 1010, - Sneaking = 1011, - SneakEvent = 1012, - Sprinting = 1013, - SprintEvent = 1014, - PreviousGamemode = 1015, - Health = 1016, - WalkSpeed = 1017, - CreativeFlyingSpeed = 1018, - CanCreativeFly = 1019, - CanBuild = 1020, - Instabreak = 1021, - Invulnerable = 1022, - PlayerJoinEvent = 1023, - EntityRemoveEvent = 1024, - EntityCreateEvent = 1025, - GamemodeEvent = 1026, - InstabreakEvent = 1027, - FlyingAbilityEvent = 1028, - BuildingAbilityEvent = 1029, - InvulnerabilityEvent = 1030, - } -} - -/// How a component will be serialized. -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum SerializationMethod { - /// Copy raw bytes with `bytemuck`. - Bytemuck, - /// Serialize into a `Vec` with `bincode. - Bincode, -} - -/// A type that can be used as a component. -/// -/// # Safety -/// [`Component::from_bytes`] must return `Some(_)` if given -/// any byte slice returned by [`Component::to_bytes`]. A violation -/// if this contract may result in undefined behavior -/// on the plugin side. -pub unsafe trait Component: Send + Sync + Sized + 'static { - /// How this component will be serialized. - const SERIALIZATION_METHOD: SerializationMethod; - - /// Returns the [`HostComponent`] corresponding to this - /// component. - /// - /// # Contract - /// A sound implementation of this method _must_ - /// return the `HostComponent` corresponding to - /// this type. - fn host_component() -> HostComponent; - - /// Serializes this component to bytes suitable - /// for deserialization by `from_bytes`. - /// - /// Should panic if `Self::SERIALIZATION_METHOD == SerializationMethod::Bytemuck`. - fn to_bytes(&self, target: &mut Vec); - - /// Gets this component as a byte slice. - /// - /// Should panic if `Self::SERIALIZATION_METHOD != SerializationMethod::Bytemuck`. - fn as_bytes(&self) -> &[u8]; - - /// Deserializes this component from bytes - /// returned by [`Component::to_bytes`]. - /// - /// Returns the number of bytes used to deserialize - /// `self`. `bytes` may have a greater length than is needed. - /// - /// # Contract - /// A sound implementation of this method _must_ - /// return `Some(_)` for all values of `bytes` - /// that can be returned by `Self::to_bytes`. - fn from_bytes(bytes: &[u8]) -> Option<(Self, usize)>; - - /// Deserializes this component from bytes returned by [`Component::to_bytes`] - /// without validating correctness. - /// - /// The default implementation of this method calls [`Self::from_bytes`] - /// and then performs an unchecked unwrap. - /// - /// # Safety - /// Behavior is undefined if `bytes` was not previously - /// returned from a call to `Self::to_bytes`. - unsafe fn from_bytes_unchecked(bytes: &[u8]) -> (Self, usize) { - // Do an unchecked unwrap of `from_bytes`. - // This should cause the optimizer to - // remove safety checks in `bincode`, - // which may improve performance on the plugin side. - match Self::from_bytes(bytes) { - Some(this) => this, - None => std::hint::unreachable_unchecked(), - } - } - - /// Serializes `self` into bytes using - /// the appropriate `SerializationMethod`. - fn to_cow_bytes(&self) -> CloneOnWrite<[u8]> { - match Self::SERIALIZATION_METHOD { - SerializationMethod::Bytemuck => CloneOnWrite::Borrowed(self.as_bytes()), - SerializationMethod::Bincode => { - let mut buffer = Vec::new(); - self.to_bytes(&mut buffer); - CloneOnWrite::Owned(buffer) - } - } - } -} - -macro_rules! pod_component_impl { - ($type:ident) => { - unsafe impl crate::component::Component for $type { - const SERIALIZATION_METHOD: crate::component::SerializationMethod = - crate::component::SerializationMethod::Bytemuck; - - fn host_component() -> crate::component::HostComponent { - crate::component::HostComponent::$type - } - - fn to_bytes(&self, _target: &mut Vec) { - unreachable!() - } - - fn as_bytes(&self) -> &[u8] { - bytemuck::cast_slice(std::slice::from_ref(self)) - } - - fn from_bytes(bytes: &[u8]) -> Option<(Self, usize)> { - let this = bytemuck::try_from_bytes(&bytes[..std::mem::size_of::()]) - .ok() - .copied()?; - Some((this, std::mem::size_of::())) - } - } - }; -} - -pod_component_impl!(Position); - -/** -If you are using this macro and you get the error: -``` - error[E0599]: no variant or associated item named `...` found for enum `HostComponent` in the current scope. -``` -Then you need to go to the top of the file were this macro is defined. There you find the HostCompoent enum, that -you need to add your component to. -*/ -macro_rules! bincode_component_impl { - ($type:ident) => { - unsafe impl crate::Component for $type { - const SERIALIZATION_METHOD: crate::component::SerializationMethod = - crate::component::SerializationMethod::Bincode; - - fn host_component() -> crate::component::HostComponent { - crate::component::HostComponent::$type - } - - fn to_bytes(&self, target: &mut Vec) { - bincode::serialize_into(target, self).expect("failed to serialize component"); - } - - fn as_bytes(&self) -> &[u8] { - unreachable!() - } - - fn from_bytes(bytes: &[u8]) -> Option<(Self, usize)> { - let mut cursor = std::io::Cursor::new(bytes); - let this = bincode::deserialize_from(&mut cursor).ok()?; - Some((this, cursor.position() as usize)) - } - } - }; -} - -bincode_component_impl!(Gamemode); -bincode_component_impl!(Uuid); -bincode_component_impl!(Particle); -bincode_component_impl!(InteractEntityEvent); -bincode_component_impl!(BlockPlacementEvent); -bincode_component_impl!(BlockInteractEvent); -bincode_component_impl!(CreativeFlyingEvent); -bincode_component_impl!(SneakEvent); -bincode_component_impl!(SprintEvent); -bincode_component_impl!(PlayerJoinEvent); -bincode_component_impl!(EntityRemoveEvent); -bincode_component_impl!(EntityCreateEvent); -bincode_component_impl!(GamemodeEvent); -bincode_component_impl!(InstabreakEvent); -bincode_component_impl!(FlyingAbilityEvent); -bincode_component_impl!(BuildingAbilityEvent); -bincode_component_impl!(InvulnerabilityEvent); diff --git a/quill/common/src/entities.rs b/quill/common/src/entities.rs deleted file mode 100644 index 452be357c..000000000 --- a/quill/common/src/entities.rs +++ /dev/null @@ -1,216 +0,0 @@ -pub mod area_effect_cloud; -pub use area_effect_cloud::AreaEffectCloud; -pub mod armor_stand; -pub use armor_stand::ArmorStand; -pub mod arrow; -pub use arrow::Arrow; -pub mod bat; -pub use bat::Bat; -pub mod bee; -pub use bee::Bee; -pub mod blaze; -pub use blaze::Blaze; -pub mod boat; -pub use boat::Boat; -pub mod cat; -pub use cat::Cat; -pub mod cave_spider; -pub use cave_spider::CaveSpider; -pub mod chicken; -pub use chicken::Chicken; -pub mod cod; -pub use cod::Cod; -pub mod cow; -pub use cow::Cow; -pub mod creeper; -pub use creeper::Creeper; -pub mod dolphin; -pub use dolphin::Dolphin; -pub mod donkey; -pub use donkey::Donkey; -pub mod dragon_fireball; -pub use dragon_fireball::DragonFireball; -pub mod drowned; -pub use drowned::Drowned; -pub mod elder_guardian; -pub use elder_guardian::ElderGuardian; -pub mod end_crystal; -pub use end_crystal::EndCrystal; -pub mod ender_dragon; -pub use ender_dragon::EnderDragon; -pub mod enderman; -pub use enderman::Enderman; -pub mod endermite; -pub use endermite::Endermite; -pub mod evoker; -pub use evoker::Evoker; -pub mod evoker_fangs; -pub use evoker_fangs::EvokerFangs; -pub mod experience_orb; -pub use experience_orb::ExperienceOrb; -pub mod eye_of_ender; -pub use eye_of_ender::EyeOfEnder; -pub mod falling_block; -pub use falling_block::FallingBlock; -pub mod firework_rocket; -pub use firework_rocket::FireworkRocket; -pub mod fox; -pub use fox::Fox; -pub mod ghast; -pub use ghast::Ghast; -pub mod giant; -pub use giant::Giant; -pub mod guardian; -pub use guardian::Guardian; -pub mod hoglin; -pub use hoglin::Hoglin; -pub mod horse; -pub use horse::Horse; -pub mod husk; -pub use husk::Husk; -pub mod illusioner; -pub use illusioner::Illusioner; -pub mod iron_golem; -pub use iron_golem::IronGolem; -pub mod item; -pub use item::Item; -pub mod item_frame; -pub use item_frame::ItemFrame; -pub mod fireball; -pub use fireball::Fireball; -pub mod leash_knot; -pub use leash_knot::LeashKnot; -pub mod lightning_bolt; -pub use lightning_bolt::LightningBolt; -pub mod llama; -pub use llama::Llama; -pub mod llama_spit; -pub use llama_spit::LlamaSpit; -pub mod magma_cube; -pub use magma_cube::MagmaCube; -pub mod minecart; -pub use minecart::Minecart; -pub mod chest_minecart; -pub use chest_minecart::ChestMinecart; -pub mod command_block_minecart; -pub use command_block_minecart::CommandBlockMinecart; -pub mod furnace_minecart; -pub use furnace_minecart::FurnaceMinecart; -pub mod hopper_minecart; -pub use hopper_minecart::HopperMinecart; -pub mod spawner_minecart; -pub use spawner_minecart::SpawnerMinecart; -pub mod tnt_minecart; -pub use tnt_minecart::TntMinecart; -pub mod mule; -pub use mule::Mule; -pub mod mooshroom; -pub use mooshroom::Mooshroom; -pub mod ocelot; -pub use ocelot::Ocelot; -pub mod painting; -pub use painting::Painting; -pub mod panda; -pub use panda::Panda; -pub mod parrot; -pub use parrot::Parrot; -pub mod phantom; -pub use phantom::Phantom; -pub mod pig; -pub use pig::Pig; -pub mod piglin; -pub use piglin::Piglin; -pub mod piglin_brute; -pub use piglin_brute::PiglinBrute; -pub mod pillager; -pub use pillager::Pillager; -pub mod polar_bear; -pub use polar_bear::PolarBear; -pub mod tnt; -pub use tnt::Tnt; -pub mod pufferfish; -pub use pufferfish::Pufferfish; -pub mod rabbit; -pub use rabbit::Rabbit; -pub mod ravager; -pub use ravager::Ravager; -pub mod salmon; -pub use salmon::Salmon; -pub mod sheep; -pub use sheep::Sheep; -pub mod shulker; -pub use shulker::Shulker; -pub mod shulker_bullet; -pub use shulker_bullet::ShulkerBullet; -pub mod silverfish; -pub use silverfish::Silverfish; -pub mod skeleton; -pub use skeleton::Skeleton; -pub mod skeleton_horse; -pub use skeleton_horse::SkeletonHorse; -pub mod slime; -pub use slime::Slime; -pub mod small_fireball; -pub use small_fireball::SmallFireball; -pub mod snow_golem; -pub use snow_golem::SnowGolem; -pub mod snowball; -pub use snowball::Snowball; -pub mod spectral_arrow; -pub use spectral_arrow::SpectralArrow; -pub mod spider; -pub use spider::Spider; -pub mod squid; -pub use squid::Squid; -pub mod stray; -pub use stray::Stray; -pub mod strider; -pub use strider::Strider; -pub mod egg; -pub use egg::Egg; -pub mod ender_pearl; -pub use ender_pearl::EnderPearl; -pub mod experience_bottle; -pub use experience_bottle::ExperienceBottle; -pub mod potion; -pub use potion::Potion; -pub mod trident; -pub use trident::Trident; -pub mod trader_llama; -pub use trader_llama::TraderLlama; -pub mod tropical_fish; -pub use tropical_fish::TropicalFish; -pub mod turtle; -pub use turtle::Turtle; -pub mod vex; -pub use vex::Vex; -pub mod villager; -pub use villager::Villager; -pub mod vindicator; -pub use vindicator::Vindicator; -pub mod wandering_trader; -pub use wandering_trader::WanderingTrader; -pub mod witch; -pub use witch::Witch; -pub mod wither; -pub use wither::Wither; -pub mod wither_skeleton; -pub use wither_skeleton::WitherSkeleton; -pub mod wither_skull; -pub use wither_skull::WitherSkull; -pub mod wolf; -pub use wolf::Wolf; -pub mod zoglin; -pub use zoglin::Zoglin; -pub mod zombie; -pub use zombie::Zombie; -pub mod zombie_horse; -pub use zombie_horse::ZombieHorse; -pub mod zombie_villager; -pub use zombie_villager::ZombieVillager; -pub mod zombified_piglin; -pub use zombified_piglin::ZombifiedPiglin; -pub mod player; -pub use player::Player; -pub mod fishing_bobber; -pub use fishing_bobber::FishingBobber; diff --git a/quill/common/src/entities/area_effect_cloud.rs b/quill/common/src/entities/area_effect_cloud.rs deleted file mode 100644 index da07f1ab0..000000000 --- a/quill/common/src/entities/area_effect_cloud.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for area effect cloud entities. -/// -/// # Example -/// A system that queries for all area effect clouds: -/// ```no_run -/// use quill::{Game, Position, entities::AreaEffectCloud}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &AreaEffectCloud)>() { -/// println!("Found a area effect cloud with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct AreaEffectCloud; - -pod_component_impl!(AreaEffectCloud); diff --git a/quill/common/src/entities/armor_stand.rs b/quill/common/src/entities/armor_stand.rs deleted file mode 100644 index 53edaf229..000000000 --- a/quill/common/src/entities/armor_stand.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for armor stand entities. -/// -/// # Example -/// A system that queries for all armor stands: -/// ```no_run -/// use quill::{Game, Position, entities::ArmorStand}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ArmorStand)>() { -/// println!("Found a armor stand with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ArmorStand; - -pod_component_impl!(ArmorStand); diff --git a/quill/common/src/entities/arrow.rs b/quill/common/src/entities/arrow.rs deleted file mode 100644 index 6267a47c3..000000000 --- a/quill/common/src/entities/arrow.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for arrow entities. -/// -/// # Example -/// A system that queries for all arrows: -/// ```no_run -/// use quill::{Game, Position, entities::Arrow}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Arrow)>() { -/// println!("Found a arrow with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Arrow; - -pod_component_impl!(Arrow); diff --git a/quill/common/src/entities/bat.rs b/quill/common/src/entities/bat.rs deleted file mode 100644 index 82a6f13d5..000000000 --- a/quill/common/src/entities/bat.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for bat entities. -/// -/// # Example -/// A system that queries for all bats: -/// ```no_run -/// use quill::{Game, Position, entities::Bat}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Bat)>() { -/// println!("Found a bat with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Bat; - -pod_component_impl!(Bat); diff --git a/quill/common/src/entities/bee.rs b/quill/common/src/entities/bee.rs deleted file mode 100644 index ee81b1567..000000000 --- a/quill/common/src/entities/bee.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for bee entities. -/// -/// # Example -/// A system that queries for all bees: -/// ```no_run -/// use quill::{Game, Position, entities::Bee}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Bee)>() { -/// println!("Found a bee with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Bee; - -pod_component_impl!(Bee); diff --git a/quill/common/src/entities/blaze.rs b/quill/common/src/entities/blaze.rs deleted file mode 100644 index abf9c986e..000000000 --- a/quill/common/src/entities/blaze.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for blaze entities. -/// -/// # Example -/// A system that queries for all blazes: -/// ```no_run -/// use quill::{Game, Position, entities::Blaze}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Blaze)>() { -/// println!("Found a blaze with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Blaze; - -pod_component_impl!(Blaze); diff --git a/quill/common/src/entities/boat.rs b/quill/common/src/entities/boat.rs deleted file mode 100644 index 21d260449..000000000 --- a/quill/common/src/entities/boat.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for boat entities. -/// -/// # Example -/// A system that queries for all boats: -/// ```no_run -/// use quill::{Game, Position, entities::Boat}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Boat)>() { -/// println!("Found a boat with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Boat; - -pod_component_impl!(Boat); diff --git a/quill/common/src/entities/cat.rs b/quill/common/src/entities/cat.rs deleted file mode 100644 index b8f0721e3..000000000 --- a/quill/common/src/entities/cat.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for cat entities. -/// -/// # Example -/// A system that queries for all cats: -/// ```no_run -/// use quill::{Game, Position, entities::Cat}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Cat)>() { -/// println!("Found a cat with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Cat; - -pod_component_impl!(Cat); diff --git a/quill/common/src/entities/cave_spider.rs b/quill/common/src/entities/cave_spider.rs deleted file mode 100644 index c600f48b3..000000000 --- a/quill/common/src/entities/cave_spider.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for cave spider entities. -/// -/// # Example -/// A system that queries for all cave spiders: -/// ```no_run -/// use quill::{Game, Position, entities::CaveSpider}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &CaveSpider)>() { -/// println!("Found a cave spider with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct CaveSpider; - -pod_component_impl!(CaveSpider); diff --git a/quill/common/src/entities/chest_minecart.rs b/quill/common/src/entities/chest_minecart.rs deleted file mode 100644 index 010a314c7..000000000 --- a/quill/common/src/entities/chest_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for chest minecart entities. -/// -/// # Example -/// A system that queries for all chest minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::ChestMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ChestMinecart)>() { -/// println!("Found a chest minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ChestMinecart; - -pod_component_impl!(ChestMinecart); diff --git a/quill/common/src/entities/chicken.rs b/quill/common/src/entities/chicken.rs deleted file mode 100644 index 236399d04..000000000 --- a/quill/common/src/entities/chicken.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for chicken entities. -/// -/// # Example -/// A system that queries for all chickens: -/// ```no_run -/// use quill::{Game, Position, entities::Chicken}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Chicken)>() { -/// println!("Found a chicken with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Chicken; - -pod_component_impl!(Chicken); diff --git a/quill/common/src/entities/cod.rs b/quill/common/src/entities/cod.rs deleted file mode 100644 index 528b8d369..000000000 --- a/quill/common/src/entities/cod.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for cod entities. -/// -/// # Example -/// A system that queries for all cods: -/// ```no_run -/// use quill::{Game, Position, entities::Cod}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Cod)>() { -/// println!("Found a cod with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Cod; - -pod_component_impl!(Cod); diff --git a/quill/common/src/entities/command_block_minecart.rs b/quill/common/src/entities/command_block_minecart.rs deleted file mode 100644 index 33c0ca053..000000000 --- a/quill/common/src/entities/command_block_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for command block minecart entities. -/// -/// # Example -/// A system that queries for all command block minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::CommandBlockMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &CommandBlockMinecart)>() { -/// println!("Found a command block minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct CommandBlockMinecart; - -pod_component_impl!(CommandBlockMinecart); diff --git a/quill/common/src/entities/cow.rs b/quill/common/src/entities/cow.rs deleted file mode 100644 index adb540b9c..000000000 --- a/quill/common/src/entities/cow.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for cow entities. -/// -/// # Example -/// A system that queries for all cows: -/// ```no_run -/// use quill::{Game, Position, entities::Cow}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Cow)>() { -/// println!("Found a cow with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Cow; - -pod_component_impl!(Cow); diff --git a/quill/common/src/entities/creeper.rs b/quill/common/src/entities/creeper.rs deleted file mode 100644 index 48261737f..000000000 --- a/quill/common/src/entities/creeper.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for creeper entities. -/// -/// # Example -/// A system that queries for all creepers: -/// ```no_run -/// use quill::{Game, Position, entities::Creeper}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Creeper)>() { -/// println!("Found a creeper with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Creeper; - -pod_component_impl!(Creeper); diff --git a/quill/common/src/entities/dolphin.rs b/quill/common/src/entities/dolphin.rs deleted file mode 100644 index c763c7a65..000000000 --- a/quill/common/src/entities/dolphin.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for dolphin entities. -/// -/// # Example -/// A system that queries for all dolphins: -/// ```no_run -/// use quill::{Game, Position, entities::Dolphin}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Dolphin)>() { -/// println!("Found a dolphin with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Dolphin; - -pod_component_impl!(Dolphin); diff --git a/quill/common/src/entities/donkey.rs b/quill/common/src/entities/donkey.rs deleted file mode 100644 index 5c9565572..000000000 --- a/quill/common/src/entities/donkey.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for donkey entities. -/// -/// # Example -/// A system that queries for all donkeys: -/// ```no_run -/// use quill::{Game, Position, entities::Donkey}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Donkey)>() { -/// println!("Found a donkey with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Donkey; - -pod_component_impl!(Donkey); diff --git a/quill/common/src/entities/dragon_fireball.rs b/quill/common/src/entities/dragon_fireball.rs deleted file mode 100644 index 2ecb539ff..000000000 --- a/quill/common/src/entities/dragon_fireball.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for dragon fireball entities. -/// -/// # Example -/// A system that queries for all dragon fireballs: -/// ```no_run -/// use quill::{Game, Position, entities::DragonFireball}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &DragonFireball)>() { -/// println!("Found a dragon fireball with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct DragonFireball; - -pod_component_impl!(DragonFireball); diff --git a/quill/common/src/entities/drowned.rs b/quill/common/src/entities/drowned.rs deleted file mode 100644 index bcf1fa93f..000000000 --- a/quill/common/src/entities/drowned.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for drowned entities. -/// -/// # Example -/// A system that queries for all drowneds: -/// ```no_run -/// use quill::{Game, Position, entities::Drowned}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Drowned)>() { -/// println!("Found a drowned with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Drowned; - -pod_component_impl!(Drowned); diff --git a/quill/common/src/entities/egg.rs b/quill/common/src/entities/egg.rs deleted file mode 100644 index 0c89551cc..000000000 --- a/quill/common/src/entities/egg.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for egg entities. -/// -/// # Example -/// A system that queries for all eggs: -/// ```no_run -/// use quill::{Game, Position, entities::Egg}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Egg)>() { -/// println!("Found a egg with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Egg; - -pod_component_impl!(Egg); diff --git a/quill/common/src/entities/elder_guardian.rs b/quill/common/src/entities/elder_guardian.rs deleted file mode 100644 index ea2503448..000000000 --- a/quill/common/src/entities/elder_guardian.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for elder guardian entities. -/// -/// # Example -/// A system that queries for all elder guardians: -/// ```no_run -/// use quill::{Game, Position, entities::ElderGuardian}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ElderGuardian)>() { -/// println!("Found a elder guardian with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ElderGuardian; - -pod_component_impl!(ElderGuardian); diff --git a/quill/common/src/entities/end_crystal.rs b/quill/common/src/entities/end_crystal.rs deleted file mode 100644 index 2ceaa8fa7..000000000 --- a/quill/common/src/entities/end_crystal.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for end crystal entities. -/// -/// # Example -/// A system that queries for all end crystals: -/// ```no_run -/// use quill::{Game, Position, entities::EndCrystal}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &EndCrystal)>() { -/// println!("Found a end crystal with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct EndCrystal; - -pod_component_impl!(EndCrystal); diff --git a/quill/common/src/entities/ender_dragon.rs b/quill/common/src/entities/ender_dragon.rs deleted file mode 100644 index 0ab804da3..000000000 --- a/quill/common/src/entities/ender_dragon.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for ender dragon entities. -/// -/// # Example -/// A system that queries for all ender dragons: -/// ```no_run -/// use quill::{Game, Position, entities::EnderDragon}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &EnderDragon)>() { -/// println!("Found a ender dragon with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct EnderDragon; - -pod_component_impl!(EnderDragon); diff --git a/quill/common/src/entities/ender_pearl.rs b/quill/common/src/entities/ender_pearl.rs deleted file mode 100644 index 4f44365cf..000000000 --- a/quill/common/src/entities/ender_pearl.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for ender pearl entities. -/// -/// # Example -/// A system that queries for all ender pearls: -/// ```no_run -/// use quill::{Game, Position, entities::EnderPearl}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &EnderPearl)>() { -/// println!("Found a ender pearl with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct EnderPearl; - -pod_component_impl!(EnderPearl); diff --git a/quill/common/src/entities/enderman.rs b/quill/common/src/entities/enderman.rs deleted file mode 100644 index 393fce912..000000000 --- a/quill/common/src/entities/enderman.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for enderman entities. -/// -/// # Example -/// A system that queries for all endermans: -/// ```no_run -/// use quill::{Game, Position, entities::Enderman}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Enderman)>() { -/// println!("Found a enderman with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Enderman; - -pod_component_impl!(Enderman); diff --git a/quill/common/src/entities/endermite.rs b/quill/common/src/entities/endermite.rs deleted file mode 100644 index cc4b19dd9..000000000 --- a/quill/common/src/entities/endermite.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for endermite entities. -/// -/// # Example -/// A system that queries for all endermites: -/// ```no_run -/// use quill::{Game, Position, entities::Endermite}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Endermite)>() { -/// println!("Found a endermite with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Endermite; - -pod_component_impl!(Endermite); diff --git a/quill/common/src/entities/evoker.rs b/quill/common/src/entities/evoker.rs deleted file mode 100644 index 118fb90da..000000000 --- a/quill/common/src/entities/evoker.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for evoker entities. -/// -/// # Example -/// A system that queries for all evokers: -/// ```no_run -/// use quill::{Game, Position, entities::Evoker}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Evoker)>() { -/// println!("Found a evoker with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Evoker; - -pod_component_impl!(Evoker); diff --git a/quill/common/src/entities/evoker_fangs.rs b/quill/common/src/entities/evoker_fangs.rs deleted file mode 100644 index 48cbb3d78..000000000 --- a/quill/common/src/entities/evoker_fangs.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for evoker fangs entities. -/// -/// # Example -/// A system that queries for all evoker fangss: -/// ```no_run -/// use quill::{Game, Position, entities::EvokerFangs}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &EvokerFangs)>() { -/// println!("Found a evoker fangs with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct EvokerFangs; - -pod_component_impl!(EvokerFangs); diff --git a/quill/common/src/entities/experience_bottle.rs b/quill/common/src/entities/experience_bottle.rs deleted file mode 100644 index 034e71d58..000000000 --- a/quill/common/src/entities/experience_bottle.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for experience bottle entities. -/// -/// # Example -/// A system that queries for all experience bottles: -/// ```no_run -/// use quill::{Game, Position, entities::ExperienceBottle}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ExperienceBottle)>() { -/// println!("Found a experience bottle with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ExperienceBottle; - -pod_component_impl!(ExperienceBottle); diff --git a/quill/common/src/entities/experience_orb.rs b/quill/common/src/entities/experience_orb.rs deleted file mode 100644 index f3aa27199..000000000 --- a/quill/common/src/entities/experience_orb.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for experience orb entities. -/// -/// # Example -/// A system that queries for all experience orbs: -/// ```no_run -/// use quill::{Game, Position, entities::ExperienceOrb}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ExperienceOrb)>() { -/// println!("Found a experience orb with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ExperienceOrb; - -pod_component_impl!(ExperienceOrb); diff --git a/quill/common/src/entities/eye_of_ender.rs b/quill/common/src/entities/eye_of_ender.rs deleted file mode 100644 index 6c1e83cd4..000000000 --- a/quill/common/src/entities/eye_of_ender.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for eye of ender entities. -/// -/// # Example -/// A system that queries for all eye of enders: -/// ```no_run -/// use quill::{Game, Position, entities::EyeOfEnder}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &EyeOfEnder)>() { -/// println!("Found a eye of ender with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct EyeOfEnder; - -pod_component_impl!(EyeOfEnder); diff --git a/quill/common/src/entities/falling_block.rs b/quill/common/src/entities/falling_block.rs deleted file mode 100644 index abc223edf..000000000 --- a/quill/common/src/entities/falling_block.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for falling block entities. -/// -/// # Example -/// A system that queries for all falling blocks: -/// ```no_run -/// use quill::{Game, Position, entities::FallingBlock}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &FallingBlock)>() { -/// println!("Found a falling block with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct FallingBlock; - -pod_component_impl!(FallingBlock); diff --git a/quill/common/src/entities/fireball.rs b/quill/common/src/entities/fireball.rs deleted file mode 100644 index d524648be..000000000 --- a/quill/common/src/entities/fireball.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for fireball entities. -/// -/// # Example -/// A system that queries for all fireballs: -/// ```no_run -/// use quill::{Game, Position, entities::Fireball}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Fireball)>() { -/// println!("Found a fireball with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Fireball; - -pod_component_impl!(Fireball); diff --git a/quill/common/src/entities/firework_rocket.rs b/quill/common/src/entities/firework_rocket.rs deleted file mode 100644 index f03f2edc3..000000000 --- a/quill/common/src/entities/firework_rocket.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for firework rocket entities. -/// -/// # Example -/// A system that queries for all firework rockets: -/// ```no_run -/// use quill::{Game, Position, entities::FireworkRocket}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &FireworkRocket)>() { -/// println!("Found a firework rocket with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct FireworkRocket; - -pod_component_impl!(FireworkRocket); diff --git a/quill/common/src/entities/fishing_bobber.rs b/quill/common/src/entities/fishing_bobber.rs deleted file mode 100644 index c49a726f4..000000000 --- a/quill/common/src/entities/fishing_bobber.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for fishing bobber entities. -/// -/// # Example -/// A system that queries for all fishing bobbers: -/// ```no_run -/// use quill::{Game, Position, entities::FishingBobber}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &FishingBobber)>() { -/// println!("Found a fishing bobber with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct FishingBobber; - -pod_component_impl!(FishingBobber); diff --git a/quill/common/src/entities/fox.rs b/quill/common/src/entities/fox.rs deleted file mode 100644 index c8c367585..000000000 --- a/quill/common/src/entities/fox.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for fox entities. -/// -/// # Example -/// A system that queries for all foxs: -/// ```no_run -/// use quill::{Game, Position, entities::Fox}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Fox)>() { -/// println!("Found a fox with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Fox; - -pod_component_impl!(Fox); diff --git a/quill/common/src/entities/furnace_minecart.rs b/quill/common/src/entities/furnace_minecart.rs deleted file mode 100644 index 259647d1d..000000000 --- a/quill/common/src/entities/furnace_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for furnace minecart entities. -/// -/// # Example -/// A system that queries for all furnace minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::FurnaceMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &FurnaceMinecart)>() { -/// println!("Found a furnace minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct FurnaceMinecart; - -pod_component_impl!(FurnaceMinecart); diff --git a/quill/common/src/entities/ghast.rs b/quill/common/src/entities/ghast.rs deleted file mode 100644 index ee1b579d3..000000000 --- a/quill/common/src/entities/ghast.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for ghast entities. -/// -/// # Example -/// A system that queries for all ghasts: -/// ```no_run -/// use quill::{Game, Position, entities::Ghast}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Ghast)>() { -/// println!("Found a ghast with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Ghast; - -pod_component_impl!(Ghast); diff --git a/quill/common/src/entities/giant.rs b/quill/common/src/entities/giant.rs deleted file mode 100644 index 4dd05874a..000000000 --- a/quill/common/src/entities/giant.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for giant entities. -/// -/// # Example -/// A system that queries for all giants: -/// ```no_run -/// use quill::{Game, Position, entities::Giant}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Giant)>() { -/// println!("Found a giant with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Giant; - -pod_component_impl!(Giant); diff --git a/quill/common/src/entities/guardian.rs b/quill/common/src/entities/guardian.rs deleted file mode 100644 index 29ec01eef..000000000 --- a/quill/common/src/entities/guardian.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for guardian entities. -/// -/// # Example -/// A system that queries for all guardians: -/// ```no_run -/// use quill::{Game, Position, entities::Guardian}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Guardian)>() { -/// println!("Found a guardian with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Guardian; - -pod_component_impl!(Guardian); diff --git a/quill/common/src/entities/hoglin.rs b/quill/common/src/entities/hoglin.rs deleted file mode 100644 index 621867f00..000000000 --- a/quill/common/src/entities/hoglin.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for hoglin entities. -/// -/// # Example -/// A system that queries for all hoglins: -/// ```no_run -/// use quill::{Game, Position, entities::Hoglin}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Hoglin)>() { -/// println!("Found a hoglin with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Hoglin; - -pod_component_impl!(Hoglin); diff --git a/quill/common/src/entities/hopper_minecart.rs b/quill/common/src/entities/hopper_minecart.rs deleted file mode 100644 index 04f1453ea..000000000 --- a/quill/common/src/entities/hopper_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for hopper minecart entities. -/// -/// # Example -/// A system that queries for all hopper minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::HopperMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &HopperMinecart)>() { -/// println!("Found a hopper minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct HopperMinecart; - -pod_component_impl!(HopperMinecart); diff --git a/quill/common/src/entities/horse.rs b/quill/common/src/entities/horse.rs deleted file mode 100644 index dd6d52ea7..000000000 --- a/quill/common/src/entities/horse.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for horse entities. -/// -/// # Example -/// A system that queries for all horses: -/// ```no_run -/// use quill::{Game, Position, entities::Horse}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Horse)>() { -/// println!("Found a horse with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Horse; - -pod_component_impl!(Horse); diff --git a/quill/common/src/entities/husk.rs b/quill/common/src/entities/husk.rs deleted file mode 100644 index 37a7cc2e9..000000000 --- a/quill/common/src/entities/husk.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for husk entities. -/// -/// # Example -/// A system that queries for all husks: -/// ```no_run -/// use quill::{Game, Position, entities::Husk}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Husk)>() { -/// println!("Found a husk with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Husk; - -pod_component_impl!(Husk); diff --git a/quill/common/src/entities/illusioner.rs b/quill/common/src/entities/illusioner.rs deleted file mode 100644 index 4efc89bbe..000000000 --- a/quill/common/src/entities/illusioner.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for illusioner entities. -/// -/// # Example -/// A system that queries for all illusioners: -/// ```no_run -/// use quill::{Game, Position, entities::Illusioner}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Illusioner)>() { -/// println!("Found a illusioner with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Illusioner; - -pod_component_impl!(Illusioner); diff --git a/quill/common/src/entities/iron_golem.rs b/quill/common/src/entities/iron_golem.rs deleted file mode 100644 index 6ee2f96bd..000000000 --- a/quill/common/src/entities/iron_golem.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for iron golem entities. -/// -/// # Example -/// A system that queries for all iron golems: -/// ```no_run -/// use quill::{Game, Position, entities::IronGolem}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &IronGolem)>() { -/// println!("Found a iron golem with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct IronGolem; - -pod_component_impl!(IronGolem); diff --git a/quill/common/src/entities/item.rs b/quill/common/src/entities/item.rs deleted file mode 100644 index 9c37e4a45..000000000 --- a/quill/common/src/entities/item.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for item entities. -/// -/// # Example -/// A system that queries for all items: -/// ```no_run -/// use quill::{Game, Position, entities::Item}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Item)>() { -/// println!("Found a item with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Item; - -pod_component_impl!(Item); diff --git a/quill/common/src/entities/item_frame.rs b/quill/common/src/entities/item_frame.rs deleted file mode 100644 index 1eb6157d6..000000000 --- a/quill/common/src/entities/item_frame.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for item frame entities. -/// -/// # Example -/// A system that queries for all item frames: -/// ```no_run -/// use quill::{Game, Position, entities::ItemFrame}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ItemFrame)>() { -/// println!("Found a item frame with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ItemFrame; - -pod_component_impl!(ItemFrame); diff --git a/quill/common/src/entities/leash_knot.rs b/quill/common/src/entities/leash_knot.rs deleted file mode 100644 index 548f0b546..000000000 --- a/quill/common/src/entities/leash_knot.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for leash knot entities. -/// -/// # Example -/// A system that queries for all leash knots: -/// ```no_run -/// use quill::{Game, Position, entities::LeashKnot}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &LeashKnot)>() { -/// println!("Found a leash knot with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct LeashKnot; - -pod_component_impl!(LeashKnot); diff --git a/quill/common/src/entities/lightning_bolt.rs b/quill/common/src/entities/lightning_bolt.rs deleted file mode 100644 index e02e12761..000000000 --- a/quill/common/src/entities/lightning_bolt.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for lightning bolt entities. -/// -/// # Example -/// A system that queries for all lightning bolts: -/// ```no_run -/// use quill::{Game, Position, entities::LightningBolt}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &LightningBolt)>() { -/// println!("Found a lightning bolt with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct LightningBolt; - -pod_component_impl!(LightningBolt); diff --git a/quill/common/src/entities/llama.rs b/quill/common/src/entities/llama.rs deleted file mode 100644 index 0d6ebab54..000000000 --- a/quill/common/src/entities/llama.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for llama entities. -/// -/// # Example -/// A system that queries for all llamas: -/// ```no_run -/// use quill::{Game, Position, entities::Llama}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Llama)>() { -/// println!("Found a llama with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Llama; - -pod_component_impl!(Llama); diff --git a/quill/common/src/entities/llama_spit.rs b/quill/common/src/entities/llama_spit.rs deleted file mode 100644 index f6a4948de..000000000 --- a/quill/common/src/entities/llama_spit.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for llama spit entities. -/// -/// # Example -/// A system that queries for all llama spits: -/// ```no_run -/// use quill::{Game, Position, entities::LlamaSpit}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &LlamaSpit)>() { -/// println!("Found a llama spit with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct LlamaSpit; - -pod_component_impl!(LlamaSpit); diff --git a/quill/common/src/entities/magma_cube.rs b/quill/common/src/entities/magma_cube.rs deleted file mode 100644 index ab0b18736..000000000 --- a/quill/common/src/entities/magma_cube.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for magma cube entities. -/// -/// # Example -/// A system that queries for all magma cubes: -/// ```no_run -/// use quill::{Game, Position, entities::MagmaCube}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &MagmaCube)>() { -/// println!("Found a magma cube with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct MagmaCube; - -pod_component_impl!(MagmaCube); diff --git a/quill/common/src/entities/minecart.rs b/quill/common/src/entities/minecart.rs deleted file mode 100644 index 25919dfbf..000000000 --- a/quill/common/src/entities/minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for minecart entities. -/// -/// # Example -/// A system that queries for all minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::Minecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Minecart)>() { -/// println!("Found a minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Minecart; - -pod_component_impl!(Minecart); diff --git a/quill/common/src/entities/mooshroom.rs b/quill/common/src/entities/mooshroom.rs deleted file mode 100644 index 2f5a6403d..000000000 --- a/quill/common/src/entities/mooshroom.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for mooshroom entities. -/// -/// # Example -/// A system that queries for all mooshrooms: -/// ```no_run -/// use quill::{Game, Position, entities::Mooshroom}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Mooshroom)>() { -/// println!("Found a mooshroom with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Mooshroom; - -pod_component_impl!(Mooshroom); diff --git a/quill/common/src/entities/mule.rs b/quill/common/src/entities/mule.rs deleted file mode 100644 index fcebeabd9..000000000 --- a/quill/common/src/entities/mule.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for mule entities. -/// -/// # Example -/// A system that queries for all mules: -/// ```no_run -/// use quill::{Game, Position, entities::Mule}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Mule)>() { -/// println!("Found a mule with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Mule; - -pod_component_impl!(Mule); diff --git a/quill/common/src/entities/ocelot.rs b/quill/common/src/entities/ocelot.rs deleted file mode 100644 index 31b474209..000000000 --- a/quill/common/src/entities/ocelot.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for ocelot entities. -/// -/// # Example -/// A system that queries for all ocelots: -/// ```no_run -/// use quill::{Game, Position, entities::Ocelot}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Ocelot)>() { -/// println!("Found a ocelot with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Ocelot; - -pod_component_impl!(Ocelot); diff --git a/quill/common/src/entities/painting.rs b/quill/common/src/entities/painting.rs deleted file mode 100644 index e14abff7d..000000000 --- a/quill/common/src/entities/painting.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for painting entities. -/// -/// # Example -/// A system that queries for all paintings: -/// ```no_run -/// use quill::{Game, Position, entities::Painting}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Painting)>() { -/// println!("Found a painting with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Painting; - -pod_component_impl!(Painting); diff --git a/quill/common/src/entities/panda.rs b/quill/common/src/entities/panda.rs deleted file mode 100644 index 8bcd8b544..000000000 --- a/quill/common/src/entities/panda.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for panda entities. -/// -/// # Example -/// A system that queries for all pandas: -/// ```no_run -/// use quill::{Game, Position, entities::Panda}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Panda)>() { -/// println!("Found a panda with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Panda; - -pod_component_impl!(Panda); diff --git a/quill/common/src/entities/parrot.rs b/quill/common/src/entities/parrot.rs deleted file mode 100644 index f06afd167..000000000 --- a/quill/common/src/entities/parrot.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for parrot entities. -/// -/// # Example -/// A system that queries for all parrots: -/// ```no_run -/// use quill::{Game, Position, entities::Parrot}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Parrot)>() { -/// println!("Found a parrot with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Parrot; - -pod_component_impl!(Parrot); diff --git a/quill/common/src/entities/phantom.rs b/quill/common/src/entities/phantom.rs deleted file mode 100644 index c5a839b8e..000000000 --- a/quill/common/src/entities/phantom.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for phantom entities. -/// -/// # Example -/// A system that queries for all phantoms: -/// ```no_run -/// use quill::{Game, Position, entities::Phantom}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Phantom)>() { -/// println!("Found a phantom with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Phantom; - -pod_component_impl!(Phantom); diff --git a/quill/common/src/entities/pig.rs b/quill/common/src/entities/pig.rs deleted file mode 100644 index 753e2f019..000000000 --- a/quill/common/src/entities/pig.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for pig entities. -/// -/// # Example -/// A system that queries for all pigs: -/// ```no_run -/// use quill::{Game, Position, entities::Pig}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Pig)>() { -/// println!("Found a pig with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Pig; - -pod_component_impl!(Pig); diff --git a/quill/common/src/entities/piglin.rs b/quill/common/src/entities/piglin.rs deleted file mode 100644 index 9f5ea2633..000000000 --- a/quill/common/src/entities/piglin.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for piglin entities. -/// -/// # Example -/// A system that queries for all piglins: -/// ```no_run -/// use quill::{Game, Position, entities::Piglin}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Piglin)>() { -/// println!("Found a piglin with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Piglin; - -pod_component_impl!(Piglin); diff --git a/quill/common/src/entities/piglin_brute.rs b/quill/common/src/entities/piglin_brute.rs deleted file mode 100644 index 0c27b5f6f..000000000 --- a/quill/common/src/entities/piglin_brute.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for piglin brute entities. -/// -/// # Example -/// A system that queries for all piglin brutes: -/// ```no_run -/// use quill::{Game, Position, entities::PiglinBrute}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &PiglinBrute)>() { -/// println!("Found a piglin brute with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct PiglinBrute; - -pod_component_impl!(PiglinBrute); diff --git a/quill/common/src/entities/pillager.rs b/quill/common/src/entities/pillager.rs deleted file mode 100644 index 8fb27bf60..000000000 --- a/quill/common/src/entities/pillager.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for pillager entities. -/// -/// # Example -/// A system that queries for all pillagers: -/// ```no_run -/// use quill::{Game, Position, entities::Pillager}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Pillager)>() { -/// println!("Found a pillager with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Pillager; - -pod_component_impl!(Pillager); diff --git a/quill/common/src/entities/player.rs b/quill/common/src/entities/player.rs deleted file mode 100644 index d971ca5d7..000000000 --- a/quill/common/src/entities/player.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for player entities. -/// -/// # Example -/// A system that queries for all players: -/// ```no_run -/// use quill::{Game, Position, entities::Player}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Player)>() { -/// println!("Found a player with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Player; - -pod_component_impl!(Player); diff --git a/quill/common/src/entities/polar_bear.rs b/quill/common/src/entities/polar_bear.rs deleted file mode 100644 index b3f0e45c9..000000000 --- a/quill/common/src/entities/polar_bear.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for polar bear entities. -/// -/// # Example -/// A system that queries for all polar bears: -/// ```no_run -/// use quill::{Game, Position, entities::PolarBear}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &PolarBear)>() { -/// println!("Found a polar bear with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct PolarBear; - -pod_component_impl!(PolarBear); diff --git a/quill/common/src/entities/potion.rs b/quill/common/src/entities/potion.rs deleted file mode 100644 index 77c898d86..000000000 --- a/quill/common/src/entities/potion.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for potion entities. -/// -/// # Example -/// A system that queries for all potions: -/// ```no_run -/// use quill::{Game, Position, entities::Potion}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Potion)>() { -/// println!("Found a potion with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Potion; - -pod_component_impl!(Potion); diff --git a/quill/common/src/entities/pufferfish.rs b/quill/common/src/entities/pufferfish.rs deleted file mode 100644 index d400b1c6d..000000000 --- a/quill/common/src/entities/pufferfish.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for pufferfish entities. -/// -/// # Example -/// A system that queries for all pufferfishs: -/// ```no_run -/// use quill::{Game, Position, entities::Pufferfish}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Pufferfish)>() { -/// println!("Found a pufferfish with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Pufferfish; - -pod_component_impl!(Pufferfish); diff --git a/quill/common/src/entities/rabbit.rs b/quill/common/src/entities/rabbit.rs deleted file mode 100644 index 989fde181..000000000 --- a/quill/common/src/entities/rabbit.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for rabbit entities. -/// -/// # Example -/// A system that queries for all rabbits: -/// ```no_run -/// use quill::{Game, Position, entities::Rabbit}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Rabbit)>() { -/// println!("Found a rabbit with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Rabbit; - -pod_component_impl!(Rabbit); diff --git a/quill/common/src/entities/ravager.rs b/quill/common/src/entities/ravager.rs deleted file mode 100644 index e73a9e98a..000000000 --- a/quill/common/src/entities/ravager.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for ravager entities. -/// -/// # Example -/// A system that queries for all ravagers: -/// ```no_run -/// use quill::{Game, Position, entities::Ravager}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Ravager)>() { -/// println!("Found a ravager with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Ravager; - -pod_component_impl!(Ravager); diff --git a/quill/common/src/entities/salmon.rs b/quill/common/src/entities/salmon.rs deleted file mode 100644 index 996a3b8e5..000000000 --- a/quill/common/src/entities/salmon.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for salmon entities. -/// -/// # Example -/// A system that queries for all salmons: -/// ```no_run -/// use quill::{Game, Position, entities::Salmon}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Salmon)>() { -/// println!("Found a salmon with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Salmon; - -pod_component_impl!(Salmon); diff --git a/quill/common/src/entities/sheep.rs b/quill/common/src/entities/sheep.rs deleted file mode 100644 index cd7202db2..000000000 --- a/quill/common/src/entities/sheep.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for sheep entities. -/// -/// # Example -/// A system that queries for all sheeps: -/// ```no_run -/// use quill::{Game, Position, entities::Sheep}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Sheep)>() { -/// println!("Found a sheep with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Sheep; - -pod_component_impl!(Sheep); diff --git a/quill/common/src/entities/shulker.rs b/quill/common/src/entities/shulker.rs deleted file mode 100644 index f33b15624..000000000 --- a/quill/common/src/entities/shulker.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for shulker entities. -/// -/// # Example -/// A system that queries for all shulkers: -/// ```no_run -/// use quill::{Game, Position, entities::Shulker}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Shulker)>() { -/// println!("Found a shulker with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Shulker; - -pod_component_impl!(Shulker); diff --git a/quill/common/src/entities/shulker_bullet.rs b/quill/common/src/entities/shulker_bullet.rs deleted file mode 100644 index edd923bc4..000000000 --- a/quill/common/src/entities/shulker_bullet.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for shulker bullet entities. -/// -/// # Example -/// A system that queries for all shulker bullets: -/// ```no_run -/// use quill::{Game, Position, entities::ShulkerBullet}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ShulkerBullet)>() { -/// println!("Found a shulker bullet with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ShulkerBullet; - -pod_component_impl!(ShulkerBullet); diff --git a/quill/common/src/entities/silverfish.rs b/quill/common/src/entities/silverfish.rs deleted file mode 100644 index 990808a38..000000000 --- a/quill/common/src/entities/silverfish.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for silverfish entities. -/// -/// # Example -/// A system that queries for all silverfishs: -/// ```no_run -/// use quill::{Game, Position, entities::Silverfish}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Silverfish)>() { -/// println!("Found a silverfish with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Silverfish; - -pod_component_impl!(Silverfish); diff --git a/quill/common/src/entities/skeleton.rs b/quill/common/src/entities/skeleton.rs deleted file mode 100644 index 7162a368d..000000000 --- a/quill/common/src/entities/skeleton.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for skeleton entities. -/// -/// # Example -/// A system that queries for all skeletons: -/// ```no_run -/// use quill::{Game, Position, entities::Skeleton}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Skeleton)>() { -/// println!("Found a skeleton with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Skeleton; - -pod_component_impl!(Skeleton); diff --git a/quill/common/src/entities/skeleton_horse.rs b/quill/common/src/entities/skeleton_horse.rs deleted file mode 100644 index 0c14ff853..000000000 --- a/quill/common/src/entities/skeleton_horse.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for skeleton horse entities. -/// -/// # Example -/// A system that queries for all skeleton horses: -/// ```no_run -/// use quill::{Game, Position, entities::SkeletonHorse}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &SkeletonHorse)>() { -/// println!("Found a skeleton horse with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct SkeletonHorse; - -pod_component_impl!(SkeletonHorse); diff --git a/quill/common/src/entities/slime.rs b/quill/common/src/entities/slime.rs deleted file mode 100644 index 756c503b5..000000000 --- a/quill/common/src/entities/slime.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for slime entities. -/// -/// # Example -/// A system that queries for all slimes: -/// ```no_run -/// use quill::{Game, Position, entities::Slime}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Slime)>() { -/// println!("Found a slime with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Slime; - -pod_component_impl!(Slime); diff --git a/quill/common/src/entities/small_fireball.rs b/quill/common/src/entities/small_fireball.rs deleted file mode 100644 index 07d50e0a2..000000000 --- a/quill/common/src/entities/small_fireball.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for small fireball entities. -/// -/// # Example -/// A system that queries for all small fireballs: -/// ```no_run -/// use quill::{Game, Position, entities::SmallFireball}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &SmallFireball)>() { -/// println!("Found a small fireball with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct SmallFireball; - -pod_component_impl!(SmallFireball); diff --git a/quill/common/src/entities/snow_golem.rs b/quill/common/src/entities/snow_golem.rs deleted file mode 100644 index df0491083..000000000 --- a/quill/common/src/entities/snow_golem.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for snow golem entities. -/// -/// # Example -/// A system that queries for all snow golems: -/// ```no_run -/// use quill::{Game, Position, entities::SnowGolem}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &SnowGolem)>() { -/// println!("Found a snow golem with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct SnowGolem; - -pod_component_impl!(SnowGolem); diff --git a/quill/common/src/entities/snowball.rs b/quill/common/src/entities/snowball.rs deleted file mode 100644 index ea823c696..000000000 --- a/quill/common/src/entities/snowball.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for snowball entities. -/// -/// # Example -/// A system that queries for all snowballs: -/// ```no_run -/// use quill::{Game, Position, entities::Snowball}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Snowball)>() { -/// println!("Found a snowball with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Snowball; - -pod_component_impl!(Snowball); diff --git a/quill/common/src/entities/spawner_minecart.rs b/quill/common/src/entities/spawner_minecart.rs deleted file mode 100644 index c5584a9cd..000000000 --- a/quill/common/src/entities/spawner_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for spawner minecart entities. -/// -/// # Example -/// A system that queries for all spawner minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::SpawnerMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &SpawnerMinecart)>() { -/// println!("Found a spawner minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct SpawnerMinecart; - -pod_component_impl!(SpawnerMinecart); diff --git a/quill/common/src/entities/spectral_arrow.rs b/quill/common/src/entities/spectral_arrow.rs deleted file mode 100644 index 8a78f908c..000000000 --- a/quill/common/src/entities/spectral_arrow.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for spectral arrow entities. -/// -/// # Example -/// A system that queries for all spectral arrows: -/// ```no_run -/// use quill::{Game, Position, entities::SpectralArrow}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &SpectralArrow)>() { -/// println!("Found a spectral arrow with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct SpectralArrow; - -pod_component_impl!(SpectralArrow); diff --git a/quill/common/src/entities/spider.rs b/quill/common/src/entities/spider.rs deleted file mode 100644 index 85c5fcdc3..000000000 --- a/quill/common/src/entities/spider.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for spider entities. -/// -/// # Example -/// A system that queries for all spiders: -/// ```no_run -/// use quill::{Game, Position, entities::Spider}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Spider)>() { -/// println!("Found a spider with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Spider; - -pod_component_impl!(Spider); diff --git a/quill/common/src/entities/squid.rs b/quill/common/src/entities/squid.rs deleted file mode 100644 index 479364cb9..000000000 --- a/quill/common/src/entities/squid.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for squid entities. -/// -/// # Example -/// A system that queries for all squids: -/// ```no_run -/// use quill::{Game, Position, entities::Squid}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Squid)>() { -/// println!("Found a squid with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Squid; - -pod_component_impl!(Squid); diff --git a/quill/common/src/entities/stray.rs b/quill/common/src/entities/stray.rs deleted file mode 100644 index 92c952bc9..000000000 --- a/quill/common/src/entities/stray.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for stray entities. -/// -/// # Example -/// A system that queries for all strays: -/// ```no_run -/// use quill::{Game, Position, entities::Stray}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Stray)>() { -/// println!("Found a stray with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Stray; - -pod_component_impl!(Stray); diff --git a/quill/common/src/entities/strider.rs b/quill/common/src/entities/strider.rs deleted file mode 100644 index 63194fd1e..000000000 --- a/quill/common/src/entities/strider.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for strider entities. -/// -/// # Example -/// A system that queries for all striders: -/// ```no_run -/// use quill::{Game, Position, entities::Strider}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Strider)>() { -/// println!("Found a strider with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Strider; - -pod_component_impl!(Strider); diff --git a/quill/common/src/entities/tnt.rs b/quill/common/src/entities/tnt.rs deleted file mode 100644 index 6dbd66814..000000000 --- a/quill/common/src/entities/tnt.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for tnt entities. -/// -/// # Example -/// A system that queries for all tnts: -/// ```no_run -/// use quill::{Game, Position, entities::Tnt}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Tnt)>() { -/// println!("Found a tnt with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Tnt; - -pod_component_impl!(Tnt); diff --git a/quill/common/src/entities/tnt_minecart.rs b/quill/common/src/entities/tnt_minecart.rs deleted file mode 100644 index e9b5e4962..000000000 --- a/quill/common/src/entities/tnt_minecart.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for tnt minecart entities. -/// -/// # Example -/// A system that queries for all tnt minecarts: -/// ```no_run -/// use quill::{Game, Position, entities::TntMinecart}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &TntMinecart)>() { -/// println!("Found a tnt minecart with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct TntMinecart; - -pod_component_impl!(TntMinecart); diff --git a/quill/common/src/entities/trader_llama.rs b/quill/common/src/entities/trader_llama.rs deleted file mode 100644 index e8ef11d57..000000000 --- a/quill/common/src/entities/trader_llama.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for trader llama entities. -/// -/// # Example -/// A system that queries for all trader llamas: -/// ```no_run -/// use quill::{Game, Position, entities::TraderLlama}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &TraderLlama)>() { -/// println!("Found a trader llama with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct TraderLlama; - -pod_component_impl!(TraderLlama); diff --git a/quill/common/src/entities/trident.rs b/quill/common/src/entities/trident.rs deleted file mode 100644 index 41612484b..000000000 --- a/quill/common/src/entities/trident.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for trident entities. -/// -/// # Example -/// A system that queries for all tridents: -/// ```no_run -/// use quill::{Game, Position, entities::Trident}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Trident)>() { -/// println!("Found a trident with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Trident; - -pod_component_impl!(Trident); diff --git a/quill/common/src/entities/tropical_fish.rs b/quill/common/src/entities/tropical_fish.rs deleted file mode 100644 index 2d6b02c25..000000000 --- a/quill/common/src/entities/tropical_fish.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for tropical fish entities. -/// -/// # Example -/// A system that queries for all tropical fishs: -/// ```no_run -/// use quill::{Game, Position, entities::TropicalFish}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &TropicalFish)>() { -/// println!("Found a tropical fish with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct TropicalFish; - -pod_component_impl!(TropicalFish); diff --git a/quill/common/src/entities/turtle.rs b/quill/common/src/entities/turtle.rs deleted file mode 100644 index efe77937b..000000000 --- a/quill/common/src/entities/turtle.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for turtle entities. -/// -/// # Example -/// A system that queries for all turtles: -/// ```no_run -/// use quill::{Game, Position, entities::Turtle}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Turtle)>() { -/// println!("Found a turtle with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Turtle; - -pod_component_impl!(Turtle); diff --git a/quill/common/src/entities/vex.rs b/quill/common/src/entities/vex.rs deleted file mode 100644 index e165bd310..000000000 --- a/quill/common/src/entities/vex.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for vex entities. -/// -/// # Example -/// A system that queries for all vexs: -/// ```no_run -/// use quill::{Game, Position, entities::Vex}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Vex)>() { -/// println!("Found a vex with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Vex; - -pod_component_impl!(Vex); diff --git a/quill/common/src/entities/villager.rs b/quill/common/src/entities/villager.rs deleted file mode 100644 index e42e253a4..000000000 --- a/quill/common/src/entities/villager.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for villager entities. -/// -/// # Example -/// A system that queries for all villagers: -/// ```no_run -/// use quill::{Game, Position, entities::Villager}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Villager)>() { -/// println!("Found a villager with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Villager; - -pod_component_impl!(Villager); diff --git a/quill/common/src/entities/vindicator.rs b/quill/common/src/entities/vindicator.rs deleted file mode 100644 index 9eb5e0092..000000000 --- a/quill/common/src/entities/vindicator.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for vindicator entities. -/// -/// # Example -/// A system that queries for all vindicators: -/// ```no_run -/// use quill::{Game, Position, entities::Vindicator}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Vindicator)>() { -/// println!("Found a vindicator with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Vindicator; - -pod_component_impl!(Vindicator); diff --git a/quill/common/src/entities/wandering_trader.rs b/quill/common/src/entities/wandering_trader.rs deleted file mode 100644 index a8f0c9b7a..000000000 --- a/quill/common/src/entities/wandering_trader.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for wandering trader entities. -/// -/// # Example -/// A system that queries for all wandering traders: -/// ```no_run -/// use quill::{Game, Position, entities::WanderingTrader}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &WanderingTrader)>() { -/// println!("Found a wandering trader with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct WanderingTrader; - -pod_component_impl!(WanderingTrader); diff --git a/quill/common/src/entities/witch.rs b/quill/common/src/entities/witch.rs deleted file mode 100644 index fcb261562..000000000 --- a/quill/common/src/entities/witch.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for witch entities. -/// -/// # Example -/// A system that queries for all witchs: -/// ```no_run -/// use quill::{Game, Position, entities::Witch}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Witch)>() { -/// println!("Found a witch with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Witch; - -pod_component_impl!(Witch); diff --git a/quill/common/src/entities/wither.rs b/quill/common/src/entities/wither.rs deleted file mode 100644 index 1e0a0a765..000000000 --- a/quill/common/src/entities/wither.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for wither entities. -/// -/// # Example -/// A system that queries for all withers: -/// ```no_run -/// use quill::{Game, Position, entities::Wither}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Wither)>() { -/// println!("Found a wither with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Wither; - -pod_component_impl!(Wither); diff --git a/quill/common/src/entities/wither_skeleton.rs b/quill/common/src/entities/wither_skeleton.rs deleted file mode 100644 index baaff5de5..000000000 --- a/quill/common/src/entities/wither_skeleton.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for wither skeleton entities. -/// -/// # Example -/// A system that queries for all wither skeletons: -/// ```no_run -/// use quill::{Game, Position, entities::WitherSkeleton}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &WitherSkeleton)>() { -/// println!("Found a wither skeleton with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct WitherSkeleton; - -pod_component_impl!(WitherSkeleton); diff --git a/quill/common/src/entities/wither_skull.rs b/quill/common/src/entities/wither_skull.rs deleted file mode 100644 index 641a0a729..000000000 --- a/quill/common/src/entities/wither_skull.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for wither skull entities. -/// -/// # Example -/// A system that queries for all wither skulls: -/// ```no_run -/// use quill::{Game, Position, entities::WitherSkull}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &WitherSkull)>() { -/// println!("Found a wither skull with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct WitherSkull; - -pod_component_impl!(WitherSkull); diff --git a/quill/common/src/entities/wolf.rs b/quill/common/src/entities/wolf.rs deleted file mode 100644 index 4376907d6..000000000 --- a/quill/common/src/entities/wolf.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for wolf entities. -/// -/// # Example -/// A system that queries for all wolfs: -/// ```no_run -/// use quill::{Game, Position, entities::Wolf}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Wolf)>() { -/// println!("Found a wolf with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Wolf; - -pod_component_impl!(Wolf); diff --git a/quill/common/src/entities/zoglin.rs b/quill/common/src/entities/zoglin.rs deleted file mode 100644 index 8793439a2..000000000 --- a/quill/common/src/entities/zoglin.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for zoglin entities. -/// -/// # Example -/// A system that queries for all zoglins: -/// ```no_run -/// use quill::{Game, Position, entities::Zoglin}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Zoglin)>() { -/// println!("Found a zoglin with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Zoglin; - -pod_component_impl!(Zoglin); diff --git a/quill/common/src/entities/zombie.rs b/quill/common/src/entities/zombie.rs deleted file mode 100644 index 3532a6362..000000000 --- a/quill/common/src/entities/zombie.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for zombie entities. -/// -/// # Example -/// A system that queries for all zombies: -/// ```no_run -/// use quill::{Game, Position, entities::Zombie}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &Zombie)>() { -/// println!("Found a zombie with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct Zombie; - -pod_component_impl!(Zombie); diff --git a/quill/common/src/entities/zombie_horse.rs b/quill/common/src/entities/zombie_horse.rs deleted file mode 100644 index dc08fb6f7..000000000 --- a/quill/common/src/entities/zombie_horse.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for zombie horse entities. -/// -/// # Example -/// A system that queries for all zombie horses: -/// ```no_run -/// use quill::{Game, Position, entities::ZombieHorse}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ZombieHorse)>() { -/// println!("Found a zombie horse with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ZombieHorse; - -pod_component_impl!(ZombieHorse); diff --git a/quill/common/src/entities/zombie_villager.rs b/quill/common/src/entities/zombie_villager.rs deleted file mode 100644 index b86ab2d97..000000000 --- a/quill/common/src/entities/zombie_villager.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for zombie villager entities. -/// -/// # Example -/// A system that queries for all zombie villagers: -/// ```no_run -/// use quill::{Game, Position, entities::ZombieVillager}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ZombieVillager)>() { -/// println!("Found a zombie villager with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ZombieVillager; - -pod_component_impl!(ZombieVillager); diff --git a/quill/common/src/entities/zombified_piglin.rs b/quill/common/src/entities/zombified_piglin.rs deleted file mode 100644 index 057fbbc25..000000000 --- a/quill/common/src/entities/zombified_piglin.rs +++ /dev/null @@ -1,19 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -/// Marker component for zombified piglin entities. -/// -/// # Example -/// A system that queries for all zombified piglins: -/// ```no_run -/// use quill::{Game, Position, entities::ZombifiedPiglin}; -/// # struct MyPlugin; -/// fn print_entities_system(_plugin: &mut MyPlugin, game: &mut Game) { -/// for (entity, (position, _)) in game.query::<(&Position, &ZombifiedPiglin)>() { -/// println!("Found a zombified piglin with position {:?}", position); -/// } -/// } -/// ``` -#[derive(Debug, Copy, Clone, Zeroable, Pod)] -#[repr(C)] -pub struct ZombifiedPiglin; - -pod_component_impl!(ZombifiedPiglin); diff --git a/quill/common/src/entity.rs b/quill/common/src/entity.rs deleted file mode 100644 index 03a0b4d51..000000000 --- a/quill/common/src/entity.rs +++ /dev/null @@ -1,31 +0,0 @@ -use bytemuck::{Pod, Zeroable}; -use serde::{Deserialize, Serialize}; - -use crate::PointerMut; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Zeroable, Pod, Serialize, Deserialize)] -#[repr(transparent)] -pub struct EntityId(pub u64); - -/// Returned by `query_begin`. Contains pointers -/// to the data yielded by the query. -#[derive(Copy, Clone, Debug, Zeroable, Pod)] -#[repr(C)] -pub struct QueryData { - /// The number of (entity, component_1, ..., component_n) pairs - /// yielded by this query. - pub num_entities: u64, - /// Pointer to an array of `num_entities` entities. - pub entities_ptr: PointerMut, - /// Pointer to an array of component pointers, one for - /// each component in the call to `query_begin`. Each component - /// pointer points to `num_entities` components of the corresponding type, - /// serialized using the component's `to_bytes` method. - /// - /// Note that each component pointer is 64 bits regardless of target. - pub component_ptrs: PointerMut>, - /// Pointer to an array of `u32`s, one for each component. - /// Each `u32` is the number of bytes in the corresponding - /// component buffer. - pub component_lens: PointerMut, -} diff --git a/quill/common/src/entity_init.rs b/quill/common/src/entity_init.rs deleted file mode 100644 index 741659615..000000000 --- a/quill/common/src/entity_init.rs +++ /dev/null @@ -1,330 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// Initial state of an entity passed -/// to `Game::create_entity_builder`. -#[derive(Debug, Serialize, Deserialize)] -pub enum EntityInit { - /// Spawn an area effect cloud. - AreaEffectCloud, - - /// Spawn an armor stand. - ArmorStand, - - /// Spawn an arrow. - Arrow, - - /// Spawn a bat. - Bat, - - /// Spawn a bee. - Bee, - - /// Spawn a blaze. - Blaze, - - /// Spawn a boat. - Boat, - - /// Spawn a cat. - Cat, - - /// Spawn a cave spider. - CaveSpider, - - /// Spawn a chicken. - Chicken, - - /// Spawn a cod. - Cod, - - /// Spawn a cow. - Cow, - - /// Spawn a creeper. - Creeper, - - /// Spawn a dolphin. - Dolphin, - - /// Spawn a donkey. - Donkey, - - /// Spawn a dragon fireball. - DragonFireball, - - /// Spawn a drowned. - Drowned, - - /// Spawn an elder guardian. - ElderGuardian, - - /// Spawn an end crystal. - EndCrystal, - - /// Spawn an ender dragon. - EnderDragon, - - /// Spawn an enderman. - Enderman, - - /// Spawn an endermite. - Endermite, - - /// Spawn an evoker. - Evoker, - - /// Spawn an evoker fangs. - EvokerFangs, - - /// Spawn an experience orb. - ExperienceOrb, - - /// Spawn an eye of ender. - EyeOfEnder, - - /// Spawn a falling block. - FallingBlock, - - /// Spawn a firework rocket. - FireworkRocket, - - /// Spawn a fox. - Fox, - - /// Spawn a ghast. - Ghast, - - /// Spawn a giant. - Giant, - - /// Spawn a guardian. - Guardian, - - /// Spawn a hoglin. - Hoglin, - - /// Spawn a horse. - Horse, - - /// Spawn a husk. - Husk, - - /// Spawn an illusioner. - Illusioner, - - /// Spawn an iron golem. - IronGolem, - - /// Spawn an item. - Item, - - /// Spawn an item frame. - ItemFrame, - - /// Spawn a fireball. - Fireball, - - /// Spawn a leash knot. - LeashKnot, - - /// Spawn a lightning bolt. - LightningBolt, - - /// Spawn a llama. - Llama, - - /// Spawn a llama spit. - LlamaSpit, - - /// Spawn a magma cube. - MagmaCube, - - /// Spawn a minecart. - Minecart, - - /// Spawn a chest minecart. - ChestMinecart, - - /// Spawn a command block minecart. - CommandBlockMinecart, - - /// Spawn a furnace minecart. - FurnaceMinecart, - - /// Spawn a hopper minecart. - HopperMinecart, - - /// Spawn a spawner minecart. - SpawnerMinecart, - - /// Spawn a tnt minecart. - TntMinecart, - - /// Spawn a mule. - Mule, - - /// Spawn a mooshroom. - Mooshroom, - - /// Spawn an ocelot. - Ocelot, - - /// Spawn a painting. - Painting, - - /// Spawn a panda. - Panda, - - /// Spawn a parrot. - Parrot, - - /// Spawn a phantom. - Phantom, - - /// Spawn a pig. - Pig, - - /// Spawn a piglin. - Piglin, - - /// Spawn a piglin brute. - PiglinBrute, - - /// Spawn a pillager. - Pillager, - - /// Spawn a polar bear. - PolarBear, - - /// Spawn a tnt. - Tnt, - - /// Spawn a pufferfish. - Pufferfish, - - /// Spawn a rabbit. - Rabbit, - - /// Spawn a ravager. - Ravager, - - /// Spawn a salmon. - Salmon, - - /// Spawn a sheep. - Sheep, - - /// Spawn a shulker. - Shulker, - - /// Spawn a shulker bullet. - ShulkerBullet, - - /// Spawn a silverfish. - Silverfish, - - /// Spawn a skeleton. - Skeleton, - - /// Spawn a skeleton horse. - SkeletonHorse, - - /// Spawn a slime. - Slime, - - /// Spawn a small fireball. - SmallFireball, - - /// Spawn a snow golem. - SnowGolem, - - /// Spawn a snowball. - Snowball, - - /// Spawn a spectral arrow. - SpectralArrow, - - /// Spawn a spider. - Spider, - - /// Spawn a squid. - Squid, - - /// Spawn a stray. - Stray, - - /// Spawn a strider. - Strider, - - /// Spawn an egg. - Egg, - - /// Spawn an ender pearl. - EnderPearl, - - /// Spawn an experience bottle. - ExperienceBottle, - - /// Spawn a potion. - Potion, - - /// Spawn a trident. - Trident, - - /// Spawn a trader llama. - TraderLlama, - - /// Spawn a tropical fish. - TropicalFish, - - /// Spawn a turtle. - Turtle, - - /// Spawn a vex. - Vex, - - /// Spawn a villager. - Villager, - - /// Spawn a vindicator. - Vindicator, - - /// Spawn a wandering trader. - WanderingTrader, - - /// Spawn a witch. - Witch, - - /// Spawn a wither. - Wither, - - /// Spawn a wither skeleton. - WitherSkeleton, - - /// Spawn a wither skull. - WitherSkull, - - /// Spawn a wolf. - Wolf, - - /// Spawn a zoglin. - Zoglin, - - /// Spawn a zombie. - Zombie, - - /// Spawn a zombie horse. - ZombieHorse, - - /// Spawn a zombie villager. - ZombieVillager, - - /// Spawn a zombified piglin. - ZombifiedPiglin, - - /// Spawn a player. - Player, - - /// Spawn a fishing bobber. - FishingBobber, -} diff --git a/quill/common/src/events.rs b/quill/common/src/events.rs deleted file mode 100644 index e253da176..000000000 --- a/quill/common/src/events.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub use block_interact::{BlockInteractEvent, BlockPlacementEvent}; -pub use change::{ - BuildingAbilityEvent, CreativeFlyingEvent, FlyingAbilityEvent, GamemodeEvent, InstabreakEvent, - InvulnerabilityEvent, SneakEvent, SprintEvent, -}; -pub use entity::{EntityCreateEvent, EntityRemoveEvent, PlayerJoinEvent}; -pub use interact_entity::InteractEntityEvent; - -mod block_interact; -mod change; -mod entity; -mod interact_entity; diff --git a/quill/common/src/lib.rs b/quill/common/src/lib.rs deleted file mode 100644 index 53d8a262b..000000000 --- a/quill/common/src/lib.rs +++ /dev/null @@ -1,105 +0,0 @@ -#[macro_use] -mod utils; -#[macro_use] -pub mod component; -pub mod block; -pub mod components; -pub mod entities; -pub mod entity; -pub mod entity_init; -pub mod events; - -use std::marker::PhantomData; - -use bytemuck::{Pod, Zeroable}; - -pub use component::{Component, HostComponent}; -pub use entity::EntityId; - -/// Wrapper type that enforces 64-bit pointers -/// for all targets. Needed for ABI compatibility -/// between WASM-compiled and native-compiled plugins. -#[derive(Debug, PartialEq, Eq, Zeroable)] -#[repr(transparent)] -pub struct Pointer { - ptr: u64, - _marker: PhantomData<*const T>, -} - -impl Clone for Pointer { - fn clone(&self) -> Self { - Self { - ptr: self.ptr, - _marker: self._marker, - } - } -} - -impl Copy for Pointer {} - -impl Pointer { - pub fn new(ptr: *const T) -> Self { - Self { - ptr: ptr as usize as u64, - _marker: PhantomData, - } - } - - pub fn as_ptr(self) -> *const T { - self.ptr as usize as *const T - } -} - -impl From<*const T> for Pointer { - fn from(ptr: *const T) -> Self { - Self::new(ptr) - } -} - -// SAFETY: Pointer contains a u64 regardless -// of T. bytemuck won't derive Pod for generic -// types because it cannot guarantee this. -unsafe impl Pod for Pointer {} - -/// Wrapper type that enforces 64-bit pointers -/// for all targets. Needed for ABI compatibility -/// between WASM-compiled and native-compiled plugins. -#[derive(Debug, PartialEq, Eq, Zeroable)] -#[repr(transparent)] -pub struct PointerMut { - ptr: u64, - _marker: PhantomData<*mut T>, -} - -impl Clone for PointerMut { - fn clone(&self) -> Self { - Self { - ptr: self.ptr, - _marker: self._marker, - } - } -} - -impl Copy for PointerMut {} - -impl PointerMut { - pub fn new(ptr: *mut T) -> Self { - Self { - ptr: ptr as usize as u64, - _marker: PhantomData, - } - } - - pub fn as_mut_ptr(self) -> *mut T { - self.ptr as usize as *mut T - } -} - -impl From<*mut T> for PointerMut { - fn from(ptr: *mut T) -> Self { - Self::new(ptr) - } -} - -// SAFETY: see impl Pod for Pointer. -unsafe impl Pod for PointerMut {} diff --git a/quill/common/src/utils.rs b/quill/common/src/utils.rs deleted file mode 100644 index 54af94934..000000000 --- a/quill/common/src/utils.rs +++ /dev/null @@ -1,28 +0,0 @@ -macro_rules! c_enum { - ( - $(#[$outer:meta])* - pub enum $ident:ident { - $($variant:ident = $x:literal),* $(,)? - } - ) => { - $(#[$outer])* - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, ::serde::Serialize, ::serde::Deserialize)] - #[repr(u32)] - pub enum $ident { - $( - $variant = $x, - )* - } - - impl $ident { - pub fn from_u32(x: u32) -> Option { - match x { - $( - $x => Some(Self::$variant), - )* - _ => None, - } - } - } - } -} diff --git a/quill/docs/components.md b/quill/docs/components.md deleted file mode 100644 index 99c6fa6fd..000000000 --- a/quill/docs/components.md +++ /dev/null @@ -1,9 +0,0 @@ -# Components and Queries in Quill - -There are two types of components accessed by a plugin: -* "Plain-old-data" components, typically implementing `Copy`. To transfer these to a plugin, -the raw struct bytes are copied into the plugin's memory, and the plugin gets a pointer to that data. -* Opaque components, i.e., those not implementing `Copy`. These typically hold more data. Examples: `Inventory` of , `Window`. -A plugin accesses these components via host calls without ever getting a copy of the component itself. For example, -to get an item from an inventory, a plugin calls `quill_entity_get_inventory_item`. (The high-level `quill` API wraps -this raw call with an `Inventory` struct, but the struct doesn't actually hold the inventory. It's just a marker.) diff --git a/quill/example-plugins/block-access/Cargo.toml b/quill/example-plugins/block-access/Cargo.toml deleted file mode 100644 index f67453638..000000000 --- a/quill/example-plugins/block-access/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "block-access" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/block-access/src/lib.rs b/quill/example-plugins/block-access/src/lib.rs deleted file mode 100644 index 9813d2b36..000000000 --- a/quill/example-plugins/block-access/src/lib.rs +++ /dev/null @@ -1,26 +0,0 @@ -//! A plugin to demonstrate getting and setting blocks in the world. - -use quill::{entities::Player, BlockState, Game, Plugin, Position}; - -#[quill::plugin] -pub struct BlockAccess; - -impl Plugin for BlockAccess { - fn enable(_game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - setup.add_system(system); - Self - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn system(_plugin: &mut BlockAccess, game: &mut Game) { - // Set the blocks each player is standing on - // to bedrock. - for (_entity, (_, pos)) in game.query::<(&Player, &Position)>() { - let block_pos = pos.block(); - - game.set_block(block_pos, BlockState::from_id(33).unwrap()) - .ok(); - } -} diff --git a/quill/example-plugins/block-place/Cargo.toml b/quill/example-plugins/block-place/Cargo.toml deleted file mode 100644 index 26b61fa9d..000000000 --- a/quill/example-plugins/block-place/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "block-place" -version = "0.1.0" -authors = ["Amber Kowalski "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/block-place/src/lib.rs b/quill/example-plugins/block-place/src/lib.rs deleted file mode 100644 index 19913eb7f..000000000 --- a/quill/example-plugins/block-place/src/lib.rs +++ /dev/null @@ -1,21 +0,0 @@ -//! Allows the user to place blocks. - -use quill::{events::BlockPlacementEvent, Game, Plugin}; - -#[quill::plugin] -pub struct BlockPlace; - -impl Plugin for BlockPlace { - fn enable(_game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - setup.add_system(system); - Self - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn system(_plugin: &mut BlockPlace, game: &mut Game) { - for (_entity, _event) in game.query::<&BlockPlacementEvent>() { - println!("A client has placed a block!"); - } -} diff --git a/quill/example-plugins/observe-creativemode-flight-event/Cargo.toml b/quill/example-plugins/observe-creativemode-flight-event/Cargo.toml deleted file mode 100644 index 77fdfd2eb..000000000 --- a/quill/example-plugins/observe-creativemode-flight-event/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "observe-creativemode-flight-event" -version = "0.1.0" -authors = ["Miro Andrin "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs b/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs deleted file mode 100644 index 9d84f159d..000000000 --- a/quill/example-plugins/observe-creativemode-flight-event/src/lib.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* -This plugin observers the CreativeFlightEvent printing a msg when someone starts -flying. -*/ - -use quill::{ - components::Sprinting, - events::{CreativeFlyingEvent, SneakEvent}, - Game, Plugin, Setup, -}; - -#[quill::plugin] -struct FlightPlugin {} - -impl Plugin for FlightPlugin { - fn enable(_game: &mut Game, setup: &mut Setup) -> Self { - setup.add_system(flight_observer_system); - setup.add_system(sneak_observer_system); - setup.add_system(sprinting_observer_system); - FlightPlugin {} - } - - fn disable(self, _game: &mut Game) {} -} - -fn flight_observer_system(_plugin: &mut FlightPlugin, game: &mut Game) { - for (entity, change) in game.query::<&CreativeFlyingEvent>() { - if change.is_flying { - entity.send_message("Enjoy your flight!"); - } else { - entity.send_message("Hope you enjoyed your flight."); - } - } -} - -fn sneak_observer_system(_plugin: &mut FlightPlugin, game: &mut Game) { - for (player, change) in game.query::<&SneakEvent>() { - if change.is_sneaking { - player.send_message("Enjoy sneaking!"); - } else { - player.send_message("How was it to be sneaking?"); - } - } -} - -fn sprinting_observer_system(_plugin: &mut FlightPlugin, game: &mut Game) { - for (player, sprinting) in game.query::<&Sprinting>() { - if sprinting.0 { - player.send_message("Are you sprinting?"); - } - } -} diff --git a/quill/example-plugins/particle-example/Cargo.toml b/quill/example-plugins/particle-example/Cargo.toml deleted file mode 100644 index 8cf008b7c..000000000 --- a/quill/example-plugins/particle-example/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "particle-example" -version = "0.1.0" -authors = ["Gijs de Jong "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/particle-example/src/lib.rs b/quill/example-plugins/particle-example/src/lib.rs deleted file mode 100644 index bd84bb58d..000000000 --- a/quill/example-plugins/particle-example/src/lib.rs +++ /dev/null @@ -1,59 +0,0 @@ -use quill::{Game, Particle, ParticleKind, Plugin, Position}; - -#[quill::plugin] -struct ParticleExample {} - -impl Plugin for ParticleExample { - fn enable(_game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - setup.add_system(particle_system); - - ParticleExample {} - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn particle_system(_plugin: &mut ParticleExample, game: &mut Game) { - let mut position = Position { - x: 0.0, - y: 65.0, - z: 0.0, - pitch: 0.0, - yaw: 0.0, - }; - - let particle = Particle { - kind: ParticleKind::SoulFireFlame, - offset_x: 0.0, - offset_y: 0.0, - offset_z: 0.0, - count: 1, - }; - - game.spawn_particle(position, particle); - - position.x += 1.0; - - let particle2 = Particle { - kind: ParticleKind::Dust { - red: 1.0, - green: 1.0, - blue: 0.0, - scale: 3.5, - }, - offset_x: 0.0, - offset_y: 0.0, - offset_z: 0.0, - count: 1, - }; - - // Initialise an empty ecs-entity builder - let mut builder = game.create_empty_entity_builder(); - - // Add the required components to display a particle effect - builder.add(position); - builder.add(particle2); - - // Finish the builder, this will spawn the ecs-entity in the ecs-world - builder.finish(); -} diff --git a/quill/example-plugins/plugin-message/Cargo.toml b/quill/example-plugins/plugin-message/Cargo.toml deleted file mode 100644 index 4624566a1..000000000 --- a/quill/example-plugins/plugin-message/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "plugin-message" -version = "0.1.0" -authors = ["Derek Lee "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/plugin-message/src/lib.rs b/quill/example-plugins/plugin-message/src/lib.rs deleted file mode 100644 index 9b66f8c7a..000000000 --- a/quill/example-plugins/plugin-message/src/lib.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! An example plugin that uses BungeeCord's plugin messaging channel to -//! send a player to a server named lobby. -use quill::{entities::Player, BlockPosition, Game, Plugin, Position}; - -#[quill::plugin] -pub struct PluginMessage; - -impl Plugin for PluginMessage { - fn enable(_game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - setup.add_system(plugin_message_system); - Self - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn plugin_message_system(_plugin: &mut PluginMessage, game: &mut Game) { - for (entity, (_, position)) in game.query::<(&Player, &Position)>() { - if let BlockPosition { - x: 10..=12, - y: _, - z: 10..=12, - } = position.block() - { - let mut data = Vec::new(); - data.extend_from_slice(&u16::to_be_bytes(7)); - data.extend_from_slice(b"Connect"); - data.extend_from_slice(&u16::to_be_bytes(5)); - data.extend_from_slice(b"lobby"); - Game::send_plugin_message(entity.id(), "bungeecord:main", &data); - } - } -} diff --git a/quill/example-plugins/query-entities/Cargo.toml b/quill/example-plugins/query-entities/Cargo.toml deleted file mode 100644 index 6c9815807..000000000 --- a/quill/example-plugins/query-entities/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "query-entities" -version = "0.1.0" -authors = ["Caelum van Ispelen "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } -rand = "0.8" diff --git a/quill/example-plugins/query-entities/src/lib.rs b/quill/example-plugins/query-entities/src/lib.rs deleted file mode 100644 index 527fd7546..000000000 --- a/quill/example-plugins/query-entities/src/lib.rs +++ /dev/null @@ -1,43 +0,0 @@ -//! An example plugin that spawns 10,000 entities -//! on startup, then moves them each tick using a query. - -use quill::{entities::PiglinBrute, EntityInit, Game, Plugin, Position}; -use rand::Rng; - -#[quill::plugin] -struct QueryEntities { - tick_counter: u64, -} - -impl Plugin for QueryEntities { - fn enable(game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - // Spawn 10,000 piglin brutes - for x in 0..100 { - for z in 0..100 { - let pos = Position { - x: (x - 50) as f64 * 12.0, - y: 64.0, - z: (z - 50) as f64 * 12.0, - pitch: rand::thread_rng().gen_range(30.0..330.0), - yaw: rand::thread_rng().gen_range(0.0..360.0), - }; - game.create_entity_builder(pos, EntityInit::PiglinBrute) - .finish(); - } - } - - setup.add_system(query_system); - - Self { tick_counter: 0 } - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn query_system(plugin: &mut QueryEntities, game: &mut Game) { - // Make the piglin brutes float into the air. - plugin.tick_counter += 1; - for (_, (mut position, _piglin_brute)) in game.query::<(&mut Position, &PiglinBrute)>() { - position.y += 0.1 * ((plugin.tick_counter as f64 / 20.0).sin() + 1.0); - } -} diff --git a/quill/example-plugins/simple/Cargo.toml b/quill/example-plugins/simple/Cargo.toml deleted file mode 100644 index 145d598bc..000000000 --- a/quill/example-plugins/simple/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "simple-plugin" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } -rand = "0.8" diff --git a/quill/example-plugins/simple/src/lib.rs b/quill/example-plugins/simple/src/lib.rs deleted file mode 100644 index d6ac19dae..000000000 --- a/quill/example-plugins/simple/src/lib.rs +++ /dev/null @@ -1,60 +0,0 @@ -use quill::{ - components::{CustomName, Name}, - entities::Cow, - EntityInit, Game, Gamemode, Plugin, Position, Setup, Uuid, -}; -use rand::Rng; - -#[quill::plugin] -struct SimplePlugin { - tick_counter: u64, -} - -impl Plugin for SimplePlugin { - fn enable(_game: &mut Game, setup: &mut Setup) -> Self { - setup.add_system(test_system); - SimplePlugin { tick_counter: 0 } - } - - fn disable(self, _game: &mut Game) {} -} - -fn test_system(plugin: &mut SimplePlugin, game: &mut Game) { - for (entity, (position, name, gamemode, uuid)) in - game.query::<(&Position, &Name, &Gamemode, &Uuid)>() - { - entity.send_message(format!( - "[{}] Hi {}. Your gamemode is {:?} and your position is {:.1?} and your UUID is {}", - plugin.tick_counter, - name, - gamemode, - position, - uuid.to_hyphenated() - )); - - if plugin.tick_counter % 100 == 0 { - entity.send_message("Spawning a mob on you"); - game.create_entity_builder(position, random_mob()) - .with(CustomName::new("Custom name")) - .finish(); - } - } - for (_, (mut position, _)) in game.query::<(&mut Position, &Cow)>() { - position.y += 0.1; - } - - plugin.tick_counter += 1; -} - -fn random_mob() -> EntityInit { - let mut entities = vec![ - EntityInit::Zombie, - EntityInit::Piglin, - EntityInit::Zoglin, - EntityInit::Skeleton, - EntityInit::Enderman, - EntityInit::Cow, - ]; - let index = rand::thread_rng().gen_range(0..entities.len()); - entities.remove(index) -} diff --git a/quill/example-plugins/titles/Cargo.toml b/quill/example-plugins/titles/Cargo.toml deleted file mode 100644 index 1041d93e1..000000000 --- a/quill/example-plugins/titles/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "titles" -version = "0.1.0" -authors = ["Gijs de Jong "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -quill = { path = "../../api" } diff --git a/quill/example-plugins/titles/src/lib.rs b/quill/example-plugins/titles/src/lib.rs deleted file mode 100644 index 634f5b003..000000000 --- a/quill/example-plugins/titles/src/lib.rs +++ /dev/null @@ -1,53 +0,0 @@ -use quill::{entities::Player, Game, Plugin, Text, TextComponent, TextComponentBuilder, Title}; - -#[quill::plugin] -struct TitleExample { - tick_count: u32, - title_active: bool, -} - -impl Plugin for TitleExample { - fn enable(_game: &mut quill::Game, setup: &mut quill::Setup) -> Self { - setup.add_system(title_system); - - TitleExample { - tick_count: 0, - title_active: false, - } - } - - fn disable(self, _game: &mut quill::Game) {} -} - -fn title_system(plugin: &mut TitleExample, game: &mut Game) { - // Run once every 100 ticks (5 seconds) - if plugin.tick_count % 100 == 0 && !plugin.title_active { - let component = TextComponentBuilder::gray(TextComponent::from("Wicked fast Minecraft!")); - let title_component = TextComponentBuilder::white(TextComponent::from("Hello Feather!")); - - // Create a title to send to the player - let title = Title { - title: Some(Text::from(title_component)), - sub_title: Some(Text::from(component)), - fade_in: 5, - stay: 400, - fade_out: 5, - }; - - // Send the title to all online players - for (entity, _) in game.query::<&Player>() { - entity.send_title(&title); - plugin.title_active = true; - } - } - - if plugin.tick_count % 250 == 0 && plugin.title_active { - // Reset the title for all players - for (entity, _) in game.query::<&Player>() { - entity.reset_title(); - plugin.title_active = false; - } - } - - plugin.tick_count += 1; -} diff --git a/quill/plugin-format/Cargo.toml b/quill/plugin-format/Cargo.toml deleted file mode 100644 index 7043f9c8f..000000000 --- a/quill/plugin-format/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "quill-plugin-format" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -anyhow = "1" -tar = "0.4" -flate2 = "1" -serde = { version = "1", features = ["derive"] } -serde_json = "1" -serde_with = "1" -target-lexicon = "0.11" diff --git a/quill/plugin-format/src/lib.rs b/quill/plugin-format/src/lib.rs deleted file mode 100644 index 20a55c417..000000000 --- a/quill/plugin-format/src/lib.rs +++ /dev/null @@ -1,206 +0,0 @@ -//! Defines the file format used for compiled [`quill`](https://github.com/feather-rs/quill) -//! plugins. -//! -//! Currently, the file format is based on gzipped `tar` files. -mod metadata; - -use std::{ - borrow::Cow, - io::{Cursor, Read, Write}, -}; - -use anyhow::{anyhow, bail}; -use flate2::Compression; -use tar::Header; - -pub use metadata::{PluginMetadata, PluginTarget}; - -use target_lexicon::OperatingSystem; -pub use target_lexicon::Triple; - -const METADATA_PATH: &str = "metadata.json"; - -/// A plugin definition stored in the Quill file format. -pub struct PluginFile<'a> { - module: Cow<'a, [u8]>, - metadata: PluginMetadata, -} - -impl<'a> PluginFile<'a> { - pub fn new(module: impl Into>, metadata: PluginMetadata) -> Self { - Self { - module: module.into(), - metadata, - } - } - - /// Returns the plugin's module. - /// - /// If the plugin is a WebAssembly plugin, - /// then this is the WASM bytecode. - /// - /// If the plugin is a native plugin, then - /// this is the contents of the shared library - /// containing the plugin. - pub fn module(&self) -> &[u8] { - &*self.module - } - - pub fn metadata(&self) -> &PluginMetadata { - &self.metadata - } - - /// Writes this plugin into a `Vec`. - /// - /// `compression_level` should be between 0 (worst) and 9 (best, but slow). - pub fn encode(&self, compression_level: u32) -> Vec { - let vec = Vec::new(); - let mut archive_builder = tar::Builder::new(flate2::write::GzEncoder::new( - vec, - Compression::new(compression_level), - )); - - self.write_metadata(&mut archive_builder); - self.write_module(&mut archive_builder).unwrap(); - - archive_builder - .into_inner() - .expect("write to Vec failed") - .finish() - .expect("compression failed") - } - - fn write_metadata(&self, archive_builder: &mut tar::Builder) { - let metadata = serde_json::to_string_pretty(&self.metadata) - .expect("failed to serialize PluginMetadata"); - - let mut header = Header::new_gnu(); - header.set_size(metadata.len() as u64); - header.set_mode(0o644); - - archive_builder - .append_data( - &mut header, - METADATA_PATH, - Cursor::new(metadata.into_bytes()), - ) - .expect("write to Vec failed"); - } - - fn write_module(&self, archive_builder: &mut tar::Builder) -> anyhow::Result<()> { - let mut header = Header::new_gnu(); - header.set_size(self.module.len() as u64); - header.set_mode(0o644); - - let path = get_module_path(&self.metadata.target)?; - - archive_builder - .append_data(&mut header, path, Cursor::new(self.module())) - .expect("write to Vec failed"); - - Ok(()) - } -} - -impl PluginFile<'static> { - /// Deserializes a plugin file. - pub fn decode(data: impl Read) -> anyhow::Result { - let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(data)); - - // Current limitation: the metadata must appear - // in the tarball before the WASM module. - - let mut metadata = None; - let mut module = None; - let mut module_path = None; - for entry in archive.entries()? { - let entry = entry?; - - match &*entry.path()?.to_string_lossy() { - s if s == METADATA_PATH => { - let meta = Self::decode_metadata(entry)?; - module_path = Some(get_module_path(&meta.target)?); - metadata = Some(meta); - } - s if Some(s) == module_path => module = Some(Self::decode_wasm_bytecode(entry)?), - _ => (), - } - } - - let metadata = - metadata.ok_or_else(|| anyhow!("missing plugin metadata ({})", METADATA_PATH))?; - let module = module - .ok_or_else(|| anyhow!("missing module ({:?})", module_path))? - .into(); - Ok(Self { module, metadata }) - } - - fn decode_metadata(reader: impl Read) -> anyhow::Result { - serde_json::from_reader(reader).map_err(anyhow::Error::from) - } - - fn decode_wasm_bytecode(mut reader: impl Read) -> anyhow::Result> { - let mut wasm = Vec::new(); - reader.read_to_end(&mut wasm)?; - Ok(wasm) - } -} - -fn get_module_path(target: &PluginTarget) -> anyhow::Result<&'static str> { - Ok(match target { - PluginTarget::Wasm => "module.wasm", - PluginTarget::Native { target_triple } => match target_triple.operating_system { - OperatingSystem::Linux => "module.so", - OperatingSystem::Darwin => "module.dylib", - OperatingSystem::Windows => "module.dll", - os => bail!("unsupported plugin operating system {:?}", os), - }, - }) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn roundtrip_wasm() { - let module = vec![0xFF; 1024]; - let metadata = PluginMetadata { - name: "TestPlugin".to_owned(), - identifier: "test-plugin".to_owned(), - version: "0.1.0".to_owned(), - api_version: "0.1.0".to_owned(), - description: Some("test plugin".to_owned()), - authors: vec!["caelunshun".to_owned()], - target: PluginTarget::Wasm, - }; - let file = PluginFile::new(module.clone(), metadata.clone()); - let encoded = file.encode(8); - let decoded = PluginFile::decode(Cursor::new(encoded)).unwrap(); - - assert_eq!(decoded.metadata(), &metadata); - assert_eq!(decoded.module(), module); - } - - #[test] - fn roundtrip_native() { - let module = vec![0xEE; 1024]; - let metadata = PluginMetadata { - name: "TestPlugin".to_owned(), - identifier: "test-plugin".to_owned(), - version: "0.1.0".to_owned(), - api_version: "0.1.0".to_owned(), - description: Some("test plugin".to_owned()), - authors: vec!["caelunshun".to_owned()], - target: PluginTarget::Native { - target_triple: Triple::host(), - }, - }; - let file = PluginFile::new(module.clone(), metadata.clone()); - let encoded = file.encode(8); - let decoded = PluginFile::decode(Cursor::new(encoded)).unwrap(); - - assert_eq!(decoded.metadata(), &metadata); - assert_eq!(decoded.module(), module); - } -} diff --git a/quill/plugin-format/src/metadata.rs b/quill/plugin-format/src/metadata.rs deleted file mode 100644 index 66cd70eb5..000000000 --- a/quill/plugin-format/src/metadata.rs +++ /dev/null @@ -1,36 +0,0 @@ -use serde::{Deserialize, Serialize}; -use serde_with::{serde_as, DisplayFromStr}; -use target_lexicon::Triple; - -/// A plugin's metadata, stored alongside its WASM module. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct PluginMetadata { - /// Plugin name, no spaces - pub name: String, - /// Plugin identifier (crate name), snake_case or kebab-case - pub identifier: String, - /// Plugin version - pub version: String, - /// `quill` version used to compile the plugin - pub api_version: String, - - #[serde(default)] - pub description: Option, - #[serde(default)] - pub authors: Vec, - - pub target: PluginTarget, -} - -/// Type of a plugin -#[serde_as] -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum PluginTarget { - Wasm, - Native { - /// The target the plugin has been compiled to. - #[serde_as(as = "DisplayFromStr")] - target_triple: Triple, - }, -} diff --git a/feather/common/src/chat.rs b/quill/src/chat.rs similarity index 97% rename from feather/common/src/chat.rs rename to quill/src/chat.rs index 287860495..d0122739d 100644 --- a/feather/common/src/chat.rs +++ b/quill/src/chat.rs @@ -1,4 +1,5 @@ -use base::{Text, Title}; +use libcraft::{Text, Title}; +use vane::Component; /// An entity's "mailbox" for receiving chat messages. /// @@ -12,6 +13,8 @@ pub struct ChatBox { preference: ChatPreference, } +impl Component for ChatBox {} + impl ChatBox { pub fn new(preference: ChatPreference) -> Self { Self { diff --git a/feather/base/src/chunk_lock.rs b/quill/src/chunk_lock.rs similarity index 82% rename from feather/base/src/chunk_lock.rs rename to quill/src/chunk_lock.rs index 033281d09..93fd8bd4b 100644 --- a/feather/base/src/chunk_lock.rs +++ b/quill/src/chunk_lock.rs @@ -8,6 +8,7 @@ use anyhow::bail; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; pub type ChunkHandle = Arc; + /// A wrapper around a RwLock. Cannot be locked for writing when unloaded. /// This structure exists so that a chunk can be read from even after being unloaded without accidentaly writing to it. #[derive(Debug)] @@ -15,17 +16,20 @@ pub struct ChunkLock { loaded: AtomicBool, lock: RwLock, } + impl ChunkLock { - pub fn new(chunk: Chunk, loaded: bool) -> Self { + pub fn new(chunk: Chunk) -> Self { Self { - loaded: AtomicBool::new(loaded), + loaded: AtomicBool::new(true), lock: RwLock::new(chunk), } } + /// Returns whether the chunk is loaded. pub fn is_loaded(&self) -> bool { self.loaded.load(Ordering::SeqCst) } + /// Attempts to set the chunk as unloaded. Returns an error if the chunk is locked as writable. pub fn set_unloaded(&self) -> anyhow::Result<()> { if self.loaded.swap(false, Ordering::SeqCst) { @@ -37,23 +41,24 @@ impl ChunkLock { } Ok(()) } + /// Sets the chunk as loaded and returns the previous state. pub fn set_loaded(&self) -> bool { self.loaded.swap(true, Ordering::SeqCst) } - /// Locks this chunk with read acccess. Doesn't block. + /// Locks this chunk with read access. Doesn't block. /// Returns None if the chunk is unloaded or locked for writing, Some otherwise. pub fn try_read(&self) -> Option> { self.lock.try_read() } - /// Locks this chunk with read acccess, blocking the current thread until it can be acquired. - /// Returns None if the chunk is unloaded, Some otherwise. + /// Locks this chunk with read access, blocking the current thread until it can be acquired. pub fn read(&self) -> RwLockReadGuard { self.lock.read() } - /// Locks this chunk with exclusive write acccess. Doesn't block. + + /// Locks this chunk with exclusive write access. Doesn't block. /// Returns None if the chunk is unloaded or locked already, Some otherwise. pub fn try_write(&self) -> Option> { if self.is_loaded() { @@ -62,6 +67,7 @@ impl ChunkLock { None } } + /// Locks this chunk with exclusive write acccess, blocking the current thread until it can be acquired. /// Returns None if the chunk is unloaded, Some otherwise. pub fn write(&self) -> Option> { @@ -79,20 +85,22 @@ impl ChunkLock { #[cfg(test)] mod tests { + use crate::world::Sections; + use crate::ChunkPosition; use std::{ thread::{sleep, spawn, JoinHandle}, time::Duration, }; - use libcraft_core::ChunkPosition; - use super::*; - fn empty_lock(x: i32, z: i32, loaded: bool) -> ChunkLock { - ChunkLock::new(Chunk::new(ChunkPosition::new(x, z)), loaded) + + fn empty_lock(x: i32, z: i32) -> ChunkLock { + ChunkLock::new(Chunk::new(ChunkPosition::new(x, z), Sections(16), 0)) } + #[test] fn normal_function() { - let lock = empty_lock(0, 0, true); + let lock = empty_lock(0, 0); for _ in 0..100 { // It should be possible to lock in any way if rand::random::() { @@ -102,19 +110,24 @@ mod tests { } } } + #[test] fn cannot_write_unloaded() { - let lock = empty_lock(0, 0, false); + let lock = empty_lock(0, 0); + lock.set_unloaded(); assert!(lock.try_write().is_none()) } + #[test] fn can_read_unloaded() { - let lock = empty_lock(0, 0, false); + let lock = empty_lock(0, 0); + lock.set_unloaded(); assert!(lock.try_read().is_some()) } + #[test] fn multithreaded() { - let lock = Arc::new(empty_lock(0, 0, true)); + let lock = Arc::new(empty_lock(0, 0)); let mut handles: Vec> = vec![]; for _ in 0..20 { let l = lock.clone(); diff --git a/quill/common/src/components.rs b/quill/src/components.rs similarity index 66% rename from quill/common/src/components.rs rename to quill/src/components.rs index 352c45b69..1c6121ce6 100644 --- a/quill/common/src/components.rs +++ b/quill/src/components.rs @@ -1,31 +1,51 @@ -//! Components not associated with a specific type of entity. +//! Components for entities. //! //! See the [entities module](crate::entities) for entity-specific //! components. use std::fmt::Display; +use derive_more::{Deref, DerefMut}; +use libcraft::{ChunkPosition, EntityKind, Gamemode, Inventory, Particle, Position}; use serde::{Deserialize, Serialize}; use smartstring::{LazyCompact, SmartString}; +use uuid::Uuid; +use vane::Component; -use libcraft_core::Gamemode; +use crate::{events::InventorySlotUpdateEvent, WorldId}; + +/// The kind of an entity. +#[derive(Copy, Clone, Debug, Deref, DerefMut)] +pub struct EntityKindComponent(pub EntityKind); +impl Component for EntityKindComponent {} + +/// Stores the position of an entity. +#[derive(Copy, Clone, Debug, Deref, DerefMut)] +pub struct EntityPosition(pub Position); +impl Component for EntityPosition {} + +/// Stores the current chunk of an entity. +#[derive(Copy, Clone, Debug, Deref, DerefMut)] +pub struct EntityChunk(pub ChunkPosition); +impl Component for EntityChunk {} + +/// Stores a player's gamemode. +#[derive(Copy, Clone, Debug, Deref, DerefMut)] +pub struct PlayerGamemode(pub Gamemode); +impl Component for PlayerGamemode {} + +/// An entity's UUID. +/// +/// For players, this is the UUID of the player account when +/// the server is in online mode. +#[derive(Copy, Clone, Debug, Deref, DerefMut)] +pub struct EntityUuid(pub Uuid); +impl Component for EntityUuid {} /// Whether an entity is touching the ground. -#[derive( - Copy, - Clone, - Debug, - PartialEq, - Eq, - Hash, - Serialize, - Deserialize, - derive_more::Deref, - derive_more::DerefMut, -)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Deref, DerefMut)] pub struct OnGround(pub bool); - -bincode_component_impl!(OnGround); +impl Component for OnGround {} /// A player's username. /// @@ -36,8 +56,7 @@ bincode_component_impl!(OnGround); /// if you need to name an entity. #[derive(Clone, Debug, Serialize, Deserialize, derive_more::Deref)] pub struct Name(SmartString); - -bincode_component_impl!(Name); +impl Component for Name {} impl Name { pub fn new(string: &str) -> Self { @@ -63,8 +82,7 @@ impl Display for Name { /// Giving a player a custom name has no effect. #[derive(Clone, Debug, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut)] pub struct CustomName(SmartString); - -bincode_component_impl!(CustomName); +impl Component for CustomName {} impl CustomName { /// Creates a custom name from a string. @@ -92,8 +110,7 @@ impl Display for CustomName { Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, )] pub struct WalkSpeed(pub f32); - -bincode_component_impl!(WalkSpeed); +impl Component for WalkSpeed {} impl Default for WalkSpeed { fn default() -> Self { @@ -106,8 +123,7 @@ impl Default for WalkSpeed { Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, )] pub struct CreativeFlyingSpeed(pub f32); - -bincode_component_impl!(CreativeFlyingSpeed); +impl Component for CreativeFlyingSpeed {} impl Default for CreativeFlyingSpeed { fn default() -> Self { @@ -129,8 +145,7 @@ impl Default for CreativeFlyingSpeed { derive_more::DerefMut, )] pub struct CanCreativeFly(pub bool); - -bincode_component_impl!(CanCreativeFly); +impl Component for CanCreativeFly {} /// Whether a player is flying (like in creative mode, so it does not reflect if the player is flying by other means) #[derive( @@ -146,8 +161,7 @@ bincode_component_impl!(CanCreativeFly); derive_more::DerefMut, )] pub struct CreativeFlying(pub bool); - -bincode_component_impl!(CreativeFlying); +impl Component for CreativeFlying {} /// Whether a player can place and destroy blocks #[derive( @@ -163,8 +177,7 @@ bincode_component_impl!(CreativeFlying); derive_more::DerefMut, )] pub struct CanBuild(pub bool); - -bincode_component_impl!(CanBuild); +impl Component for CanBuild {} /// Whether a player breaks blocks instantly (like in creative mode) #[derive( @@ -180,8 +193,7 @@ bincode_component_impl!(CanBuild); derive_more::DerefMut, )] pub struct Instabreak(pub bool); - -bincode_component_impl!(Instabreak); +impl Component for Instabreak {} /// Whether a player is immune to damage #[derive( @@ -197,8 +209,7 @@ bincode_component_impl!(Instabreak); derive_more::DerefMut, )] pub struct Invulnerable(pub bool); - -bincode_component_impl!(Invulnerable); +impl Component for Invulnerable {} /// Whether an entity is sneaking, like in pressing shift. #[derive( @@ -214,13 +225,14 @@ bincode_component_impl!(Invulnerable); derive_more::DerefMut, )] pub struct Sneaking(pub bool); -bincode_component_impl!(Sneaking); +impl Component for Sneaking {} /// A player's previous gamemode #[derive( Copy, Clone, Debug, + Default, PartialEq, Eq, Hash, @@ -230,8 +242,7 @@ bincode_component_impl!(Sneaking); derive_more::DerefMut, )] pub struct PreviousGamemode(pub Option); - -bincode_component_impl!(PreviousGamemode); +impl Component for PreviousGamemode {} impl PreviousGamemode { /// Gets a previous gamemode from its ID. @@ -262,7 +273,7 @@ impl PreviousGamemode { Copy, Clone, Debug, PartialEq, Serialize, Deserialize, derive_more::Deref, derive_more::DerefMut, )] pub struct Health(pub f32); -bincode_component_impl!(Health); +impl Component for Health {} /// A component on players that tracks if they are sprinting or not. #[derive( @@ -278,9 +289,42 @@ bincode_component_impl!(Health); derive_more::DerefMut, )] pub struct Sprinting(pub bool); +impl Component for Sprinting {} + impl Sprinting { pub fn new(value: bool) -> Self { Sprinting(value) } } -bincode_component_impl!(Sprinting); + +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, derive_more::Deref, derive_more::DerefMut)] +pub struct EntityWorld(pub WorldId); +impl Component for EntityWorld {} + +/// An entity's inventory. +#[derive(Deref, DerefMut, Debug)] +pub struct EntityInventory(pub Inventory); + +impl EntityInventory { + pub fn new(inventory: Inventory) -> Self { + Self(inventory) + } +} + +impl Component for EntityInventory { + fn on_inserted(&mut self, ecs: &vane::Entities, owner: vane::Entity) { + let bus = ecs.bus(); + self.0.set_slot_mutated_callback(move |area, slot| { + let event = InventorySlotUpdateEvent { + entity: owner, + area, + slot, + }; + bus.defer(|ecs| ecs.insert_event(event)); + }); + } +} + +#[derive(Debug, Deref, DerefMut)] +pub struct EntityParticle(pub Particle); +impl Component for EntityParticle {} diff --git a/quill/src/entities.rs b/quill/src/entities.rs new file mode 100644 index 000000000..7a81fefae --- /dev/null +++ b/quill/src/entities.rs @@ -0,0 +1,454 @@ +// This file is @generated. Please do not edit. +use vane::Component; +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for area_effect_cloud entities."] +pub struct AreaEffectCloud; +impl Component for AreaEffectCloud {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for armor_stand entities."] +pub struct ArmorStand; +impl Component for ArmorStand {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for arrow entities."] +pub struct Arrow; +impl Component for Arrow {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for axolotl entities."] +pub struct Axolotl; +impl Component for Axolotl {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for bat entities."] +pub struct Bat; +impl Component for Bat {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for bee entities."] +pub struct Bee; +impl Component for Bee {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for blaze entities."] +pub struct Blaze; +impl Component for Blaze {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for boat entities."] +pub struct Boat; +impl Component for Boat {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for cat entities."] +pub struct Cat; +impl Component for Cat {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for cave_spider entities."] +pub struct CaveSpider; +impl Component for CaveSpider {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for chicken entities."] +pub struct Chicken; +impl Component for Chicken {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for cod entities."] +pub struct Cod; +impl Component for Cod {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for cow entities."] +pub struct Cow; +impl Component for Cow {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for creeper entities."] +pub struct Creeper; +impl Component for Creeper {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for dolphin entities."] +pub struct Dolphin; +impl Component for Dolphin {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for donkey entities."] +pub struct Donkey; +impl Component for Donkey {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for dragon_fireball entities."] +pub struct DragonFireball; +impl Component for DragonFireball {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for drowned entities."] +pub struct Drowned; +impl Component for Drowned {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for elder_guardian entities."] +pub struct ElderGuardian; +impl Component for ElderGuardian {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for end_crystal entities."] +pub struct EndCrystal; +impl Component for EndCrystal {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for ender_dragon entities."] +pub struct EnderDragon; +impl Component for EnderDragon {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for enderman entities."] +pub struct Enderman; +impl Component for Enderman {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for endermite entities."] +pub struct Endermite; +impl Component for Endermite {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for evoker entities."] +pub struct Evoker; +impl Component for Evoker {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for evoker_fangs entities."] +pub struct EvokerFangs; +impl Component for EvokerFangs {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for experience_orb entities."] +pub struct ExperienceOrb; +impl Component for ExperienceOrb {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for eye_of_ender entities."] +pub struct EyeOfEnder; +impl Component for EyeOfEnder {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for falling_block entities."] +pub struct FallingBlock; +impl Component for FallingBlock {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for firework_rocket entities."] +pub struct FireworkRocket; +impl Component for FireworkRocket {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for fox entities."] +pub struct Fox; +impl Component for Fox {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for ghast entities."] +pub struct Ghast; +impl Component for Ghast {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for giant entities."] +pub struct Giant; +impl Component for Giant {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for glow_item_frame entities."] +pub struct GlowItemFrame; +impl Component for GlowItemFrame {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for glow_squid entities."] +pub struct GlowSquid; +impl Component for GlowSquid {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for goat entities."] +pub struct Goat; +impl Component for Goat {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for guardian entities."] +pub struct Guardian; +impl Component for Guardian {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for hoglin entities."] +pub struct Hoglin; +impl Component for Hoglin {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for horse entities."] +pub struct Horse; +impl Component for Horse {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for husk entities."] +pub struct Husk; +impl Component for Husk {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for illusioner entities."] +pub struct Illusioner; +impl Component for Illusioner {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for iron_golem entities."] +pub struct IronGolem; +impl Component for IronGolem {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for item entities."] +pub struct Item; +impl Component for Item {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for item_frame entities."] +pub struct ItemFrame; +impl Component for ItemFrame {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for fireball entities."] +pub struct Fireball; +impl Component for Fireball {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for leash_knot entities."] +pub struct LeashKnot; +impl Component for LeashKnot {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for lightning_bolt entities."] +pub struct LightningBolt; +impl Component for LightningBolt {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for llama entities."] +pub struct Llama; +impl Component for Llama {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for llama_spit entities."] +pub struct LlamaSpit; +impl Component for LlamaSpit {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for magma_cube entities."] +pub struct MagmaCube; +impl Component for MagmaCube {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for marker entities."] +pub struct Marker; +impl Component for Marker {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for minecart entities."] +pub struct Minecart; +impl Component for Minecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for chest_minecart entities."] +pub struct ChestMinecart; +impl Component for ChestMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for command_block_minecart entities."] +pub struct CommandBlockMinecart; +impl Component for CommandBlockMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for furnace_minecart entities."] +pub struct FurnaceMinecart; +impl Component for FurnaceMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for hopper_minecart entities."] +pub struct HopperMinecart; +impl Component for HopperMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for spawner_minecart entities."] +pub struct SpawnerMinecart; +impl Component for SpawnerMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for tnt_minecart entities."] +pub struct TntMinecart; +impl Component for TntMinecart {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for mule entities."] +pub struct Mule; +impl Component for Mule {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for mooshroom entities."] +pub struct Mooshroom; +impl Component for Mooshroom {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for ocelot entities."] +pub struct Ocelot; +impl Component for Ocelot {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for painting entities."] +pub struct Painting; +impl Component for Painting {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for panda entities."] +pub struct Panda; +impl Component for Panda {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for parrot entities."] +pub struct Parrot; +impl Component for Parrot {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for phantom entities."] +pub struct Phantom; +impl Component for Phantom {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for pig entities."] +pub struct Pig; +impl Component for Pig {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for piglin entities."] +pub struct Piglin; +impl Component for Piglin {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for piglin_brute entities."] +pub struct PiglinBrute; +impl Component for PiglinBrute {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for pillager entities."] +pub struct Pillager; +impl Component for Pillager {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for polar_bear entities."] +pub struct PolarBear; +impl Component for PolarBear {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for tnt entities."] +pub struct Tnt; +impl Component for Tnt {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for pufferfish entities."] +pub struct Pufferfish; +impl Component for Pufferfish {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for rabbit entities."] +pub struct Rabbit; +impl Component for Rabbit {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for ravager entities."] +pub struct Ravager; +impl Component for Ravager {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for salmon entities."] +pub struct Salmon; +impl Component for Salmon {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for sheep entities."] +pub struct Sheep; +impl Component for Sheep {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for shulker entities."] +pub struct Shulker; +impl Component for Shulker {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for shulker_bullet entities."] +pub struct ShulkerBullet; +impl Component for ShulkerBullet {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for silverfish entities."] +pub struct Silverfish; +impl Component for Silverfish {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for skeleton entities."] +pub struct Skeleton; +impl Component for Skeleton {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for skeleton_horse entities."] +pub struct SkeletonHorse; +impl Component for SkeletonHorse {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for slime entities."] +pub struct Slime; +impl Component for Slime {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for small_fireball entities."] +pub struct SmallFireball; +impl Component for SmallFireball {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for snow_golem entities."] +pub struct SnowGolem; +impl Component for SnowGolem {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for snowball entities."] +pub struct Snowball; +impl Component for Snowball {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for spectral_arrow entities."] +pub struct SpectralArrow; +impl Component for SpectralArrow {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for spider entities."] +pub struct Spider; +impl Component for Spider {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for squid entities."] +pub struct Squid; +impl Component for Squid {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for stray entities."] +pub struct Stray; +impl Component for Stray {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for strider entities."] +pub struct Strider; +impl Component for Strider {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for egg entities."] +pub struct Egg; +impl Component for Egg {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for ender_pearl entities."] +pub struct EnderPearl; +impl Component for EnderPearl {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for experience_bottle entities."] +pub struct ExperienceBottle; +impl Component for ExperienceBottle {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for potion entities."] +pub struct Potion; +impl Component for Potion {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for trident entities."] +pub struct Trident; +impl Component for Trident {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for trader_llama entities."] +pub struct TraderLlama; +impl Component for TraderLlama {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for tropical_fish entities."] +pub struct TropicalFish; +impl Component for TropicalFish {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for turtle entities."] +pub struct Turtle; +impl Component for Turtle {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for vex entities."] +pub struct Vex; +impl Component for Vex {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for villager entities."] +pub struct Villager; +impl Component for Villager {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for vindicator entities."] +pub struct Vindicator; +impl Component for Vindicator {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for wandering_trader entities."] +pub struct WanderingTrader; +impl Component for WanderingTrader {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for witch entities."] +pub struct Witch; +impl Component for Witch {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for wither entities."] +pub struct Wither; +impl Component for Wither {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for wither_skeleton entities."] +pub struct WitherSkeleton; +impl Component for WitherSkeleton {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for wither_skull entities."] +pub struct WitherSkull; +impl Component for WitherSkull {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for wolf entities."] +pub struct Wolf; +impl Component for Wolf {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for zoglin entities."] +pub struct Zoglin; +impl Component for Zoglin {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for zombie entities."] +pub struct Zombie; +impl Component for Zombie {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for zombie_horse entities."] +pub struct ZombieHorse; +impl Component for ZombieHorse {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for zombie_villager entities."] +pub struct ZombieVillager; +impl Component for ZombieVillager {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for zombified_piglin entities."] +pub struct ZombifiedPiglin; +impl Component for ZombifiedPiglin {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for player entities."] +pub struct Player; +impl Component for Player {} +#[derive(Debug, Copy, Clone)] +#[doc = "A marker component for fishing_bobber entities."] +pub struct FishingBobber; +impl Component for FishingBobber {} diff --git a/quill/src/events.rs b/quill/src/events.rs new file mode 100644 index 000000000..5b6fa3246 --- /dev/null +++ b/quill/src/events.rs @@ -0,0 +1,27 @@ +//! The game events exposed to plugins. + +pub use block_interact::{BlockInteractEvent, BlockPlacementEvent}; +pub use change::{ + BuildingAbilityEvent, CreativeFlyingEvent, FlyingAbilityEvent, GamemodeEvent, + HeldItemChangeEvent, InstabreakEvent, InventorySlotUpdateEvent, InvulnerabilityEvent, + SneakEvent, SprintEvent, +}; +pub use entity::{EntityCreateEvent, EntityRemoveEvent, PlayerJoinEvent}; +pub use interact_entity::InteractEntityEvent; +use libcraft::ChunkPosition; +use vane::Component; + +use crate::world::WorldId; + +mod block_interact; +mod change; +mod entity; +mod interact_entity; + +/// Event triggered when a chunk is loaded. +#[derive(Debug)] +pub struct ChunkLoadEvent { + pub pos: ChunkPosition, + pub world: WorldId, +} +impl Component for ChunkLoadEvent {} diff --git a/quill/common/src/events/block_interact.rs b/quill/src/events/block_interact.rs similarity index 80% rename from quill/common/src/events/block_interact.rs rename to quill/src/events/block_interact.rs index c464025b4..fec5a205a 100644 --- a/quill/common/src/events/block_interact.rs +++ b/quill/src/events/block_interact.rs @@ -1,5 +1,6 @@ -use libcraft_core::{BlockFace, BlockPosition, Hand, Vec3f}; +use libcraft::{BlockFace, BlockPosition, Hand, Vec3f}; use serde::{Deserialize, Serialize}; +use vane::Component; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct BlockInteractEvent { @@ -10,6 +11,7 @@ pub struct BlockInteractEvent { /// If the client thinks its inside a block when the interaction is fired. pub inside_block: bool, } +impl Component for BlockInteractEvent {} #[derive(Debug, Serialize, Deserialize, Clone)] pub struct BlockPlacementEvent { @@ -20,3 +22,4 @@ pub struct BlockPlacementEvent { /// If the client thinks its inside a block when the interaction is fired. pub inside_block: bool, } +impl Component for BlockPlacementEvent {} diff --git a/quill/common/src/events/change.rs b/quill/src/events/change.rs similarity index 70% rename from quill/common/src/events/change.rs rename to quill/src/events/change.rs index 266846160..abf73a8c9 100644 --- a/quill/common/src/events/change.rs +++ b/quill/src/events/change.rs @@ -3,13 +3,15 @@ All events in this file are triggered when there is a change in a certain value. */ use derive_more::Deref; -use libcraft_core::Gamemode; +use libcraft::{Area, Gamemode}; use serde::{Deserialize, Serialize}; +use vane::{Component, Entity}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct CreativeFlyingEvent { pub is_flying: bool, } +impl Component for CreativeFlyingEvent {} impl CreativeFlyingEvent { pub fn new(changed_to: bool) -> Self { @@ -23,6 +25,7 @@ impl CreativeFlyingEvent { pub struct SneakEvent { pub is_sneaking: bool, } +impl Component for SneakEvent {} impl SneakEvent { pub fn new(changed_to: bool) -> Self { @@ -36,6 +39,7 @@ impl SneakEvent { pub struct SprintEvent { pub is_sprinting: bool, } +impl Component for SprintEvent {} impl SprintEvent { pub fn new(changed_to: bool) -> Self { @@ -48,19 +52,38 @@ impl SprintEvent { /// This event is called when a player's gamemode is changed and every time the player joins. #[derive(Debug, Serialize, Deserialize, Clone, Deref)] pub struct GamemodeEvent(pub Gamemode); +impl Component for GamemodeEvent {} /// This event is called when player's ability to instantly break blocks changes. #[derive(Debug, Serialize, Deserialize, Clone, Deref)] pub struct InstabreakEvent(pub bool); +impl Component for InstabreakEvent {} /// This event is called when player's ability to fly changes. #[derive(Debug, Serialize, Deserialize, Clone, Deref)] pub struct FlyingAbilityEvent(pub bool); +impl Component for FlyingAbilityEvent {} /// This event is called when player's ability to place or break blocks changes. #[derive(Debug, Serialize, Deserialize, Clone, Deref)] pub struct BuildingAbilityEvent(pub bool); +impl Component for BuildingAbilityEvent {} /// This event is called when player's invulnerability property changes. #[derive(Debug, Serialize, Deserialize, Clone, Deref)] pub struct InvulnerabilityEvent(pub bool); +impl Component for InvulnerabilityEvent {} + +/// Invoked when a slot in an inventory is updated. +#[derive(Debug)] +pub struct InventorySlotUpdateEvent { + /// The entity whose slot was updated + pub entity: Entity, + pub area: Area, + pub slot: usize, +} +impl Component for InventorySlotUpdateEvent {} + +#[derive(Debug)] +pub struct HeldItemChangeEvent; +impl Component for HeldItemChangeEvent {} diff --git a/quill/common/src/events/entity.rs b/quill/src/events/entity.rs similarity index 79% rename from quill/common/src/events/entity.rs rename to quill/src/events/entity.rs index 073feb61a..513412aeb 100644 --- a/quill/common/src/events/entity.rs +++ b/quill/src/events/entity.rs @@ -1,9 +1,12 @@ use serde::{Deserialize, Serialize}; +use vane::Component; /// Triggered when a player joins the `Game`. #[derive(Debug, Serialize, Deserialize, Clone)] pub struct PlayerJoinEvent; +impl Component for PlayerJoinEvent {} + /// Triggered when an entity is removed from the world. /// /// The entity will remain alive for one tick after it is @@ -11,6 +14,10 @@ pub struct PlayerJoinEvent; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct EntityRemoveEvent; +impl Component for EntityRemoveEvent {} + /// Triggered when an entity is added into the world. #[derive(Debug, Serialize, Deserialize, Clone)] pub struct EntityCreateEvent; + +impl Component for EntityCreateEvent {} diff --git a/quill/common/src/events/interact_entity.rs b/quill/src/events/interact_entity.rs similarity index 62% rename from quill/common/src/events/interact_entity.rs rename to quill/src/events/interact_entity.rs index b77c80be0..6927bd84d 100644 --- a/quill/common/src/events/interact_entity.rs +++ b/quill/src/events/interact_entity.rs @@ -1,12 +1,14 @@ -use crate::EntityId; -use libcraft_core::{Hand, InteractionType, Vec3f}; +use libcraft::{Hand, InteractionType, Vec3f}; use serde::{Deserialize, Serialize}; +use vane::{Component, Entity}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct InteractEntityEvent { - pub target: EntityId, + pub target: Entity, pub ty: InteractionType, pub target_pos: Option, pub hand: Option, pub sneaking: bool, } + +impl Component for InteractEntityEvent {} diff --git a/quill/src/game.rs b/quill/src/game.rs new file mode 100644 index 000000000..d3d1fbe38 --- /dev/null +++ b/quill/src/game.rs @@ -0,0 +1,144 @@ +//! A plugin's primary interface to interacting with the server state. + +use std::cell::{Ref, RefMut}; + +use tokio::runtime; +use vane::{Entities, Entity, EntityBuilder, Resources}; + +use crate::{ + saveload::{worldgen::WorldGeneratorFactory, WorldSourceFactory}, + threadpool::ThreadPool, + world::WorldDescriptor, + World, WorldId, +}; + +/// A plugin's primary interface to interacting with the server state. +/// +/// A `Game` contains all worlds, blocks, entities, and resources +/// in the server. +/// +/// # Asynchronous work +/// Often a plugin needs to run some task asynchronously, on a separate +/// thread, for performance reasons. The server contains two facilities +/// to assist in this: +/// * A Tokio runtime for running asynchronous IO work. +/// * A thread pool for compute tasks. +/// +/// Do not spawn heavy computation tasks on the Tokio runtime, or IO +/// work on the thread pool. You'll block other tasks from running. +/// +/// # Dynamic dispatch +/// Typically you'll pass around an `&dyn mut Game` - i.e., a dynamically- +/// dispatched reference to some implementation of this trait. The actual +/// struct that implements this trait lives in Feather itself and is not +/// exposed to plugins. +pub trait Game: 'static { + /// Gets a reference to the ECS that contains all entities. + fn ecs(&self) -> &Entities; + + /// Gets a mutable reference to the ECS that contains all entities. + fn ecs_mut(&mut self) -> &mut Entities; + + /// Gets the `Resources` stored in the server. + fn resources(&self) -> &Resources; + + /// Mutably gets the `Resources` stored in the server. + fn resources_mut(&mut self) -> &mut Resources; + + /// Creates a new `World` using the given world descriptor. + /// + /// Note that the world will not persist in the `Game` after + /// a server restart. You need to add back the world each time + /// the server starts, using the same ID. + fn create_world(&mut self, desc: WorldDescriptor); + + /// Registers a `WorldSourceFactory` that can be referenced in the server config file. + fn register_world_source_factory(&mut self, name: &str, factory: Box); + + /// Registers a `WorldGeneratorFactory` that can be referenced in the server config file. + fn register_world_generator_factory( + &mut self, + name: &str, + factory: Box, + ); + + /// Gets a `WorldSourceFactory` by its name. + fn world_source_factory( + &self, + name: &str, + ) -> Result<&dyn WorldSourceFactory, WorldSourceFactoryNotFound>; + + /// Gets a `WorldGeneratorFactory` by its name. + fn world_generator_factory( + &self, + name: &str, + ) -> Result<&dyn WorldGeneratorFactory, WorldGeneratorFactoryNotFound>; + + /// Removes the world with the given ID. + /// + /// The world will no longer be accessible, but its chunks + /// are kept in memory until they have all been saved, + /// even if the server starts to shut down. + fn remove_world(&mut self, id: WorldId) -> Result<(), WorldNotFound>; + + /// Gets a reference to the world with the given ID. + fn world(&self, id: WorldId) -> Result, WorldNotFound>; + + /// Gets a mutable reference to the world with the given ID. + fn world_mut(&self, id: WorldId) -> Result, WorldNotFound>; + + /// Sets the default world. + /// + /// # Panics + /// Panics if `id` does not reference a valid world. + fn set_default_world(&mut self, id: WorldId); + + /// Gets the ID of the main/default world. + fn default_world_id(&self) -> WorldId; + + /// Gets a reference to the default world. + fn default_world(&self) -> Ref { + self.world(self.default_world_id()) + .expect("default world does not exist?") + } + + /// Gets a mutable reference to the default world. + fn default_world_mut(&self) -> RefMut { + self.world_mut(self.default_world_id()) + .expect("default world does not exist?") + } + + /// Spawns a new entity. + /// + /// This method will correctly trigger events related + /// to the entity spawn. Avoid spawning entities + /// directly on the ECS, as those events will not trigger + /// and thus the entities won't show on clients. + fn spawn_entity(&mut self, builder: EntityBuilder) -> Entity; + + /// Queues an entity to be removed on the next tick. + /// + /// You should prefer this method over removing entities + /// directly on the ECS, as it allows other plugins and the server + /// code to react to the `EntityRemoveEvent`. + fn queue_remove_entity(&mut self, entity: Entity); + + /// Gets a handle to the multithreaded Tokio runtime shared by the server and all plugins. + fn tokio_runtime(&self) -> runtime::Handle; + + /// Gets a handle to the thread pool used for asynchronous + /// compute work. + fn compute_pool(&self) -> &ThreadPool; +} + +#[derive(Debug, thiserror::Error)] +#[error("world with ID {0} was not found")] +pub struct WorldNotFound(pub WorldId); + +#[derive(Debug, thiserror::Error)] +#[error("world source factory '{0}' was not found")] +pub struct WorldSourceFactoryNotFound(pub String); + +#[derive(Debug, thiserror::Error)] +#[error("world generator factory '{0}' was not found")] +pub struct WorldGeneratorFactoryNotFound(pub String); diff --git a/quill/src/lib.rs b/quill/src/lib.rs new file mode 100644 index 000000000..91c523d5d --- /dev/null +++ b/quill/src/lib.rs @@ -0,0 +1,41 @@ +//! Quill, Feather's plugin API. + +pub mod chat; +mod chunk_lock; +pub mod components; +/// Marker components for each specific entity. +pub mod entities; +pub mod events; +pub mod game; +mod plugin; +pub mod saveload; +pub mod threadpool; +pub mod world; + +#[doc(inline)] +pub use vane::{Component, Entities, Entity, EntityBuilder, EntityRef, Resources, SysResult}; + +#[doc(inline)] +pub use chat::ChatBox; +#[doc(inline)] +pub use chunk_lock::{ChunkHandle, ChunkLock}; +#[doc(inline)] +pub use game::Game; +pub use plugin::{Plugin, PluginInfo, Setup}; +#[doc(inline)] +pub use world::{World, WorldId}; + +#[doc(inline)] +pub use libcraft::{ + blocks::{block_data, BlockData, BlockKind, BlockState}, + chunk::{Chunk, ChunkSection}, + inventory::Inventory, + items::{ + Enchantment, EnchantmentKind, InventorySlot, Item, ItemStack, ItemStackBuilder, + ItemStackError, ItemStackMeta, + }, + text::{Text, TextComponentBuilder}, + BlockPosition, ChunkPosition, Position, CHUNK_WIDTH, +}; + +pub extern crate libcraft; diff --git a/quill/src/plugin.rs b/quill/src/plugin.rs new file mode 100644 index 000000000..4e586e6cd --- /dev/null +++ b/quill/src/plugin.rs @@ -0,0 +1,54 @@ +use vane::{Resources, SysResult}; + +use crate::Game; + +/// Context passed to `Plugin::initialize`. +pub trait Setup { + /// Registers a system. + fn register_system( + &mut self, + system: fn(&mut dyn Game, &mut P::State) -> SysResult, + name: &str, + ); + + /// Gets the `Game`. + fn game(&self) -> &dyn Game; + + /// Mutably gets the `Game`. + fn game_mut(&mut self) -> &mut dyn Game; + + /// Gets the `Resources`. + fn resources(&self) -> &Resources { + self.game().resources() + } + + /// Mutably gets the `Resources`. + fn resources_mut(&mut self) -> &mut Resources { + self.game_mut().resources_mut() + } +} + +/// Represents a plugin loaded at startup. +/// +/// Every plugin should have a unit struct implementing this trait. +pub trait Plugin: 'static { + /// A plugin state passed as the second parameter to all plugin systems. + type State: 'static; + + /// Gets the plugin's info. + fn info(&self) -> PluginInfo; + + /// Called at plugin load time. + /// + /// You should register systems and insert resources in this method. + fn initialize(&mut self, setup: &mut dyn Setup) -> SysResult; +} + +/// Metadata associated with a plugin. +#[derive(Debug)] +pub struct PluginInfo { + /// Display name of the plugin in PascalCase. + pub name: &'static str, + /// ID of the plugin in snake_case. + pub id: &'static str, +} diff --git a/quill/src/saveload.rs b/quill/src/saveload.rs new file mode 100644 index 000000000..59aee33e6 --- /dev/null +++ b/quill/src/saveload.rs @@ -0,0 +1,165 @@ +//! Allows customizing how the server loads world and player data. + +use std::{collections::VecDeque, time::Duration}; + +use libcraft::{dimension::DimensionInfo, ChunkPosition}; + +use crate::{ChunkHandle, Game, WorldId}; + +pub mod worldgen; + +/// A source with which chunks and entities are loaded and saved. +/// +/// World loading is asynchronous. The server requests the world source +/// to load a chunk by calling `queue_load_chunk`. Then, each tick, +/// it polls for completed chunks by calling `poll_loaded_chunk`. +/// +/// Likewise, saving is asynchronous and durable. The server calls +/// `queue_save_chunk` to save a chunk but will not assume the chunk +/// has been properly saved until `poll_saved_chunk` returns an Ok +/// status with the corresponding position. +/// +/// An implementation of this trait should take advantage of the asynchronous +/// nature of world loading. It should never do IO or intensive +/// computations (e.g. world generation) on the main thread. Instead, +/// it should run IO on the Tokio runtime or world generation on the compute pool. +pub trait WorldSource: 'static { + /// Returns whether the world source supports saving. + fn supports_saving(&self) -> bool; + + /// Queues a chunk to be loaded. + /// + /// A future call to `poll_loaded_chunk` should return the result + /// of loading this chunk. + fn queue_load_chunk(&mut self, pos: ChunkPosition); + + /// Polls for the next chunk that has finished loading. + /// + /// Should return `None` if no chunks have completed loading. + fn poll_loaded_chunk(&mut self) -> Option; + + /// Queues a chunk to be saved into the world source. + /// + /// A future call to `poll_saved_chunk` should return the result + /// of saving this chunk. + /// + /// If `supports_saving` returns false, then this method may panic. + fn queue_save_chunk(&mut self, chunk: StoredChunk); + + /// Polls for the next chunk that has finshed saving. + /// + /// Should return `None` if no chunks have completed saving. + /// + /// If `supports_saving` returns false, then this method may panic. + fn poll_saved_chunk(&mut self) -> Option; +} + +/// A loaded chunk. +/// +/// Eventually, this structure will also contain the entities +/// and block entities loaded in the chunk. +#[derive(Debug)] +pub struct StoredChunk { + /// Position of the chunk. + pub pos: ChunkPosition, + /// The chunk data. + pub chunk: ChunkHandle, +} + +/// Result of loading a chunk. +#[derive(Debug)] +pub struct ChunkLoadResult { + /// Position of the loaded chunk. + pub pos: ChunkPosition, + /// The loaded chunk, or the error that occurred. + pub result: Result, +} + +/// An error while loading a chunk. +#[derive(Debug, thiserror::Error)] +pub enum ChunkLoadError { + /// The chunk is not contained in the world source. + /// + /// The server will fall back to using an empty chunk. + #[error("world source does not contain the given chunk")] + Missing, + /// An error occurred loading the chunk, e.g., an IO + /// error or a malformed data error. + #[error(transparent)] + Other(#[from] anyhow::Error), +} + +/// The outcome of saving a chunk. +#[derive(Debug)] +pub struct ChunkSaveResult { + /// The position of the chunk that was (attempted to be) saved. + pub pos: ChunkPosition, + /// Whether saving the chunk was successful. + pub result: Result, +} + +/// An error while saving a chunk. +#[derive(Debug)] +pub struct ChunkSaveError { + /// The error that occurred. + pub error: anyhow::Error, + /// How long the server should wait until retrying. + /// + /// If saving failed because of a temporary error (e.g., a database + /// restart), then this functionality may help retain world durability. + /// + /// The server will retry the same chunk a maximum number of times, + /// configured in the world's `WorldSettings`. After reaching the retry limit, + /// the server drops the chunk, and all changes are lost. + pub retry_in: Duration, +} + +/// Unit struct indicating a chunk was saved and is stored +/// in a persistent, durable location. +#[derive(Debug)] +pub struct ChunkSaved; + +/// A world source that never yields any chunks. +#[derive(Default)] +pub struct EmptyWorldSource { + queued: VecDeque, +} + +impl WorldSource for EmptyWorldSource { + fn supports_saving(&self) -> bool { + false + } + + fn queue_load_chunk(&mut self, pos: ChunkPosition) { + self.queued.push_back(pos); + } + + fn poll_loaded_chunk(&mut self) -> Option { + self.queued.pop_front().map(|pos| ChunkLoadResult { + pos, + result: Err(ChunkLoadError::Missing), + }) + } + + fn queue_save_chunk(&mut self, _chunk: StoredChunk) { + unimplemented!() + } + + fn poll_saved_chunk(&mut self) -> Option { + unimplemented!() + } +} + +/// A factory for a [`WorldSource`]. +/// +/// Registering `WorldSourceFactory`s allows the `config.toml` +/// file to create worlds using plugins' `WorldSource`s. +pub trait WorldSourceFactory: 'static { + fn create_world_source( + &self, + game: &dyn Game, + params: &toml::Value, + dimension_info: &DimensionInfo, + world_id: WorldId, + ) -> anyhow::Result>; +} diff --git a/quill/src/saveload/worldgen.rs b/quill/src/saveload/worldgen.rs new file mode 100644 index 000000000..f419265c8 --- /dev/null +++ b/quill/src/saveload/worldgen.rs @@ -0,0 +1,122 @@ +//! Integrates world generation into the `WorldSource` design. + +use std::sync::Arc; + +use flume::{Receiver, Sender}; +use libcraft::{Chunk, ChunkPosition, Sections}; + +use crate::{threadpool::ThreadPool, ChunkHandle, ChunkLock, Game, WorldId}; + +use super::{ChunkLoadError, ChunkLoadResult, ChunkSaveResult, StoredChunk, WorldSource}; + +/// A world generator. +/// +/// Note that world generation happens in parallel, so generators +/// are required to be `Send + Sync`. +pub trait WorldGenerator: Send + Sync + 'static { + /// Generates the chunk at the given position. + fn generate_chunk(&self, pos: ChunkPosition) -> Chunk; +} + +/// A factory for a world generator. +/// +/// Used to initialize a `WorldGenerator` from a config file. +pub trait WorldGeneratorFactory: 'static { + fn create_world_generator( + &self, + game: &dyn Game, + params: &toml::Value, + world_id: WorldId, + sections: Sections, + min_y: i32, + ) -> anyhow::Result>; +} + +/// A `WorldSource` that wraps an inner world source +/// and generates a new chunk when the inner source +/// is missing a chunk. +/// +/// World generation is performed on a separate thread +/// (in parallel on the server's compute thread pool.) +pub struct WorldGeneratorWorldSource { + inner: Box, + generator: Arc, + generated_chunks_sender: Sender, + generated_chunks_receiver: Receiver, + pool: ThreadPool, +} + +impl WorldGeneratorWorldSource { + pub fn new( + inner: Box, + generator: Arc, + compute_pool: &ThreadPool, + ) -> Self { + let (generated_chunks_sender, generated_chunks_receiver) = flume::unbounded(); + Self { + inner, + generator, + generated_chunks_sender, + generated_chunks_receiver, + pool: compute_pool.clone(), + } + } + + fn queue_generate_chunk(&mut self, pos: ChunkPosition) { + let generator = Arc::clone(&self.generator); + let sender = self.generated_chunks_sender.clone(); + self.pool.spawn(move || { + let chunk = generator.generate_chunk(pos); + sender + .send(StoredChunk { + pos, + chunk: ChunkHandle::new(ChunkLock::new(chunk)), + }) + .ok(); + }); + } + + fn poll_generated_chunk(&mut self) -> Option { + self.generated_chunks_receiver + .try_recv() + .ok() + .map(|chunk| ChunkLoadResult { + pos: chunk.pos, + result: Ok(chunk), + }) + } +} + +impl WorldSource for WorldGeneratorWorldSource { + fn supports_saving(&self) -> bool { + self.inner.supports_saving() + } + + fn queue_load_chunk(&mut self, pos: ChunkPosition) { + self.inner.queue_load_chunk(pos) + } + + fn poll_loaded_chunk(&mut self) -> Option { + self.poll_generated_chunk().or_else(|| { + // Greedily consume all missing chunks. + loop { + let result = self.inner.poll_loaded_chunk()?; + + match &result.result { + Err(ChunkLoadError::Missing) => { + self.queue_generate_chunk(result.pos); + } + Ok(_) | Err(_) => break Some(result), + } + } + }) + } + + fn queue_save_chunk(&mut self, chunk: StoredChunk) { + self.inner.queue_save_chunk(chunk) + } + + fn poll_saved_chunk(&mut self) -> Option { + self.inner.poll_saved_chunk() + } +} diff --git a/quill/src/threadpool.rs b/quill/src/threadpool.rs new file mode 100644 index 000000000..d4937dcdb --- /dev/null +++ b/quill/src/threadpool.rs @@ -0,0 +1,43 @@ +//! A simple thread pool implementation. + +use std::thread; + +use flume::Sender; + +/// A simple thread pool. +/// +/// This struct can be cloned to create +/// new handles to the pool (like an `Arc`). +#[derive(Clone)] +pub struct ThreadPool { + sender: Sender, +} + +impl ThreadPool { + /// Creates a thread pool. + /// + /// `num_threads` threads are spawned. Each thread's name + /// is computed from the given `name`. + pub fn new(name: &str, num_threads: usize) -> Self { + let (sender, receiver) = flume::unbounded::(); + for i in 0..num_threads { + let receiver = receiver.clone(); + thread::Builder::new() + .name(format!("{} #{}", name, i + 1)) + .spawn(move || { + for task in receiver { + (task)(); + } + }) + .expect("failed to spawn thread"); + } + Self { sender } + } + + /// Spawns a task on the thread pool. + pub fn spawn(&self, task: impl FnOnce() + Send + 'static) { + self.sender.send(Box::new(task)).ok(); + } +} + +type Task = Box; diff --git a/quill/src/world.rs b/quill/src/world.rs new file mode 100644 index 000000000..1a8c81ded --- /dev/null +++ b/quill/src/world.rs @@ -0,0 +1,220 @@ +//! Feather's multiworld support. + +use std::{fmt::Display, time::Duration}; + +use flume::Sender; +use libcraft::{dimension::DimensionInfo, BlockPosition, BlockState, ChunkPosition, WorldHeight}; +use uuid::Uuid; + +use crate::{saveload::WorldSource, ChunkHandle}; + +/// Unique, persistent ID of a world. +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +pub struct WorldId(Uuid); + +impl Display for WorldId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0.to_hyphenated()) + } +} + +impl WorldId { + pub fn new_random() -> Self { + Self(Uuid::new_v4()) + } + + pub fn to_uuid(self) -> Uuid { + self.0 + } +} + +/// Parameters to initialize a world. +pub struct WorldDescriptor { + /// ID of the world. + /// + /// If the world already exists, then this ID should + /// match the original ID. If it is a new world, you + /// can use `WorldId::new_random`. + pub id: WorldId, + /// Where chunks will be loaded and saved. + pub source: Box, + /// An optional name. + pub name: Option, + /// Dimension info. + pub dimension_info: DimensionInfo, + /// Whether this is a superflat world with a different + /// horizon. + pub flat: bool, + /// Settings on how the server will load and unload chunks. + pub settings: WorldSettings, +} + +/// Settings on how the server will load and unload chunks. +#[derive(Debug)] +pub struct WorldSettings { + /// When a chunk loses all its tickets, the server puts + /// it into a queue to be unloaded. It will wait at least + /// this duration before unloading the chunk. + pub unload_delay: Duration, + /// How the server will save chunks. + /// + /// Note that if this is set to `SaveIncrementally` and the configured + /// `WorldSource` does not support saving, then the server + /// will panic when creating the world. + pub save_strategy: WorldSaveStrategy, +} + +impl Default for WorldSettings { + fn default() -> Self { + Self { + unload_delay: Duration::from_secs(30), + save_strategy: WorldSaveStrategy::SaveIncrementally { + save_interval: Duration::from_secs(60 * 5), + }, + } + } +} + +/// How the server will save chunks. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum WorldSaveStrategy { + /// Chunks will be saved incrementally at the given interval, + /// as well as when they are unloaded or the server shuts down. + /// + /// The server will save chunks by calling `WorldSource::save_chunk`. + SaveIncrementally { save_interval: Duration }, + /// The server will not save chunks, instead choosing to drop any changes made + /// to chunks when they are unloaded. Changes will not persist after + /// a chunk is unloaded. + /// + /// This option is only recommended if you have an immutable world. + DropChanges, + /// The server will not save chunks, instead choosing to keep all loaded + /// chunks in memory. Changes will not persist after a server restart. + /// + /// This option is useful for minigames where the map is reset each new game, + /// and the world is small enough that all chunks can stay loaded. + KeepLoaded, +} + +/// Stores all blocks and chunks in a world. +/// +/// A world does not store entities; it only contains blocks. +/// +/// Like `Game`, this is a trait. You can pass around `World`s +/// using `&dyn World`. +/// +/// # Identifying worlds +/// Every world is associated with a UUID and optionally a world name. +/// +/// # Chunk loading +/// Each world manages its own chunk loading and saving. +/// +/// A world is associated with a [`WorldSource`](crate::saveload::WorldSource) +/// to which chunks are loaded and saved. +/// +/// Chunk loading and unloading works off of a _ticket_ system. +/// Any chunks for which one or more tickets exists are kept +/// loaded. If all tickets for a chunk are removed, then the chunk +/// may be unloaded. +pub trait World: 'static { + /// Gets the ID of this world. + /// + /// The ID is persistent even after a server restart. + fn id(&self) -> WorldId; + + /// Gets the optionally-set name of this world. + /// + /// Note that a world's name can change, although its UUID is stable. + fn name(&self) -> Option<&str>; + + /// Gets a string to be displayed to the console when describing + /// this world. + fn display_name(&self) -> String { + self.name() + .map(str::to_owned) + .unwrap_or_else(|| self.id().to_string()) + } + + /// Gets the block at the given position, + /// or returns an error if the chunk containing + /// the block is not loaded. + fn block_at(&self, pos: BlockPosition) -> Result; + + /// Sets the block at the given position, + /// or returns an error if the chunk containing + /// the block is not loaded. + fn set_block_at(&self, pos: BlockPosition, block: BlockState) -> Result<(), ChunkNotLoaded>; + + /// Gets the chunk at the given chunk position. + fn chunk_handle_at(&self, pos: ChunkPosition) -> Result; + + /// Returns whether the given chunk is loaded. + fn is_chunk_loaded(&self, pos: ChunkPosition) -> bool; + + /// Gets the dimension info of this world. + fn dimension_info(&self) -> &DimensionInfo; + + /// Gets the minimum Y coordinate of blocks in this world. + fn min_y(&self) -> i32 { + self.dimension_info().info.min_y + } + + /// Gets the height of the world, in blocks. + /// + /// Guaranteed to be a multiple of 16 (the height of a chunk section). + fn height(&self) -> WorldHeight { + WorldHeight( + self.dimension_info() + .info + .height + .try_into() + .unwrap_or_default(), + ) + } + + /// Creates a ticket for the given chunk. + /// + /// If the chunk is not already loaded, then it is queued + /// for loading. On a future tick, it will be available. + #[must_use] + fn create_chunk_ticket(&mut self, chunk: ChunkPosition) -> ChunkTicket; + + /// Returns whether the `WorldSource` backing this world + /// will save changes. + fn is_persistent(&self) -> bool; + + /// Returns whether this world has a superflat world's horizon. + fn is_flat(&self) -> bool; +} + +/// Indicates that the chunk needed to perform +/// an operation is not loaded. +#[derive(Debug, thiserror::Error)] +#[error("chunk {0:?} is not loaded")] +pub struct ChunkNotLoaded(pub ChunkPosition); + +/// A ticket to keep a chunk loaded. +/// +/// When this value is dropped, the ticket is removed automatically. +#[derive(Debug)] +pub struct ChunkTicket { + id: u64, + dropped_channel: Sender, +} + +impl ChunkTicket { + #[doc(hidden)] + pub fn new(id: u64, dropped_channel: Sender) -> Self { + Self { + id, + dropped_channel, + } + } +} + +impl Drop for ChunkTicket { + fn drop(&mut self) { + self.dropped_channel.send(self.id).ok(); + } +} diff --git a/quill/sys-macros/Cargo.toml b/quill/sys-macros/Cargo.toml deleted file mode 100644 index 525d419ce..000000000 --- a/quill/sys-macros/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "quill-sys-macros" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[lib] -proc-macro = true - -[dependencies] -proc-macro2 = "1" -syn = { version = "1", features = ["full"] } -quote = "1" diff --git a/quill/sys-macros/src/lib.rs b/quill/sys-macros/src/lib.rs deleted file mode 100644 index 687de7a07..000000000 --- a/quill/sys-macros/src/lib.rs +++ /dev/null @@ -1,142 +0,0 @@ -use quote::quote; -use syn::ForeignItem; - -/// Macro to redefine host functions depending -/// on whether we are compiling to the WebAssembly -/// or the native target. -/// -/// See the `quill-sys` crate-level documentation for more info. -#[proc_macro_attribute] -pub fn host_functions( - _args: proc_macro::TokenStream, - input: proc_macro::TokenStream, -) -> proc_macro::TokenStream { - let input: syn::ItemForeignMod = syn::parse_macro_input!(input as syn::ItemForeignMod); - - let mut functions = Vec::new(); - for item in &input.items { - let item = match item { - ForeignItem::Fn(f) => f, - _ => panic!("only functions may be defined within the host calls module"), - }; - functions.push(item.clone()); - } - - let mut vtable_entries = Vec::new(); - for function in &functions { - let ident = &function.sig.ident; - let args: Vec<_> = function - .sig - .inputs - .iter() - .map(|arg| match arg { - syn::FnArg::Receiver(_) => panic!("self argument"), - syn::FnArg::Typed(arg) => arg.ty.clone(), - }) - .collect(); - let ret = &function.sig.output; - let ret = match ret { - syn::ReturnType::Default => None, - syn::ReturnType::Type(_, ty) => Some(quote! { -> #ty }), - }; - vtable_entries.push(quote! { - #ident: unsafe extern "C" fn(*const (), #(#args),*) #ret - }); - } - - let vtable = quote! { - struct HostVTable { - #(#vtable_entries,)* - } - }; - - let mut vtable_init_bindings = Vec::new(); - let mut vtable_init = Vec::new(); - for function in &functions { - let ident = &function.sig.ident; - let ident_string = ident.to_string(); - let missing_error = format!("missing vtable entry {}", ident_string); - - vtable_init_bindings.push(quote! { - let #ident = *vtable.get(#ident_string).ok_or_else(|| #missing_error)?; - // Safety: Transmute from a usize to a function pointer. - // This is valid on all targeted native platforms. - let #ident = std::mem::transmute::(#ident); - }); - - vtable_init.push(ident.clone()); - } - - let vtable_init = quote! { - #[doc = "Initializes the host vtable."] - #[doc = "Safety: the host vtable must not already be initialized."] - pub unsafe fn init_host_vtable(vtable: &std::collections::HashMap<&str, usize>) -> Result<(), &'static str> { - #(#vtable_init_bindings)* - HOST_VTABLE = Some(HostVTable { - #(#vtable_init,)* - }); - Ok(()) - } - }; - - let through_vtable_functions: Vec<_> = functions - .iter() - .map(|function| { - let ident = &function.sig.ident; - let args = &function.sig.inputs; - let ret = match &function.sig.output { - syn::ReturnType::Default => None, - syn::ReturnType::Type(_, ty) => Some(quote! { -> #ty }), - }; - let value_args: Vec<_> = args - .iter() - .map(|arg| match arg { - syn::FnArg::Receiver(_) => panic!("host functions cannot take self"), - syn::FnArg::Typed(arg) => arg.pat.clone(), - }) - .collect(); - let attrs = &function.attrs; - quote! { - #(#attrs)* - pub unsafe fn #ident(#args) #ret { - let vtable = HOST_VTABLE.as_ref().expect("vtable not initialized"); - let context = HOST_CONTEXT.expect("context not initialized"); - (vtable.#ident)(context, #(#value_args),*) - } - } - }) - .collect(); - - let attrs = &input.attrs; - - let result = quote! { - #[cfg(target_arch = "wasm32")] - #(#attrs)* - extern "C" { - #(#functions)* - } - - #[cfg(not(target_arch = "wasm32"))] - mod host_functions { - use super::*; - - static mut HOST_VTABLE: Option = None; - static mut HOST_CONTEXT: Option<*const ()> = None; - - #vtable - - #vtable_init - - #[doc = "Sets the host context."] - #[doc = "Safety: can only be called once."] - pub unsafe fn init_host_context(context: *const ()) { - HOST_CONTEXT = Some(context); - } - - #(#through_vtable_functions)* - } - #[cfg(not(target_arch = "wasm32"))] - pub use host_functions::*; - }; - result.into() -} diff --git a/quill/sys/Cargo.toml b/quill/sys/Cargo.toml deleted file mode 100644 index 1ff2e6c0a..000000000 --- a/quill/sys/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "quill-sys" -version = "0.1.0" -authors = ["caelunshun "] -edition = "2018" - -[dependencies] -quill-common = { path = "../common" } -quill-sys-macros = { path = "../sys-macros" } diff --git a/quill/sys/src/lib.rs b/quill/sys/src/lib.rs deleted file mode 100644 index c0b6d8f79..000000000 --- a/quill/sys/src/lib.rs +++ /dev/null @@ -1,196 +0,0 @@ -//! Raw FFI functions for host calls. -//! -//! # WASM vs Native -//! `quill-sys` exposes the same API on both WASM and native -//! targets, but there are internal differences in how -//! host functions are called. -//! -//! On WASM, host calls are `extern "C"` functions -//! that the linker adds as an import for the WASM module. -//! -//! On native, host calls are defined in a vtable struct -//! containing a function pointer for each call. The exported -//! functions in this crate defer to the vtable to make their host calls. -//! -//! Additionally, on native, `quill-sys` exports a `HOST_CONTEXT` constant -//! which is passed to every host call. The host expects this to be the -//! value passed to the `quill_setup` method. Failing to set this -//! constant correctly before making host calls -//! will result in undefined behavior. - -use std::mem::MaybeUninit; - -use quill_common::{ - block::BlockGetResult, entity::QueryData, EntityId, HostComponent, Pointer, PointerMut, -}; - -// The attribute macro transforms the block into either: -// 1. On WASM, an extern "C" block defining functions imported from the host. -// 2. On native targets, the necessary glue code to use the HOST_VTABLE -// to call host functions. -// The resulting public API is the same for both targets. -#[quill_sys_macros::host_functions] -#[link(wasm_import_module = "quill_01")] -extern "C" { - /// Registers a system. - /// - /// Each tick, the system is invoked - /// by calling the plugin's exported `quill_run_system` method. - /// `quill_run_system` is given the `system_data` pointer passed - /// to this host call. - pub fn register_system(system_data: PointerMut, name_ptr: Pointer, name_len: u32); - - /// Initiates a query. Returns the query data. - /// - /// The returned query buffers are allocated within - /// the plugin's bump allocator. They will be - /// freed automatically after the plugin finishes - /// executing the current system. - pub fn entity_query( - components_ptr: Pointer, - components_len: u32, - query_data: PointerMut>, - ); - - /// Determines whether the given entity exists. - pub fn entity_exists(entity: EntityId) -> bool; - - /// Gets a component for an entity. - /// - /// Sets `bytes_ptr` to a pointer to the serialized - /// component bytes and `bytes_len` to the number of bytes. - /// - /// If the entity does not have the component, - /// then `bytes_ptr` is set to null, and `bytes_len` - /// is left untouched. - pub fn entity_get_component( - entity: EntityId, - component: HostComponent, - bytes_ptr: PointerMut>, - bytes_len: PointerMut, - ); - - /// Sets or replaces a component for an entity. - /// - /// `bytes_ptr` is a pointer to the serialized - /// component. - /// - /// This will overwrite any existing component of the same type. - /// Does nothing if `entity` does not exist. - pub fn entity_set_component( - entity: EntityId, - component: HostComponent, - bytes_ptr: Pointer, - bytes_len: u32, - ); - - /// Adds an event for an entity. - /// - /// `bytes_ptr` is a pointer to the serialized - /// event. - /// - /// This will overwrite any existing event of the same type. - /// Does nothing if `entity` does not exist. - pub fn entity_add_event( - entity: EntityId, - event: HostComponent, - bytes_ptr: Pointer, - bytes_len: u32, - ); - - /// Adds a global event. - /// - /// `bytes_ptr` is a pointer to the serialized - /// component. - pub fn add_event(event: HostComponent, bytes_ptr: Pointer, bytes_len: u32); - - /// Sends a message to an entity. - /// - /// The given message should be in the JSON format. - /// - /// Does nothing if the entity does not exist or it does not have the `Chat` component. - pub fn entity_send_message(entity: EntityId, message_ptr: Pointer, message_len: u32); - - /// Sends a title to an entity. - /// - /// The given `Title` should contain at least a `title` or a `sub_title` - /// - /// Does nothing if the entity does not exist or if it does not have the `Chat` component. - pub fn entity_send_title(entity: EntityId, title_json_ptr: Pointer, title_len: u32); - - /// Creates an empty entity builder. - /// - /// This builder is used for creating an ecs-entity - /// - /// **This is NOT specifically for a minecraft entity!** - /// - pub fn entity_builder_new_empty() -> u32; - - /// Creates an entity builder. - /// - /// The builder is initialized with the default - /// components for the given `EntityInit`. - /// - /// `entity_init` is a `bincode`-serialized `EntityInit`. - pub fn entity_builder_new( - position: Pointer, - entity_init_ptr: Pointer, - entity_init_len: u32, - ) -> u32; - - /// Adds a component to an entity builder. - /// - /// `bytes` is the serialized component. - pub fn entity_builder_add_component( - builder: u32, - component: HostComponent, - bytes_ptr: Pointer, - bytes_len: u32, - ); - - /// Creates an entity from an entity builder. - /// - /// Returns the new entity. - /// - /// `builder` is consumed after this call. - /// Reusing it is undefined behavior. - pub fn entity_builder_finish(builder: u32) -> EntityId; - - /// Gets the block at the given position. - /// - /// Returns `None` if the block's chunk is unloaded - /// or if the Y coordinate is out of bounds. - pub fn block_get(x: i32, y: i32, z: i32) -> BlockGetResult; - - /// Sets the block at the given position. - /// - /// Returns `true` if successful and `false` - /// if the block's chunk is not loaded or - /// the Y coordinate is out of bounds. - /// - /// `block` is the vanilla ID of the block. - pub fn block_set(x: i32, y: i32, z: i32, block: u16) -> bool; - - /// Fills the given chunk section with `block`. - /// - /// Replaces all existing blocks in the section. - /// - /// This is an optimized bulk operation that will be significantly - /// faster than calling [`block_set`] on each block in the chunk section. - /// - /// Returns `true` if successful and `false` if the - /// block's chunk is not loaded or the section index is out of bounds. - pub fn block_fill_chunk_section(chunk_x: i32, section_y: u32, chunk_z: i32, block: u16) - -> bool; - - /// Sends a custom packet to an entity. - /// - /// Does nothing if the entity does not have the `ClientId` component. - pub fn plugin_message_send( - entity: EntityId, - channel_ptr: Pointer, - channel_len: u32, - data_ptr: Pointer, - data_len: u32, - ); -} diff --git a/vane/Cargo.toml b/vane/Cargo.toml new file mode 100644 index 000000000..b5e88403b --- /dev/null +++ b/vane/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "vane" +version = "0.1.0" +authors = ["caelunshun "] +edition = "2021" + +[dependencies] +ahash = "0.7" +anyhow = "1" +arrayvec = "0.7" +flume = "0.10" +itertools = "0.10" +log = "0.4" +once_cell = "1" +serde = { version = "1", features = [ "derive" ] } +thiserror = "1" +thread_local = "1" diff --git a/vane/src/borrow.rs b/vane/src/borrow.rs new file mode 100644 index 000000000..acfba73e8 --- /dev/null +++ b/vane/src/borrow.rs @@ -0,0 +1,200 @@ +use std::{ + cell::Cell, + fmt::{Debug, Display}, + ops::{Deref, DerefMut}, +}; + +/// Used to dynamically borrow-check component accesses. +/// +/// Supports either one mutable reference or up to 254 shared references. +/// Exceeding either limit results in `BorrowError`. +#[derive(Default)] +pub struct BorrowFlag { + flag: Cell, +} + +const MUTABLE_SENTINEL: u8 = u8::MAX; + +#[derive(Debug, thiserror::Error)] +#[error("borrow conflict or too many borrows (more than 254 Refs)")] +pub struct BorrowError; + +impl BorrowFlag { + pub fn borrow(&self) -> Result<(), BorrowError> { + let flag = self.flag.get(); + + // The checked arithmetic will fail if the current borrow count + // is 254, which is the greatest possible number of shared borrows, or + // if it's 255, which means the flag is mutably borrowed. + let new_flag_plus_one = flag.checked_add(2).ok_or(BorrowError)?; + + self.flag.set(new_flag_plus_one - 1); + Ok(()) + } + + pub fn borrow_mut(&self) -> Result<(), BorrowError> { + let flag = self.flag.get(); + if flag != 0 { + return Err(BorrowError); + } + + self.flag.set(MUTABLE_SENTINEL); + Ok(()) + } + + pub fn unborrow(&self) { + let flag = self.flag.get(); + debug_assert!(flag > 0); + debug_assert!(flag != MUTABLE_SENTINEL); + self.flag.set(flag - 1); + } + + pub fn unborrow_mut(&self) { + debug_assert_eq!(self.flag.get(), MUTABLE_SENTINEL); + self.flag.set(0); + } +} + +/// A reference to a component. +/// +/// This is an RAII guard that dynamically tracks +/// borrow checking, akin to `std::cell::RefCell`. +pub struct Ref<'a, T> { + component: &'a T, + flag: &'a BorrowFlag, +} + +impl<'a, T> Ref<'a, T> { + pub(crate) fn new(component: &'a T, flag: &'a BorrowFlag) -> Self { + Self { component, flag } + } +} + +impl<'a, T> Deref for Ref<'a, T> { + type Target = T; + + fn deref(&self) -> &Self::Target { + self.component + } +} + +impl<'a, T> Debug for Ref<'a, T> +where + T: Debug, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.component.fmt(f) + } +} + +impl<'a, T> Display for Ref<'a, T> +where + T: Display, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.component.fmt(f) + } +} + +impl<'a, T> PartialEq<&'a T> for Ref<'a, T> +where + &'a T: PartialEq<&'a T>, +{ + fn eq(&self, other: &&'a T) -> bool { + self.component.eq(other) + } +} + +impl<'a, T> Drop for Ref<'a, T> { + fn drop(&mut self) { + self.flag.unborrow(); + } +} + +/// A mutable reference to a component. +/// +/// This is an RAII guard that dynamically tracks +/// borrow checking, akin to `std::cell::RefCell`. +pub struct RefMut<'a, T> { + component: &'a mut T, + flag: &'a BorrowFlag, +} + +impl<'a, T> RefMut<'a, T> { + pub(crate) fn new(component: &'a mut T, flag: &'a BorrowFlag) -> Self { + Self { component, flag } + } +} + +impl<'a, T> Deref for RefMut<'a, T> { + type Target = T; + + fn deref(&self) -> &Self::Target { + self.component + } +} + +impl<'a, T> DerefMut for RefMut<'a, T> { + fn deref_mut(&mut self) -> &mut Self::Target { + self.component + } +} + +impl<'a, T> Debug for RefMut<'a, T> +where + T: Debug, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.component.fmt(f) + } +} + +impl<'a, T> Display for RefMut<'a, T> +where + T: Display, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.component.fmt(f) + } +} + +impl<'a, T> Drop for RefMut<'a, T> { + fn drop(&mut self) { + self.flag.unborrow_mut(); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn borrow_unborrow() { + let flag = BorrowFlag::default(); + flag.borrow().unwrap(); + assert!(flag.borrow_mut().is_err()); + flag.borrow().unwrap(); + assert!(flag.borrow_mut().is_err()); + + flag.unborrow(); + assert!(flag.borrow_mut().is_err()); + flag.unborrow(); + + flag.borrow_mut().unwrap(); + assert!(flag.borrow().is_err()); + assert!(flag.borrow_mut().is_err()); + + flag.unborrow_mut(); + flag.borrow().unwrap(); + } + + #[test] + fn borrow_max_amount() { + let flag = BorrowFlag::default(); + for _ in 0..254 { + flag.borrow().unwrap(); + assert!(flag.borrow_mut().is_err()); + } + assert!(flag.borrow().is_err()); + } +} diff --git a/vane/src/bundle.rs b/vane/src/bundle.rs new file mode 100644 index 000000000..8a598ea42 --- /dev/null +++ b/vane/src/bundle.rs @@ -0,0 +1,28 @@ +use crate::{Component, Entities, Entity}; + +/// A bundle of components that can be added to an entity. +pub trait ComponentBundle: Sized { + /// Adds components to the entity. + fn add_to_entity(self, world: &mut Entities, entity: Entity); +} + +macro_rules! bundle_tuple { + ($($ty:ident),* $(,)?) => { + impl <$($ty: Component),*> ComponentBundle for ($($ty,)*) { + #[allow(non_snake_case)] + fn add_to_entity(self, world: &mut Entities, entity: Entity) { + let ($($ty,)*) = self; + $( + world.insert(entity, $ty).unwrap(); + )* + } + } + } +} + +bundle_tuple!(T1); +bundle_tuple!(T1, T2); +bundle_tuple!(T1, T2, T3); +bundle_tuple!(T1, T2, T3, T4); +bundle_tuple!(T1, T2, T3, T4, T5); +bundle_tuple!(T1, T2, T3, T4, T5, T6); diff --git a/vane/src/bus.rs b/vane/src/bus.rs new file mode 100644 index 000000000..28ce3d08f --- /dev/null +++ b/vane/src/bus.rs @@ -0,0 +1,58 @@ +use flume::{Receiver, Sender}; + +use crate::Entities; + +/// A `Bus` provides a connection to an `Entities` that allows +/// inserting events without having a mutable reference to the `Entities` structure. +/// +/// A `Bus` may be useful in implementing custom change detection. +/// A component can contain a `Bus` and insert an event when it +/// detects a change. +/// +/// Acquire a `Bus` by calling [`Entities::bus`](crate::Entities::bus). +#[derive(Clone)] +pub struct Bus { + sender: Sender, +} + +impl Bus { + /// Executes a callback on the `Entities` immediately after the current system + /// returns. + pub fn defer(&self, action: impl FnOnce(&mut Entities) + 'static) { + self.sender.send(Box::new(action)).ok(); + } +} + +type Action = Box; + +#[derive(Clone)] +pub(crate) struct BusReceiver { + receiver: Receiver, + bus: Bus, +} + +impl Default for BusReceiver { + fn default() -> Self { + Self::new() + } +} + +impl BusReceiver { + pub fn new() -> Self { + let (sender, receiver) = flume::unbounded(); + Self { + receiver, + bus: Bus { sender }, + } + } + + pub fn bus(&self) -> Bus { + self.bus.clone() + } + + pub fn drain(&self, entities: &mut Entities) { + for action in self.receiver.try_iter() { + (action)(entities); + } + } +} diff --git a/vane/src/component.rs b/vane/src/component.rs new file mode 100644 index 000000000..24dba7888 --- /dev/null +++ b/vane/src/component.rs @@ -0,0 +1,50 @@ +use std::{alloc::Layout, any::TypeId, ptr, sync::Arc}; + +use crate::{Entities, Entity}; + +/// A type that can be used as a component. +/// +/// Components must implement this trait. +pub trait Component: 'static { + /// Called when the component is inserted into the ECS. + /// + /// This method can be used to implement custom change detection + /// by obtaining a `Bus`. + /// + /// The default implementation does nothing. + fn on_inserted(&mut self, ecs: &Entities, owner: Entity) { + let _ = (ecs, owner); + } +} + +// Special impl +impl Component for () {} + +/// Metadata for a component type. +#[derive(Clone)] +pub struct ComponentMeta { + /// Component type ID. + pub(crate) type_id: TypeId, + /// Component layout. + pub(crate) layout: Layout, + /// Function to drop the component. + pub(crate) drop_fn: unsafe fn(*mut u8), + pub(crate) on_inserted_fn: unsafe fn(*mut u8, &Entities, Entity), + pub(crate) name: &'static str, +} + +impl ComponentMeta { + /// Creates a `ComponentMeta` for a native Rust component. + pub fn of() -> Self { + Self { + type_id: TypeId::of::(), + layout: Layout::new::(), + drop_fn: |ptr| unsafe { ptr::drop_in_place(ptr.cast::()) }, + on_inserted_fn: |ptr, entities, owner| unsafe { + let val = &mut *(ptr.cast::()); + val.on_inserted(entities, owner) + }, + name: std::any::type_name::(), + } + } +} diff --git a/vane/src/entity.rs b/vane/src/entity.rs new file mode 100644 index 000000000..d7e521dec --- /dev/null +++ b/vane/src/entity.rs @@ -0,0 +1,145 @@ +use serde::{Deserialize, Serialize}; + +/// The ID of an entity. +/// +/// Pass this struct to various methods on the `Ecs` +/// to access the entity's components. +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[repr(C)] +pub struct Entity { + index: u32, + generation: u32, +} + +impl Entity { + pub fn to_bits(self) -> u64 { + ((self.index as u64) << 32) | (self.generation as u64) + } + + pub fn from_bits(bits: u64) -> Self { + let index = (bits >> 32) as u32; + let generation = bits as u32; + Self { index, generation } + } + + pub fn index(self) -> u32 { + self.index + } + + pub fn generation(self) -> u32 { + self.generation + } +} + +#[derive(Debug)] +pub struct GenerationMismatch; + +/// Allocator for entity IDs. Maintains generations +/// and indices. +#[derive(Default)] +pub(crate) struct EntityIds { + free_indices: Vec, + next_index: u32, + generations: Vec, +} + +impl EntityIds { + /// Allocates a new, unique entity ID. + pub fn allocate(&mut self) -> Entity { + let index = self.free_indices.pop().unwrap_or_else(|| { + self.next_index += 1; + self.next_index - 1 + }); + let generation = self.new_generation(index); + + Entity { index, generation } + } + + /// Deallocates an entity ID, allowing its index to be reused. + pub fn deallocate(&mut self, entity: Entity) -> Result<(), GenerationMismatch> { + self.check_generation(entity)?; + + self.free_indices.push(entity.index); + + self.generations[entity.index as usize] += 1; + + Ok(()) + } + + fn new_generation(&mut self, index: u32) -> u32 { + if index == self.generations.len() as u32 { + self.generations.push(0); + 0 + } else { + self.generations[index as usize] + } + } + + /// Verifies that the generation of `entity` is up to date. + pub fn check_generation(&self, entity: Entity) -> Result<(), GenerationMismatch> { + if self.generations[entity.index as usize] != entity.generation { + Err(GenerationMismatch) + } else { + Ok(()) + } + } + + /// Gets the entity with generation for the given index. + pub fn get(&self, index: u32) -> Entity { + Entity { + index, + generation: self.generations[index as usize], + } + } + + pub fn iter(&self) -> impl Iterator + '_ { + self.generations + .iter() + .enumerate() + .map(|(index, &generation)| Entity { + index: index as u32, + generation, + }) + .filter(move |entity| !self.free_indices.contains(&entity.index)) + } +} + +#[cfg(test)] +mod tests { + use crate::Entities; + + use super::*; + + #[test] + fn to_bits_from_bits_roundtrip() { + let entity = Entity { + index: 10000, + generation: 10000000, + }; + assert_eq!(Entity::from_bits(entity.to_bits()), entity); + } + + #[test] + fn entities_linear_allocation() { + let mut entities = EntityIds::default(); + + for i in 0..100 { + let entity = entities.allocate(); + assert_eq!(entity.index(), i); + assert_eq!(entity.generation(), 0); + assert!(entities.check_generation(entity).is_ok()); + } + + entities + .deallocate(Entity { + index: 5, + generation: 0, + }) + .unwrap(); + + let entity = entities.allocate(); + assert_eq!(entity.index(), 5); + assert_eq!(entity.generation(), 1); + assert!(entities.check_generation(entity).is_ok()); + } +} diff --git a/vane/src/entity_builder.rs b/vane/src/entity_builder.rs new file mode 100644 index 000000000..0c7d7180a --- /dev/null +++ b/vane/src/entity_builder.rs @@ -0,0 +1,160 @@ +use std::{ + alloc::{alloc, dealloc}, + any::TypeId, + mem::{size_of, MaybeUninit}, + ptr::{self, NonNull}, +}; + +use crate::{component::ComponentMeta, Component, Entities, Entity}; + +/// A utility to build an entity's components. +/// +/// An `EntityBuilder` can be reused to avoid repeated allocations. +#[derive(Default)] +pub struct EntityBuilder { + /// Packed vector containing component data. + components: Vec>, + entries: Vec, +} + +impl EntityBuilder { + pub fn new() -> Self { + Self::default() + } + + /// Inserts a new component for the entity. + /// + /// If the entity builder already contains the component, + /// then the previous value is overriden. + pub fn add(&mut self, component: T) -> &mut Self { + let component = MaybeUninit::new(component); + self.components.reserve(size_of::()); + + let offset = self.components.len(); + unsafe { + ptr::copy_nonoverlapping( + component.as_ptr().cast::>(), + self.components.as_mut_ptr().add(offset), + size_of::(), + ); + + self.components + .set_len(self.components.len() + size_of::()); + } + self.entries.push(Entry { + component_meta: ComponentMeta::of::(), + offset, + }); + + self + } + + /// Determines whether the builder has a component + /// of type T. + pub fn has(&self) -> bool { + self.entries + .iter() + .any(|entry| entry.component_meta.type_id == TypeId::of::()) + } + + /// Gets the given component from the builder. + /// + /// For soundness reasons, `T` must be `Copy`. + /// + /// Time complexity: O(n) with respect to the number of components. + pub fn get(&self) -> Option { + let entry = self + .entries + .iter() + .find(|e| e.component_meta.type_id == TypeId::of::()); + + entry.map(|entry| unsafe { + ptr::read_unaligned(self.components.as_ptr().add(entry.offset).cast::()) + }) + } + + /// Spawns the entity builder into an `Ecs`. + pub fn spawn_into(&mut self, ecs: &mut Entities) -> Entity { + ecs.spawn_builder(self) + } + + /// Drains the builder, returning tuples of + /// the component meta and a pointer + /// to the component data. + /// + /// NB: component data is not necessarily aligned. + pub(crate) fn drain(&mut self) -> impl Iterator)> + '_ { + let components = &mut self.components; + self.entries.drain(..).map(move |entry| { + let component = unsafe { + NonNull::new_unchecked(components.as_mut_ptr().add(entry.offset).cast::()) + }; + (entry.component_meta, component) + }) + } + + /// Resets the builder, clearing all components. + /// + /// Does not invoke component drop functions. + pub(crate) fn reset(&mut self) { + self.entries.clear(); + self.components.clear(); + } +} + +impl Drop for EntityBuilder { + fn drop(&mut self) { + for entry in self.entries.drain(..) { + unsafe { + let src_ptr = self.components.as_ptr().add(entry.offset).cast::(); + // Pointers in the entity builder are unaligned, so a + // separate, aligned buffer is needed to store the component for dropping. + let buffer = alloc(entry.component_meta.layout); + std::ptr::copy_nonoverlapping(src_ptr, buffer, entry.component_meta.layout.size()); + + (entry.component_meta.drop_fn)(buffer); + + dealloc(buffer, entry.component_meta.layout); + } + } + } +} + +struct Entry { + component_meta: ComponentMeta, + offset: usize, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[derive(Copy, Clone, Debug, PartialEq)] + struct Comp(T); + + impl Component for Comp {} + + #[test] + fn build_entity() { + let mut builder = EntityBuilder::new(); + + builder + .add(Comp(10i32)) + .add(Comp("a string".to_owned())) + .add(Comp(50usize)); + + assert_eq!(builder.get::>(), Some(Comp(10))); + + builder.reset(); + assert_eq!(builder.drain().count(), 0); + } + + #[test] + fn drops_components_on_drop() { + let mut builder = EntityBuilder::new(); + builder.add(Comp(vec![1, 2, 3])); + drop(builder); + + // A memory leak is detected by Miri if this fails + } +} diff --git a/vane/src/entity_ref.rs b/vane/src/entity_ref.rs new file mode 100644 index 000000000..ff90b863f --- /dev/null +++ b/vane/src/entity_ref.rs @@ -0,0 +1,26 @@ +use crate::{Component, ComponentError, Entities, Entity, Ref, RefMut}; + +/// Convenient wrapper over an `EntityId` that +/// gives access to components. +pub struct EntityRef<'a> { + entity: Entity, + world: &'a Entities, +} + +impl<'a> EntityRef<'a> { + pub(crate) fn new(entity: Entity, world: &'a Entities) -> Self { + Self { entity, world } + } + + pub fn get(&self) -> Result, ComponentError> { + self.world.get(self.entity) + } + + pub fn get_mut(&self) -> Result, ComponentError> { + self.world.get_mut(self.entity) + } + + pub fn has(&self) -> bool { + self.world.has::(self.entity) + } +} diff --git a/feather/ecs/src/event.rs b/vane/src/event.rs similarity index 84% rename from feather/ecs/src/event.rs rename to vane/src/event.rs index 3ed66c3d3..7b474f27d 100644 --- a/feather/ecs/src/event.rs +++ b/vane/src/event.rs @@ -1,15 +1,15 @@ -use hecs::{Component, Entity, World}; +use crate::{Component, Entities, Entity}; /// Function to remove an event from the ECS. -type EventRemoveFn = fn(&mut World, Entity); +type EventRemoveFn = fn(&mut Entities, Entity); fn entity_event_remove_fn() -> EventRemoveFn { |ecs, entity| { - let _ = ecs.remove_one::(entity); + let _ = ecs.remove::(entity); } } -fn event_remove_fn(world: &mut World, event_entity: Entity) { +fn event_remove_fn(world: &mut Entities, event_entity: Entity) { let _ = world.despawn(event_entity); } @@ -18,7 +18,7 @@ fn event_remove_fn(world: &mut World, event_entity: Entity) { /// /// An event's lifecycle is as follows: /// 1. The event is added as a component to its entity -/// by calling `Ecs::insert_event`. The system that +/// by calling `vane::insert_event`. The system that /// inserts the event is called the "triggering system." /// 2. Each system runs and has exactly one chance to observe /// the event through a query. @@ -48,9 +48,9 @@ impl EventTracker { } /// Adds a custom function to run - /// before the current systems executes again. + /// before the current system executes again. #[allow(unused)] - pub fn insert_custom(&mut self, entity: Entity, callback: fn(&mut World, Entity)) { + pub fn insert_custom(&mut self, entity: Entity, callback: fn(&mut Entities, Entity)) { let events_vec = self.current_events_vec(); events_vec.push((entity, callback)); } @@ -61,7 +61,7 @@ impl EventTracker { /// Deletes events that were triggered on the previous tick /// by the current system. - pub fn remove_old_events(&mut self, world: &mut World) { + pub fn remove_old_events(&mut self, world: &mut Entities) { let events_vec = self.current_events_vec(); for (entity, remove_fn) in events_vec.drain(..) { remove_fn(world, entity); diff --git a/vane/src/layout_ext.rs b/vane/src/layout_ext.rs new file mode 100644 index 000000000..10a01d357 --- /dev/null +++ b/vane/src/layout_ext.rs @@ -0,0 +1,56 @@ +use std::alloc::Layout; + +/// Provides extra methods on `Layout` that are unstable +/// in `std`. +pub trait LayoutExt: Sized { + fn repeat(&self, n: usize) -> Result<(Self, usize), ()>; + + fn padding_needed_for(&self, align: usize) -> usize; +} + +// Implementations taken from `std`. +impl LayoutExt for Layout { + fn repeat(&self, n: usize) -> Result<(Self, usize), ()> { + // This cannot overflow. Quoting from the invariant of Layout: + // > `size`, when rounded up to the nearest multiple of `align`, + // > must not overflow (i.e., the rounded value must be less than + // > `usize::MAX`) + let padded_size = self.size() + ::padding_needed_for(self, self.align()); + let alloc_size = padded_size.checked_mul(n).ok_or(())?; + + // SAFETY: self.align is already known to be valid and alloc_size has been + // padded already. + unsafe { + Ok(( + Layout::from_size_align_unchecked(alloc_size, self.align()), + padded_size, + )) + } + } + + fn padding_needed_for(&self, align: usize) -> usize { + let len = self.size(); + + // Rounded up value is: + // len_rounded_up = (len + align - 1) & !(align - 1); + // and then we return the padding difference: `len_rounded_up - len`. + // + // We use modular arithmetic throughout: + // + // 1. align is guaranteed to be > 0, so align - 1 is always + // valid. + // + // 2. `len + align - 1` can overflow by at most `align - 1`, + // so the &-mask with `!(align - 1)` will ensure that in the + // case of overflow, `len_rounded_up` will itself be 0. + // Thus the returned padding, when added to `len`, yields 0, + // which trivially satisfies the alignment `align`. + // + // (Of course, attempts to allocate blocks of memory whose + // size and padding overflow in the above manner should cause + // the allocator to yield an error anyway.) + + let len_rounded_up = len.wrapping_add(align).wrapping_sub(1) & !align.wrapping_sub(1); + len_rounded_up.wrapping_sub(len) + } +} diff --git a/vane/src/lib.rs b/vane/src/lib.rs new file mode 100644 index 000000000..6a0338ec5 --- /dev/null +++ b/vane/src/lib.rs @@ -0,0 +1,29 @@ +#![allow(unused)] // TEMP (remove before merge) +#![allow(unstable_name_collisions)] + +mod borrow; +mod bundle; +mod bus; +mod component; +mod entity; +mod entity_builder; +mod entity_ref; +mod event; +mod layout_ext; +mod query; +mod resources; +mod storage; +mod system; +mod world; + +pub use borrow::{BorrowError, BorrowFlag, Ref, RefMut}; +pub use bus::Bus; +pub use component::Component; +pub use entity::Entity; +pub use entity_builder::EntityBuilder; +pub use entity_ref::EntityRef; +pub use query::{QueryDriver, QueryItem}; +pub use resources::{ResourceError, Resources}; +pub use storage::{SparseSetRef, SparseSetStorage}; +pub use system::{HasEntities, HasResources, SysResult, SystemExecutor}; +pub use world::{ComponentError, Components, Entities, EntityDead}; diff --git a/vane/src/query.rs b/vane/src/query.rs new file mode 100644 index 000000000..2a760ce66 --- /dev/null +++ b/vane/src/query.rs @@ -0,0 +1,357 @@ +//! Dynamic query infrastructure. + +use std::{any::TypeId, borrow::Cow, cell::Cell, ops::Deref}; + +use crate::{ + storage::sparse_set, Component, Components, Entities, Ref, RefMut, SparseSetRef, + SparseSetStorage, +}; + +/// Drives a query by yielding the entities +/// whose components satisfy the query parameters. +pub struct QueryDriver<'w, 'q> { + /// A sparse set for each component in the query. + sparse_sets: Cow<'q, [SparseSetRef<'w>]>, + + /// The "lead" sparse set, chosen as the set with + /// the smallest number of components. + lead: SparseSetRef<'w>, + + /// Used as the yielded value for the iterator. + /// (We can't own this because of the lack of GATs.) + dense_indices: Cow<'q, [Cell]>, +} + +impl<'w, 'q> QueryDriver<'w, 'q> { + /// Creates a new `QueryDriver` given the sparse sets + /// whose components are required by the query. + /// + /// `dense_indices` should be a zeroed slice of size `sparse_sets.len()`. + /// + /// # Panics + /// Panics if `sparse_sets.len() != dense_indices.len()`. + pub fn new( + sparse_sets: Cow<'q, [SparseSetRef<'w>]>, + dense_indices: Cow<'q, [Cell]>, + ) -> Self { + let lead = sparse_sets + .iter() + .min_by_key(|set| set.len()) + .copied() + .unwrap_or(*SparseSetRef::empty()); + + Self { + sparse_sets, + lead, + dense_indices, + } + } + + /// Returns the number of components in the query. + pub fn num_components(&self) -> usize { + self.sparse_sets.len() + } + + /// Iterates over dense and sparse indices matching the query. + pub fn iter(&'q mut self) -> QueryDriverIter<'w, 'q> { + QueryDriverIter { + lead_iter: self.lead.iter(), + driver: self, + } + } +} + +/// An iterator for a QueryDriver. +pub struct QueryDriverIter<'w, 'q> { + driver: &'q mut QueryDriver<'w, 'q>, + lead_iter: sparse_set::Iter<'q>, +} + +impl<'w, 'q> QueryDriverIter<'w, 'q> { + #[allow(clippy::never_loop)] // looks like a false positive - the loop has a `continue` + pub fn next(&mut self) -> Option { + loop { + let (sparse_index, lead_dense_index) = self.lead_iter.next()?; + + for (dense_index, sparse_set) in self + .driver + .dense_indices + .iter() + .zip(self.driver.sparse_sets.iter()) + { + dense_index.set(match sparse_set.dense_index_of(sparse_index) { + Some(d) => d, + None => continue, + }); + } + + break Some(QueryItem { + dense_indices: &self.driver.dense_indices, + sparse_index, + }); + } + } +} + +/// An item yielded by a query. +pub struct QueryItem<'q> { + /// The `dense` index into the sparse set + /// of each component in the query. + pub dense_indices: &'q [Cell], + /// The sparse (entity) index of this item. + pub sparse_index: u32, +} + +// -- Static queries + +/// A typed query element. +pub trait QueryParameter<'a> { + type Output: 'a; + type Component: Component; + + unsafe fn get_unchecked_by_dense_index( + storage: &'a SparseSetStorage, + dense_index: u32, + ) -> Self::Output; +} + +impl<'a, T> QueryParameter<'a> for &'a T +where + T: Component, +{ + type Output = Ref<'a, T>; + type Component = T; + + unsafe fn get_unchecked_by_dense_index( + storage: &'a SparseSetStorage, + dense_index: u32, + ) -> Self::Output { + let (ptr, borrow_flag) = storage.get_unchecked_by_dense_index(dense_index); + borrow_flag.borrow().expect("query causes borrow conflicts"); + Ref::new(&*ptr.as_ptr(), borrow_flag) + } +} + +impl<'a, T> QueryParameter<'a> for &'a mut T +where + T: Component, +{ + type Output = RefMut<'a, T>; + type Component = T; + + unsafe fn get_unchecked_by_dense_index( + storage: &'a SparseSetStorage, + dense_index: u32, + ) -> Self::Output { + let (ptr, borrow_flag) = storage.get_unchecked_by_dense_index(dense_index); + borrow_flag + .borrow_mut() + .expect("query causes borrow conflicts"); + RefMut::new(&mut *ptr.as_ptr(), borrow_flag) + } +} + +/// A tuple of query parameters. +pub trait QueryTuple<'a> { + type Output: 'a; + + // avoiding allocations here is blocked on const generics and/or GATs + fn sparse_sets(components: &Components) -> Vec<&SparseSetStorage>; + + fn dense_indices() -> Vec>; + + /// # Safety + /// `dense_indices` must be valid dense indices into the + /// sparse set at the corresponding index. + /// + /// `dense_indices` and `sparse_sets` must have a length equal + /// to the length of the vectors returned by the corresponding methods + /// of this trait. + unsafe fn make_output( + sparse_sets: &[&'a SparseSetStorage], + dense_indices: &[Cell], + ) -> Self::Output; +} + +macro_rules! query_tuple_impl { + ($count:literal, $(($ty:ident, $index:literal)),* $(,)?) => { + impl <'a, $($ty: QueryParameter<'a>),*> QueryTuple<'a> for ($($ty),*) { + type Output = ($($ty::Output),*); + + fn sparse_sets(components: &Components) -> Vec<&SparseSetStorage> { + vec![ + $( + components.storage_for::<$ty::Component>().unwrap_or_else(|_| SparseSetStorage::empty()), + )* + ] + } + + fn dense_indices() -> Vec> { + vec![Cell::new(0); $count] + } + + unsafe fn make_output( + sparse_sets: &[&'a SparseSetStorage], + dense_indices: &[Cell], + ) -> Self::Output { + ( + $( + $ty::get_unchecked_by_dense_index(sparse_sets.get_unchecked($index), dense_indices.get_unchecked($index).get()) + ),* + ) + } + } + } +} + +query_tuple_impl!(1, (T0, 0)); +query_tuple_impl!(2, (T0, 0), (T1, 1)); +query_tuple_impl!(3, (T0, 0), (T1, 1), (T2, 2)); +query_tuple_impl!(4, (T0, 0), (T1, 1), (T2, 2), (T3, 3)); +query_tuple_impl!(5, (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4)); +query_tuple_impl!(6, (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4), (T5, 5)); +query_tuple_impl!( + 7, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6) +); +query_tuple_impl!( + 8, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7) +); +query_tuple_impl!( + 9, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8) +); +query_tuple_impl!( + 10, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9) +); +query_tuple_impl!( + 11, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10) +); +query_tuple_impl!( + 12, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10), + (T11, 11) +); +query_tuple_impl!( + 13, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10), + (T11, 11), + (T12, 12) +); +query_tuple_impl!( + 14, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10), + (T11, 11), + (T12, 12), + (T13, 13) +); +query_tuple_impl!( + 15, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10), + (T11, 11), + (T12, 12), + (T13, 13), + (T14, 14) +); +query_tuple_impl!( + 16, + (T0, 0), + (T1, 1), + (T2, 2), + (T3, 3), + (T4, 4), + (T5, 5), + (T6, 6), + (T7, 7), + (T8, 8), + (T9, 9), + (T10, 10), + (T11, 11), + (T12, 12), + (T13, 13), + (T14, 14), + (T15, 15) +); diff --git a/feather/ecs/src/resources.rs b/vane/src/resources.rs similarity index 100% rename from feather/ecs/src/resources.rs rename to vane/src/resources.rs diff --git a/vane/src/storage.rs b/vane/src/storage.rs new file mode 100644 index 000000000..d635612b7 --- /dev/null +++ b/vane/src/storage.rs @@ -0,0 +1,5 @@ +mod blob_array; +mod component_vec; +pub(crate) mod sparse_set; + +pub use sparse_set::{SparseSetRef, SparseSetStorage}; diff --git a/vane/src/storage/blob_array.rs b/vane/src/storage/blob_array.rs new file mode 100644 index 000000000..30680eb87 --- /dev/null +++ b/vane/src/storage/blob_array.rs @@ -0,0 +1,322 @@ +use std::{ + alloc::Layout, + mem::MaybeUninit, + ptr::{self, NonNull}, + sync::Arc, +}; + +use crate::layout_ext::LayoutExt; + +/// Returned from `push` when the blob array is full. +#[derive(Debug)] +pub struct Full; + +/// A heap-allocated array of values of the same layout, stored +/// as raw bytes. +/// +/// This is an untyped version of a `Box<[T]>`. +/// +/// Does not support resizing. Values have a fixed location in memory +/// unless `swap_remove` is called. +pub struct BlobArray { + /// Layout of the values stored in the blob vector. + item_layout: Layout, + /// Function to drop items in the array. + item_drop_fn: unsafe fn(*mut u8), + + /// The maximum number of items. + capacity: usize, + /// The number of items. + len: usize, + /// Untyped pointer to the items. + ptr: NonNull, +} + +impl BlobArray { + pub fn new(item_layout: Layout, item_drop_fn: unsafe fn(*mut u8), capacity: usize) -> Self { + assert!( + capacity < isize::MAX as usize, + "capacity cannot exceed isize::MAX" + ); + assert_ne!(capacity, 0, "capacity cannot be zero"); + + // Allocate space for the items. + let ptr = if item_layout.size() == 0 { + // Use a dangling pointer - we can't make allocations of zero size. + NonNull::new(item_layout.align() as *mut _).expect("zero align") + } else { + let ptr = unsafe { std::alloc::alloc(item_layout.repeat(capacity).unwrap().0) }; + NonNull::new(ptr).expect("allocation failed") + }; + + Self { + item_layout, + item_drop_fn, + + capacity, + len: 0, + ptr, + } + } + + pub fn push(&mut self, value: T) -> Result<*mut u8, Full> { + self.assert_layout_matches::(); + + // Put the value in a MaybeUninit so that + // it is not dropped after its bytes have been copied. + // Otherwise, we risk a double free. + let value = MaybeUninit::new(value); + unsafe { self.push_raw(value.as_ptr().cast()) } + } + + pub unsafe fn push_raw(&mut self, value: *const u8) -> Result<*mut u8, Full> { + let new_len = self.len + 1; + if new_len > self.capacity { + return Err(Full); + } + + self.len = new_len; + + let ptr = self.item_ptr(self.len - 1); + unsafe { + ptr::copy_nonoverlapping(value, ptr, self.item_layout.size()); + } + + self.check_invariants(); + + Ok(ptr) + } + + pub unsafe fn set_len(&mut self, len: usize) { + self.len = len; + } + + /// # Safety + /// The values stored in this vector must be of type `T`. + pub unsafe fn get(&self, index: usize) -> Option<&T> { + self.assert_layout_matches::(); + let ptr = self.get_raw(index)?; + Some(&*ptr.cast().as_ptr()) + } + + /// # Safety + /// The values stored in this vector must be of type `T`. + pub unsafe fn get_mut(&mut self, index: usize) -> Option<&mut T> { + let ptr = self.get_raw(index)?; + Some(&mut *ptr.cast().as_ptr()) + } + + /// Gets the value at index `index` as a raw pointer. + pub fn get_raw(&self, index: usize) -> Option> { + if index >= self.len { + return None; + } + + // SAFETY: `index` is in bounds. + unsafe { Some(self.get_raw_unchecked(index)) } + } + + /// # Safety + /// `index` must be within bounds. + pub unsafe fn get_raw_unchecked(&self, index: usize) -> NonNull { + let ptr = self.item_ptr(index); + NonNull::new_unchecked(ptr) + } + + /// Removes the value at `at_index` and moves + /// the last item to `at_index`. + /// + /// # Panics + /// Panics if `at_index >= self.len()`. + pub fn swap_remove(&mut self, at_index: usize) { + assert!( + at_index < self.len, + "swap remove index out of bounds ({} > {})", + at_index, + self.len + ); + + let ptr = self.item_ptr(at_index); + let end_ptr = self.item_ptr(self.len - 1); + + unsafe { + (self.item_drop_fn)(ptr); + + // Move the value at `end_ptr` to + // `ptr`, overwriting the value at `ptr`. + std::ptr::copy(end_ptr, ptr, self.item_layout.size()); + } + + self.len -= 1; + } + + fn item_ptr(&self, offset: usize) -> *mut u8 { + unsafe { self.ptr.as_ptr().add(offset * self.item_layout.size()) } + } + + pub fn len(&self) -> usize { + self.len + } + + pub fn byte_len(&self) -> usize { + self.len * self.item_layout.size() + } + + pub fn capacity(&self) -> usize { + self.capacity + } + + fn check_invariants(&self) { + debug_assert!(self.capacity() >= self.len()); + } + + fn assert_layout_matches(&self) { + assert_eq!( + Layout::new::(), + self.item_layout, + "pushed item must have same layout as item_layout ({:?} != {:?})", + Layout::new::(), + self.item_layout + ); + } +} + +impl Drop for BlobArray { + fn drop(&mut self) { + for i in 0..self.len() { + let ptr = self.get_raw(i).unwrap().as_ptr(); + unsafe { + (self.item_drop_fn)(ptr); + } + } + if self.item_layout.size() != 0 { + unsafe { + std::alloc::dealloc( + self.ptr.as_ptr(), + self.item_layout.repeat(self.capacity).unwrap().0, + ); + } + } + } +} + +unsafe impl Send for BlobArray {} + +#[cfg(test)] +mod tests { + use std::sync::atomic::{AtomicBool, Ordering}; + + use super::*; + + #[test] + fn push_get() { + let mut vec = BlobArray::new(Layout::new::(), |_| (), 1001); + vec.push(123usize); + for i in 0usize..1000 { + vec.push(i); + } + assert_eq!(vec.len(), 1001); + assert!(vec.capacity() >= vec.len()); + assert!(vec.push(10usize).is_err()); + unsafe { + assert_eq!(vec.get(0), Some(&123usize)); + for i in 1..1001 { + assert_eq!(vec.get(i), Some(&(i - 1))); + } + assert_eq!(vec.get::(1001), None); + } + } + + #[test] + fn push_get_raw_bytes() { + let mut vec = BlobArray::new(Layout::new::(), |_| (), 1000); + for i in 0usize..1000 { + vec.push(i); + } + + for i in 0usize..1000 { + let bytes = vec.get_raw(i).unwrap(); + unsafe { + assert_eq!(*bytes.as_ptr().cast::(), i); + } + } + } + + #[test] + fn swap_remove() { + let mut vec = BlobArray::new(Layout::new::(), |_| (), 100); + for i in 0..100 { + vec.push(i as usize); + } + + assert_eq!(vec.len(), 100); + + unsafe { + vec.swap_remove(50); + assert_eq!(vec.len(), 99); + + assert_eq!(vec.get(98), Some(&98usize)); + assert_eq!(vec.get(50), Some(&99usize)); + } + } + + #[test] + fn calls_drop_fn() { + struct NeedsDrop { + x: i32, + } + + static WAS_DROPPED: AtomicBool = AtomicBool::new(false); + + impl Drop for NeedsDrop { + fn drop(&mut self) { + WAS_DROPPED.store(true, Ordering::SeqCst); + assert_eq!(self.x, 15); + } + } + + let mut vec = BlobArray::new( + Layout::new::(), + |ptr| unsafe { ptr::drop_in_place::(ptr.cast()) }, + 1, + ); + vec.push(NeedsDrop { x: 15 }); + + vec.swap_remove(0); + + assert!(WAS_DROPPED.load(Ordering::SeqCst)); + } + + /* #[test] + fn iter() { + let mut vec = BlobVec::new(Layout::new::()); + for i in 0usize..1000 { + vec.push(i); + } + + unsafe { + for (i, value) in vec.iter::().enumerate() { + assert_eq!(i, *value); + } + } + } + + #[test] + fn iter_mut() { + let mut vec = BlobVec::new(Layout::new::()); + for i in 0usize..1000 { + vec.push(i); + } + + unsafe { + for (i, value) in vec.iter_mut::().enumerate() { + assert_eq!(i, *value); + *value += 1; + } + + for (i, value) in vec.iter::().enumerate() { + assert_eq!(i, *value + 1); + } + } + }*/ +} diff --git a/vane/src/storage/component_vec.rs b/vane/src/storage/component_vec.rs new file mode 100644 index 000000000..596da0a72 --- /dev/null +++ b/vane/src/storage/component_vec.rs @@ -0,0 +1,249 @@ +use std::{alloc::Layout, ptr::NonNull, sync::Arc}; + +use arrayvec::ArrayVec; + +use crate::component::ComponentMeta; + +use super::blob_array::BlobArray; + +/// A vector of component values, stored as untyped, raw +/// bytes. +/// +/// Components have a stable location in memory unless `swap_remove` +/// is called. +/// +/// This implementation uses a series of `BlobArray`s with exponentially +/// increasing capacities. The first 512 components are stored in the first +/// array; the next 1024 in the second; and so on. Therefore, arrays are never resized, +/// which gives two key properties: +/// 1. Values have a stable location in memory: regrowth does not move data. +/// 2. Pushing is `O(1)` in the worst case. On the other hand, +/// if we allowed for regrowth, the worst case would be `O(n)`. +pub struct ComponentVec { + arrays: ArrayVec, + component_meta: ComponentMeta, + len: u32, +} + +impl ComponentVec { + /// Creates a new `ComponentVec`. Does not allocate. + pub fn new(component_meta: ComponentMeta) -> Self { + Self { + arrays: ArrayVec::new(), + component_meta, + len: 0, + } + } + + /// Pushes the given value into the component vector. + /// + /// After this call, the value pointed by `ptr` is uninitialized. + /// + /// # Safety + /// `ptr` must be a valid pointer to an instance of + /// the component type stored in this vector. + pub unsafe fn push(&mut self, value: *const u8) -> *mut u8 { + let new_len = self + .len + .checked_add(1) + .expect("component vector length exceed u32::MAX"); + + self.len = new_len; + + let array = self.array_for_item_or_grow(new_len - 1); + + let ptr = array.push_raw(value).expect("array cannot be full"); + + self.check_invariants(); + + ptr + } + + /// Gets the value at the given index. + /// + /// # Safety + /// `index` must be in bounds. + pub unsafe fn get_unchecked(&self, index: u32) -> NonNull { + self.array_for_item(index) + .get_raw_unchecked(item_index_within_array(index)) + } + + /// Swap-removes the item at the given index. + /// + /// This call moves the last item in the array to `index`, + /// deleting the previous value at `index`. + /// + /// # Warning + /// This function breaks pointer stability. Any pointers into + /// values in this component vector should be considered invalid + /// after this call. + pub fn swap_remove(&mut self, index: u32) { + assert!(index < self.len, "index out of bounds"); + + let item_size = self.component_meta.layout.size(); + + unsafe { + let last_array = self.array_for_item_mut(self.len - 1); + let last_item = last_array.get_raw_unchecked(last_array.len() - 1); + last_array.set_len(last_array.len() - 1); + + let item_array = self.array_for_item_mut(index); + let removed_item = item_array.get_raw_unchecked(item_index_within_array(index)); + + (self.component_meta.drop_fn)(removed_item.as_ptr()); + + std::ptr::copy(last_item.as_ptr(), removed_item.as_ptr(), item_size); + } + + self.len -= 1; + + self.check_invariants(); + } + + /// Returns the number of components in the vector. + pub fn len(&self) -> u32 { + self.len + } + + pub fn component_meta(&self) -> &ComponentMeta { + &self.component_meta + } + + fn check_invariants(&self) { + debug_assert_eq!( + self.arrays.iter().map(|array| array.len()).sum::(), + self.len as usize + ); + } + + /// # Safety + /// `item_index` must be in bounds. + unsafe fn array_for_item(&self, item_index: u32) -> &BlobArray { + // SAFETY: `array_index` always returns indices in bounds. + unsafe { self.arrays.get_unchecked(array_index(item_index)) } + } + + /// # Safety + /// `item_index` must be in bounds. + unsafe fn array_for_item_mut(&mut self, item_index: u32) -> &mut BlobArray { + // SAFETY: `array_index` always returns indices in bounds. + unsafe { self.arrays.get_unchecked_mut(array_index(item_index)) } + } + + fn array_for_item_or_grow(&mut self, item_index: u32) -> &mut BlobArray { + let array_index = array_index(item_index); + + if array_index >= self.arrays.len() { + self.allocate_new_array(); + } + + self.arrays.get_mut(array_index).unwrap() + } + + fn allocate_new_array(&mut self) { + let previous_capacity = self + .arrays + .last() + .map(|array| array.capacity()) + .unwrap_or_else(|| 2usize.pow(START_CAP_LOG2 as u32)); + let next_capacity = previous_capacity.checked_mul(2).expect("capacity overflow"); + let array = BlobArray::new( + self.component_meta.layout, + self.component_meta.drop_fn, + next_capacity, + ); + self.arrays.push(array); + } +} + +const START_CAP_LOG2: usize = 9; // log2(512) +const MAX_NUM_ARRAYS: usize = 32 - START_CAP_LOG2 + 1; + +/// Returns the index into `ComponentVec::arrays` of +/// the item at the given index. +fn array_index(item_index: u32) -> usize { + let log2_index = 32u32 - item_index.leading_zeros(); + let array_index = (log2_index.saturating_sub(START_CAP_LOG2 as u32)) as usize; + debug_assert!(array_index < MAX_NUM_ARRAYS); + array_index +} + +/// Returns the index inside an array +/// of the given item index. +fn item_index_within_array(item_index: u32) -> usize { + let next_power_of_two = item_index.next_power_of_two(); + let prev_power_of_two = next_power_of_two / 2; + + (item_index & (prev_power_of_two.max(2u32.pow(START_CAP_LOG2 as u32)) - 1)) as usize +} + +#[cfg(test)] +mod tests { + use crate::Component; + + use super::*; + + #[repr(transparent)] + struct Comp(T); + + impl Component for Comp {} + + #[test] + fn array_index_zero() { + assert_eq!(array_index(0), 0); + } + + #[test] + fn array_index_max_equals_last_array() { + assert_eq!(array_index(u32::MAX), MAX_NUM_ARRAYS - 1); + } + + #[test] + fn array_index_between() { + assert_eq!(array_index(2u32.pow(START_CAP_LOG2 as u32)), 1); + assert_eq!(array_index(2u32.pow(START_CAP_LOG2 as u32 + 1)), 2); + assert_eq!(array_index(1), 0); + } + + #[test] + fn item_index_within_array_test() { + assert_eq!(item_index_within_array(0), 0); + assert_eq!(item_index_within_array(511), 511); + assert_eq!(item_index_within_array(512), 0); + assert_eq!(item_index_within_array(256), 256); + } + + #[test] + #[cfg_attr(miri, ignore)] + fn push_and_get() { + let meta = ComponentMeta::of::>(); + let mut vec = ComponentVec::new(meta); + + unsafe { + for i in 0..10_000i32 { + vec.push(&i as *const i32 as *const u8); + } + for i in 0..10_000i32 { + assert_eq!(*vec.get_unchecked(i as u32).cast::().as_ref(), i); + } + } + } + + #[test] + #[cfg_attr(miri, ignore)] + fn swap_remove() { + let meta = ComponentMeta::of::>(); + let mut vec = ComponentVec::new(meta); + + unsafe { + for i in 0..1000i32 { + vec.push(&i as *const i32 as *const u8); + } + assert_eq!(vec.len(), 1000); + + vec.swap_remove(50); + assert_eq!(*vec.get_unchecked(50).cast::().as_ref(), 999); + assert_eq!(vec.len(), 999); + } + } +} diff --git a/vane/src/storage/sparse_set.rs b/vane/src/storage/sparse_set.rs new file mode 100644 index 000000000..ffdd3b18d --- /dev/null +++ b/vane/src/storage/sparse_set.rs @@ -0,0 +1,302 @@ +use core::slice; +use std::{ + any::TypeId, + iter::{self, Enumerate}, + mem::{self, MaybeUninit}, + ptr::{self, NonNull}, +}; + +use once_cell::sync::Lazy; +use thread_local::ThreadLocal; + +use crate::{ + borrow::BorrowFlag, + component::{self, ComponentMeta}, + BorrowError, ComponentError, Ref, RefMut, +}; + +use super::{blob_array::BlobArray, component_vec::ComponentVec}; + +static EMPTY: Lazy> = Lazy::new(ThreadLocal::new); + +/// Stores components in a sparse set. +pub struct SparseSetStorage { + // Data structure invariant: if `dense[sparse[i]] == i`, + // then the storage contains a component for the entity with index `i`, + // and that component is stored at `components[sparse[i]]`. + // + // It follows that the component at `components[i]` belongs to + // the entity index at `dense[i]` for all `i`. + sparse: Vec, + dense: Vec, + components: ComponentVec, + borrow_flags: Vec, +} + +impl SparseSetStorage { + pub fn new(component_meta: ComponentMeta) -> Self { + Self { + sparse: Vec::new(), + dense: Vec::new(), + components: ComponentVec::new(component_meta), + borrow_flags: Vec::new(), + } + } + + /// The empty sparse set. + /// Attempting to access components from this sparse + /// set will usually cause a panic. + pub fn empty() -> &'static Self { + EMPTY.get_or(|| SparseSetStorage::new(ComponentMeta::of::<()>())) + } + + pub fn insert(&mut self, index: u32, value: T) { + self.assert_type_matches::(); + let value = MaybeUninit::new(value); + unsafe { + self.insert_raw(index, value.as_ptr().cast()); + } + } + + /// # Safety + /// `component` must point to a valid (but not necessarily aligned) instance of the component + /// stored in this sparse set. + pub unsafe fn insert_raw(&mut self, index: u32, component: *const u8) -> *mut u8 { + self.grow_sparse_for(index); + + if let Some((existing_component, _)) = self.get_raw(index) { + // Component already exists for this index; overwrite it. + ptr::drop_in_place(existing_component.as_ptr()); + ptr::copy_nonoverlapping( + component, + existing_component.as_ptr(), + self.components.component_meta().layout.size(), + ); + existing_component.as_ptr() + } else { + self.sparse[index as usize] = self.dense.len() as u32; + let ptr = self.components.push(component); + self.dense.push(index); + self.borrow_flags.push(BorrowFlag::default()); + + ptr + } + } + + pub fn get(&self, index: u32) -> Result>, BorrowError> { + self.assert_type_matches::(); + unsafe { + let (ptr, borrow_flag) = match self.get_raw(index) { + Some(x) => x, + None => return Ok(None), + }; + + borrow_flag.borrow()?; + let component = &*ptr.as_ptr().cast(); + + Ok(Some(Ref::new(component, borrow_flag))) + } + } + + pub fn get_mut(&self, index: u32) -> Result>, BorrowError> { + self.assert_type_matches::(); + unsafe { + let (ptr, borrow_flag) = match self.get_raw(index) { + Some(x) => x, + None => return Ok(None), + }; + + borrow_flag.borrow_mut()?; + let component = &mut *ptr.as_ptr().cast(); + + Ok(Some(RefMut::new(component, borrow_flag))) + } + } + + pub(crate) fn get_raw(&self, index: u32) -> Option<(NonNull, &BorrowFlag)> { + let sparse = *self.sparse.get(index as usize)?; + let dense = *self.dense.get(sparse as usize)?; + + if dense == index { + // SAFETY: by the data structure invariant, + // `sparse` exists in `components` if `dense[sparse] == index`. + let component = unsafe { self.components.get_unchecked(sparse) }; + let borrow_flag = unsafe { self.borrow_flags.get_unchecked(sparse as usize) }; + + Some((component, borrow_flag)) + } else { + None + } + } + + /// # Safety + /// The sparse set must contain a value at dense + /// index `index`. (Note that dense indices are _not_ + /// the same as entity indices, referred to as sparse indices here.) + pub unsafe fn get_unchecked_by_dense_index( + &self, + dense_index: u32, + ) -> (NonNull, &BorrowFlag) { + let component = self.components.get_unchecked(dense_index).cast(); + let borrow_flag = self.borrow_flags.get_unchecked(dense_index as usize); + (component, borrow_flag) + } + + pub fn remove(&mut self, index: u32) -> bool { + let sparse = match self.sparse.get(index as usize) { + Some(&s) => s, + None => return false, + }; + let dense = match self.dense.get(sparse as usize) { + Some(&d) => d, + None => return false, + }; + + if dense == index { + // Swap-remove the entity. + self.dense.swap_remove(sparse as usize); + if let Some(&new_entity_at_index) = self.dense.get(sparse as usize) { + self.sparse[new_entity_at_index as usize] = sparse; + } + self.components.swap_remove(sparse); + self.borrow_flags.swap_remove(sparse as usize); + true + } else { + false + } + } + + pub fn to_ref(&self) -> SparseSetRef { + SparseSetRef { + sparse: &self.sparse, + dense: &self.dense, + } + } + + fn grow_sparse_for(&mut self, index: u32) { + if index >= self.sparse.len() as u32 { + let needed_padding = index as usize - self.sparse.len() + 1; + self.sparse + .extend(iter::repeat(u32::MAX).take(needed_padding)); + } + } + + fn assert_type_matches(&self) { + assert_eq!(TypeId::of::(), self.components.component_meta().type_id); + } +} + +/// An immutable reference to a sparse set. +#[derive(Copy, Clone)] +pub struct SparseSetRef<'a> { + sparse: &'a [u32], + dense: &'a [u32], +} + +impl<'a> SparseSetRef<'a> { + pub fn empty() -> &'static Self { + const EMPTY: SparseSetRef<'static> = SparseSetRef { + sparse: &[], + dense: &[], + }; + &EMPTY + } + + pub(crate) fn dense_index_of(&self, index: u32) -> Option { + let sparse = *self.sparse.get(index as usize)?; + let dense = *self.dense.get(sparse as usize)?; + if dense == index { + Some(sparse) + } else { + None + } + } + + /// Returns whether the sparse set contains the given index. + pub fn contains(&self, index: u32) -> bool { + self.dense_index_of(index).is_some() + } + + /// Returns the number of values stored in the sparse set. + pub fn len(&self) -> usize { + self.dense.len() + } + + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns an iterator over (sparse_index, dense_index) within this sparse set. + pub fn iter(&self) -> Iter<'a> { + Iter { + inner: self.dense.iter().enumerate(), + } + } +} + +pub struct Iter<'a> { + inner: Enumerate>, +} + +impl<'a> Iterator for Iter<'a> { + type Item = (u32, u32); + + fn next(&mut self) -> Option { + let (dense_index, sparse_index) = self.inner.next()?; + Some((*sparse_index, dense_index as u32)) + } +} + +#[cfg(test)] +mod tests { + use std::alloc::Layout; + + use crate::Component; + + use super::*; + + #[repr(transparent)] + #[derive(Debug, Copy, Clone, PartialEq, Eq)] + struct Comp(T); + + impl Component for Comp {} + + #[test] + fn insert_and_get() { + let mut storage = SparseSetStorage::new(ComponentMeta::of::>()); + + let entity_a = 10; + let entity_b = 15; + + storage.insert(entity_b, Comp("entity b")); + storage.insert(entity_a, Comp("entity a")); + + assert_eq!( + *storage + .get::>(entity_b) + .unwrap() + .unwrap(), + Comp("entity b") + ); + assert_eq!( + *storage + .get::>(entity_a) + .unwrap() + .unwrap(), + Comp("entity a") + ); + + storage.remove(entity_a); + assert_eq!( + *storage + .get::>(entity_b) + .unwrap() + .unwrap(), + Comp("entity b") + ); + assert!(storage + .get::>(entity_a) + .unwrap() + .is_none()); + } +} diff --git a/feather/ecs/src/system.rs b/vane/src/system.rs similarity index 90% rename from feather/ecs/src/system.rs rename to vane/src/system.rs index 3fd8aa840..8e8dacb72 100644 --- a/feather/ecs/src/system.rs +++ b/vane/src/system.rs @@ -2,7 +2,7 @@ use std::{any::type_name, marker::PhantomData, sync::Arc}; -use crate::{Ecs, Resources}; +use crate::{Entities, Resources}; /// The result type returned by a system function. /// @@ -41,19 +41,19 @@ pub trait HasResources { fn resources(&self) -> Arc; } -/// A type containing an `Ecs`. -pub trait HasEcs { - fn ecs(&self) -> &Ecs; +/// A type containing an `Entities`. +pub trait HasEntities { + fn entities(&self) -> &Entities; - fn ecs_mut(&mut self) -> &mut Ecs; + fn entities_mut(&mut self) -> &mut Entities; } -impl HasEcs for Ecs { - fn ecs(&self) -> &Ecs { +impl HasEntities for Entities { + fn entities(&self) -> &Entities { self } - fn ecs_mut(&mut self) -> &mut Ecs { + fn entities_mut(&mut self) -> &mut Entities { self } } @@ -127,10 +127,10 @@ impl SystemExecutor { /// Errors are logged using the `log` crate. pub fn run(&mut self, input: &mut Input) where - Input: HasEcs, + Input: HasEntities, { for (i, system) in self.systems.iter_mut().enumerate() { - input.ecs_mut().set_current_system_index(i); + input.entities_mut().set_current_system_index(i); // For the first cycle, we don't want to clear // events because some code may have triggered @@ -138,9 +138,12 @@ impl SystemExecutor { // this check, these events would be cleared before // any system could observe them. if !self.is_first_run { - input.ecs_mut().remove_old_events(); + input.entities_mut().remove_old_events(); } + let entities = input.entities_mut(); + entities.bus_receiver.clone().drain(entities); + let result = (system.function)(input); if let Err(e) = result { log::error!( diff --git a/vane/src/world.rs b/vane/src/world.rs new file mode 100644 index 000000000..00ac06045 --- /dev/null +++ b/vane/src/world.rs @@ -0,0 +1,306 @@ +use std::{any::type_name, borrow::Cow, iter, marker::PhantomData, mem}; + +use ahash::AHashMap; +use itertools::Either; + +use crate::{ + bundle::ComponentBundle, + bus::{Bus, BusReceiver}, + component::{Component, ComponentMeta}, + entity::{Entity, EntityIds}, + entity_builder::EntityBuilder, + entity_ref::EntityRef, + event::EventTracker, + query::{QueryDriverIter, QueryTuple}, + storage::SparseSetStorage, + BorrowError, QueryDriver, Ref, RefMut, +}; + +pub use self::components::Components; + +mod components; + +#[derive(Debug, thiserror::Error)] +pub enum ComponentError { + #[error("entity does not have a component of type {0}")] + MissingComponent(&'static str), + #[error(transparent)] + MissingEntity(#[from] EntityDead), + #[error(transparent)] + BorrowConflict(#[from] BorrowError), +} + +#[derive(Debug, thiserror::Error)] +#[error("entity is dead or was unloaded")] +pub struct EntityDead; + +/// The entity-component data structure. +/// +/// An `Entities` stores _components_ for _entities_. +#[derive(Default)] +pub struct Entities { + components: Components, + entity_ids: EntityIds, + event_tracker: EventTracker, + pub(crate) bus_receiver: BusReceiver, +} + +impl Entities { + /// Creates a new, empty ECS. + pub fn new() -> Self { + Self::default() + } + + /// Gets a [`Bus`](crate::Bus) to execute actions on the `Entities`. + pub fn bus(&self) -> Bus { + self.bus_receiver.bus() + } + + /// Returns whether an entity still exists. + pub fn contains(&self, entity: Entity) -> bool { + self.check_entity(entity).is_ok() + } + + /// Gets a component for an entity. + /// + /// Borrow checking is dynamic. If a mutable reference to the + /// component is still active, this function will return an error. + /// + /// Note that at most 254 `Ref`s can exist for a given component. Attempting + /// to acquire more will result in anerror. + /// + /// Time complexity: O(1) + pub fn get(&self, entity: Entity) -> Result, ComponentError> { + self.check_entity(entity)?; + self.components.get(entity.index()) + } + + /// Mutably gets a component for an entity. + /// + /// Borrow checking is dynamic. If any references to the + /// component are still alive, this function will return an error. + /// + /// Time complexity: O(1) + pub fn get_mut(&self, entity: Entity) -> Result, ComponentError> { + self.check_entity(entity)?; + self.components.get_mut(entity.index()) + } + + /// Determines whether the given entity has the given component. + pub fn has(&self, entity: Entity) -> bool { + self.get::(entity).is_ok() + } + + /// Gets an `EntityRef` to the given entity. + pub fn entity(&self, entity_id: Entity) -> Result { + self.check_entity(entity_id)?; + Ok(EntityRef::new(entity_id, self)) + } + + /// Inserts a component for an entity. + /// + /// If the entity already has this component, then it + /// is overriden. + /// + /// Time complexity: O(1) + pub fn insert(&mut self, entity: Entity, component: T) -> Result<(), EntityDead> { + self.check_entity(entity)?; + self.components.insert(entity.index(), component); + self.get_mut::(entity) + .expect("component not inserted") + .on_inserted(self, entity); + Ok(()) + } + + /// Removes a component from an entity. + /// + /// Returns `Err` if the entity does not exist + /// or if it did not have the component. + /// + /// Time complexity: O(1) + pub fn remove(&mut self, entity: Entity) -> Result<(), ComponentError> { + self.check_entity(entity)?; + self.components.remove::(entity.index()) + } + + /// Creates a new entity with no components. + /// + /// Time complexity: O(1) + pub fn spawn_empty(&mut self) -> Entity { + self.entity_ids.allocate() + } + + /// Creates a new entity and adds all components + /// from `builder` to the entity. + /// + /// `builder` is reset and can be reused after this call. + /// + /// Time complexity: O(n) with respect to the number of components in `builder`. + pub fn spawn_builder(&mut self, builder: &mut EntityBuilder) -> Entity { + let entity = self.spawn_empty(); + + for (component_meta, component) in builder.drain() { + unsafe { + let ptr = self.components.insert_raw( + entity.index(), + component_meta.clone(), + component.as_ptr(), + ); + (component_meta.on_inserted_fn)(ptr, self, entity); + } + } + + builder.reset(); + + entity + } + + /// Creates a new entity using a `ComponentBundle`, i.e., + /// a tuple of components. + /// + /// Time complexity: O(n) with respect to the number of components in `bundle`. + pub fn spawn_bundle(&mut self, bundle: impl ComponentBundle) -> Entity { + let entity = self.spawn_empty(); + + bundle.add_to_entity(self, entity); + + entity + } + + /// Despawns an entity. Future access to the entity + /// will result in `EntityDead` + /// + /// Time complexity: O(n) with respect to the total number of components + /// stored in this ECS. + pub fn despawn(&mut self, entity: Entity) -> Result<(), EntityDead> { + self.entity_ids.deallocate(entity).map_err(|_| EntityDead)?; + + // PERF: could we somehow optimize this linear search + // by only checking storages containing the entity? + for (_, storage) in self.components.storages_mut() { + storage.remove(entity.index()); + } + + Ok(()) + } + + /// Defers removing an entity until before the next time this system + /// runs, allowing it to be observed by systems one last time. + pub fn defer_despawn(&mut self, entity: Entity) { + // a bit of a hack - but this will change once + // hecs allows taking out components of a despawned entity + self.event_tracker.insert_event(entity); + } + + /// Queries for all entities that have the given set of components. + /// + /// Returns an iterator over tuples of `(entity, components)`. + pub fn query<'w, 'q, Q: QueryTuple<'w>>(&'w self) -> Query<'w, 'q, Q> { + let sparse_sets = Q::sparse_sets(&self.components); + let sparse_set_refs: Vec<_> = sparse_sets.iter().map(|set| set.to_ref()).collect(); + let dense_indices = Q::dense_indices(); + + let driver = QueryDriver::new(Cow::Owned(sparse_set_refs), Cow::Owned(dense_indices)); + + Query { + driver, + sparse_sets, + entities: &self.entity_ids, + _marker: PhantomData, + } + } + + /// Iterates over all alive entities in this world. + pub fn iter(&self) -> impl Iterator + '_ { + self.entity_ids.iter() + } + + /// Creates an event not related to any entity. Use + /// `insert_entity_event` for events regarding specific + /// entities (`PlayerJoinEvent`, `EntityDamageEvent`, etc...) + pub fn insert_event(&mut self, event: T) { + let entity = self.spawn_bundle((event,)); + self.event_tracker.insert_event(entity); + } + + /// Adds an event component to an entity and schedules + /// it to be removed immeditately before the current system + /// runs again. Thus, all systems have exactly one chance + /// to observe the event before it is dropped. + pub fn insert_entity_event( + &mut self, + entity: Entity, + event: T, + ) -> Result<(), EntityDead> { + self.insert(entity, event)?; + self.event_tracker.insert_entity_event::(entity); + Ok(()) + } + + /// Sets the index of the currently executing system, + /// used for event tracking. + pub fn set_current_system_index(&mut self, index: usize) { + self.event_tracker.set_current_system_index(index); + } + + /// Should be called before each system runs. + pub fn remove_old_events(&mut self) { + let mut tracker = mem::take(&mut self.event_tracker); + tracker.remove_old_events(self); + self.event_tracker = tracker; + } + + fn check_entity(&self, entity: Entity) -> Result<(), EntityDead> { + self.entity_ids + .check_generation(entity) + .map_err(|_| EntityDead) + } +} + +/// An iterator over a statically-typed query. +/// +/// Call [`iter`] to iterate over the items. +pub struct Query<'w, 'q, Q> { + driver: QueryDriver<'w, 'q>, + sparse_sets: Vec<&'w SparseSetStorage>, + entities: &'w EntityIds, + _marker: PhantomData, +} + +impl<'w, 'q, Q> Query<'w, 'q, Q> +where + Q: QueryTuple<'w>, +{ + pub fn iter(&'q mut self) -> QueryIter<'w, 'q, Q> { + QueryIter { + driver: self.driver.iter(), + sparse_sets: &self.sparse_sets, + entities: self.entities, + _marker: self._marker, + } + } +} + +pub struct QueryIter<'w, 'q, Q> { + driver: QueryDriverIter<'w, 'q>, + sparse_sets: &'q [&'w SparseSetStorage], + entities: &'w EntityIds, + _marker: PhantomData, +} + +impl<'w, 'q, Q> Iterator for QueryIter<'w, 'q, Q> +where + Q: QueryTuple<'w>, +{ + type Item = (Entity, Q::Output); + + fn next(&mut self) -> Option { + let item = self.driver.next()?; + + let components = unsafe { Q::make_output(self.sparse_sets, item.dense_indices) }; + + let entity = self.entities.get(item.sparse_index); + + Some((entity, components)) + } +} diff --git a/vane/src/world/components.rs b/vane/src/world/components.rs new file mode 100644 index 000000000..05269cd4c --- /dev/null +++ b/vane/src/world/components.rs @@ -0,0 +1,98 @@ +use std::any::{type_name, TypeId}; + +use ahash::AHashMap; + +use crate::{ + component::ComponentMeta, storage::SparseSetStorage, Component, ComponentError, Ref, RefMut, +}; + +/// A raw ECS that stores only components but does not track +/// entities. +/// +/// Operates on entity indices but does not account for generations. +#[derive(Default)] +pub struct Components { + storages: AHashMap, +} + +impl Components { + pub fn new() -> Self { + Self::default() + } + + pub fn insert(&mut self, index: u32, component: T) { + self.storage_or_insert_for::().insert(index, component); + } + + /// # Safety + /// `component` must point to a valid instance of the component. + pub unsafe fn insert_raw( + &mut self, + index: u32, + component_meta: ComponentMeta, + component: *const u8, + ) -> *mut u8 { + self.storage_or_insert_for_untyped(component_meta) + .insert_raw(index, component) + } + + pub fn remove(&mut self, index: u32) -> Result<(), ComponentError> { + let was_removed = self.storage_mut_for::()?.remove(index); + if was_removed { + Ok(()) + } else { + Err(ComponentError::MissingComponent(type_name::())) + } + } + + pub fn get(&self, index: u32) -> Result, ComponentError> { + self.storage_for::()? + .get(index)? + .ok_or_else(|| ComponentError::MissingComponent(type_name::())) + } + + pub fn get_mut(&self, index: u32) -> Result, ComponentError> { + self.storage_for::()? + .get_mut(index)? + .ok_or_else(|| ComponentError::MissingComponent(type_name::())) + } + + pub fn storages(&self) -> impl Iterator + '_ { + self.storages + .iter() + .map(|(&type_id, storage)| (type_id, storage)) + } + + pub fn storages_mut(&mut self) -> impl Iterator + '_ { + self.storages + .iter_mut() + .map(|(&type_id, storage)| (type_id, storage)) + } + + pub fn storage_for(&self) -> Result<&SparseSetStorage, ComponentError> { + self.storages + .get(&TypeId::of::()) + .ok_or_else(|| ComponentError::MissingComponent(type_name::())) + } + + fn storage_mut_for(&mut self) -> Result<&mut SparseSetStorage, ComponentError> { + self.storages + .get_mut(&TypeId::of::()) + .ok_or_else(|| ComponentError::MissingComponent(type_name::())) + } + + fn storage_or_insert_for(&mut self) -> &mut SparseSetStorage { + self.storages + .entry(TypeId::of::()) + .or_insert_with(|| SparseSetStorage::new(ComponentMeta::of::())) + } + + fn storage_or_insert_for_untyped( + &mut self, + component_meta: ComponentMeta, + ) -> &mut SparseSetStorage { + self.storages + .entry(component_meta.type_id) + .or_insert_with(|| SparseSetStorage::new(component_meta)) + } +} diff --git a/vane/tests/world.rs b/vane/tests/world.rs new file mode 100644 index 000000000..3b3bfa79a --- /dev/null +++ b/vane/tests/world.rs @@ -0,0 +1,258 @@ +use std::collections::HashMap; + +use vane::*; + +struct Comp(T); + +impl vane::Component for Comp {} + +#[test] +fn insert_and_get() { + let mut world = Entities::new(); + + let entity = EntityBuilder::new() + .add(Comp(10i32)) + .add(Comp("name")) + .spawn_into(&mut world); + + assert_eq!(world.get::>(entity).unwrap().0, 10); + assert_eq!(world.get::>(entity).unwrap().0, "name"); + assert!(world.get::>(entity).is_err()); +} + +#[test] +#[cfg_attr(miri, ignore)] +fn spawn_many_entities() { + let mut world = Entities::new(); + + let mut entities = Vec::new(); + for i in 0..10_000 { + let entity = EntityBuilder::new() + .add(Comp(10i32)) + .add(Comp(format!("Entity #{}", i))) + .spawn_into(&mut world); + entities.push(entity); + } + + for (i, entity) in entities.into_iter().enumerate() { + assert_eq!(world.get::>(entity).unwrap().0, 10); + assert_eq!( + world.get::>(entity).unwrap().0, + format!("Entity #{}", i) + ); + } +} + +#[test] +fn zero_sized_components() { + let mut world = Entities::new(); + + #[derive(PartialEq, Debug)] + struct ZeroSized; + + let entity = world.spawn_bundle((Comp(ZeroSized),)); + + assert_eq!(world.get::>(entity).unwrap().0, ZeroSized); +} + +#[test] +fn remove_components() { + let mut world = Entities::new(); + + let entity1 = world.spawn_bundle((Comp(10i32), Comp("string"))); + let entity2 = world.spawn_bundle((Comp(15i32), Comp("string2"))); + + world.remove::>(entity1).unwrap(); + assert!(world.get::>(entity1).is_err()); + assert_eq!(world.get::>(entity2).unwrap().0, 15); +} + +#[test] +#[cfg_attr(miri, ignore)] +fn remove_components_large_storage() { + let mut world = Entities::new(); + + let mut entities: Vec = (0..10_000usize) + .map(|i| world.spawn_bundle((Comp(i),))) + .collect(); + + let removed_entity = entities.remove(5000); + world.remove::>(removed_entity).unwrap(); + assert!(world.get::>(removed_entity).is_err()); + + for (i, entity) in entities.into_iter().enumerate() { + let i = if i >= 5000 { i + 1 } else { i }; + assert_eq!(world.get::>(entity).unwrap().0, i); + } +} + +#[test] +fn remove_nonexisting() { + let mut world = Entities::new(); + + let entity = world.spawn_bundle((Comp(10i32),)); + assert!(world.remove::>(entity).is_err()); +} + +#[test] +fn query_basic() { + let mut world = Entities::new(); + + let entity1 = world.spawn_bundle((Comp(10i32), Comp("name1"))); + let entity2 = world.spawn_bundle((Comp(15i32), Comp("name2"), Comp(50.0f32))); + + let mut query = world.query::<(&Comp, &Comp<&'static str>)>(); + let mut iter = query.iter(); + + let (entity, (i, name)) = iter.next().unwrap(); + assert_eq!(entity, entity1); + assert_eq!(i.0, 10); + assert_eq!(name.0, "name1"); + + let (entity, (i, name)) = iter.next().unwrap(); + assert_eq!(entity, entity2); + assert_eq!(i.0, 15); + assert_eq!(name.0, "name2"); + + assert!(iter.next().is_none()); +} + +#[test] +fn query_big_ecs_after_despawn() { + let mut world = Entities::new(); + + let mut entities = Vec::new(); + for i in 0..100usize { + let mut builder = EntityBuilder::new(); + if i % 3 == 0 { + builder.add(Comp(format!("entity #{}", i))); + } + builder.add(Comp(i)); + let entity = builder.spawn_into(&mut world); + if i % 3 == 0 { + entities.push(entity); + } + } + + let last = entities.len() - 1; + world.despawn(entities.remove(last)).unwrap(); + + let queried: HashMap>, Ref>)> = world + .query::<(&Comp, &Comp)>() + .iter() + .collect(); + + for (i, entity) in entities.iter().copied().enumerate() { + let (name, number) = &queried[&entity]; + assert_eq!(name.0, format!("entity #{}", i * 3)); + assert_eq!(number.0, i * 3); + } + + assert_eq!(queried.len(), entities.len()); +} + +#[test] +fn empty_query() { + let world = Entities::new(); + + assert_eq!(world.query::<&Comp>().iter().count(), 0); +} + +#[test] +fn mutable_access() { + let mut world = Entities::new(); + let entity = world.spawn_bundle((Comp(10i32),)); + world.get_mut::>(entity).unwrap().0 = 15; + assert_eq!(world.get::>(entity).unwrap().0, 15); +} + +#[test] +fn borrow_conflict_mutable() { + let mut world = Entities::new(); + let entity = world.spawn_bundle((Comp(10i32),)); + + let mut reference = world.get_mut::>(entity).unwrap(); + + assert!(matches!( + world.get::>(entity), + Err(ComponentError::BorrowConflict(_)) + )); + reference.0 = 5; + + drop(reference); + assert_eq!(world.get::>(entity).unwrap().0, 5); +} + +#[test] +fn borrow_conflict_shared() { + let mut world = Entities::new(); + let entity = world.spawn_bundle((Comp(10i32),)); + + let _reference = world.get::>(entity).unwrap(); + assert!(matches!( + world.get_mut::>(entity), + Err(ComponentError::BorrowConflict(_)) + )); +} + +#[test] +fn too_many_shared_borrows() { + let mut world = Entities::new(); + let entity = world.spawn_bundle((Comp(10i32),)); + + let refs: Vec<_> = (0..254) + .map(|_| world.get::>(entity).unwrap()) + .collect(); + + assert!(matches!( + world.get::>(entity), + Err(ComponentError::BorrowConflict(_)) + )); + assert!(matches!( + world.get_mut::>(entity), + Err(ComponentError::BorrowConflict(_)) + )); + + drop(refs); + + assert_eq!(world.get::>(entity).unwrap().0, 10); +} + +#[test] +fn query_after_removing() { + let mut world = Entities::new(); + + let entity = world.spawn_bundle((Comp(0i32), Comp("foo"))); + + assert_eq!(world.query::<&Comp>().iter().count(), 1); + + world.remove::>(entity).unwrap(); + + assert_eq!(world.query::<&Comp>().iter().count(), 0); + + for _ in 0..100 { + world.spawn_bundle((Comp("foo"),)); + } + + let entity = world.spawn_bundle((Comp(0i32), Comp("foo"))); + + assert_eq!(world.query::<&Comp>().iter().count(), 1); + + world.remove::>(entity).unwrap(); + + assert_eq!(world.query::<&Comp>().iter().count(), 0); +} + +#[test] +fn insert_twice_overwrites() { + let mut world = Entities::new(); + + let entity = world.spawn_empty(); + + world.insert(entity, Comp(0i32)).unwrap(); + assert_eq!(world.query::<&Comp>().iter().count(), 1); + + world.insert(entity, Comp(1i32)).unwrap(); + assert_eq!(world.query::<&Comp>().iter().count(), 1); + assert_eq!(world.get::>(entity).unwrap().0, 1); +}